Page 3 of 5

Re: Requested API Structure and constants

Posted: Thu Mar 22, 2018 10:34 am
by nco2k
missing padding for 64bit:

Code: Select all

Structure NMTVITEMCHANGE
  hdr.NMHDR
  uChanged.l
  CompilerIf #PB_Compiler_Processor = #PB_Processor_x64
    PB_Alignment.b[4]
  CompilerEndIf
  hItem.i
  uStateNew.l
  uStateOld.l
  lParam.i
EndStructure
c ya,
nco2k

Re: Requested API Structure and constants

Posted: Sun Jun 02, 2019 3:44 pm
by RSBasic
The constant #TVM_SETLINECOLOR exists in the auto completion list, but PureBasic does not know the value.

Code: Select all

#TVM_SETLINECOLOR = #TV_FIRST + 40
\\Edit:

Code: Select all

#TVM_SETTEXTCOLOR = #TV_FIRST + 30 

Code: Select all

#TVM_SETBKCOLOR = #TV_FIRST + 29

Re: Requested API Structure and constants

Posted: Sat Jun 29, 2019 9:58 am
by RSBasic
For LoadIcon_():

Code: Select all

#IDI_SHIELD = 32518

Re: Requested API Structure and constants

Posted: Tue Jul 30, 2019 3:03 pm
by RSBasic
The WinAPI function SearchTreeForFile_() does not work.
Please change the import of the WinAPI function. SearchTreeForFileA -> SearchTreeForFileW
Example for SearchTreeForFileW: viewtopic.php?p=539852#p539852

Re: Requested API Structure and constants

Posted: Wed Feb 05, 2020 8:29 pm
by User_Russian
https://msdn.microsoft.com/en-us/ie/aa363244(v=vs.80)

Code: Select all

Structure DEV_BROADCAST_DEVICEINTERFACE Align #PB_Structure_AlignC
  dbcc_size.l
  dbcc_devicetype.l
  dbcc_reserved.l
  dbcc_classguid.GUID
  dbcc_name.c[1]
EndStructure

API Structure and constants

Posted: Fri Oct 23, 2020 12:23 pm
by Denis
Structure LVGROUP declared in PB has to be updated.

I use these declarations since a while now without crash

C/C++ code using Visual Studio 2019 Version 16.7.6 (use declarations 10.0.18362.0)

Code: Select all


#include <iostream>
#include <windows.h>
#include <commctrl.h>


#define PRINTF_SIZEOF(type) printf("  SizeOf( "  #type  " ) = %zu\n", sizeof(type))
#define PRINTF_OffsetOf(type,member) printf("  OffsetOf( "  #member  " ) = %zu\n", offsetof(type,member))

int main()
{
	#ifdef UNICODE


	#if defined(_WIN64)
		printf("\n");
		printf("\n");
		printf("  Compilation Window 64 bit - mode unicode\n");
	#else
		printf("\n");
		printf("\n");
		printf("  Compilation Window 32 bit - mode unicode\n");
	#endif

		/*
			commctrl.h  line 4043
			--------------------
			typedef struct tagLVGROUP
						{
							UINT    cbSize;
							UINT    mask;
							LPWSTR  pszHeader;
							int     cchHeader;

							LPWSTR  pszFooter;
							int     cchFooter;

							int     iGroupId;

							UINT    stateMask;
							UINT    state;
							UINT    uAlign;
						#if (NTDDI_VERSION >= NTDDI_VISTA)
							LPWSTR  pszSubtitle;
							UINT    cchSubtitle;
							LPWSTR  pszTask;
							UINT    cchTask;
							LPWSTR  pszDescriptionTop;
							UINT    cchDescriptionTop;
							LPWSTR  pszDescriptionBottom;
							UINT    cchDescriptionBottom;
							int     iTitleImage;
							int     iExtendedImage;
							int     iFirstItem;         // Read only
							UINT    cItems;             // Read only
							LPWSTR  pszSubsetTitle;     // NULL if group is not subset
							UINT    cchSubsetTitle;

						#define LVGROUP_V5_SIZE CCSIZEOF_STRUCT(LVGROUP, uAlign)

						#endif
						} LVGROUP, *PLVGROUP;
					*/

		printf("\n");
		printf("  Structure LVGROUP\n");
		printf("  -----------------\n");

		PRINTF_SIZEOF(LVGROUP);
		printf("\n");
		PRINTF_OffsetOf(LVGROUP, cbSize);
		PRINTF_OffsetOf(LVGROUP, mask);
		PRINTF_OffsetOf(LVGROUP, pszHeader);
		PRINTF_OffsetOf(LVGROUP, cchHeader);
		PRINTF_OffsetOf(LVGROUP, pszFooter);
		PRINTF_OffsetOf(LVGROUP, cchFooter);
		PRINTF_OffsetOf(LVGROUP, iGroupId);
		PRINTF_OffsetOf(LVGROUP, stateMask);
		PRINTF_OffsetOf(LVGROUP, state);
		PRINTF_OffsetOf(LVGROUP, uAlign);
		PRINTF_OffsetOf(LVGROUP, pszSubtitle);
		PRINTF_OffsetOf(LVGROUP, cchSubtitle);
		PRINTF_OffsetOf(LVGROUP, pszTask);
		PRINTF_OffsetOf(LVGROUP, cchTask);
		PRINTF_OffsetOf(LVGROUP, pszDescriptionTop);
		PRINTF_OffsetOf(LVGROUP, cchDescriptionTop);
		PRINTF_OffsetOf(LVGROUP, pszDescriptionBottom);
		PRINTF_OffsetOf(LVGROUP, cchDescriptionBottom);
		PRINTF_OffsetOf(LVGROUP, iTitleImage);
		PRINTF_OffsetOf(LVGROUP, iExtendedImage);
		PRINTF_OffsetOf(LVGROUP, iFirstItem);
		PRINTF_OffsetOf(LVGROUP, cItems);
		PRINTF_OffsetOf(LVGROUP, pszSubsetTitle);
		PRINTF_OffsetOf(LVGROUP, cchSubsetTitle);

	#else
		printf("You must compile in unicode mode!\n");
	#endif


	return 0;
}
PB code

Code: Select all

; https://docs.microsoft.com/en-us/windows/win32/api/commctrl/ns-commctrl-lvgroup
; Structure actuelle LVGROUP PB x86/x64
; Structure LVGROUP
;       cbSize.l
;       mask.l
;       *pszHeader
;       cchHeader.l
;       *pszFooter
;       cchFooter.l
;       iGroupId.l
;       stateMask.l
;       state.l
;       uAlign.l
; EndStructure

; Version fichier h --> 10.0.18362.0
; commctrl.h  Structure x64 line 4043
; typedef struct tagLVGROUP
; {
;     UINT    cbSize;
;     UINT    mask;
;     LPWSTR  pszHeader;
;     int     cchHeader;
;
;     LPWSTR  pszFooter;
;     int     cchFooter;
;
;     int     iGroupId;
;
;     UINT    stateMask;
;     UINT    state;
;     UINT    uAlign;
; #if (NTDDI_VERSION >= NTDDI_VISTA)
;     LPWSTR  pszSubtitle;
;     UINT    cchSubtitle;
;     LPWSTR  pszTask;
;     UINT    cchTask;
;     LPWSTR  pszDescriptionTop;
;     UINT    cchDescriptionTop;
;     LPWSTR  pszDescriptionBottom;
;     UINT    cchDescriptionBottom;
;     int     iTitleImage;
;     int     iExtendedImage;
;     int     iFirstItem;         // Read only
;     UINT    cItems;             // Read only
;     LPWSTR  pszSubsetTitle;     // NULL if group is not subset
;     UINT    cchSubsetTitle;
;
; #define LVGROUP_V5_SIZE CCSIZEOF_STRUCT(LVGROUP, uAlign)
;
; #endif
; } LVGROUP, *PLVGROUP;

CompilerSelect #PB_Compiler_Processor
      CompilerCase #PB_Processor_x86
            ; Structure PureBasic LVGROUP mise à jour/Structure PureBasic LVGROUP updated
            Debug "  Compilation Window 32 bit - mode unicode"
            Structure LVGROUP_x86
                  cbSize.l
                  mask.l
                  *pszHeader
                  cchHeader.l
                  *pszFooter
                  cchFooter.l
                  iGroupId.l
                  stateMask.l
                  state.l
                  uAlign.l
                  *pszSubtitle
                  cchSubtitle.l
                  *pszTask
                  cchTask.l
                  *pszDescriptionTop
                  cchDescriptionTop.l
                  *pszDescriptionBottom
                  cchDescriptionBottom.l
                  iTitleImage.l
                  iExtendedImage.l
                  iFirstItem.l
                  cItems.l
                  *pszSubsetTitle
                  cchSubsetTitle.l
            EndStructure
            
            Debug ""
            Debug "  Structure LVGROUP"
            Debug "  -----------------"

            Debug "  SizeOf(  LVGROUP_x86  ) = " + Str(SizeOf(LVGROUP_x86))
            Debug ""
            Debug "  OffsetOf(  cbSize  ) = " + Str(OffsetOf(LVGROUP_x86\cbSize))
            Debug "  OffsetOf(  mask  ) = " + Str(OffsetOf(LVGROUP_x86\mask))
            Debug "  OffsetOf(  *pszHeader  ) = " + Str(OffsetOf(LVGROUP_x86\pszHeader))
            Debug "  OffsetOf(  cchHeader  ) = " + Str(OffsetOf(LVGROUP_x86\cchHeader))
            Debug "  OffsetOf(  *pszFooter  ) = " + Str(OffsetOf(LVGROUP_x86\pszFooter))
            Debug "  OffsetOf(  cchFooter  ) = " + Str(OffsetOf(LVGROUP_x86\cchFooter))
            Debug "  OffsetOf(  iGroupId  ) = " + Str(OffsetOf(LVGROUP_x86\iGroupId))
            Debug "  OffsetOf(  stateMask  ) = " + Str(OffsetOf(LVGROUP_x86\stateMask))
            Debug "  OffsetOf(  state  ) = " + Str(OffsetOf(LVGROUP_x86\state))
            Debug "  OffsetOf(  uAlign  ) = " + Str(OffsetOf(LVGROUP_x86\uAlign))
            Debug "  OffsetOf(  *pszSubtitle  ) = " + Str(OffsetOf(LVGROUP_x86\pszSubtitle))
            Debug "  OffsetOf(  cchSubtitle  ) = " + Str(OffsetOf(LVGROUP_x86\cchSubtitle))
            Debug "  OffsetOf(  *pszTask  ) = " + Str(OffsetOf(LVGROUP_x86\pszTask))
            Debug "  OffsetOf(  cchTask  ) = " + Str(OffsetOf(LVGROUP_x86\cchTask))
            Debug "  OffsetOf(  *pszDescriptionTop  ) = " + Str(OffsetOf(LVGROUP_x86\pszDescriptionTop))
            Debug "  OffsetOf(  cchDescriptionTop  ) = " + Str(OffsetOf(LVGROUP_x86\cchDescriptionTop))
            Debug "  OffsetOf(  *pszDescriptionBottom  ) = " + Str(OffsetOf(LVGROUP_x86\pszDescriptionBottom))
            Debug "  OffsetOf(  cchDescriptionBottom  ) = " + Str(OffsetOf(LVGROUP_x86\cchDescriptionBottom))
            Debug "  OffsetOf(  iTitleImage  ) = " + Str(OffsetOf(LVGROUP_x86\iTitleImage))
            Debug "  OffsetOf(  iExtendedImage  ) = " + Str(OffsetOf(LVGROUP_x86\iExtendedImage))
            Debug "  OffsetOf(  iFirstItem  ) = " + Str(OffsetOf(LVGROUP_x86\iFirstItem))
            Debug "  OffsetOf(  cItems  ) = " + Str(OffsetOf(LVGROUP_x86\cItems))
            Debug "  OffsetOf(  *pszSubsetTitle  ) = " + Str(OffsetOf(LVGROUP_x86\pszSubsetTitle))
            Debug "  OffsetOf(  cchSubsetTitle  ) = " + Str(OffsetOf(LVGROUP_x86\cchSubsetTitle))
            
      CompilerCase #PB_Processor_x64
            ; Structure PureBasic mise à jour/Structure PureBasic LVGROUP updated
            Debug "  Compilation Window 64 bit - mode unicode"
            Structure LVGROUP_x64
                  cbSize.l
                  mask.l
                  *pszHeader
                  cchHeader.l
                  PB_Alignment.b[4]
                  *pszFooter
                  cchFooter.l
                  iGroupId.l
                  stateMask.l
                  state.l
                  uAlign.l
                  PB_Alignment_1.b[4]
                  *pszSubtitle
                  cchSubtitle.l
                  PB_Alignment_2.b[4]
                  *pszTask
                  cchTask.l
                  PB_Alignment_3.b[4]
                  *pszDescriptionTop
                  cchDescriptionTop.l
                  PB_Alignment_4.b[4]
                  *pszDescriptionBottom
                  cchDescriptionBottom.l
                  iTitleImage.l
                  iExtendedImage.l
                  iFirstItem.l
                  cItems.l
                  PB_Alignment_5.b[4]
                  *pszSubsetTitle
                  cchSubsetTitle.l
                  PB_Alignment_6.b[4]
            EndStructure
            
            Debug ""
            Debug "  Structure LVGROUP"
            Debug "  -----------------"

            Debug "  SizeOf(  LVGROUP_x64  ) = " + Str(SizeOf(LVGROUP_x64))
            Debug ""
            Debug "  OffsetOf(  cbSize  ) = " + Str(OffsetOf(LVGROUP_x64\cbSize))
            Debug "  OffsetOf(  mask  ) = " + Str(OffsetOf(LVGROUP_x64\mask))
            Debug "  OffsetOf(  *pszHeader  ) = " + Str(OffsetOf(LVGROUP_x64\pszHeader))
            Debug "  OffsetOf(  cchHeader  ) = " + Str(OffsetOf(LVGROUP_x64\cchHeader))
            Debug "  OffsetOf(  *pszFooter  ) = " + Str(OffsetOf(LVGROUP_x64\pszFooter))
            Debug "  OffsetOf(  cchFooter  ) = " + Str(OffsetOf(LVGROUP_x64\cchFooter))
            Debug "  OffsetOf(  iGroupId  ) = " + Str(OffsetOf(LVGROUP_x64\iGroupId))
            Debug "  OffsetOf(  stateMask  ) = " + Str(OffsetOf(LVGROUP_x64\stateMask))
            Debug "  OffsetOf(  state  ) = " + Str(OffsetOf(LVGROUP_x64\state))
            Debug "  OffsetOf(  uAlign  ) = " + Str(OffsetOf(LVGROUP_x64\uAlign))
            Debug "  OffsetOf(  *pszSubtitle  ) = " + Str(OffsetOf(LVGROUP_x64\pszSubtitle))
            Debug "  OffsetOf(  cchSubtitle  ) = " + Str(OffsetOf(LVGROUP_x64\cchSubtitle))
            Debug "  OffsetOf(  *pszTask  ) = " + Str(OffsetOf(LVGROUP_x64\pszTask))
            Debug "  OffsetOf(  cchTask  ) = " + Str(OffsetOf(LVGROUP_x64\cchTask))
            Debug "  OffsetOf(  *pszDescriptionTop  ) = " + Str(OffsetOf(LVGROUP_x64\pszDescriptionTop))
            Debug "  OffsetOf(  cchDescriptionTop  ) = " + Str(OffsetOf(LVGROUP_x64\cchDescriptionTop))
            Debug "  OffsetOf(  *pszDescriptionBottom  ) = " + Str(OffsetOf(LVGROUP_x64\pszDescriptionBottom))
            Debug "  OffsetOf(  cchDescriptionBottom  ) = " + Str(OffsetOf(LVGROUP_x64\cchDescriptionBottom))
            Debug "  OffsetOf(  iTitleImage  ) = " + Str(OffsetOf(LVGROUP_x64\iTitleImage))
            Debug "  OffsetOf(  iExtendedImage  ) = " + Str(OffsetOf(LVGROUP_x64\iExtendedImage))
            Debug "  OffsetOf(  iFirstItem  ) = " + Str(OffsetOf(LVGROUP_x64\iFirstItem))
            Debug "  OffsetOf(  cItems  ) = " + Str(OffsetOf(LVGROUP_x64\cItems))
            Debug "  OffsetOf(  *pszSubsetTitle  ) = " + Str(OffsetOf(LVGROUP_x64\pszSubsetTitle))
            Debug "  OffsetOf(  cchSubsetTitle  ) = " + Str(OffsetOf(LVGROUP_x64\cchSubsetTitle))
CompilerEndSelect

result in x86 mode :
Image
result in x64 mode :
Image

Re: Requested API Structure and constants

Posted: Fri Oct 23, 2020 3:27 pm
by Denis
Structure HDITEM declared in PB has to be updated.

C/C++ code using Visual Studio 2019 Version 16.7.6 (use declarations 10.0.18362.0)

Code: Select all


#include <iostream>
#include <windows.h>
#include <commctrl.h>


#define PRINTF_SIZEOF(type) printf("  SizeOf( "  #type  " ) = %zu\n", sizeof(type))
// #define PRINTF_OffsetOf(type,member) printf("  OffsetOf(" #type", "#member ") = %zu\n", offsetof(type,member))
#define PRINTF_OffsetOf(type,member) printf("  OffsetOf( "  #member  " ) = %zu\n", offsetof(type,member))


int main()
{
#ifdef UNICODE


#if defined(_WIN64)
	printf("\n");
	printf("\n");
	printf("  Compilation Window 64 bit - mode unicode\n");
#else
	printf("\n");
	printf("\n");
	printf("  Compilation Window 32 bit - mode unicode\n");
#endif

	/*
		commctrl.h  line 788
		--------------------
			typedef struct _HD_ITEMW
			{
				UINT    mask;
				int     cxy;
				LPWSTR  pszText;
				HBITMAP hbm;
				int     cchTextMax;
				int     fmt;
				LPARAM  lParam;
				int     iImage;         // index of bitmap in ImageList
				int     iOrder;
				UINT    type;           // [in] filter type (defined what pvFilter is a pointer to)
				void *  pvFilter;       // [in] fillter data see above
			#if (NTDDI_VERSION >= NTDDI_VISTA)
				UINT   state;
			#endif
			} HDITEM, *LPHDITEMW;

			#ifdef UNICODE
			#define HDITEM HDITEM
			#define LPHDITEM LPHDITEMW
			#define HDITEM_V1_SIZE HDITEMW_V1_SIZE
			#else
			#define HDITEM HDITEMA
			#define LPHDITEM LPHDITEMA
			#define HDITEM_V1_SIZE HDITEMA_V1_SIZE
			#endif


				*/

			printf("\n");
			printf("  Structure HDITEM\n");
			printf("  -----------------\n");

			PRINTF_SIZEOF(HDITEM);
			printf("\n");
			PRINTF_OffsetOf(HDITEM, mask);
			PRINTF_OffsetOf(HDITEM, cxy);
			PRINTF_OffsetOf(HDITEM, pszText);
			PRINTF_OffsetOf(HDITEM, hbm);
			PRINTF_OffsetOf(HDITEM, cchTextMax);
			PRINTF_OffsetOf(HDITEM, fmt);
			PRINTF_OffsetOf(HDITEM, lParam);
			PRINTF_OffsetOf(HDITEM, iImage);
			PRINTF_OffsetOf(HDITEM, iOrder);
			PRINTF_OffsetOf(HDITEM, type);
			PRINTF_OffsetOf(HDITEM, pvFilter);
			PRINTF_OffsetOf(HDITEM, state);


#else
	printf("You must compile in unicode mode!\n");
#endif


	return 0;
}
PB code

Code: Select all

;   Structure HDITEMW
;  https://docs.microsoft.com/en-us/windows/win32/api/commctrl/ns-commctrl-hditemw

; Structure actuelle HDITEM PB x86
; Structure HDITEM
;   mask.l
;   cxy.l
;   *pszText
;   hbm.i
;   cchTextMax.l
;   fmt.l
;   lParam.i
;   iImage.l
;   iOrder.l
;   type.l
;   *pvFilter
; EndStructure

; Structure actuelle HDITEM PB x64
; Structure HDITEM
;   mask.l
;   cxy.l
;   *pszText
;   hbm.i
;   cchTextMax.l
;   fmt.l
;   lParam.i
;   iImage.l
;   iOrder.l
;   type.l
;   PB_Alignment.b[4]
;   *pvFilter
; EndStructure

; Version fichier h etc. --> 10.0.18362.0
; commctrl.h  Structure x64 line 788
;  typedef struct _HD_ITEMW
;  {
;     UINT    mask;
;     int     cxy;
;     LPWSTR  pszText;
;     HBITMAP hbm;
;     int     cchTextMax;
;     int     fmt;
;     LPARAM  lParam;
;     int     iImage;        // index of bitmap in ImageList
;     int     iOrder;
;     UINT    type;          // [in] filter type (defined what pvFilter is a pointer to)
;     void* pvFilter;        // [in] fillter data see above
;     #if (NTDDI_VERSION >= NTDDI_VISTA)
;          UINT   state;
;     #endif
;  } HDITEMW, * LPHDITEMW;

CompilerSelect #PB_Compiler_Processor
      CompilerCase #PB_Processor_x86
            ; Structure PureBasic mise à jour/Structure PureBasic HDITEM updated
            Debug "  Compilation Window 32 bit - mode unicode"
            Structure HDITEM_x86
                  mask.l
                  cxy.l
                  *pszText
                  hbm.i
                  cchTextMax.l
                  fmt.l
                  lParam.i
                  iImage.l
                  iOrder.l
                  type.l
                  *pvFilter
                  state.l
            EndStructure
            
            Debug ""
            Debug "  Structure HDITEM_x86"
            Debug "  -----------------"

            Debug "  SizeOf(HDITEM_x86  ) = " + Str(SizeOf(HDITEM_x86))
            Debug ""
            Debug "  OffsetOf(  mask  ) = " + Str(OffsetOf(HDITEM_x86\mask))
            Debug "  OffsetOf(  cxy  ) = " + Str(OffsetOf(HDITEM_x86\cxy))
            Debug "  OffsetOf(  pszText  ) = " + Str(OffsetOf(HDITEM_x86\pszText))
            Debug "  OffsetOf(  hbm  ) = " + Str(OffsetOf(HDITEM_x86\hbm))
            Debug "  OffsetOf(  cchTextMax  ) = " + Str(OffsetOf(HDITEM_x86\cchTextMax))
            Debug "  OffsetOf(  fmt  ) = " + Str(OffsetOf(HDITEM_x86\fmt))
            Debug "  OffsetOf(  lParam  ) = " + Str(OffsetOf(HDITEM_x86\lParam))
            Debug "  OffsetOf(  iImage  ) = " + Str(OffsetOf(HDITEM_x86\iImage))
            Debug "  OffsetOf(  iOrder  ) = " + Str(OffsetOf(HDITEM_x86\iOrder))
            Debug "  OffsetOf(  type  ) = " + Str(OffsetOf(HDITEM_x86\type))
            Debug "  OffsetOf(  pvFilter  ) = " + Str(OffsetOf(HDITEM_x86\pvFilter))
            Debug "  OffsetOf(  state  ) = " + Str(OffsetOf(HDITEM_x86\state))
            
            
      CompilerCase #PB_Processor_x64
            ; Structure PureBasic mise à jour/Structure PureBasic HDITEM updated
            Debug "  Compilation Window 64 bit - mode unicode"
            Structure HDITEM_x64
                  mask.l
                  cxy.l
                  *pszText
                  hbm.i
                  cchTextMax.l
                  fmt.l
                  lParam.i
                  iImage.l
                  iOrder.l
                  type.l
                  PB_Alignment.b[4]
                  *pvFilter
                  state.l
                  PB_Alignment_1.b[4]
            EndStructure
            
            Debug ""
            Debug "  Structure HDITEM_x64"
            Debug "  -----------------"

            Debug "  SizeOf(HDITEM_x64  ) = " + Str(SizeOf(HDITEM_x64))
            Debug ""
            Debug "  OffsetOf(  mask  ) = " + Str(OffsetOf(HDITEM_x64\mask))
            Debug "  OffsetOf(  cxy  ) = " + Str(OffsetOf(HDITEM_x64\cxy))
            Debug "  OffsetOf(  pszText  ) = " + Str(OffsetOf(HDITEM_x64\pszText))
            Debug "  OffsetOf(  hbm  ) = " + Str(OffsetOf(HDITEM_x64\hbm))
            Debug "  OffsetOf(  cchTextMax  ) = " + Str(OffsetOf(HDITEM_x64\cchTextMax))
            Debug "  OffsetOf(  fmt  ) = " + Str(OffsetOf(HDITEM_x64\fmt))
            Debug "  OffsetOf(  lParam  ) = " + Str(OffsetOf(HDITEM_x64\lParam))
            Debug "  OffsetOf(  iImage  ) = " + Str(OffsetOf(HDITEM_x64\iImage))
            Debug "  OffsetOf(  iOrder  ) = " + Str(OffsetOf(HDITEM_x64\iOrder))
            Debug "  OffsetOf(  type  ) = " + Str(OffsetOf(HDITEM_x64\type))
            Debug "  OffsetOf(  pvFilter  ) = " + Str(OffsetOf(HDITEM_x64\pvFilter))
            Debug "  OffsetOf(  state  ) = " + Str(OffsetOf(HDITEM_x64\state))
CompilerEndSelect
result in x86 mode :
Image
result in x64 mode :
Image

Re: Requested API Structure and constants

Posted: Fri Oct 23, 2020 5:21 pm
by Denis
Structure LVITEM declared in PB has to be updated but only with x64 declaration
Just added a padding of 4 bytes after the very last element.

C/C++ code using Visual Studio 2019 Version 16.7.6 (use declarations 10.0.18362.0)

Code: Select all


#include <iostream>
#include <windows.h>
#include <commCtrl.h>


#define PRINTF_SIZEOF(type) printf("  SizeOf( "  #type  " ) = %zu\n", sizeof(type))
#define PRINTF_OffsetOf(type,member) printf("  OffsetOf( "  #member  " ) = %zu\n", offsetof(type,member))


int main()
{
#ifdef UNICODE


#if defined(_WIN64)
	printf("\n");
	printf("\n");
	printf("  Compilation Window 64 bit - mode unicode\n");
#else
	printf("\n");
	printf("\n");
	printf("  Compilation Window 32 bit - mode unicode\n");
#endif

	/*
		commctrl.h  line 3219
	typedef struct tagLVITEMW
	{
		UINT mask;
		int iItem;
		int iSubItem;
		UINT state;
		UINT stateMask;
		LPWSTR pszText;
		int cchTextMax;
		int iImage;
		LPARAM lParam;
		int iIndent;
	#if (NTDDI_VERSION >= NTDDI_WINXP)
		int iGroupId;
		UINT cColumns; // tile view columns
		PUINT puColumns;
	#endif
	#if (NTDDI_VERSION >= NTDDI_VISTA)
		int* piColFmt;
		int iGroup; // readonly. only valid for owner data.
	#endif
	} LVITEMW, *LPLVITEMW;

	#ifdef UNICODE
	#define LVITEM    LVITEMW
	#define LPLVITEM  LPLVITEMW
	#define LVITEM_V1_SIZE LVITEMW_V1_SIZE
	#else
	#define LVITEM    LVITEMA
	#define LPLVITEM  LPLVITEMA
	#define LVITEM_V1_SIZE LVITEMA_V1_SIZE
	#endif


	*/

	printf("\n");
	printf("  Structure LVITEM\n");
	printf("  -----------------\n");

	PRINTF_SIZEOF(LVITEM);
	printf("\n");
	PRINTF_OffsetOf(LVITEM, mask);
	PRINTF_OffsetOf(LVITEM, iItem);
	PRINTF_OffsetOf(LVITEM, iSubItem);
	PRINTF_OffsetOf(LVITEM, state);
	PRINTF_OffsetOf(LVITEM, stateMask);
	PRINTF_OffsetOf(LVITEM, pszText);
	PRINTF_OffsetOf(LVITEM, cchTextMax);
	PRINTF_OffsetOf(LVITEM, iImage);
	PRINTF_OffsetOf(LVITEM, lParam);
	PRINTF_OffsetOf(LVITEM, iIndent);
	PRINTF_OffsetOf(LVITEM, iGroupId);
	PRINTF_OffsetOf(LVITEM, cColumns);
	PRINTF_OffsetOf(LVITEM, puColumns);
	PRINTF_OffsetOf(LVITEM, piColFmt);
	PRINTF_OffsetOf(LVITEM, iGroup);


#else
	printf("You must compile in unicode mode!\n");
#endif


	return 0;
}
PB code

Code: Select all

; Structure LVITEM
; https://docs.microsoft.com/en-us/windows/win32/api/commctrl/ns-commctrl-lvitemw

; Structure LVITEM x86  PB
; Structure LVITEM
;   mask.l
;   iItem.l
;   iSubItem.l
;   state.l
;   stateMask.l
;   *pszText
;   cchTextMax.l
;   iImage.l
;   lParam.i
;   iIndent.l
;   iGroupId.l
;   cColumns.l
;   puColumns.i
;   piColFmt.i
;   iGroup.l
; EndStructure

; Structure LVITEM x64  PB
; Structure LVITEM
;   mask.l
;   iItem.l
;   iSubItem.l
;   state.l
;   stateMask.l
;   PB_Alignment1.b[4]
;   *pszText
;   cchTextMax.l
;   iImage.l
;   lParam.i
;   iIndent.l
;   iGroupId.l
;   cColumns.l
;   PB_Alignment2.b[4]
;   puColumns.i
;   piColFmt.i
;   iGroup.l
; EndStructure

; Version fichier h etc. --> 10.0.18362.0
; commctrl.h  Structure x64 line 3219
; typedef struct tagLVITEMW
; {
;     UINT mask;
;     int iItem;
;     int iSubItem;
;     UINT state;
;     UINT stateMask;
;     LPWSTR pszText;
;     int cchTextMax;
;     int iImage;
;     LPARAM lParam;
;     int iIndent;
; #if (NTDDI_VERSION >= NTDDI_WINXP)
;     int iGroupId;
;     UINT cColumns; // tile view columns
;     PUINT puColumns;
; #endif
; #if (NTDDI_VERSION >= NTDDI_VISTA)
;     int* piColFmt;
;     int iGroup; // readonly. only valid for owner data.
; #endif
; } LVITEMW, *LPLVITEMW;


CompilerSelect #PB_Compiler_Processor
      CompilerCase #PB_Processor_x86
            Debug "  Compilation Window 32 bit - mode unicode"
            Structure LVITEM_x86 Extends LVITEM
            EndStructure
            
            Debug ""
            Debug "  Structure LVITEM_x86"
            Debug "  --------------------"
            
            Debug "  SizeOf(  LVITEM_x86  ) = " + Str(SizeOf(LVITEM_x86))
            Debug ""
            Debug "  OffsetOf(  mask  ) = " + Str(OffsetOf(LVITEM_x86\mask))
            Debug "  OffsetOf(  iItem  ) = " + Str(OffsetOf(LVITEM_x86\iItem))
            Debug "  OffsetOf(  iSubItem  ) = " + Str(OffsetOf(LVITEM_x86\iSubItem))
            Debug "  OffsetOf(  state  ) = " + Str(OffsetOf(LVITEM_x86\state))
            Debug "  OffsetOf(  stateMask  ) = " + Str(OffsetOf(LVITEM_x86\stateMask))
            Debug "  OffsetOf(  *pszText  ) = " + Str(OffsetOf(LVITEM_x86\pszText))
            Debug "  OffsetOf(  cchTextMax  ) = " + Str(OffsetOf(LVITEM_x86\cchTextMax))
            Debug "  OffsetOf(  iImage  ) = " + Str(OffsetOf(LVITEM_x86\iImage))
            Debug "  OffsetOf(  lParam  ) = " + Str(OffsetOf(LVITEM_x86\lParam))
            Debug "  OffsetOf(  iIndent  ) = " + Str(OffsetOf(LVITEM_x86\iIndent))
            Debug "  OffsetOf(  iGroupId  ) = " + Str(OffsetOf(LVITEM_x86\iGroupId))
            Debug "  OffsetOf(  cColumns  ) = " + Str(OffsetOf(LVITEM_x86\cColumns))
            Debug "  OffsetOf(  puColumns  ) = " + Str(OffsetOf(LVITEM_x86\puColumns))
            Debug "  OffsetOf(  piColFmt  ) = " + Str(OffsetOf(LVITEM_x86\piColFmt))
            Debug "  OffsetOf(  iGroup  ) = " + Str(OffsetOf(LVITEM_x86\iGroup))
            
            
            
      CompilerCase #PB_Processor_x64
            ; Structure PureBasic mise à jour/Structure PureBasic LVITEM updated
            Debug "  Compilation Window 64 bit - mode unicode"
            Structure LVITEM_x64
                  mask.l
                  iItem.l
                  iSubItem.l
                  state.l
                  stateMask.l
                  PB_Alignment1.b[4]
                  *pszText
                  cchTextMax.l
                  iImage.l
                  lParam.i
                  iIndent.l
                  iGroupId.l
                  cColumns.l
                  PB_Alignment2.b[4]
                  puColumns.i
                  piColFmt.i
                  iGroup.l
                  PB_Alignment3.b[4]
            EndStructure
            
            Debug ""
            Debug "  Structure LVITEM_x64"
            Debug "  --------------------"
            
            Debug "  SizeOf(  LVITEM_x64  ) = " + Str(SizeOf(LVITEM_x64))
            Debug ""
            Debug "  OffsetOf(  mask  ) = " + Str(OffsetOf(LVITEM_x64\mask))
            Debug "  OffsetOf(  iItem  ) = " + Str(OffsetOf(LVITEM_x64\iItem))
            Debug "  OffsetOf(  iSubItem  ) = " + Str(OffsetOf(LVITEM_x64\iSubItem))
            Debug "  OffsetOf(  state  ) = " + Str(OffsetOf(LVITEM_x64\state))
            Debug "  OffsetOf(  stateMask  ) = " + Str(OffsetOf(LVITEM_x64\stateMask))
            Debug "  OffsetOf(  *pszText  ) = " + Str(OffsetOf(LVITEM_x64\pszText))
            Debug "  OffsetOf(  cchTextMax  ) = " + Str(OffsetOf(LVITEM_x64\cchTextMax))
            Debug "  OffsetOf(  iImage  ) = " + Str(OffsetOf(LVITEM_x64\iImage))
            Debug "  OffsetOf(  lParam  ) = " + Str(OffsetOf(LVITEM_x64\lParam))
            Debug "  OffsetOf(  iIndent  ) = " + Str(OffsetOf(LVITEM_x64\iIndent))
            Debug "  OffsetOf(  iGroupId  ) = " + Str(OffsetOf(LVITEM_x64\iGroupId))
            Debug "  OffsetOf(  cColumns  ) = " + Str(OffsetOf(LVITEM_x64\cColumns))
            Debug "  OffsetOf(  puColumns  ) = " + Str(OffsetOf(LVITEM_x64\puColumns))
            Debug "  OffsetOf(  piColFmt  ) = " + Str(OffsetOf(LVITEM_x64\piColFmt))
            Debug "  OffsetOf(  iGroup  ) = " + Str(OffsetOf(LVITEM_x64\iGroup))
            
CompilerEndSelect
result in x86 mode :
Image
result in x64 mode :
Image

Re: Requested API Structure and constants

Posted: Mon Nov 23, 2020 3:21 pm
by Fred
We opensourced the whole Residents directory, so please do a pull request if you want to add something to it:

https://github.com/fantaisie-software/p ... ts/Windows

Re: Requested API Structure and constants

Posted: Mon Nov 23, 2020 11:41 pm
by LinXP
Hi Fred, Could you also upload files from /Imports there? he is already in "free" access.
There is a desire to assign normal names to parameters, all Arg1-ArgX and then you can update the current APIFunctionListing.txt in one click

Re: Requested API Structure and constants

Posted: Mon Dec 21, 2020 11:36 pm
by Mijikai
Missing constant: #CALLBACK_EVENT = $50000
https://docs.microsoft.com/en-us/window ... aveoutopen

Re: Requested API Structure and constants

Posted: Tue Dec 22, 2020 3:36 pm
by Axolotl
From my codes I have this to ask for:
Single constants (maybe already mentioned in the former texts

Code: Select all

#MOD_NOREPEAT          = $00004000    ;' Hotkey parameter 

#CAPTUREBLT            = $40000000    ;' BitBlt parameter 
 
#HWND_MESSAGE          =        -3    ;' creates a Message-Only Window --> SetParent(WindowID(<Window>), #HWND_MESSAGE) 

#LBS_NOSEL             = $00004000    ;' 0x4000 ... in ListViewGadget()  ??? 


Receiving Shutdown messages
Maybe this WM_ messages can go into the main loop by similar PB_Event_... events ?
The constants below are missing anyways.

Code: Select all

;   ;' WM_QUERYENDSESSION and WM_ENDSESSION lParam 
;   ;'   Note that this parameter is a bit mask. 
;   ;'   To test for this value, use a bit-wise operation; do not test for equality.
;   ;' WM_ENDSESSION .. 
;   ;'  If wParam is TRUE, the application must shut down. 
;   ;'  Any Data should be saved automatically without prompting the user (For more information, see Remarks). 
;   ;'  The Restart Manager sends this message when the application is using a file that needs to be replaced, 
;   ;'  when it must service the system, Or when system resources are exhausted. The application will be restarted 
;   ;'  if it has registered for restart using the RegisterApplicationRestart function. For more information, see Guidelines for Applications.
;   ;'
;   ;'  If wParam is FALSE, the application should not shut down.
#ENDSESSION_CLOSEAPP   = $00000001     ;' (0x1)
#ENDSESSION_CRITICAL   = $40000000     ;' (0x40000000)  The application is forced to shut down.
#ENDSESSION_LOGOFF     = $80000000     ;' (0x80000000)  The user is logging off. For more information, see Logging Off.


Power Management
The constant for PowerSettingChange is already defined, the structure unfortunately not. (Sorry, this request needs some improvement.)

Code: Select all

;   ;' #WM_POWERBROADCAST -- constants for windows powermanagement message 
;   ;' [url]https://docs.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-powerbroadcast_setting[/url] 

;   Global pbs.POWERBROADCAST_SETTING 

  Debug #PBT_POWERSETTINGCHANGE      ;' = $8013         ;' A power setting change event has been received.
I found more missing constants like this:

Code: Select all

  #PBTF_APMRESUMEFROMFAILURE   = $00000001     ;' not found 

  #PBT_APMQUERYSTANDBY         = $0001         ;' not found 
  #PBT_APMQUERYSTANDBYFAILED   = $0003         ;' not found 
  #PBT_APMSTANDBY              = $0005         ;' not found 
  #PBT_APMRESUMESTANDBY        = $0008         ;' not found 

Select uMsg 
  Case #WM_POWERBROADCAST 
    If wParam = #PBT_APMQUERYSUSPEND Or wParam = #PBT_APMQUERYSTANDBY 
      ;' windows want to go into standby or hibernation mode 
    ElseIf wParam = #PBT_APMRESUMECRITICAL Or wParam = #PBT_APMRESUMESUSPEND Or wParam = #PBT_APMRESUMESTANDBY 
      ;'  windows returns from standby or hibernation 
    EndIf 
;' 
; [url]http://msdn.microsoft.com/en-us/library/aa372721(VS.85).aspx[/url] 

; The system allows approximately two seconds for an application to handle this notification. If an application is still performing operations after its time allotment has expired, the system may interrupt the application.
; Windows Server 2003 and Windows XP/2000: Applications are allowed up to 20 seconds to respond to the PBT_APMSUSPEND event. 



Autocomplete on Stringgadget

Code: Select all

#SHACF_DEFAULT               = $00000000
#SHACF_FILESYSTEM            = $00000001     ;' * 
#SHACF_URLHISTORY            = $00000002
#SHACF_URLMRU                = $00000004
#SHACF_URLALL                = #SHACF_URLHISTORY | #SHACF_URLMRU
#SHACF_USETAB                = $00000008
#SHACF_FILESYS_ONLY          = $00000010
#SHACF_AUTOSUGGEST_FORCE_ON  = $10000000
#SHACF_AUTOSUGGEST_FORCE_OFF = $20000000
#SHACF_AUTOAPPEND_FORCE_ON   = $40000000
#SHACF_AUTOAPPEND_FORCE_OFF  = $80000000
#SHACF_FILESYS_DIRS          = $00000020

;' sample code 
  CoInitialize_(#Null) ;' init once at beginning -- for autocomplete in stringgadgets  
  ; ... 
    StringGadget(#GADGET_SourceDir, 288, 80, 304, 20, "")
    SHAutoComplete_(GadgetID(#GADGET_SourceDir), #SHACF_AUTOAPPEND_FORCE_ON | #SHACF_AUTOSUGGEST_FORCE_ON | #SHACF_FILESYSTEM)
  ; ... 
  CoUninitialize_()  ;' uninit at end of program 

Re: Requested API Structure and constants

Posted: Mon Dec 28, 2020 3:04 pm
by Axolotl
Together with the MessageBox_(..) function there is a constant missing:

Code: Select all

;MB_DEFBUTTON1 = $00000000  ;' The first button is the default button. #MB_DEFBUTTON1 is the default unless MB_DEFBUTTON2, MB_DEFBUTTON3, or MB_DEFBUTTON4 is specified. 
;MB_DEFBUTTON2 = $00000100  ;' The second button is the default button.
;MB_DEFBUTTON3 = $00000200  ;' The third button is the default button. 
#MB_DEFBUTTON4 = $00000300  ;' The fourth button is the default button.

Re: Requested API Structure and constants

Posted: Sat Jan 23, 2021 8:55 am
by Denis
Fred wrote:We opensourced the whole Residents directory, so please do a pull request if you want to add something to it:

https://github.com/fantaisie-software/p ... ts/Windows
Salut Fred,

Sorry, I don't understand what you want :oops:
can you develop a little?

Re: Requested API Structure and constants

Posted: Wed Sep 08, 2021 8:06 pm
by Mijikai
DirectDraw ddraw.h
It also includes the GUIDS (commented).

Code: Select all


EnableExplicit

;File: ddraw.h - DirectDraw7
;Copyright (C) Microsoft Corporation.  All Rights Reserved.
;Translated to PureBasic by Mijikai

#DIRECTDRAW_VERSION = $0700

#FACDD = $876

Macro MAKE_DDHRESULT(_code_)
  ((1 << 31)|(#FACDD << 16)|_code_)
EndMacro

Macro MAKEFOURCC(_ch0_,_ch1_,_ch2_,_ch3_)
  (_ch0_|(_ch1_ << 8)|(_ch2_ << 16)|(_ch3_ << 24))
EndMacro  

#FOURCC_DXT1 = MAKEFOURCC('D','X','T','1')
#FOURCC_DXT2 = MAKEFOURCC('D','X','T','2')
#FOURCC_DXT3 = MAKEFOURCC('D','X','T','3')
#FOURCC_DXT4 = MAKEFOURCC('D','X','T','4')
#FOURCC_DXT5 = MAKEFOURCC('D','X','T','5')
  
; Macro DEFINE_GUID(_name_,_dd_,_dw1_,_dw2_,_db1_,_db2_,_db3_,_db4_,_db5_,_db6_,_db7_,_db8_);<- if needed uncomment!
;   Global _name_.GUID
;   _name_\Data1 = _dd_
;   _name_\Data2 = _dw1_
;   _name_\Data3 = _dw2_
;   _name_\Data4[0] = _db1_
;   _name_\Data4[1] = _db2_
;   _name_\Data4[2] = _db3_
;   _name_\Data4[3] = _db4_
;   _name_\Data4[4] = _db5_
;   _name_\Data4[5] = _db6_
;   _name_\Data4[6] = _db7_
;   _name_\Data4[7] = _db8_
; EndMacro
; 
; DEFINE_GUID(CLSID_DirectDraw,$D7B70EE0,$4340,$11CF,$B0,$63,$00,$20,$AF,$C2,$CD,$35)
; DEFINE_GUID(CLSID_DirectDraw7,$3c305196,$50db,$11d3,$9c,$fe,$00,$c0,$4f,$d9,$30,$c5)
; DEFINE_GUID(CLSID_DirectDrawClipper,$593817A0,$7DB3,$11CF,$A2,$DE,$00,$AA,$00,$b9,$33,$56)
; DEFINE_GUID(IID_IDirectDraw,$6C14DB80,$A733,$11CE,$A5,$21,$00,$20,$AF,$0B,$E5,$60)
; DEFINE_GUID(IID_IDirectDraw2,$B3A6F3E0,$2B43,$11CF,$A2,$DE,$00,$AA,$00,$B9,$33,$56)
; DEFINE_GUID(IID_IDirectDraw4,$9c59509a,$39bd,$11d1,$8c,$4a,$00,$c0,$4f,$d9,$30,$c5)
; DEFINE_GUID(IID_IDirectDraw7,$15e65ec0,$3b9c,$11d2,$b9,$2f,$00,$60,$97,$97,$ea,$5b)
; DEFINE_GUID(IID_IDirectDrawSurface,$6C14DB81,$A733,$11CE,$A5,$21,$00,$20,$AF,$0B,$E5,$60)
; DEFINE_GUID(IID_IDirectDrawSurface2,$57805885,$6eec,$11cf,$94,$41,$a8,$23,$03,$c1,$0e,$27)
; DEFINE_GUID(IID_IDirectDrawSurface3,$DA044E00,$69B2,$11D0,$A1,$D5,$00,$AA,$00,$B8,$DF,$BB)
; DEFINE_GUID(IID_IDirectDrawSurface4,$0B2B8630,$AD35,$11D0,$8E,$A6,$00,$60,$97,$97,$EA,$5B)
; DEFINE_GUID(IID_IDirectDrawSurface7,$06675a80,$3b9b,$11d2,$b9,$2f,$00,$60,$97,$97,$ea,$5b)
; DEFINE_GUID(IID_IDirectDrawPalette,$6C14DB84,$A733,$11CE,$A5,$21,$00,$20,$AF,$0B,$E5,$60)
; DEFINE_GUID(IID_IDirectDrawClipper,$6C14DB85,$A733,$11CE,$A5,$21,$00,$20,$AF,$0B,$E5,$60)
; DEFINE_GUID(IID_IDirectDrawColorControl,$4B9F0EE0,$0D7E,$11D0,$9B,$06,$00,$A0,$C9,$03,$A3,$B8)
; DEFINE_GUID(IID_IDirectDrawGammaControl,$69C11C3E,$B46B,$11D1,$AD,$7A,$00,$C0,$4F,$C2,$9B,$4E)

#DDENUM_ATTACHEDSECONDARYDEVICES  = $00000001
#DDENUM_DETACHEDSECONDARYDEVICES  = $00000002
#DDENUM_NONDISPLAYDEVICES         = $00000004

#REGSTR_KEY_DDHW_DESCRIPTION      = "Description"
#REGSTR_KEY_DDHW_DRIVERNAME       = "DriverName"
#REGSTR_PATH_DDHW                 = "Hardware\\DirectDrawDrivers"

#DDCREATE_HARDWAREONLY            = $00000001
#DDCREATE_EMULATIONONLY           = $00000002

Structure DDARGB Align #PB_Structure_AlignC
  blue.a
  green.a
  red.a
  alpha.a
EndStructure

Structure DDRGBA Align #PB_Structure_AlignC
  red.a
  green.a
  blue.a
  alpha.a
EndStructure

Structure DDCOLORKEY Align #PB_Structure_AlignC
  dwColorSpaceLowValue.l
  dwColorSpaceHighValue.l                                  
EndStructure

Structure DDBLTFX Align #PB_Structure_AlignC
  dwSize.l
  dwDDFX.l
  dwROP.l
  dwDDROP.l
  dwRotationAngle.l
  dwZBufferOpCode.l
  dwZBufferLow.l
  dwZBufferHigh.l
  dwZBufferBaseDest.l
  dwZDestConstBitDepth.l
  StructureUnion
    dwZDestConst.l
    *lpDDSZBufferDest
  EndStructureUnion
  dwZSrcConstBitDepth.l
  StructureUnion
    dwZSrcConst.l
    *lpDDSZBufferSrc
  EndStructureUnion
  dwAlphaEdgeBlendBitDepth.l
  dwAlphaEdgeBlend.l
  dwReserved.l
  dwAlphaDestConstBitDepth.l
  StructureUnion
    dwAlphaDestConst.l
    *lpDDSAlphaDest
  EndStructureUnion
  dwAlphaSrcConstBitDepth.l
  StructureUnion
    dwAlphaSrcConst.l
    *lpDDSAlphaSrc
  EndStructureUnion
  StructureUnion
    dwFillColor.l
    dwFillDepth.l
    dwFillPixel.l
    *lpDDSPattern
  EndStructureUnion
  ddckDestColorkey.DDCOLORKEY
  ddckSrcColorkey.DDCOLORKEY
EndStructure

Structure DDSCAPS Align #PB_Structure_AlignC
  dwCaps.l
EndStructure

Structure DDOSCAPS Align #PB_Structure_AlignC
  dwCaps.l
EndStructure

Structure DDSCAPSEX Align #PB_Structure_AlignC
  dwCaps2.l
  dwCaps3.l
  StructureUnion
    dwCaps4.l
    dwVolumeDepth.l
  EndStructureUnion
EndStructure

Structure DDSCAPS2 Align #PB_Structure_AlignC
  dwCaps.l
  dwCaps2.l
  dwCaps3.l
  StructureUnion
    dwCaps4.l
    dwVolumeDepth.l
  EndStructureUnion
EndStructure

#DD_ROP_SPACE = (256 / 32)

Structure DDCAPS_DX1 Align #PB_Structure_AlignC
  dwSize.l
  dwCaps.l
  dwCaps2.l
  dwCKeyCaps.l
  dwFXCaps.l
  dwFXAlphaCaps.l
  dwPalCaps.l
  dwSVCaps.l
  dwAlphaBltConstBitDepths.l
  dwAlphaBltPixelBitDepths.l
  dwAlphaBltSurfaceBitDepths.l
  dwAlphaOverlayConstBitDepths.l
  dwAlphaOverlayPixelBitDepths.l
  dwAlphaOverlaySurfaceBitDepths.l
  dwZBufferBitDepths.l
  dwVidMemTotal.l
  dwVidMemFree.l
  dwMaxVisibleOverlays.l
  dwCurrVisibleOverlays.l
  dwNumFourCCCodes.l
  dwAlignBoundarySrc.l
  dwAlignSizeSrc.l
  dwAlignBoundaryDest.l
  dwAlignSizeDest.l
  dwAlignStrideAlign.l
  dwRops.l[#DD_ROP_SPACE]
  ddsCaps.DDSCAPS
  dwMinOverlayStretch.l
  dwMaxOverlayStretch.l
  dwMinLiveVideoStretch.l
  dwMaxLiveVideoStretch.l
  dwMinHwCodecStretch.l
  dwMaxHwCodecStretch.l
  dwReserved1.l
  dwReserved2.l
  dwReserved3.l
EndStructure

Structure DDCAPS_DX3 Align #PB_Structure_AlignC
  dwSize.l
  dwCaps.l
  dwCaps2.l
  dwCKeyCaps.l
  dwFXCaps.l
  dwFXAlphaCaps.l
  dwPalCaps.l
  dwSVCaps.l
  dwAlphaBltConstBitDepths.l
  dwAlphaBltPixelBitDepths.l
  dwAlphaBltSurfaceBitDepths.l
  dwAlphaOverlayConstBitDepths.l
  dwAlphaOverlayPixelBitDepths.l
  dwAlphaOverlaySurfaceBitDepths.l
  dwZBufferBitDepths.l
  dwVidMemTotal.l
  dwVidMemFree.l
  dwMaxVisibleOverlays.l
  dwCurrVisibleOverlays.l
  dwNumFourCCCodes.l
  dwAlignBoundarySrc.l
  dwAlignSizeSrc.l
  dwAlignBoundaryDest.l
  dwAlignSizeDest.l
  dwAlignStrideAlign.l
  dwRops.l[#DD_ROP_SPACE]
  ddsCaps.DDSCAPS
  dwMinOverlayStretch.l
  dwMaxOverlayStretch.l
  dwMinLiveVideoStretch.l
  dwMaxLiveVideoStretch.l
  dwMinHwCodecStretch.l
  dwMaxHwCodecStretch.l
  dwReserved1.l
  dwReserved2.l
  dwReserved3.l
  dwSVBCaps.l
  dwSVBCKeyCaps.l
  dwSVBFXCaps.l
  dwSVBRops.l[#DD_ROP_SPACE]
  dwVSBCaps.l
  dwVSBCKeyCaps.l
  dwVSBFXCaps.l
  dwVSBRops.l[#DD_ROP_SPACE]
  dwSSBCaps.l
  dwSSBCKeyCaps.l
  dwSSBFXCaps.l
  dwSSBRops.l[#DD_ROP_SPACE]
  dwReserved4.l
  dwReserved5.l
  dwReserved6.l
EndStructure

Structure DDCAPS_DX5 Align #PB_Structure_AlignC
  dwSize.l
  dwCaps.l
  dwCaps2.l
  dwCKeyCaps.l
  dwFXCaps.l
  dwFXAlphaCaps.l
  dwPalCaps.l
  dwSVCaps.l
  dwAlphaBltConstBitDepths.l
  dwAlphaBltPixelBitDepths.l
  dwAlphaBltSurfaceBitDepths.l
  dwAlphaOverlayConstBitDepths.l
  dwAlphaOverlayPixelBitDepths.l
  dwAlphaOverlaySurfaceBitDepths.l
  dwZBufferBitDepths.l
  dwVidMemTotal.l
  dwVidMemFree.l
  dwMaxVisibleOverlays.l
  dwCurrVisibleOverlays.l
  dwNumFourCCCodes.l
  dwAlignBoundarySrc.l
  dwAlignSizeSrc.l
  dwAlignBoundaryDest.l
  dwAlignSizeDest.l
  dwAlignStrideAlign.l
  dwRops.l[#DD_ROP_SPACE]
  ddsCaps.DDSCAPS
  dwMinOverlayStretch.l
  dwMaxOverlayStretch.l
  dwMinLiveVideoStretch.l
  dwMaxLiveVideoStretch.l
  dwMinHwCodecStretch.l
  dwMaxHwCodecStretch.l
  dwReserved1.l
  dwReserved2.l
  dwReserved3.l
  dwSVBCaps.l
  dwSVBCKeyCaps.l
  dwSVBFXCaps.l
  dwSVBRops.l[#DD_ROP_SPACE]
  dwVSBCaps.l
  dwVSBCKeyCaps.l
  dwVSBFXCaps.l
  dwVSBRops.l[#DD_ROP_SPACE]
  dwSSBCaps.l
  dwSSBCKeyCaps.l
  dwSSBFXCaps.l
  dwSSBRops.l[#DD_ROP_SPACE]
  dwMaxVideoPorts.l
  dwCurrVideoPorts.l
  dwSVBCaps2.l
  dwNLVBCaps.l
  dwNLVBCaps2.l
  dwNLVBCKeyCaps.l
  dwNLVBFXCaps.l
  dwNLVBRops.l[#DD_ROP_SPACE]
EndStructure

Structure DDCAPS_DX6 Align #PB_Structure_AlignC
  dwSize.l
  dwCaps.l
  dwCaps2.l
  dwCKeyCaps.l
  dwFXCaps.l
  dwFXAlphaCaps.l
  dwPalCaps.l
  dwSVCaps.l
  dwAlphaBltConstBitDepths.l
  dwAlphaBltPixelBitDepths.l
  dwAlphaBltSurfaceBitDepths.l
  dwAlphaOverlayConstBitDepths.l
  dwAlphaOverlayPixelBitDepths.l
  dwAlphaOverlaySurfaceBitDepths.l
  dwZBufferBitDepths.l
  dwVidMemTotal.l
  dwVidMemFree.l
  dwMaxVisibleOverlays.l
  dwCurrVisibleOverlays.l
  dwNumFourCCCodes.l
  dwAlignBoundarySrc.l
  dwAlignSizeSrc.l
  dwAlignBoundaryDest.l
  dwAlignSizeDest.l
  dwAlignStrideAlign.l
  dwRops.l[#DD_ROP_SPACE]
  ddsOldCaps.DDSCAPS
  dwMinOverlayStretch.l
  dwMaxOverlayStretch.l
  dwMinLiveVideoStretch.l
  dwMaxLiveVideoStretch.l
  dwMinHwCodecStretch.l
  dwMaxHwCodecStretch.l
  dwReserved1.l
  dwReserved2.l
  dwReserved3.l
  dwSVBCaps.l
  dwSVBCKeyCaps.l
  dwSVBFXCaps.l
  dwSVBRops.l[#DD_ROP_SPACE]
  dwVSBCaps.l
  dwVSBCKeyCaps.l
  dwVSBFXCaps.l
  dwVSBRops.l[#DD_ROP_SPACE]
  dwSSBCaps.l
  dwSSBCKeyCaps.l
  dwSSBFXCaps.l
  dwSSBRops.l[#DD_ROP_SPACE]
  dwMaxVideoPorts.l
  dwCurrVideoPorts.l
  dwSVBCaps2.l
  dwNLVBCaps.l
  dwNLVBCaps2.l
  dwNLVBCKeyCaps.l
  dwNLVBFXCaps.l
  dwNLVBRops.l[#DD_ROP_SPACE]
  ddsCaps.DDSCAPS2
EndStructure

Structure DDCAPS_DX7 Align #PB_Structure_AlignC
  dwSize.l
  dwCaps.l
  dwCaps2.l
  dwCKeyCaps.l
  dwFXCaps.l
  dwFXAlphaCaps.l
  dwPalCaps.l
  dwSVCaps.l
  dwAlphaBltConstBitDepths.l
  dwAlphaBltPixelBitDepths.l
  dwAlphaBltSurfaceBitDepths.l
  dwAlphaOverlayConstBitDepths.l
  dwAlphaOverlayPixelBitDepths.l
  dwAlphaOverlaySurfaceBitDepths.l
  dwZBufferBitDepths.l
  dwVidMemTotal.l
  dwVidMemFree.l
  dwMaxVisibleOverlays.l
  dwCurrVisibleOverlays.l
  dwNumFourCCCodes.l
  dwAlignBoundarySrc.l
  dwAlignSizeSrc.l
  dwAlignBoundaryDest.l
  dwAlignSizeDest.l
  dwAlignStrideAlign.l
  dwRops.l[#DD_ROP_SPACE]
  ddsOldCaps.DDSCAPS
  dwMinOverlayStretch.l
  dwMaxOverlayStretch.l
  dwMinLiveVideoStretch.l
  dwMaxLiveVideoStretch.l
  dwMinHwCodecStretch.l
  dwMaxHwCodecStretch.l
  dwReserved1.l
  dwReserved2.l
  dwReserved3.l
  dwSVBCaps.l
  dwSVBCKeyCaps.l
  dwSVBFXCaps.l
  dwSVBRops.l[#DD_ROP_SPACE]
  dwVSBCaps.l
  dwVSBCKeyCaps.l
  dwVSBFXCaps.l
  dwVSBRops.l[#DD_ROP_SPACE]
  dwSSBCaps.l
  dwSSBCKeyCaps.l
  dwSSBFXCaps.l
  dwSSBRops.l[#DD_ROP_SPACE]
  dwMaxVideoPorts.l
  dwCurrVideoPorts.l
  dwSVBCaps2.l
  dwNLVBCaps.l
  dwNLVBCaps2.l
  dwNLVBCKeyCaps.l
  dwNLVBFXCaps.l
  dwNLVBRops.l[#DD_ROP_SPACE]
  ddsCaps.DDSCAPS2
EndStructure

Structure DDMULTISAMPLECAPS Align #PB_Structure_AlignC
  wFlipMSTypes.w
  wBltMSTypes.w
EndStructure

Structure DDPIXELFORMAT Align #PB_Structure_AlignC
  dwSize.l
  dwFlags.l
  dwFourCC.l
  StructureUnion
    dwRGBBitCount.l
    dwYUVBitCount.l
    dwZBufferBitDepth.l
    dwAlphaBitDepth.l
    dwLuminanceBitCount.l
    dwBumpBitCount.l
    dwPrivateFormatBitCount.l
  EndStructureUnion
  StructureUnion
    dwRBitMask.l
    dwYBitMask.l
    dwStencilBitDepth.l
    dwLuminanceBitMask.l
    dwBumpDuBitMask.l
    dwOperations.l
  EndStructureUnion
  StructureUnion
    dwGBitMask.l
    dwUBitMask.l
    dwZBitMask.l
    dwBumpDvBitMask.l
    MultiSampleCaps.DDMULTISAMPLECAPS
  EndStructureUnion
  StructureUnion
    dwBBitMask.l
    dwVBitMask.l
    dwStencilBitMask.l
    dwBumpLuminanceBitMask.l
  EndStructureUnion
  StructureUnion
    dwRGBAlphaBitMask.l
    dwYUVAlphaBitMask.l
    dwLuminanceAlphaBitMask.l
    dwRGBZBitMask.l
    wYUVZBitMask.l
  EndStructureUnion
EndStructure

Structure DDOVERLAYFX Align #PB_Structure_AlignC
  dwSize.l
  dwAlphaEdgeBlendBitDepth.l
  dwAlphaEdgeBlend.l
  dwReserved.l
  dwAlphaDestConstBitDepth.l
  StructureUnion
    dwAlphaDestConst.l
    *lpDDSAlphaDest
  EndStructureUnion
  dwAlphaSrcConstBitDepth.l
  StructureUnion
    dwAlphaSrcConst.l
    *lpDDSAlphaSrc
  EndStructureUnion
  dckDestColorkey.DDCOLORKEY
  dckSrcColorkey.DDCOLORKEY
  dwDDFX.l
  dwFlags.l
EndStructure

Structure DDBLTBATCH Align #PB_Structure_AlignC
  *lprDest.RECT
  *lpDDSSrc
  *lprSrc.RECT
  dwFlags.l
  *lpDDBltFx.DDBLTFX
EndStructure

Structure DDGAMMARAMP Align #PB_Structure_AlignC
  red.w[256]
  green.w[256]
  blue.w[256]
EndStructure

#MAX_DDDEVICEID_STRING = 512

Structure DDDEVICEIDENTIFIER Align #PB_Structure_AlignC
  szDriver.a[#MAX_DDDEVICEID_STRING]
  szDescription.a[#MAX_DDDEVICEID_STRING]
  liDriverVersion.LARGE_INTEGER
  dwVendorId.l
  dwDeviceId.l
  dwSubSysId.l
  dwRevision.l
  guidDeviceIdentifier.GUID
EndStructure

Structure DDDEVICEIDENTIFIER2 Align #PB_Structure_AlignC
  szDriver.a[#MAX_DDDEVICEID_STRING]
  szDescription.a[#MAX_DDDEVICEID_STRING]
  liDriverVersion.LARGE_INTEGER
  dwVendorId.l
  dwDeviceId.l
  dwSubSysId.l
  dwRevision.l
  guidDeviceIdentifier.GUID 
  dwWHQLLevel.l
EndStructure

#DDGDI_GETHOSTIDENTIFIER = $00000001

Macro GET_WHQL_YEAR(_dwWHQLLevel_) 
  (_dwWHQLLevel_ / $10000)
EndMacro

Macro GET_WHQL_MONTH(_dwWHQLLevel_)
  ((_dwWHQLLevel_ / $100 ) & 0x00FF)
EndMacro

Macro GET_WHQL_DAY(_dwWHQLLevel_)
  (_dwWHQLLevel_ & 0xFF)
EndMacro

;HERE WOULD BE THE PLACE FOR THE INTERFACES - PB ALREADY HAS THEM!

Structure DDSURFACEDESC Align #PB_Structure_AlignC
  dwSize.l
  dwFlags.l
  dwHeight.l
  dwWidth.l
  StructureUnion
    lPitch.l
    dwLinearSize.l
  EndStructureUnion
  dwBackBufferCount.l
  StructureUnion
    dwMipMapCount.l
    dwZBufferBitDepth.l
    dwRefreshRate.l
  EndStructureUnion
  dwAlphaBitDepth.l
  dwReserved.l
  *lpSurface
  ddckCKDestOverlay.DDCOLORKEY
  ddckCKDestBlt.DDCOLORKEY
  ddckCKSrcOverlay.DDCOLORKEY
  ddckCKSrcBlt.DDCOLORKEY
  ddpfPixelFormat.DDPIXELFORMAT
  ddsCaps.DDSCAPS
EndStructure

Structure DDSURFACEDESC2 Align #PB_Structure_AlignC
  dwSize.l
  dwFlags.l
  dwHeight.l
  dwWidth.l
  StructureUnion
    lPitch.l
    dwLinearSize.l
  EndStructureUnion
  StructureUnion
    dwBackBufferCount.l
    dwDepth.l
  EndStructureUnion
  StructureUnion
    dwMipMapCount.l
    dwRefreshRate.l
    dwSrcVBHandle.l
  EndStructureUnion
  dwAlphaBitDepth.l
  dwReserved.l
  *lpSurface
  StructureUnion
    ddckCKDestOverlay.DDCOLORKEY
    dwEmptyFaceColor.l
  EndStructureUnion
  ddckCKDestBlt.DDCOLORKEY
  ddckCKSrcOverlay.DDCOLORKEY
  ddckCKSrcBlt.DDCOLORKEY
  StructureUnion
    ddpfPixelFormat.DDPIXELFORMAT
    dwFVF.l
  EndStructureUnion
  ddsCaps.DDSCAPS2
  dwTextureStage.l
EndStructure

#DDSD_CAPS               = $00000001
#DDSD_HEIGHT             = $00000002
#DDSD_WIDTH              = $00000004
#DDSD_PITCH              = $00000008
#DDSD_BACKBUFFERCOUNT    = $00000020
#DDSD_ZBUFFERBITDEPTH    = $00000040
#DDSD_ALPHABITDEPTH      = $00000080
#DDSD_LPSURFACE          = $00000800
#DDSD_PIXELFORMAT        = $00001000
#DDSD_CKDESTOVERLAY      = $00002000
#DDSD_CKDESTBLT          = $00004000
#DDSD_CKSRCOVERLAY       = $00008000
#DDSD_CKSRCBLT           = $00010000
#DDSD_MIPMAPCOUNT        = $00020000
#DDSD_REFRESHRATE        = $00040000
#DDSD_LINEARSIZE         = $00080000
#DDSD_TEXTURESTAGE       = $00100000
#DDSD_FVF                = $00200000
#DDSD_SRCVBHANDLE        = $00400000
#DDSD_DEPTH              = $00800000
#DDSD_ALL                = $00FFF9EE

Structure DDOPTSURFACEDESC Align #PB_Structure_AlignC
  dwSize.l
  dwFlags.l
  ddSCaps.DDSCAPS2 
  ddOSCaps.DDOSCAPS
  guid.GUID
  dwCompressionRatio.l
EndStructure

#DDOSD_GUID                  = $00000001
#DDOSD_COMPRESSION_RATIO     = $00000002
#DDOSD_SCAPS                 = $00000004
#DDOSD_OSCAPS                = $00000008
#DDOSD_ALL                   = $0000000F

#DDOSDCAPS_OPTCOMPRESSED     = $00000001
#DDOSDCAPS_OPTREORDERED      = $00000002
#DDOSDCAPS_MONOLITHICMIPMAP  = $00000004

#DDOSDCAPS_VALIDSCAPS        = $30004800
#DDOSDCAPS_VALIDOSCAPS       = $00000007

Structure DDCOLORCONTROL Align #PB_Structure_AlignC
  dwSize.l
  dwFlags.l
  lBrightness.l
  lContrast.l
  lHue.l
  lSaturation.l
  lSharpness.l
  lGamma.l
  lColorEnable.l
  dwReserved1.l
EndStructure

#DDCOLOR_BRIGHTNESS              = $00000001
#DDCOLOR_CONTRAST                = $00000002
#DDCOLOR_HUE                     = $00000004
#DDCOLOR_SATURATION              = $00000008
#DDCOLOR_SHARPNESS               = $00000010
#DDCOLOR_GAMMA                   = $00000020
#DDCOLOR_COLORENABLE             = $00000040
 
#DDSCAPS_RESERVED1                       = $00000001
#DDSCAPS_ALPHA                           = $00000002
#DDSCAPS_BACKBUFFER                      = $00000004
#DDSCAPS_COMPLEX                         = $00000008
#DDSCAPS_FLIP                            = $00000010
#DDSCAPS_FRONTBUFFER                     = $00000020
#DDSCAPS_OFFSCREENPLAIN                  = $00000040
#DDSCAPS_OVERLAY                         = $00000080
#DDSCAPS_PALETTE                         = $00000100
#DDSCAPS_PRIMARYSURFACE                  = $00000200
#DDSCAPS_RESERVED3                       = $00000400
#DDSCAPS_PRIMARYSURFACELEFT              = $00000000
#DDSCAPS_SYSTEMMEMORY                    = $00000800
#DDSCAPS_TEXTURE                         = $00001000
#DDSCAPS_3DDEVICE                        = $00002000
#DDSCAPS_VIDEOMEMORY                     = $00004000
#DDSCAPS_VISIBLE                         = $00008000
#DDSCAPS_WRITEONLY                       = $00010000
#DDSCAPS_ZBUFFER                         = $00020000
#DDSCAPS_OWNDC                           = $00040000
#DDSCAPS_LIVEVIDEO                       = $00080000
#DDSCAPS_HWCODEC                         = $00100000
#DDSCAPS_MODEX                           = $00200000
#DDSCAPS_MIPMAP                          = $00400000
#DDSCAPS_RESERVED2                       = $00800000
#DDSCAPS_ALLOCONLOAD                     = $04000000
#DDSCAPS_VIDEOPORT                       = $08000000
#DDSCAPS_LOCALVIDMEM                     = $10000000
#DDSCAPS_NONLOCALVIDMEM                  = $20000000
#DDSCAPS_STANDARDVGAMODE                 = $40000000
#DDSCAPS_OPTIMIZED                       = $80000000

#DDSCAPS2_RESERVED4                      = $00000002
#DDSCAPS2_HARDWAREDEINTERLACE            = $00000000
#DDSCAPS2_HINTDYNAMIC                    = $00000004
#DDSCAPS2_HINTSTATIC                     = $00000008
#DDSCAPS2_TEXTUREMANAGE                  = $00000010
#DDSCAPS2_RESERVED1                      = $00000020
#DDSCAPS2_RESERVED2                      = $00000040
#DDSCAPS2_OPAQUE                         = $00000080
#DDSCAPS2_HINTANTIALIASING               = $00000100
#DDSCAPS2_CUBEMAP                        = $00000200
#DDSCAPS2_CUBEMAP_POSITIVEX              = $00000400
#DDSCAPS2_CUBEMAP_NEGATIVEX              = $00000800
#DDSCAPS2_CUBEMAP_POSITIVEY              = $00001000
#DDSCAPS2_CUBEMAP_NEGATIVEY              = $00002000
#DDSCAPS2_CUBEMAP_POSITIVEZ              = $00004000
#DDSCAPS2_CUBEMAP_NEGATIVEZ              = $00008000
#DDSCAPS2_CUBEMAP_ALLFACES               = #DDSCAPS2_CUBEMAP_POSITIVEX|#DDSCAPS2_CUBEMAP_NEGATIVEX|#DDSCAPS2_CUBEMAP_POSITIVEY|#DDSCAPS2_CUBEMAP_NEGATIVEY|#DDSCAPS2_CUBEMAP_POSITIVEZ|#DDSCAPS2_CUBEMAP_NEGATIVEZ

#DDSCAPS2_MIPMAPSUBLEVEL                  = $00010000
#DDSCAPS2_D3DTEXTUREMANAGE                = $00020000
#DDSCAPS2_DONOTPERSIST                    = $00040000
#DDSCAPS2_STEREOSURFACELEFT               = $00080000
#DDSCAPS2_VOLUME                          = $00200000
#DDSCAPS2_NOTUSERLOCKABLE                 = $00400000
#DDSCAPS2_POINTS                          = $00800000
#DDSCAPS2_RTPATCHES                       = $01000000
#DDSCAPS2_NPATCHES                        = $02000000
#DDSCAPS2_RESERVED3                       = $04000000
#DDSCAPS2_DISCARDBACKBUFFER               = $10000000
#DDSCAPS2_ENABLEALPHACHANNEL              = $20000000
#DDSCAPS2_EXTENDEDFORMATPRIMARY           = $40000000
#DDSCAPS2_ADDITIONALPRIMARY               = $80000000

#DDSCAPS3_MULTISAMPLE_MASK                = $0000001F
#DDSCAPS3_MULTISAMPLE_QUALITY_MASK        = $000000E0
#DDSCAPS3_MULTISAMPLE_QUALITY_SHIFT       = 5
#DDSCAPS3_RESERVED1                       = $00000100
#DDSCAPS3_RESERVED2                       = $00000200
#DDSCAPS3_LIGHTWEIGHTMIPMAP               = $00000400
#DDSCAPS3_AUTOGENMIPMAP                   = $00000800
#DDSCAPS3_DMAP                            = $00001000
#DDSCAPS3_CREATESHAREDRESOURCE            = $00002000
#DDSCAPS3_READONLYRESOURCE                = $00004000
#DDSCAPS3_OPENSHAREDRESOURCE              = $00008000

#DDCAPS_3D                       = $00000001

#DDCAPS_ALIGNBOUNDARYDEST        = $00000002
#DDCAPS_ALIGNSIZEDEST            = $00000004
#DDCAPS_ALIGNBOUNDARYSRC         = $00000008
#DDCAPS_ALIGNSIZESRC             = $00000010
#DDCAPS_ALIGNSTRIDE              = $00000020
#DDCAPS_BLT                      = $00000040
#DDCAPS_BLTQUEUE                 = $00000080
#DDCAPS_BLTFOURCC                = $00000100
#DDCAPS_BLTSTRETCH               = $00000200
#DDCAPS_GDI                      = $00000400
#DDCAPS_OVERLAY                  = $00000800
#DDCAPS_OVERLAYCANTCLIP          = $00001000
#DDCAPS_OVERLAYFOURCC            = $00002000
#DDCAPS_OVERLAYSTRETCH           = $00004000
#DDCAPS_PALETTE                  = $00008000
#DDCAPS_PALETTEVSYNC             = $00010000
#DDCAPS_READSCANLINE             = $00020000
#DDCAPS_RESERVED1                = $00040000
#DDCAPS_VBI                      = $00080000
#DDCAPS_ZBLTS                    = $00100000
#DDCAPS_ZOVERLAYS                = $00200000
#DDCAPS_COLORKEY                 = $00400000
#DDCAPS_ALPHA                    = $00800000
#DDCAPS_COLORKEYHWASSIST         = $01000000
#DDCAPS_NOHARDWARE               = $02000000
#DDCAPS_BLTCOLORFILL             = $04000000
#DDCAPS_BANKSWITCHED             = $08000000
#DDCAPS_BLTDEPTHFILL             = $10000000
#DDCAPS_CANCLIP                  = $20000000
#DDCAPS_CANCLIPSTRETCHED         = $40000000
#DDCAPS_CANBLTSYSMEM             = $80000000

#DDCAPS2_CERTIFIED               = $00000001
#DDCAPS2_NO2DDURING3DSCENE       = $00000002
#DDCAPS2_VIDEOPORT               = $00000004
#DDCAPS2_AUTOFLIPOVERLAY         = $00000008
#DDCAPS2_CANBOBINTERLEAVED       = $00000010
#DDCAPS2_CANBOBNONINTERLEAVED    = $00000020
#DDCAPS2_COLORCONTROLOVERLAY     = $00000040
#DDCAPS2_COLORCONTROLPRIMARY     = $00000080
#DDCAPS2_CANDROPZ16BIT           = $00000100
#DDCAPS2_NONLOCALVIDMEM          = $00000200
#DDCAPS2_NONLOCALVIDMEMCAPS      = $00000400
#DDCAPS2_NOPAGELOCKREQUIRED      = $00000800
#DDCAPS2_WIDESURFACES            = $00001000
#DDCAPS2_CANFLIPODDEVEN          = $00002000
#DDCAPS2_CANBOBHARDWARE          = $00004000
#DDCAPS2_COPYFOURCC              = $00008000
#DDCAPS2_PRIMARYGAMMA            = $00020000
#DDCAPS2_CANRENDERWINDOWED       = $00080000
#DDCAPS2_CANCALIBRATEGAMMA       = $00100000
#DDCAPS2_FLIPINTERVAL            = $00200000
#DDCAPS2_FLIPNOVSYNC             = $00400000
#DDCAPS2_CANMANAGETEXTURE        = $00800000
#DDCAPS2_TEXMANINNONLOCALVIDMEM  = $01000000
#DDCAPS2_STEREO                  = $02000000
#DDCAPS2_SYSTONONLOCAL_AS_SYSTOLOCAL   = $04000000
#DDCAPS2_RESERVED1                     = $08000000
#DDCAPS2_CANMANAGERESOURCE             = $10000000
#DDCAPS2_DYNAMICTEXTURES               = $20000000
#DDCAPS2_CANAUTOGENMIPMAP              = $40000000
#DDCAPS2_CANSHARERESOURCE              = $80000000

#DDFXALPHACAPS_BLTALPHAEDGEBLEND         = $00000001
#DDFXALPHACAPS_BLTALPHAPIXELS            = $00000002
#DDFXALPHACAPS_BLTALPHAPIXELSNEG         = $00000004
#DDFXALPHACAPS_BLTALPHASURFACES          = $00000008
#DDFXALPHACAPS_BLTALPHASURFACESNEG       = $00000010
#DDFXALPHACAPS_OVERLAYALPHAEDGEBLEND     = $00000020
#DDFXALPHACAPS_OVERLAYALPHAPIXELS        = $00000040
#DDFXALPHACAPS_OVERLAYALPHAPIXELSNEG     = $00000080
#DDFXALPHACAPS_OVERLAYALPHASURFACES      = $00000100
#DDFXALPHACAPS_OVERLAYALPHASURFACESNEG   = $00000200

#DDFXCAPS_BLTARITHSTRETCHY       = $00000020
#DDFXCAPS_BLTARITHSTRETCHYN      = $00000010
#DDFXCAPS_BLTMIRRORLEFTRIGHT     = $00000040
#DDFXCAPS_BLTMIRRORUPDOWN        = $00000080
#DDFXCAPS_BLTROTATION            = $00000100
#DDFXCAPS_BLTROTATION90          = $00000200
#DDFXCAPS_BLTSHRINKX             = $00000400
#DDFXCAPS_BLTSHRINKXN            = $00000800
#DDFXCAPS_BLTSHRINKY             = $00001000
#DDFXCAPS_BLTSHRINKYN            = $00002000
#DDFXCAPS_BLTSTRETCHX            = $00004000
#DDFXCAPS_BLTSTRETCHXN           = $00008000
#DDFXCAPS_BLTSTRETCHY            = $00010000
#DDFXCAPS_BLTSTRETCHYN           = $00020000
#DDFXCAPS_OVERLAYARITHSTRETCHY   = $00040000
#DDFXCAPS_OVERLAYARITHSTRETCHYN  = $00000008
#DDFXCAPS_OVERLAYSHRINKX         = $00080000
#DDFXCAPS_OVERLAYSHRINKXN        = $00100000
#DDFXCAPS_OVERLAYSHRINKY         = $00200000
#DDFXCAPS_OVERLAYSHRINKYN        = $00400000
#DDFXCAPS_OVERLAYSTRETCHX        = $00800000
#DDFXCAPS_OVERLAYSTRETCHXN       = $01000000
#DDFXCAPS_OVERLAYSTRETCHY        = $02000000
#DDFXCAPS_OVERLAYSTRETCHYN       = $04000000
#DDFXCAPS_OVERLAYMIRRORLEFTRIGHT = $08000000
#DDFXCAPS_OVERLAYMIRRORUPDOWN    = $10000000
#DDFXCAPS_OVERLAYDEINTERLACE		 = $20000000
#DDFXCAPS_BLTALPHA               = $00000001
#DDFXCAPS_BLTFILTER              = #DDFXCAPS_BLTARITHSTRETCHY
#DDFXCAPS_OVERLAYALPHA           = $00000004
#DDFXCAPS_OVERLAYFILTER          = #DDFXCAPS_OVERLAYARITHSTRETCHY

#DDSVCAPS_RESERVED1              = $00000001
#DDSVCAPS_RESERVED2              = $00000002
#DDSVCAPS_RESERVED3              = $00000004
#DDSVCAPS_RESERVED4              = $00000008
#DDSVCAPS_STEREOSEQUENTIAL       = $00000010

#DDPCAPS_4BIT                    = $00000001
#DDPCAPS_8BITENTRIES             = $00000002
#DDPCAPS_8BIT                    = $00000004
#DDPCAPS_INITIALIZE              = $00000000
#DDPCAPS_PRIMARYSURFACE          = $00000010
#DDPCAPS_PRIMARYSURFACELEFT      = $00000020
#DDPCAPS_ALLOW256                = $00000040
#DDPCAPS_VSYNC                   = $00000080
#DDPCAPS_1BIT                    = $00000100
#DDPCAPS_2BIT                    = $00000200
#DDPCAPS_ALPHA                   = $00000400

#DDSPD_IUNKNOWNPOINTER           = $00000001
#DDSPD_VOLATILE                  = $00000002

#DDBD_1                  = $00004000
#DDBD_2                  = $00002000
#DDBD_4                  = $00001000
#DDBD_8                  = $00000800
#DDBD_16                 = $00000400
#DDBD_24                 = $00000200
#DDBD_32                 = $00000100

#DDCKEY_COLORSPACE       = $00000001
#DDCKEY_DESTBLT          = $00000002
#DDCKEY_DESTOVERLAY      = $00000004
#DDCKEY_SRCBLT           = $00000008
#DDCKEY_SRCOVERLAY       = $00000010

#DDCKEYCAPS_DESTBLT                      = $00000001
#DDCKEYCAPS_DESTBLTCLRSPACE              = $00000002
#DDCKEYCAPS_DESTBLTCLRSPACEYUV           = $00000004
#DDCKEYCAPS_DESTBLTYUV                   = $00000008
#DDCKEYCAPS_DESTOVERLAY                  = $00000010
#DDCKEYCAPS_DESTOVERLAYCLRSPACE          = $00000020
#DDCKEYCAPS_DESTOVERLAYCLRSPACEYUV       = $00000040
#DDCKEYCAPS_DESTOVERLAYONEACTIVE         = $00000080
#DDCKEYCAPS_DESTOVERLAYYUV               = $00000100
#DDCKEYCAPS_SRCBLT                       = $00000200
#DDCKEYCAPS_SRCBLTCLRSPACE               = $00000400
#DDCKEYCAPS_SRCBLTCLRSPACEYUV            = $00000800
#DDCKEYCAPS_SRCBLTYUV                    = $00001000
#DDCKEYCAPS_SRCOVERLAY                   = $00002000
#DDCKEYCAPS_SRCOVERLAYCLRSPACE           = $00004000
#DDCKEYCAPS_SRCOVERLAYCLRSPACEYUV        = $00008000
#DDCKEYCAPS_SRCOVERLAYONEACTIVE          = $00010000
#DDCKEYCAPS_SRCOVERLAYYUV                = $00020000
#DDCKEYCAPS_NOCOSTOVERLAY                = $00040000

#DDPF_ALPHAPIXELS                        = $00000001
#DDPF_ALPHA                              = $00000002
#DDPF_FOURCC                             = $00000004
#DDPF_PALETTEINDEXED4                    = $00000008
#DDPF_PALETTEINDEXEDTO8                  = $00000010
#DDPF_PALETTEINDEXED8                    = $00000020
#DDPF_RGB                                = $00000040
#DDPF_COMPRESSED                         = $00000080
#DDPF_RGBTOYUV                           = $00000100
#DDPF_YUV                                = $00000200
#DDPF_ZBUFFER                            = $00000400
#DDPF_PALETTEINDEXED1                    = $00000800
#DDPF_PALETTEINDEXED2                    = $00001000
#DDPF_ZPIXELS                            = $00002000
#DDPF_STENCILBUFFER                      = $00004000
#DDPF_ALPHAPREMULT                       = $00008000
#DDPF_LUMINANCE                          = $00020000
#DDPF_BUMPLUMINANCE                      = $00040000
#DDPF_BUMPDUDV                           = $00080000

#DDENUMSURFACES_ALL                      = $00000001
#DDENUMSURFACES_MATCH                    = $00000002
#DDENUMSURFACES_NOMATCH                  = $00000004
#DDENUMSURFACES_CANBECREATED             = $00000008
#DDENUMSURFACES_DOESEXIST                = $00000010

#DDSDM_STANDARDVGAMODE                   = $00000001

#DDEDM_REFRESHRATES                      = $00000001
#DDEDM_STANDARDVGAMODES                  = $00000002

#DDSCL_FULLSCREEN                        = $00000001
#DDSCL_ALLOWREBOOT                       = $00000002
#DDSCL_NOWINDOWCHANGES                   = $00000004
#DDSCL_NORMAL                            = $00000008
#DDSCL_EXCLUSIVE                         = $00000010
#DDSCL_ALLOWMODEX                        = $00000040
#DDSCL_SETFOCUSWINDOW                    = $00000080
#DDSCL_SETDEVICEWINDOW                   = $00000100
#DDSCL_CREATEDEVICEWINDOW                = $00000200
#DDSCL_MULTITHREADED                     = $00000400
#DDSCL_FPUSETUP                          = $00000800
#DDSCL_FPUPRESERVE                       = $00001000

#DDBLT_ALPHADEST                         = $00000001
#DDBLT_ALPHADESTCONSTOVERRIDE            = $00000002
#DDBLT_ALPHADESTNEG                      = $00000004
#DDBLT_ALPHADESTSURFACEOVERRIDE          = $00000008
#DDBLT_ALPHAEDGEBLEND                    = $00000010
#DDBLT_ALPHASRC                          = $00000020
#DDBLT_ALPHASRCCONSTOVERRIDE             = $00000040
#DDBLT_ALPHASRCNEG                       = $00000080
#DDBLT_ALPHASRCSURFACEOVERRIDE           = $00000100
#DDBLT_ASYNC                             = $00000200
#DDBLT_COLORFILL                         = $00000400
#DDBLT_DDFX                              = $00000800
#DDBLT_DDROPS                            = $00001000
#DDBLT_KEYDEST                           = $00002000
#DDBLT_KEYDESTOVERRIDE                   = $00004000
#DDBLT_KEYSRC                            = $00008000
#DDBLT_KEYSRCOVERRIDE                    = $00010000
#DDBLT_ROP                               = $00020000
#DDBLT_ROTATIONANGLE                     = $00040000
#DDBLT_ZBUFFER                           = $00080000
#DDBLT_ZBUFFERDESTCONSTOVERRIDE          = $00100000
#DDBLT_ZBUFFERDESTOVERRIDE               = $00200000
#DDBLT_ZBUFFERSRCCONSTOVERRIDE           = $00400000
#DDBLT_ZBUFFERSRCOVERRIDE                = $00800000
#DDBLT_WAIT                              = $01000000
#DDBLT_DEPTHFILL                         = $02000000
#DDBLT_DONOTWAIT                         = $08000000
#DDBLT_PRESENTATION                      = $10000000
#DDBLT_LAST_PRESENTATION                 = $20000000
#DDBLT_EXTENDED_FLAGS                    = $40000000
#DDBLT_EXTENDED_LINEAR_CONTENT           = $00000004

#DDBLTFAST_NOCOLORKEY                    = $00000000
#DDBLTFAST_SRCCOLORKEY                   = $00000001
#DDBLTFAST_DESTCOLORKEY                  = $00000002
#DDBLTFAST_WAIT                          = $00000010
#DDBLTFAST_DONOTWAIT                     = $00000020

#DDFLIP_WAIT                          = $00000001
#DDFLIP_EVEN                          = $00000002
#DDFLIP_ODD                           = $00000004
#DDFLIP_NOVSYNC                       = $00000008
#DDFLIP_INTERVAL2                     = $02000000
#DDFLIP_INTERVAL3                     = $03000000
#DDFLIP_INTERVAL4                     = $04000000
#DDFLIP_STEREO                        = $00000010
#DDFLIP_DONOTWAIT                     = $00000020

#DDOVER_ALPHADEST                        = $00000001
#DDOVER_ALPHADESTCONSTOVERRIDE           = $00000002
#DDOVER_ALPHADESTNEG                     = $00000004
#DDOVER_ALPHADESTSURFACEOVERRIDE         = $00000008
#DDOVER_ALPHAEDGEBLEND                   = $00000010
#DDOVER_ALPHASRC                         = $00000020
#DDOVER_ALPHASRCCONSTOVERRIDE            = $00000040
#DDOVER_ALPHASRCNEG                      = $00000080
#DDOVER_ALPHASRCSURFACEOVERRIDE          = $00000100
#DDOVER_HIDE                             = $00000200
#DDOVER_KEYDEST                          = $00000400
#DDOVER_KEYDESTOVERRIDE                  = $00000800
#DDOVER_KEYSRC                           = $00001000
#DDOVER_KEYSRCOVERRIDE                   = $00002000
#DDOVER_SHOW                             = $00004000
#DDOVER_ADDDIRTYRECT                     = $00008000
#DDOVER_REFRESHDIRTYRECTS                = $00010000
#DDOVER_REFRESHALL                       = $00020000
#DDOVER_DDFX                             = $00080000
#DDOVER_AUTOFLIP                         = $00100000
#DDOVER_BOB                              = $00200000
#DDOVER_OVERRIDEBOBWEAVE                 = $00400000
#DDOVER_INTERLEAVED                      = $00800000
#DDOVER_BOBHARDWARE                      = $01000000
#DDOVER_ARGBSCALEFACTORS                 = $02000000
#DDOVER_DEGRADEARGBSCALING               = $04000000

#DDSETSURFACEDESC_RECREATEDC             = $00000000
#DDSETSURFACEDESC_PRESERVEDC             = $00000001

#DDLOCK_SURFACEMEMORYPTR                 = $00000000
#DDLOCK_WAIT                             = $00000001
#DDLOCK_EVENT                            = $00000002
#DDLOCK_READONLY                         = $00000010
#DDLOCK_WRITEONLY                        = $00000020
#DDLOCK_NOSYSLOCK                        = $00000800
#DDLOCK_NOOVERWRITE                      = $00001000
#DDLOCK_DISCARDCONTENTS                  = $00002000
#DDLOCK_OKTOSWAP                         = $00002000
#DDLOCK_DONOTWAIT                        = $00004000
#DDLOCK_HASVOLUMETEXTUREBOXRECT          = $00008000
#DDLOCK_NODIRTYUPDATE                    = $00010000

#DDBLTFX_ARITHSTRETCHY                   = $00000001
#DDBLTFX_MIRRORLEFTRIGHT                 = $00000002
#DDBLTFX_MIRRORUPDOWN                    = $00000004
#DDBLTFX_NOTEARING                       = $00000008
#DDBLTFX_ROTATE180                       = $00000010
#DDBLTFX_ROTATE270                       = $00000020
#DDBLTFX_ROTATE90                        = $00000040
#DDBLTFX_ZBUFFERRANGE                    = $00000080
#DDBLTFX_ZBUFFERBASEDEST                 = $00000100

#DDOVERFX_ARITHSTRETCHY                  = $00000001
#DDOVERFX_MIRRORLEFTRIGHT                = $00000002
#DDOVERFX_MIRRORUPDOWN                   = $00000004
#DDOVERFX_DEINTERLACE                    = $00000008

#DDWAITVB_BLOCKBEGIN                     = $00000001
#DDWAITVB_BLOCKBEGINEVENT                = $00000002
#DDWAITVB_BLOCKEND                       = $00000004

#DDGFS_CANFLIP                   = $00000001
#DDGFS_ISFLIPDONE                = $00000002

#DDGBS_CANBLT                    = $00000001
#DDGBS_ISBLTDONE                 = $00000002

#DDENUMOVERLAYZ_BACKTOFRONT      = $00000000
#DDENUMOVERLAYZ_FRONTTOBACK      = $00000001

#DDOVERZ_SENDTOFRONT             = $00000000
#DDOVERZ_SENDTOBACK              = $00000001
#DDOVERZ_MOVEFORWARD             = $00000002
#DDOVERZ_MOVEBACKWARD            = $00000003
#DDOVERZ_INSERTINFRONTOF         = $00000004
#DDOVERZ_INSERTINBACKOF          = $00000005

#DDSGR_CALIBRATE                        = $00000001

#DDSMT_ISTESTREQUIRED                   = $00000001

#DDEM_MODEPASSED                        = $00000001
#DDEM_MODEFAILED                        = $00000002

#DD_OK                                  = #S_OK
#DD_FALSE                               = #S_FALSE

#DDENUMRET_CANCEL                       = 0
#DDENUMRET_OK                           = 1

#DDERR_ALREADYINITIALIZED                = MAKE_DDHRESULT(5)
#DDERR_CANNOTATTACHSURFACE               = MAKE_DDHRESULT(10)
#DDERR_CANNOTDETACHSURFACE               = MAKE_DDHRESULT(20)
#DDERR_CURRENTLYNOTAVAIL                 = MAKE_DDHRESULT(40)
#DDERR_EXCEPTION                         = MAKE_DDHRESULT(55)
#DDERR_GENERIC                           = #E_FAIL
#DDERR_HEIGHTALIGN                       = MAKE_DDHRESULT(90)
#DDERR_INCOMPATIBLEPRIMARY               = MAKE_DDHRESULT(95)
#DDERR_INVALIDCAPS                       = MAKE_DDHRESULT(100)
#DDERR_INVALIDCLIPLIST                   = MAKE_DDHRESULT(110)
#DDERR_INVALIDMODE                       = MAKE_DDHRESULT(120)
#DDERR_INVALIDOBJECT                     = MAKE_DDHRESULT(130)
#DDERR_INVALIDPARAMS                     = #E_INVALIDARG
#DDERR_INVALIDPIXELFORMAT                = MAKE_DDHRESULT(145)
#DDERR_INVALIDRECT                       = MAKE_DDHRESULT(150)
#DDERR_LOCKEDSURFACES                    = MAKE_DDHRESULT(160)
#DDERR_NO3D                              = MAKE_DDHRESULT(170)
#DDERR_NOALPHAHW                         = MAKE_DDHRESULT(180)
#DDERR_NOSTEREOHARDWARE                  = MAKE_DDHRESULT(181)
#DDERR_NOSURFACELEFT                     = MAKE_DDHRESULT(182)
#DDERR_NOCLIPLIST                        = MAKE_DDHRESULT(205)
#DDERR_NOCOLORCONVHW                     = MAKE_DDHRESULT(210)
#DDERR_NOCOOPERATIVELEVELSET             = MAKE_DDHRESULT(212)
#DDERR_NOCOLORKEY                        = MAKE_DDHRESULT(215)
#DDERR_NOCOLORKEYHW                      = MAKE_DDHRESULT(220)
#DDERR_NODIRECTDRAWSUPPORT               = MAKE_DDHRESULT(222)
#DDERR_NOEXCLUSIVEMODE                   = MAKE_DDHRESULT(225)
#DDERR_NOFLIPHW                          = MAKE_DDHRESULT(230)
#DDERR_NOGDI                             = MAKE_DDHRESULT(240)
#DDERR_NOMIRRORHW                        = MAKE_DDHRESULT(250)
#DDERR_NOTFOUND                          = MAKE_DDHRESULT(255)
#DDERR_NOOVERLAYHW                       = MAKE_DDHRESULT(260)
#DDERR_OVERLAPPINGRECTS                  = MAKE_DDHRESULT(270)
#DDERR_NORASTEROPHW                      = MAKE_DDHRESULT(280)
#DDERR_NOROTATIONHW                      = MAKE_DDHRESULT(290)
#DDERR_NOSTRETCHHW                       = MAKE_DDHRESULT(310)
#DDERR_NOT4BITCOLOR                      = MAKE_DDHRESULT(316)
#DDERR_NOT4BITCOLORINDEX                 = MAKE_DDHRESULT(317)
#DDERR_NOT8BITCOLOR                      = MAKE_DDHRESULT(320)
#DDERR_NOTEXTUREHW                       = MAKE_DDHRESULT(330)
#DDERR_NOVSYNCHW                         = MAKE_DDHRESULT(335)
#DDERR_NOZBUFFERHW                       = MAKE_DDHRESULT(340)
#DDERR_NOZOVERLAYHW                      = MAKE_DDHRESULT(350)
#DDERR_OUTOFCAPS                         = MAKE_DDHRESULT(360)
#DDERR_OUTOFMEMORY                       = #E_OUTOFMEMORY
#DDERR_OUTOFVIDEOMEMORY                  = MAKE_DDHRESULT(380)
#DDERR_OVERLAYCANTCLIP                   = MAKE_DDHRESULT(382)
#DDERR_OVERLAYCOLORKEYONLYONEACTIVE      = MAKE_DDHRESULT(384)
#DDERR_PALETTEBUSY                       = MAKE_DDHRESULT(387)
#DDERR_COLORKEYNOTSET                    = MAKE_DDHRESULT(400)
#DDERR_SURFACEALREADYATTACHED            = MAKE_DDHRESULT(410)
#DDERR_SURFACEALREADYDEPENDENT           = MAKE_DDHRESULT(420)
#DDERR_SURFACEBUSY                       = MAKE_DDHRESULT(430)
#DDERR_CANTLOCKSURFACE                   = MAKE_DDHRESULT(435)
#DDERR_SURFACEISOBSCURED                 = MAKE_DDHRESULT(440)
#DDERR_SURFACELOST                       = MAKE_DDHRESULT(450)
#DDERR_SURFACENOTATTACHED                = MAKE_DDHRESULT(460)
#DDERR_TOOBIGHEIGHT                      = MAKE_DDHRESULT(470)
#DDERR_TOOBIGSIZE                        = MAKE_DDHRESULT(480)
#DDERR_TOOBIGWIDTH                       = MAKE_DDHRESULT(490)
#DDERR_UNSUPPORTED                       = #E_NOTIMPL
#DDERR_UNSUPPORTEDFORMAT                 = MAKE_DDHRESULT(510)
#DDERR_UNSUPPORTEDMASK                   = MAKE_DDHRESULT(520)
#DDERR_INVALIDSTREAM                     = MAKE_DDHRESULT(521)
#DDERR_VERTICALBLANKINPROGRESS           = MAKE_DDHRESULT(537)
#DDERR_WASSTILLDRAWING                   = MAKE_DDHRESULT(540)
#DDERR_DDSCAPSCOMPLEXREQUIRED            = MAKE_DDHRESULT(542)
#DDERR_XALIGN                            = MAKE_DDHRESULT(560)
#DDERR_INVALIDDIRECTDRAWGUID             = MAKE_DDHRESULT(561)
#DDERR_DIRECTDRAWALREADYCREATED          = MAKE_DDHRESULT(562)
#DDERR_NODIRECTDRAWHW                    = MAKE_DDHRESULT(563)
#DDERR_PRIMARYSURFACEALREADYEXISTS       = MAKE_DDHRESULT(564)
#DDERR_NOEMULATION                       = MAKE_DDHRESULT(565)
#DDERR_REGIONTOOSMALL                    = MAKE_DDHRESULT(566)
#DDERR_CLIPPERISUSINGHWND                = MAKE_DDHRESULT(567)
#DDERR_NOCLIPPERATTACHED                 = MAKE_DDHRESULT(568)
#DDERR_NOHWND                            = MAKE_DDHRESULT(569)
#DDERR_HWNDSUBCLASSED                    = MAKE_DDHRESULT(570)
#DDERR_HWNDALREADYSET                    = MAKE_DDHRESULT(571)
#DDERR_NOPALETTEATTACHED                 = MAKE_DDHRESULT(572)
#DDERR_NOPALETTEHW                       = MAKE_DDHRESULT(573)
#DDERR_BLTFASTCANTCLIP                   = MAKE_DDHRESULT(574)
#DDERR_NOBLTHW                           = MAKE_DDHRESULT(575)
#DDERR_NODDROPSHW                        = MAKE_DDHRESULT(576)
#DDERR_OVERLAYNOTVISIBLE                 = MAKE_DDHRESULT(577)
#DDERR_NOOVERLAYDEST                     = MAKE_DDHRESULT(578)
#DDERR_INVALIDPOSITION                   = MAKE_DDHRESULT(579)
#DDERR_NOTAOVERLAYSURFACE                = MAKE_DDHRESULT(580)
#DDERR_EXCLUSIVEMODEALREADYSET           = MAKE_DDHRESULT(581)
#DDERR_NOTFLIPPABLE                      = MAKE_DDHRESULT(582)
#DDERR_CANTDUPLICATE                     = MAKE_DDHRESULT(583)
#DDERR_NOTLOCKED                         = MAKE_DDHRESULT(584)
#DDERR_CANTCREATEDC                      = MAKE_DDHRESULT(585)
#DDERR_NODC                              = MAKE_DDHRESULT(586)
#DDERR_WRONGMODE                         = MAKE_DDHRESULT(587)
#DDERR_IMPLICITLYCREATED                 = MAKE_DDHRESULT(588)
#DDERR_NOTPALETTIZED                     = MAKE_DDHRESULT(589)
#DDERR_UNSUPPORTEDMODE                   = MAKE_DDHRESULT(590)
#DDERR_NOMIPMAPHW                        = MAKE_DDHRESULT(591)
#DDERR_INVALIDSURFACETYPE                = MAKE_DDHRESULT(592)
#DDERR_NOOPTIMIZEHW                      = MAKE_DDHRESULT(600)
#DDERR_NOTLOADED                         = MAKE_DDHRESULT(601)
#DDERR_NOFOCUSWINDOW                     = MAKE_DDHRESULT(602)
#DDERR_NOTONMIPMAPSUBLEVEL               = MAKE_DDHRESULT(603)
#DDERR_DCALREADYCREATED                  = MAKE_DDHRESULT(620)
#DDERR_NONONLOCALVIDMEM                  = MAKE_DDHRESULT(630)
#DDERR_CANTPAGELOCK                      = MAKE_DDHRESULT(640)
#DDERR_CANTPAGEUNLOCK                    = MAKE_DDHRESULT(660)
#DDERR_NOTPAGELOCKED                     = MAKE_DDHRESULT(680)
#DDERR_MOREDATA                          = MAKE_DDHRESULT(690)
#DDERR_EXPIRED                           = MAKE_DDHRESULT(691)
#DDERR_TESTFINISHED                      = MAKE_DDHRESULT(692)
#DDERR_NEWMODE                           = MAKE_DDHRESULT(693)
#DDERR_D3DNOTINITIALIZED                 = MAKE_DDHRESULT(694)
#DDERR_VIDEONOTACTIVE                    = MAKE_DDHRESULT(695)
#DDERR_NOMONITORINFORMATION              = MAKE_DDHRESULT(696)
#DDERR_NODRIVERSUPPORT                   = MAKE_DDHRESULT(697)
#DDERR_DEVICEDOESNTOWNSURFACE            = MAKE_DDHRESULT(699)
#DDERR_NOTINITIALIZED                    = #CO_E_NOTINITIALIZED