----------------------------------------
-- File : dsetup.ads --
-- Translator:Dongfeng.Gu,2018/10/29 --
-- Mail: 515639@qq.com --
-- Progress:100% --
----------------------------------------
with Ada.Unchecked_Conversion;
with Interfaces.C;
with win32; use win32;
with win32.Winreg; use win32.Winreg;
with win32.winnt; use win32.winnt;
with win32.windef; use win32.windef;
with win32.rpcdce; use win32.rpcdce;
with win32.Objbase; use win32.Objbase;
package dsetup is
use type Interfaces.C.unsigned_long;
function Shift_Left(A:dword;B:Natural) return dword with import,convention=>Intrinsic;
function Lsh(A:dword;B:Natural) return dword is (Shift_Left(A,B));
function Shift_Right(A:dword;B:Natural) return dword with import,convention=>Intrinsic;
function Rsh(A:dword;B:Natural) return dword is (Shift_Right(A,B));
function AsDWORD is new Ada.Unchecked_Conversion(Character,DWORD);pragma Warnings(off,AsDWORD);
function mmioFOURCC(ch0,ch1,ch2,ch3:Character) return dword is (AsDWORD(ch0) or Lsh(AsDWORD(ch1),8) or Lsh(AsDWORD(ch2),16) or Lsh(AsDWORD(ch3),24));
FOURCC_VERS : constant dword:= mmioFOURCC('v','e','r','s');
type LPGUID is access all GUID;
DSETUPERR_SUCCESS_RESTART : constant := 1;
DSETUPERR_SUCCESS : constant := 0;
DSETUPERR_BADWINDOWSVERSION : constant := -1;
DSETUPERR_SOURCEFILENOTFOUND : constant := -2;
DSETUPERR_NOCOPY : constant := -5;
DSETUPERR_OUTOFDISKSPACE : constant := -6;
DSETUPERR_CANTFINDINF : constant := -7;
DSETUPERR_CANTFINDDIR : constant := -8;
DSETUPERR_INTERNAL : constant := -9;
DSETUPERR_UNKNOWNOS : constant := -11;
DSETUPERR_NEWERVERSION : constant := -14;
DSETUPERR_NOTADMIN : constant := -15;
DSETUPERR_UNSUPPORTEDPROCESSOR : constant := -16;
DSETUPERR_MISSINGCAB_MANAGEDDX : constant := -17;
DSETUPERR_NODOTNETFRAMEWORKINSTALLED : constant := -18;
DSETUPERR_CABDOWNLOADFAIL : constant := -19;
DSETUPERR_DXCOMPONENTFILEINUSE : constant := -20;
DSETUPERR_UNTRUSTEDCABINETFILE : constant := -21;
DSETUP_DDRAWDRV : constant := 16#00000008#; -- /* install DirectDraw Drivers */;
DSETUP_DSOUNDDRV : constant := 16#00000010#; -- /* install DirectSound Drivers */;
DSETUP_DXCORE : constant := 16#00010000#; -- /* install DirectX runtime */;
DSETUPtagDIRECTX : constant dword:= (DSETUP_DXCORE or DSETUP_DDRAWDRV or DSETUP_DSOUNDDRV);
DSETUP_MANAGEDDX : constant := 16#00004000#; -- /* OBSOLETE. install managed DirectX */;
DSETUP_TESTINSTALL : constant := 16#00020000#; -- /* just test install, don't do anything */;
DSETUP_DDRAW : constant := 16#00000001#; -- /* OBSOLETE. install DirectDraw */;
DSETUP_DSOUND : constant := 16#00000002#; -- /* OBSOLETE. install DirectSound */;
DSETUP_DPLAY : constant := 16#00000004#; -- /* OBSOLETE. install DirectPlay */;
DSETUP_DPLAYSP : constant := 16#00000020#; -- /* OBSOLETE. install DirectPlay Providers */;
DSETUP_DVIDEO : constant := 16#00000040#; -- /* OBSOLETE. install DirectVideo */;
DSETUP_D3D : constant := 16#00000200#; -- /* OBSOLETE. install Direct3D */;
DSETUPtagDINPUT : constant := 16#00000800#; -- /* OBSOLETE. install DirectInput */;
DSETUPtagDIRECTXSETUP : constant := 16#00001000#; -- /* OBSOLETE. install DirectXSetup DLL's */;
DSETUP_NOUI : constant := 16#00002000#; -- /* OBSOLETE. install DirectX with NO UI */;
DSETUP_PROMPTFORDRIVERS : constant := 16#10000000#; -- /* OBSOLETE. prompt when replacing display/audio drivers */;
DSETUP_RESTOREDRIVERS : constant := 16#20000000#; -- /* OBSOLETE. restore display/audio drivers */;
DSETUP_CB_MSG_NOMESSAGE : constant := 0;
DSETUP_CB_MSG_INTERNAL_ERROR : constant := 10;
DSETUP_CB_MSG_BEGIN_INSTALL : constant := 13;
DSETUP_CB_MSG_BEGIN_INSTALL_RUNTIME : constant := 14;
DSETUP_CB_MSG_PROGRESS : constant := 18;
DSETUP_CB_MSG_WARNINGtagDISABLED_COMPONENT : constant := 19;
type tagDSETUP_CB_PROGRESS is record
dwPhase: DWORD;
dwInPhaseMaximum: DWORD;
dwInPhaseProgress: DWORD;
dwOverallMaximum: DWORD;
dwOverallProgress: DWORD;
end record;
subtype DSETUP_CB_PROGRESS is tagDSETUP_CB_PROGRESS;
type tagDSETUP_CB_PROGRESS_PHASE is (DSETUP_INITIALIZING,
DSETUP_EXTRACTING,
DSETUP_COPYING,
DSETUP_FINALIZING);
for tagDSETUP_CB_PROGRESS_PHASE use (DSETUP_INITIALIZING=>+ 1,
DSETUP_EXTRACTING=>+ 1+ 1,
DSETUP_COPYING=>+ 1+ 1+ 1,
DSETUP_FINALIZING=>+ 1+ 1+ 1+1);
subtype DSETUP_CB_PROGRESS_PHASE is tagDSETUP_CB_PROGRESS_PHASE;
type tagDIRECTXREGISTERAPPA is record
dwSize: DWORD;
dwFlags: DWORD;
lpszApplicationName: LPSTR;
lpGUID: dsetup.LPGUID;
lpszFilename: LPSTR;
lpszCommandLine: LPSTR;
lpszPath: LPSTR;
lpszCurrentDirectory: LPSTR;
end record;
subtype DIRECTXREGISTERAPPA is tagDIRECTXREGISTERAPPA;
type PDIRECTXREGISTERAPPA is access all tagDIRECTXREGISTERAPPA;
type LPDIRECTXREGISTERAPPA is access all tagDIRECTXREGISTERAPPA;
type tagDIRECTXREGISTERAPP2A is record
dwSize: DWORD;
dwFlags: DWORD;
lpszApplicationName: LPSTR;
lpGUID: dsetup.LPGUID;
lpszFilename: LPSTR;
lpszCommandLine: LPSTR;
lpszPath: LPSTR;
lpszCurrentDirectory: LPSTR;
lpszLauncherName: LPSTR;
end record;
subtype DIRECTXREGISTERAPP2A is tagDIRECTXREGISTERAPP2A;
type PDIRECTXREGISTERAPP2A is access all tagDIRECTXREGISTERAPP2A;
type LPDIRECTXREGISTERAPP2A is access all tagDIRECTXREGISTERAPP2A;
type tagDIRECTXREGISTERAPPW is record
dwSize: DWORD;
dwFlags: DWORD;
lpszApplicationName: LPWSTR;
lpGUID: dsetup.LPGUID;
lpszFilename: LPWSTR;
lpszCommandLine: LPWSTR;
lpszPath: LPWSTR;
lpszCurrentDirectory: LPWSTR;
end record;
subtype DIRECTXREGISTERAPPW is tagDIRECTXREGISTERAPPW;
type PDIRECTXREGISTERAPPW is access all tagDIRECTXREGISTERAPPW;
type LPDIRECTXREGISTERAPPW is access all tagDIRECTXREGISTERAPPW;
type tagDIRECTXREGISTERAPP2W is record
dwSize: DWORD;
dwFlags: DWORD;
lpszApplicationName: LPWSTR;
lpGUID: dsetup.LPGUID;
lpszFilename: LPWSTR;
lpszCommandLine: LPWSTR;
lpszPath: LPWSTR;
lpszCurrentDirectory: LPWSTR;
lpszLauncherName: LPWSTR;
end record;
subtype DIRECTXREGISTERAPP2W is tagDIRECTXREGISTERAPP2W;
type PDIRECTXREGISTERAPP2W is access all tagDIRECTXREGISTERAPP2W;
type LPDIRECTXREGISTERAPP2W is access all tagDIRECTXREGISTERAPP2W;
subtype DIRECTXREGISTERAPP is DIRECTXREGISTERAPPA;
subtype PDIRECTXREGISTERAPP is PDIRECTXREGISTERAPPA;
subtype LPDIRECTXREGISTERAPP is LPDIRECTXREGISTERAPPA;
subtype DIRECTXREGISTERAPP2 is DIRECTXREGISTERAPP2A;
subtype PDIRECTXREGISTERAPP2 is PDIRECTXREGISTERAPP2A;
subtype LPDIRECTXREGISTERAPP2 is LPDIRECTXREGISTERAPP2A;
function DirectXSetupA(hWnd:Windef.HWND;lpszRootPath:LPSTR;dwFlags:DWORD) return INT with Import,Convention=>stdcall,external_name=>"DirectXSetupA";
function DirectXSetup(hWnd:Windef.HWND;lpszRootPath:LPSTR;dwFlags:DWORD) return INT with Import,Convention=>stdcall,external_name=>"DirectXSetupA";
function DirectXSetupW(hWnd:Windef.HWND;lpszRootPath:LPWSTR;dwFlags:DWORD) return INT with Import,Convention=>stdcall,external_name=>"DirectXSetupW";
function DirectXRegisterApplicationA(hWnd:Windef.HWND;lpDXRegApp:LPVOID) return INT with Import,Convention=>stdcall,external_name=>"DirectXRegisterApplicationA";
function DirectXRegisterApplication(hWnd:Windef.HWND;lpDXRegApp:LPVOID) return INT with Import,Convention=>stdcall,external_name=>"DirectXRegisterApplicationA";
function DirectXRegisterApplicationW(hWnd:Windef.HWND;lpDXRegApp:LPVOID) return INT with Import,Convention=>stdcall,external_name=>"DirectXRegisterApplicationW";
function DirectXUnRegisterApplication(hWnd:Windef.HWND;lpGUID:dsetup.LPGUID) return INT with Import,Convention=>stdcall,external_name=>"DirectXUnRegisterApplication";
type LPDIRECTXSETUPW is access function(Arg_1:HWND;Arg_2:LPWSTR;Arg_3:DWORD) return INT with Convention=>Stdcall;
type LPDIRECTXREGISTERAPPLICATIONW is access function(Arg_1:HWND;Arg_2:LPVOID) return INT with Convention=>Stdcall;
type LPDIRECTXSETUP is access function(Arg_1:HWND;Arg_2:LPSTR;Arg_3:DWORD) return INT with Convention=>Stdcall;
type LPDIRECTXREGISTERAPPLICATION is access function(Arg_1:HWND;Arg_2:LPVOID) return INT with Convention=>Stdcall;
type DSETUP_CALLBACK is access function(Reason:DWORD;MsgType:DWORD;szMessage:LPSTR;szName:LPSTR;pInfo:LPvoid) return DWORD with Convention=>Stdcall;
function DirectXSetupSetCallback(Callback:DSETUP_CALLBACK) return INT with Import,Convention=>stdcall,external_name=>"DirectXSetupSetCallback";
function DirectXSetupGetVersion(lpdwVersion:LPDWORD;lpdwMinorVersion:LPDWORD) return INT with Import,Convention=>stdcall,external_name=>"DirectXSetupGetVersion";
function DirectXSetupShowEULA(hWndParent:HWND) return INT with Import,Convention=>stdcall,external_name=>"DirectXSetupShowEULA";
function DirectXSetupGetEULAA(lpszEULA:LPSTR;cchEULA:UINT;LangID:WORD) return UINT with Import,Convention=>stdcall,external_name=>"DirectXSetupGetEULAA";
function DirectXSetupGetEULA(lpszEULA:LPSTR;cchEULA:UINT;LangID:WORD) return UINT with Import,Convention=>stdcall,external_name=>"DirectXSetupGetEULAA";
function DirectXSetupGetEULAW(lpszEULA:LPWSTR;cchEULA:UINT;LangID:WORD) return UINT with Import,Convention=>stdcall,external_name=>"DirectXSetupGetEULAW";
type LPDIRECTXSETUPGETEULAW is access function(Arg_1:LPWSTR;Arg_2:UINT;Arg_3:WORD) return UINT with Convention=>Stdcall;
type LPDIRECTXSETUPGETEULA is access function(Arg_1:LPSTR;Arg_2:UINT;Arg_3:WORD) return UINT with Convention=>Stdcall;
end dsetup;