in reply to Re^2: Win32::FileOp issues
in thread Win32::FileOp issues
is wrong. L is always 32 bits. HWND->HANDLE->PVOID->void *, 32 or 64 bit type http://msdn.microsoft.com/en-us/library/windows/desktop/aa383751%28v=vs.85%29.aspx. There are more mistakes in that pack code, including missing alignment holes. I wont cover them right now. Remember void *s and handles dont have to be readable memory addresses to be valid data. They can be offsets into a table. Or encrypted with XOR against a (C static) secret value pointers. They can also be DB primary key GUIDs or something. Win32::API uses Q or L for HANDLE/void *s/char *s/etc. See https://metacpan.org/source/BULKDD/Win32-API-0.77/Type.pm#L160. I found https://metacpan.org/source/JENDA/Win32-FileOp-0.16.02/FileOp.pm#L1217 but that is different from your pack() struct above. Looking through Win32::FileOp, nothing looks 64 bit compatible in it. " $Flags = unpack("L", substr $struct, 52, 4);" that is garbage on Win64.my $struct = pack "LLLpLLLpLpLppLIppLLpILL", ( 88, #'lStructSize' # DWORD $Handle, #'hwndOwner' # HWND 0, #'hInstance' # HINSTANCE $lpstrFilter, #'lpstrFilter' # LPCTSTR 0, 0, # $lpstrCustomFilter, #'lpstrCustomFilter' # LPTSTR # length $lpstrCustomFilter, #'nMaxCustFilter' # DWORD #I'm not able to make it work with CustomFilter $nFilterIndex, #'nFilterIndex' # D +WORD $lpstrFile, #'lpstrFile' # LPTSTR length $lpstrFile, #'nMaxFile' # DWORD $lpstrFileTitle, #'lpstrFileTitle' # LPTSTR length $lpstrFileTitle, #'nMaxFileTitle' # DWORD $lpstrInitialDir, #'lpstrInitialDir' # LPCTSTR $lpstrTitle, #'lpstrTitle' # LPCTSTR $Flags, #'Flags' # DWORD 0, #'nFileOffset' # WORD # 0, #'nFileExtension' # WORD $nFileExtension, #'nFileExtension' # WORD $lpstrDefExt, #'lpstrDefExt' # LPCTSTR 0, #'lCustData' # DWORD 0, #'lpfnHook' # LPOFNHOOKPROC $lpTemplateName #'lpTemplateName' # LPCTSTR , 0, 1 );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Win32::FileOp issues
by davide_c (Acolyte) on Mar 20, 2014 at 21:53 UTC | |
by bulk88 (Priest) on Mar 21, 2014 at 02:40 UTC | |
by davide_c (Acolyte) on Mar 21, 2014 at 10:02 UTC | |
by davide_c (Acolyte) on Jun 06, 2014 at 15:39 UTC |