AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Win32/Win64 API (native code) Delphi Brauchen Sie, um die Header-Datei für Delphi WIMGAPI zu aktualisieren!
Thema durchsuchen
Ansicht
Themen-Optionen

Brauchen Sie, um die Header-Datei für Delphi WIMGAPI zu aktualisieren!

Ein Thema von SlpLow · begonnen am 18. Dez 2013
Antwort Antwort
SlpLow

Registriert seit: 4. Nov 2013
28 Beiträge
 
#1

Brauchen Sie, um die Header-Datei für Delphi WIMGAPI zu aktualisieren!

  Alt 18. Dez 2013, 14:30
I compared the headers vimgapi.h windows 8, windows 7 and put changes with comments. Need professional (new author) edition for updating of the header file from Serbia.

Delphi-Quellcode:
unit WIMGAPI;

interface

uses Windows;

const

  // WIMCreateFile:
  //
  WIM_GENERIC_READ         = GENERIC_READ;
  WIM_GENERIC_WRITE         = GENERIC_WRITE;
  WIM_GENERIC_MOUNT         = GENERIC_EXECUTE;
  WIM_CREATE_NEW         = CREATE_NEW;
  WIM_CREATE_ALWAYS         = CREATE_ALWAYS;
  WIM_OPEN_EXISTING         = OPEN_EXISTING;
  WIM_OPEN_ALWAYS         = OPEN_ALWAYS;

  WIM_COMPRESS_NONE         = 0;
  WIM_COMPRESS_XPRESS         = 1;
  WIM_COMPRESS_LZX         = 2;
  WIM_COMPRESS_LZMS         = 3; // New Windows 8

  WIM_CREATED_NEW         = 0;
  WIM_OPENED_EXISTING         = 1;

  // WIMCreateFile, WIMCaptureImage, WIMApplyImage, WIMMountImageHandle flags:
  //
  WIM_FLAG_RESERVED         = $00000001;
  WIM_FLAG_VERIFY         = $00000002;
  WIM_FLAG_INDEX         = $00000004;
  WIM_FLAG_NO_APPLY         = $00000008;
  WIM_FLAG_NO_DIRACL         = $00000010;
  WIM_FLAG_NO_FILEACL         = $00000020;
  WIM_FLAG_SHARE_WRITE         = $00000040;
  WIM_FLAG_FILEINFO         = $00000080;
  WIM_FLAG_NO_RP_FIX         = $00000100;
  WIM_FLAG_MOUNT_READONLY      = $00000200;
  WIM_FLAG_MOUNT_FAST         = $00000400; // New Windows 8
  WIM_FLAG_MOUNT_LEGACY         = $00000800; // New Windows 8

  // WIMGetMountedImageList flags
  //
  WIM_MOUNT_FLAG_MOUNTED      = $00000001;
  WIM_MOUNT_FLAG_MOUNTING      = $00000002;
  WIM_MOUNT_FLAG_REMOUNTABLE      = $00000004;
  WIM_MOUNT_FLAG_INVALID      = $00000008;
  WIM_MOUNT_FLAG_NO_WIM         = $00000010;
  WIM_MOUNT_FLAG_NO_MOUNTDIR      = $00000020;
  WIM_MOUNT_FLAG_MOUNTDIR_REPLACED   = $00000040;
  WIM_MOUNT_FLAG_READWRITE      = $00000100;

  // WIMCommitImageHandle flags
  //
  WIM_COMMIT_FLAG_APPEND      = $00000001;

  // WIMSetReferenceFile
  //
  WIM_REFERENCE_APPEND         = $00010000;
  WIM_REFERENCE_REPLACE         = $00020000;

  // WIMExportImage
  //
  WIM_EXPORT_ALLOW_DUPLICATES      = $00000001;
  WIM_EXPORT_ONLY_RESOURCES      = $00000002;
  WIM_EXPORT_ONLY_METADATA      = $00000004;
  WIM_EXPORT_VERIFY_SOURCE      = $00000008; // New Windows 8
  WIM_EXPORT_VERIFY_DESTINATION      = $00000010; // New Windows 8

  // WIMRegisterMessageCallback:
  //
  INVALID_CALLBACK_VALUE      = $FFFFFFFF;

  // WIMCopyFile
  //
  WIM_COPY_FILE_RETRY         = $01000000;

  // WIMDeleteImageMounts
  //
  WIM_DELETE_MOUNTS_ALL         = $00000001;

  // WIMRegisterLogfile - New Windows 8
  //
  WIM_LOGFILE_UTF8         = $00000001; // New Windows 8

  // WIMMessageCallback Notifications:
  //
  WM_APP            = $8000; // uses Messages
  WIM_MSG            = WM_APP + $1476;
  WIM_MSG_TEXT            = WIM_MSG + 1;
  WIM_MSG_PROGRESS         = WIM_MSG + 2;
  WIM_MSG_PROCESS         = WIM_MSG + 3;
  WIM_MSG_SCANNING         = WIM_MSG + 4;
  WIM_MSG_SETRANGE         = WIM_MSG + 5;
  WIM_MSG_SETPOS         = WIM_MSG + 6;
  WIM_MSG_STEPIT         = WIM_MSG + 7;
  WIM_MSG_COMPRESS         = WIM_MSG + 8;
  WIM_MSG_ERROR            = WIM_MSG + 9;
  WIM_MSG_ALIGNMENT         = WIM_MSG + 10;
  WIM_MSG_RETRY            = WIM_MSG + 11;
  WIM_MSG_SPLIT            = WIM_MSG + 12;
  WIM_MSG_FILEINFO         = WIM_MSG + 13;
  WIM_MSG_INFO            = WIM_MSG + 14;
  WIM_MSG_WARNING_OBJECTID      = WIM_MSG + 15;
  WIM_MSG_CHK_PROCESS         = WIM_MSG + 16;
  WIM_MSG_STALE_MOUNT_DIR      = WIM_MSG + 17;
  WIM_MSG_STALE_MOUNT_FILE      = WIM_MSG + 18;
  WIM_MSG_MOUNT_CLEANUP_PROGRESS   = WIM_MSG + 19;
  WIM_MSG_CLEANUP_SCANNING_DRIVE   = WIM_MSG + 20;
  WIM_MSG_IMAGE_ALREADY_MOUNTED      = WIM_MSG + 21;
  WIM_MSG_CLEANUP_UNMOUNTING_IMAGE   = WIM_MSG + 22;
  WIM_MSG_QUERY_ABORT         = WIM_MSG + 23;
  WIM_MSG_IO_RANGE_START_REQUEST_LOOP   = WIM_MSG + 24; // New Windows 8
  WIM_MSG_IO_RANGE_END_REQUEST_LOOP   = WIM_MSG + 25; // New Windows 8
  WIM_MSG_IO_RANGE_REQUEST      = WIM_MSG + 26; // New Windows 8
  WIM_MSG_IO_RANGE_RELEASE      = WIM_MSG + 27; // New Windows 8
  WIM_MSG_VERIFY_PROGRESS      = WIM_MSG + 28; // New Windows 8
  WIM_MSG_COPY_BUFFER         = WIM_MSG + 29; // New Windows 8
  WIM_MSG_METADATA_EXCLUDE      = WIM_MSG + 30; // New Windows 8
  WIM_MSG_GET_APPLY_ROOT      = WIM_MSG + 31; // New Windows 8
  WIM_MSG_MDPAD            = WIM_MSG + 32; // New Windows 8
  WIM_MSG_STEPNAME         = WIM_MSG + 33; // New Windows 8

  // WIMMessageCallback Return codes:
  //
  WIM_MSG_SUCCESS         = ERROR_SUCCESS;
  WIM_MSG_DONE            = $FFFFFFF0;
  WIM_MSG_SKIP_ERROR         = $FFFFFFFE;
  WIM_MSG_ABORT_IMAGE         = $FFFFFFFF;

  // WIM_INFO dwFlags values:
  //
  WIM_ATTRIBUTE_NORMAL         = $00000000;
  WIM_ATTRIBUTE_RESOURCE_ONLY      = $00000001;
  WIM_ATTRIBUTE_METADATA_ONLY      = $00000002;
  WIM_ATTRIBUTE_VERIFY_DATA      = $00000004;
  WIM_ATTRIBUTE_RP_FIX         = $00000008;
  WIM_ATTRIBUTE_SPANNED         = $00000010;
  WIM_ATTRIBUTE_READONLY      = $00000020;

  // Define enumeration for WIMGetMountedImageInfo to determine structure to use...
  //
  MountedImageInfoLevel0      = 1;
  MountedImageInfoLevel1      = 2;
  MountedImageInfoLevelInvalid      = 3;


type
  PLARGE_INTEGER = ^LARGE_INTEGER;

  // The WIM_INFO structure used by WIMGetAttributes:
  //
  _WIM_INFO = packed record
    WimPath: array [0 .. MAX_PATH - 1] of WideChar;
    Guid: TGUID;
    ImageCount: DWORD;
    CompressionType: DWORD;
    PartNumber: WORD;
    TotalParts: WORD;
    BootIndex: DWORD;
    WimAttributes: DWORD;
    WimFlagsAndAttr: DWORD;
  end;

  WIM_INFO = _WIM_INFO;
  LPWIM_INFO = ^WIM_INFO;
  PWIM_INFO = ^WIM_INFO;

  // The WIM_MOUNT_LIST structure used for getting the list of mounted images.
  //
  _WIM_MOUNT_LIST = packed record
    WimPath: array [0 .. MAX_PATH - 1] of WideChar;
    MountPath: array [0 .. MAX_PATH - 1] of WideChar;
    ImageIndex: DWORD;
    MountedForRW: BOOL;
  end;

  WIM_MOUNT_LIST = _WIM_MOUNT_LIST;
  LPWIM_MOUNT_LIST = ^WIM_MOUNT_LIST;
  PWIM_MOUNT_LIST = ^WIM_MOUNT_LIST;
  WIM_MOUNT_INFO_LEVEL0 = _WIM_MOUNT_LIST;
  PWIM_MOUNT_INFO_LEVEL0 = ^WIM_MOUNT_LIST;
  LPWIM_MOUNT_INFO_LEVEL0 = ^WIM_MOUNT_LIST;

  // Define new WIM_MOUNT_INFO_LEVEL1 structure with additional data...
  //
  _WIM_MOUNT_INFO_LEVEL1 = packed record
    WimPath: array [0 .. MAX_PATH - 1] of WideChar;
    MountPath: array [0 .. MAX_PATH - 1] of WideChar;
    ImageIndex: DWORD;
    MountFlags: DWORD;
  end;

  WIM_MOUNT_INFO_LEVEL1 = _WIM_MOUNT_INFO_LEVEL1;
  PWIM_MOUNT_INFO_LEVEL1 = ^WIM_MOUNT_INFO_LEVEL1;
  LPWIM_MOUNT_INFO_LEVEL1 = ^WIM_MOUNT_INFO_LEVEL1;
  _MOUNTED_IMAGE_INFO_LEVELS = DWORD;
  MOUNTED_IMAGE_INFO_LEVELS = _MOUNTED_IMAGE_INFO_LEVELS;

  //===========================================================================
  // New structure in Windows 8 WIMGAPI wimgapi.h
  //===========================================================================
  //
  // An abstract type implemented by the caller when using File I/O callbacks.
  //
  typedef VOID * PFILEIOCALLBACK_SESSION; // this is probably = PFILEIOCALLBACK_SESSION = Pointer; str №448 (my note)
  //
  // The WIM_IO_RANGE_CALLBACK structure is used in conjunction with the
  // FileIOCallbackReadFile callback and the WIM_MSG_IO_RANGE_REQUEST and
  // WIM_MSG_IO_RANGE_RELEASE message callbacks. A pointer to a
  // WIM_IO_RANGE_REQUEST is passed in WPARAM to the callback for both messages.
  //
  typedef struct _WIM_IO_RANGE_CALLBACK
  {
    //
    // The callback session that corresponds to the file that is being queried.
    //
    PFILEIOCALLBACK_SESSION pSession;

    // Filled in by WIMGAPI for both messages:
    LARGE_INTEGER Offset, Size;

    // Filled in by the callback for WIM_MSG_IO_RANGE_REQUEST (set to TRUE to
    // indicate data in the specified range is available, and FALSE to indicate
    // it is not yet available):
    BOOL Available;
  }
 WIM_IO_RANGE_CALLBACK, *PWIM_IO_RANGE_CALLBACK;

  //
  // Abstract (opaque) type for WIM files used with
  // WIMEnumImageFiles API
  //
  typedef VOID * PWIM_ENUM_FILE;

  #if defined(__cplusplus)
  typedef struct _WIM_FILE_FIND_DATA : public _WIN32_FIND_DATAW
  {
  #else
  typedef struct _WIM_FILE_FIND_DATA
  {
    WIN32_FIND_DATAW;
  #endif

    BYTE bHash[20];
    PSECURITY_DESCRIPTOR pSecurityDescriptor;
    PWSTR *ppszAlternateStreamNames;
    PBYTE pbReparseData;
    DWORD cbReparseData;
}
 WIM_FIND_DATA, *PWIM_FIND_DATA;
  //===========================================================================


  //
  // Exported Function Prototypes:
  //
type
  TWIMCreateFile = function(pzWimPath: PWideChar;
    dwDesiredAccess, dwCreationDisposition, dwFlagsAndAttributes,
    dwCompressionType: DWORD; pdwCreationResult: PDWORD): THandle; stdcall;

  TWIMCloseHandle = function(hObject: THandle): BOOL; stdcall;

  TWIMSetTemporaryPath = function(hWim: THandle; pszPath: PWideChar)
    : BOOL; stdcall;

  TWIMSetReferenceFile = function(hWim: THandle; pszPath: PWideChar;
    dwFlags: DWORD): BOOL; stdcall;

  TWIMSplitFile = function(hWim: THandle; pszPartPath: PWideChar;
    pliPartSize: PLARGE_INTEGER; dwFlags: DWORD): BOOL; stdcall;

  TWIMExportImage = function(hImage, hWim: THandle; dwFlags: DWORD)
    : BOOL; stdcall;

  TWIMDeleteImage = function(hWim: THandle; dwImageIndex: DWORD): BOOL; stdcall;

  TWIMGetImageCount = function(hWim: THandle): DWORD; stdcall;

  TWIMGetAttributes = function(hWim: THandle; pWimInfo: PWIM_INFO; // in Windows 7 cbWimInfo = out_bcount(cbWimInfo) PWIM_INFO pWimInfo
    cbWimInfo: DWORD): BOOL; stdcall; // in Windows 8 cbWimInfo = out_writes_bytes_(cbWimInfo) PWIM_INFO pWimInfo

  TWIMSetBootImage = function(hWim: THandle; dwImageIndex: DWORD)
    : BOOL; stdcall;

  TWIMCaptureImage = function(hWim: THandle; pszPath: PWideChar;
    dwCaptureFlags: DWORD): THandle; stdcall;

  TWIMLoadImage = function(hWim: THandle; dwImageIndex: DWORD)
    : THandle; stdcall;

  TWIMApplyImage = function(hImage: THandle; pszPath: PWideChar;
    dwApplyFlags: DWORD): BOOL; stdcall;

  TWIMGetImageInformation = function(hImage: THandle; ppvImageInfo: Pointer; // in Windows 7 ppvImageInfo = out PVOID *ppvImageInfo
    pcbImageInfo: PDWORD): BOOL; stdcall; // in Windows 8 ppvImageInfo = typefix(PWSTR*) __deref_out_ecount_z(*pcbImageInfo/2) PVOID *ppvImageInfo

  TWIMSetImageInformation = function(hImage: THandle; pvImageInfo: Pointer; // in Windows 7 pvImageInfo = in_bcount(cbImageInfo) PVOID pvImageInfo
    cbImageInfo: DWORD): BOOL; stdcall; // in Windows 8 pvImageInfo = in_reads_bytes_(cbImageInfo) PVOID pvImageInfo

  TWIMGetMessageCallbackCount = function(hWim: THandle): DWORD; stdcall;

  TWIMRegisterMessageCallback = function(hWim: THandle;
    fpMessageProc, pvUserData: Pointer): DWORD; stdcall;

  TWIMUnregisterMessageCallback = function(hWim: THandle;
    fpMessageProc: Pointer): BOOL; stdcall;

  TWIMMessageCallback = function(dwMessageId: DWORD; wParam: wParam;
    lParam: lParam; pvUserData: Pointer): DWORD; stdcall;

  TWIMCopyFile = function(pszExistingFileName, pszNewFileName: PWideChar;
    pProgressRoutine, pvData: Pointer; pbCancel: PBOOL; dwCopyFlags: DWORD)
    : BOOL; stdcall;

  TWIMMountImage = function(pszMountPath, pszWimFileName: PWideChar;
    dwImageIndex: DWORD; pszTempPath: PWideChar): BOOL; stdcall;

  // New in Windows 7 WIMGAPI
  TWIMMountImageHandle = function(hImage: THandle; pszMountPath: PWideChar;
    dwMountFlags: DWORD): BOOL; stdcall;

  // New in Windows 7 WIMGAPI
  TWIMRemountImage = function(pszMountPath: PWideChar; dwMountFlags: DWORD)
    : BOOL; stdcall;

  // New in Windows 7 WIMGAPI
  TWIMCommitImageHandle = function(hImage: THandle; dwCommitFlags: DWORD;
    phNewImageHandle: PHandle): BOOL; stdcall;

  TWIMUnmountImage = function(pszMountPath, pszWimFileName: PWideChar;
    dwImageIndex: DWORD; bCommitChanges: BOOL): BOOL; stdcall;

  // New in Windows 7 WIMGAPI
  TWIMUnmountImageHandle = function(hImage: THandle; dwUnmountFlags: DWORD)
    : BOOL; stdcall;

  // OBSOLETE since Windows 7 - Replaced by WIMGetMountedImageInfo
  TWIMGetMountedImages = function(pMountList: PWIM_MOUNT_LIST; // in Windows 7 pMountList = out_bcount_opt(*pcbMountList) PWIM_MOUNT_LIST pMountList
    pcbMountListLength: PDWORD): BOOL; stdcall; // in Windows 8 pMountList = out_writes_bytes_opt_(*pcbMountList) PWIM_MOUNT_LIST pMountList

  // New in Windows 7 WIMGAPI
  TWIMGetMountedImageInfo = function(fInfoLevelId: MOUNTED_IMAGE_INFO_LEVELS; // in Windows 7 pMountInfo = out_bcount_opt(*pcbMountInfo) PVOID pMountInfo
    pdwImageCount: PDWORD; pMountInfo: Pointer; cbMountInfoLength: DWORD; // in Windows 8 pMountInfo = out_writes_bytes_opt_(cbMountInfoLength) PVOID pMountInfo
    pcbReturnLength: PDWORD): BOOL; stdcall;

  // New in Windows 7 WIMGAPI
  TWIMGetMountedImageInfoFromHandle = function(hImage: THandle; // in Windows 7 pMountInfo = out_bcount_opt(*pcbMountInfo) PVOID pMountInfo
    fInfoLevelId: MOUNTED_IMAGE_INFO_LEVELS; pMountInfo: Pointer; // in Windows 8 pMountInfo = out_writes_bytes_opt_(cbMountInfoLength) PVOID pMountInfo
    cbMountInfoLength: DWORD; pcbReturnLength: PDWORD): BOOL; stdcall;

  // New in Windows 7 WIMGAPI
  TWIMGetMountedImageHandle = function(pszMountPath: PWideChar; dwFlags: DWORD;
    phWimHandle, phImageHandle: PHandle): BOOL; stdcall;

  // New in Windows 7 WIMGAPI
  TWIMDeleteImageMounts = function(dwDeleteFlags: DWORD): BOOL; stdcall;

  // Neu in Windows 7 WIMGAPI
  TWIMRegisterLogFile = function(pszLogFile: PWideChar; dwFlags: DWORD)
    : BOOL; stdcall;

  // New in Windows 7 WIMGAPI
  TWIMUnregisterLogFile = function(pszLogFile: PWideChar): BOOL; stdcall;

  // New in Windows 7 WIMGAPI
  TWIMExtractImagePath = function(hImage: THandle;
    pszImagePath, pszDestinationPath: PWideChar; dwExtractFlags: DWORD)
    : BOOL; stdcall;

  TWIMInitFileIOCallbacks = function(pCallbacks: Pointer): BOOL; stdcall;

  TWIMSetFileIOCallbackTemporaryPath = function(pszPath: PWideChar)
    : BOOL; stdcall;

  //===========================================================================
  // New Function in Windows 8 WIMGAPI wimgapi.h
  //===========================================================================

  //---------------------------------------------------------------------------
  HANDLE
  WINAPI
  WIMFindFirstImageFile(
      _In_ HANDLE hImage,
      _In_ PCWSTR pwszFilePath,
      _Out_ PWIM_FIND_DATA pFindFileData
      );

  //---------------------------------------------------------------------------
  BOOL
  WINAPI
  WIMFindNextImageFile(
      _In_ HANDLE hFindFile,
      _Out_ PWIM_FIND_DATA pFindFileData
      );
  //---------------------------------------------------------------------------

  //
  // API for fast enumeration of image files
  //
  typedef
  HRESULT
  (CALLBACK * WIMEnumImageFilesCallback)(
      _In_ PWIM_FIND_DATA pFindFileData,
      _In_ PWIM_ENUM_FILE pEnumFile,
      _In_opt_ PVOID pEnumContext
      );

  //---------------------------------------------------------------------------
  BOOL
  WINAPI
  WIMEnumImageFiles(
      _In_ HANDLE hImage,
      _In_opt_ PWIM_ENUM_FILE pEnumFile,
      _In_ WIMEnumImageFilesCallback fpEnumImageCallback,
      _In_opt_ PVOID pEnumContext
      );

  //---------------------------------------------------------------------------
  HANDLE
  WINAPI
  WIMCreateImageFile(
      _In_ HANDLE hImage,
      _In_ PCWSTR pwszFilePath,
      _In_ DWORD dwDesiredAccess,
      _In_ DWORD dwCreationDisposition,
      _In_ DWORD dwFlagsAndAttributes
      );

  //---------------------------------------------------------------------------
  BOOL
  WINAPI
  WIMReadImageFile(
      _In_ HANDLE hImgFile,
      _Out_writes_bytes_to_(dwBytesToRead, *pdwBytesRead) PBYTE pbBuffer,
      _In_ DWORD dwBytesToRead,
      _Out_opt_ PDWORD pdwBytesRead,
      _Inout_ LPOVERLAPPED lpOverlapped
      );
  //===========================================================================



  //
  // File I/O callback prototypes
  //
type
  PFILEIOCALLBACK_SESSION = Pointer;

type
  FileIOCallbackOpenFile = function(pszFileName: PWideChar)
    : PFILEIOCALLBACK_SESSION;

  FileIOCallbackCloseFile = function(hFile: PFILEIOCALLBACK_SESSION): BOOL;

  FileIOCallbackReadFile = function(hFile: PFILEIOCALLBACK_SESSION; // in Windows 7 pOverlapped = in LPOVERLAPPED pOverlapped
    pBuffer: Pointer; nNumberOfBytesToRead: DWORD; pNumberOfBytesRead: LPDWORD; // in Windows 8 pOverlapped = inout_LPOVERLAPPED pOverlapped
    pOverlapped: pOverlapped): BOOL;

  FileIOCallbackSetFilePointer = function(hFile: PFILEIOCALLBACK_SESSION; // in Windows 7 pNewFilePointer = in PLARGE_INTEGER pNewFilePointer
    liDistanceToMove: LARGE_INTEGER; pNewFilePointer: PLARGE_INTEGER; // in Windows 8 pNewFilePointer = out_PLARGE_INTEGER pNewFilePointer
    dwMoveMethod: DWORD): BOOL;

  FileIOCallbackGetFileSize = function(hFile: THandle;
    pFileSize: PLARGE_INTEGER): BOOL;

type
  _SFileIOCallbackInfo = packed record
    pfnOpenFile: FileIOCallbackOpenFile;
    pfnCloseFile: FileIOCallbackCloseFile;
    pfnReadFile: FileIOCallbackReadFile;
    pfnSetFilePointer: FileIOCallbackSetFilePointer;
    pfnGetFileSize: FileIOCallbackGetFileSize;
  end;

  SFileIOCallbackInfo = _SFileIOCallbackInfo;

const
  WIMGAPI_LIBNAME = 'wimgapi.dll';

var
  WIMCreateFile: TWIMCreateFile;
  WIMCloseHandle: TWIMCloseHandle;
  WIMSetTemporaryPath: TWIMSetTemporaryPath;
  WIMSetReferenceFile: TWIMSetReferenceFile;
  WIMSplitFile: TWIMSplitFile;
  WIMExportImage: TWIMExportImage;
  WIMDeleteImage: TWIMDeleteImage;
  WIMGetImageCount: TWIMGetImageCount;
  WIMGetAttributes: TWIMGetAttributes;
  WIMSetBootImage: TWIMSetBootImage;
  WIMCaptureImage: TWIMCaptureImage;
  WIMLoadImage: TWIMLoadImage;
  WIMApplyImage: TWIMApplyImage;
  WIMGetImageInformation: TWIMGetImageInformation;
  WIMSetImageInformation: TWIMSetImageInformation;
  WIMGetMessageCallbackCount: TWIMGetMessageCallbackCount;
  WIMRegisterMessageCallback: TWIMRegisterMessageCallback;
  WIMUnregisterMessageCallback: TWIMUnregisterMessageCallback;
  WIMMessageCallback: TWIMMessageCallback;
  WIMCopyFile: TWIMCopyFile;
  WIMMountImage: TWIMMountImage;
  WIMMountImageHandle: TWIMMountImageHandle;
  WIMRemountImage: TWIMRemountImage;
  WIMCommitImageHandle: TWIMCommitImageHandle;
  WIMUnmountImage: TWIMUnmountImage;
  WIMUnmountImageHandle: TWIMUnmountImageHandle;
  WIMGetMountedImages: TWIMGetMountedImages;
  WIMGetMountedImageInfo: TWIMGetMountedImageInfo;
  WIMGetMountedImageInfoFromHandle: TWIMGetMountedImageInfoFromHandle;
  WIMGetMountedImageHandle: TWIMGetMountedImageHandle;
  WIMDeleteImageMounts: TWIMDeleteImageMounts;
  WIMRegisterLogFile: TWIMRegisterLogFile;
  WIMUnregisterLogFile: TWIMUnregisterLogFile;
  WIMExtractImagePath: TWIMExtractImagePath;
  WIMInitFileIOCallbacks: TWIMInitFileIOCallbacks;
  WIMSetFileIOCallbackTemporaryPath: TWIMSetFileIOCallbackTemporaryPath;

procedure InitWIMGAPI(const APath: String = WIMGAPI_LIBNAME);
function WIMGAPILoaded: Boolean;

implementation

var
  hWIMGAPI: THandle;

procedure InitWIMGAPI(const APath: String = WIMGAPI_LIBNAME);
begin
  if (hWIMGAPI = 0) then
  begin
    hWIMGAPI := LoadLibrary(PChar(APath));

    if (hWIMGAPI <> 0) then
    begin
      @WIMCreateFile := GetProcAddress(hWIMGAPI, 'WIMCreateFile');
      @WIMCloseHandle := GetProcAddress(hWIMGAPI, 'WIMCloseHandle');
      @WIMSetTemporaryPath := GetProcAddress(hWIMGAPI, 'WIMSetTemporaryPath');
      @WIMSetReferenceFile := GetProcAddress(hWIMGAPI, 'WIMSetReferenceFile');
      @WIMSplitFile := GetProcAddress(hWIMGAPI, 'WIMSplitFile');
      @WIMExportImage := GetProcAddress(hWIMGAPI, 'WIMExportImage');
      @WIMDeleteImage := GetProcAddress(hWIMGAPI, 'WIMDeleteImage');
      @WIMGetImageCount := GetProcAddress(hWIMGAPI, 'WIMGetImageCount');
      @WIMGetAttributes := GetProcAddress(hWIMGAPI, 'WIMGetAttributes');
      @WIMSetBootImage := GetProcAddress(hWIMGAPI, 'WIMSetBootImage');
      @WIMCaptureImage := GetProcAddress(hWIMGAPI, 'WIMCaptureImage');
      @WIMLoadImage := GetProcAddress(hWIMGAPI, 'WIMLoadImage');
      @WIMApplyImage := GetProcAddress(hWIMGAPI, 'WIMApplyImage');
      @WIMGetImageInformation := GetProcAddress(hWIMGAPI,
        'WIMGetImageInformation');
      @WIMSetImageInformation := GetProcAddress(hWIMGAPI,
        'WIMSetImageInformation');
      @WIMGetMessageCallbackCount := GetProcAddress(hWIMGAPI,
        'WIMGetMessageCallbackCount');
      @WIMRegisterMessageCallback := GetProcAddress(hWIMGAPI,
        'WIMRegisterMessageCallback');
      @WIMUnregisterMessageCallback := GetProcAddress(hWIMGAPI,
        'WIMUnregisterMessageCallback');
      @WIMMessageCallback := GetProcAddress(hWIMGAPI, 'WIMMessageCallback');
      @WIMCopyFile := GetProcAddress(hWIMGAPI, 'WIMCopyFile');
      @WIMMountImage := GetProcAddress(hWIMGAPI, 'WIMMountImage');
      @WIMMountImageHandle := GetProcAddress(hWIMGAPI, 'WIMMountImageHandle');
      @WIMRemountImage := GetProcAddress(hWIMGAPI, 'WIMRemountImage');
      @WIMCommitImageHandle := GetProcAddress(hWIMGAPI, 'WIMCommitImageHandle');
      @WIMUnmountImage := GetProcAddress(hWIMGAPI, 'WIMUnmountImage');
      @WIMUnmountImageHandle := GetProcAddress(hWIMGAPI,
        'WIMUnmountImageHandle');
      @WIMGetMountedImages := GetProcAddress(hWIMGAPI, 'WIMGetMountedImages');
      @WIMGetMountedImageInfo := GetProcAddress(hWIMGAPI,
        'WIMGetMountedImageInfo');
      @WIMGetMountedImageInfoFromHandle :=
        GetProcAddress(hWIMGAPI, 'WIMGetMountedImageInfoFromHandle');
      @WIMGetMountedImageHandle := GetProcAddress(hWIMGAPI,
        'WIMGetMountedImageHandle');
      @WIMDeleteImageMounts := GetProcAddress(hWIMGAPI, 'WIMDeleteImageMounts');
      @WIMRegisterLogFile := GetProcAddress(hWIMGAPI, 'WIMRegisterLogFile');
      @WIMUnregisterLogFile := GetProcAddress(hWIMGAPI, 'WIMUnregisterLogFile');
      @WIMExtractImagePath := GetProcAddress(hWIMGAPI, 'WIMExtractImagePath');
      @WIMInitFileIOCallbacks := GetProcAddress(hWIMGAPI,
        'WIMInitFileIOCallbacks');
      @WIMSetFileIOCallbackTemporaryPath :=
        GetProcAddress(hWIMGAPI, 'WIMSetFileIOCallbackTemporaryPath');
    end;
  end;
end;

procedure CloseWIMGAPI;
begin
  if (hWIMGAPI <> 0) then
  begin
    FreeLibrary(hWIMGAPI);
    hWIMGAPI := 0;
  end;
end;

function WIMGAPILoaded: Boolean;
begin
  Result := (hWIMGAPI <> 0);
end;

initialization

hWIMGAPI := 0;

WIMCreateFile := nil;
WIMCloseHandle := nil;
WIMSetTemporaryPath := nil;
WIMSetReferenceFile := nil;
WIMSplitFile := nil;
WIMExportImage := nil;
WIMDeleteImage := nil;
WIMGetImageCount := nil;
WIMGetAttributes := nil;
WIMSetBootImage := nil;
WIMCaptureImage := nil;
WIMLoadImage := nil;
WIMApplyImage := nil;
WIMGetImageInformation := nil;
WIMSetImageInformation := nil;
WIMGetMessageCallbackCount := nil;
WIMRegisterMessageCallback := nil;
WIMUnregisterMessageCallback := nil;
WIMMessageCallback := nil;
WIMCopyFile := nil;
WIMMountImage := nil;
WIMMountImageHandle := nil;
WIMRemountImage := nil;
WIMCommitImageHandle := nil;
WIMUnmountImage := nil;
WIMUnmountImageHandle := nil;
WIMGetMountedImages := nil;
WIMGetMountedImageInfo := nil;
WIMGetMountedImageInfoFromHandle := nil;
WIMGetMountedImageHandle := nil;
WIMDeleteImageMounts := nil;
WIMRegisterLogFile := nil;
WIMUnregisterLogFile := nil;
WIMExtractImagePath := nil;
WIMInitFileIOCallbacks := nil;
WIMSetFileIOCallbackTemporaryPath := nil;

finalization

CloseWIMGAPI;

ReportMemoryLeaksOnShutdown := True;

end.
Angehängte Dateien
Dateityp: 7z File.7z (7,1 KB, 18x aufgerufen)

Geändert von SlpLow (19. Dez 2013 um 00:17 Uhr)
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 07:46 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz