Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^4: [Win32] Verify filename (case sensitively)

by bulk88 (Priest)
on Oct 09, 2012 at 05:14 UTC ( [id://997925]=note: print w/replies, xml ) Need Help??


in reply to Re^3: [Win32] Verify filename (case sensitively)
in thread [Win32] Verify filename (case sensitively)

Compiler fine. No compiler warnings.
Test Summary Report ------------------- t/2-exist.t (Wstat: 2304 Tests: 15 Failed: 9) Failed tests: 4-6, 8-11, 14-15 Non-zero exit status: 9 t/3-stat.t (Wstat: 2304 Tests: 15 Failed: 9) Failed tests: 4-6, 8-11, 14-15 Non-zero exit status: 9 t/4-dir.t (Wstat: 1792 Tests: 13 Failed: 7) Failed tests: 4-5, 7-9, 12-13 Non-zero exit status: 7 t/7-rmdir.t (Wstat: 2048 Tests: 14 Failed: 8) Failed tests: 2, 5, 7, 9-10, 12-14 Non-zero exit status: 8 Files=9, Tests=114, 2 wallclock secs ( 0.13 usr + 0.05 sys = 0.17 C +PU) Result: FAIL Failed 4/9 test programs. 33/114 subtests failed. NMAKE : fatal error U1077: 'C:\perl512\bin\perl.exe' : return code '0x +ff' Stop. C:\Documents and Settings\Owner\Desktop\cpan libs\Win32-StrictFileName +s-0.01>
Can't load 'C:\sisyphusion\Win32-StrictFileNames-0.01\blib\arch/ auto/ +Win32/StrictFileNames/StrictFileNames.dll' for module Win32::StrictFi +leNames: load_file:Invalid access to memory location at C:/MinGW/perl +512/lib/DynaLoader.pm line 200.
means something in DllMain did an access vio.

1 minute later of research.

// ========== Initialisation //-------------------------------------------------------------------- +--------- // DllMain() // Function called by the system when processes and threads are initia +lized // and terminated. //-------------------------------------------------------------------- +--------- BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpRese +rved) { BOOL bResult = TRUE; int i; char szMsvcrt[3][16] = { "MSVCRT.dll", "MSVCRT70.dll", "MSVCRT71.dll" }; switch( dwReason ) { case DLL_PROCESS_ATTACH: hDllInstance = hInstance; // save Dll instance handle DEBUGSTR("hDllInstance = 0x%.8x", hDllInstance); bResult &= HookAPIAllMod("KERNEL32.dll", "CreateFileA", (PROC)My +_CreateFileA); DEBUGSTR("CreateFileA = %d", bResult); bResult &= HookAPIAllMod("KERNEL32.dll", "GetFileAttributesA", ( +PROC)My_GetFileAttributesA); DEBUGSTR("GetFileAttributesA = %d", bResult); for (i=0; i<3; i++) { if ( GetModuleHandle(szMsvcrt[i]) ) { bResult &= HookAPIAllMod(szMsvcrt[i], "_stati64", (PROC)My_s +tati64); bResult &= HookAPIAllMod(szMsvcrt[i], "_stat", (PROC)My_stat +); bResult &= HookAPIAllMod(szMsvcrt[i], "_rmdir", (PROC)My_rmd +ir); bResult &= HookAPIAllMod(szMsvcrt[i], "_chdir", (PROC)My_chd +ir); DEBUGSTR("%s functions = %d", szMsvcrt[i], bResult); } } case DLL_PROCESS_DETACH: break; } return (bResult); }
WHAT???!!!! I see a familiar friend, I guess I am not the first to do IAT patching with Perl in XS. I'm guessing bitrot/compiler/crt versions or x64 broke this module.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://997925]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (2)
As of 2024-04-19 21:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found