Hi, i am trying to use the wingapi.dll with perl - here the dll function for C
HANDLE WINAPI WIMCreateFile( LPWSTR lpszWimPath, DWORD dwDesiredAccess, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, DWORD dwCompressionType, LPDWORD lpdwCreationResult );
Here my code ...
use Win32::API; use Data::Dumper; use FileHandle; #Open Filehandler $fh = new FileHandle; if ($fh->open("< C:\\data.wim")) { $fh->close; } my $wimfile = new Win32::API("wimgapi", "WIMCreateFile", ['P','C','C', +'C','C','C'], 'N'); my $value = $wimfile->Call($fh,WIM_GENERIC_WRITE,WIM_OPEN_EXISTING,WIM +_FLAG_VERIFY,WIM_COMPRESS_NONE,WIM_OPENED_EXISTING); print $value; #Returns: # 0 print Dumper($wimfile); #Returns: # $VAR1 = bless( { # 'out' => 1, # 'dll' => 1940783104, # 'procname' => 'WIMCreateFile', # 'proc' => 1940839096, # 'dllname' => 'wimgapi', # 'in' => [ # 2, # 6, # 6, # 6, # 6, # 6 # ] # }, 'Win32::API' ); # I: value is an integer (int) # N: value is a number (long) # F: value is a floating point number (float) # D: value is a double precision number (double) # C: value is a char (char) # P: value is a pointer (to a string, structure, etc...) # S: value is a Win32::API::Struct object (see below) # K: value is a Win32::API::Callback object (see Win32::API::Callback)
I dont know if its even possible to call function from the wimgapi. Thanks

In reply to Use Windows wimgapi dll by iea

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.