use Win32::API;
use Data::Dumper;
use Encode qw( encode );
#API FUNCTION WIMCreateFile
# HANDLE
# WINAPI
# WIMCreateFile(
# LPWSTR lpszWimPath,
# DWORD dwDesiredAccess,
# DWORD dwCreationDisposition,
# DWORD dwFlagsAndAttributes,
# DWORD dwCompressionType,
# LPDWORD lpdwCreationResult
# );
my $filehandler = encode('UCS-2le', "C:\\test.wim");
#Code example in C
#TCHAR *wimFile = TEXT("C:\\sample_image.wim");
my $wimfile = new Win32::API("wimgapi", "WIMCreateFile", ['P','N','N',
+'N','N','N'], 'N');
my $hWim = $wimfile->Call($filehandler,
WIM_GENERIC_WRITE,
WIM_CREATE_NEW,
0,
0,
0);
#Code example in C
# hWim = WIMCreateFile ( wimFile, //exis
+ting .wim file to append to
# WIM_GENERIC_READ | WIM_GENERIC_WRITE, //acce
+ss mode
# WIM_OPEN_EXISTING, //open
+ flag
# 0, // or
+WIM_FLAG_VERIFY flag for file corruption check
# 0,
# &created );
print $hWim;
|