philip
January 28th, 2003, 18:43
I'm having a problem calling UniToBSCPath in my Vxd. I'm hooking a file operation. Looking at the ioreq structure to see what file is trying to be written to. But I keep on getting a crash in the Vxd call UniToBCSPath.
But one of the values I'm passing to the UniToBCSPath (ptr to unicode path name) is all wrong. I've traced in Softice:
mov eax, dword ptr [ebp+28d]
mov eax, dword ptr [eax+12d]
add eax,4
should give me ptr to Unicode name right? It gives me something like 0FFFFFBBFh, which it then proceeds to crash on.
What is wrong? Any help much appreciated, as it's driving me nuts. This is the hook (set in place by a previous InstallFileSystemApiHook)
hook:
push ebp
mov ebp,esp
sub esp,60h ;plenty of room
....
cmp busy,1
je exit_hook
cmp dword ptr [ebp+0Ch], IFSFN_WRITE
je WRITE_OPERATION
....
....
WRITE_OPERATION:
mov busy,1
mov esi,OFFSET32 filename
push 0
push 260d
mov eax, dword ptr [ebp+28d]
mov eax, dword ptr [eax+12d]
add eax, 4 ;
push eax ; push unicode filename --PROBLEM!!!!
push esi ; destination buffer
int 20h
dw UniToBCSPath
dw IFSMgr

But one of the values I'm passing to the UniToBCSPath (ptr to unicode path name) is all wrong. I've traced in Softice:
mov eax, dword ptr [ebp+28d]
mov eax, dword ptr [eax+12d]
add eax,4
should give me ptr to Unicode name right? It gives me something like 0FFFFFBBFh, which it then proceeds to crash on.
What is wrong? Any help much appreciated, as it's driving me nuts. This is the hook (set in place by a previous InstallFileSystemApiHook)
hook:
push ebp
mov ebp,esp
sub esp,60h ;plenty of room
....
cmp busy,1
je exit_hook
cmp dword ptr [ebp+0Ch], IFSFN_WRITE
je WRITE_OPERATION
....
....
WRITE_OPERATION:
mov busy,1
mov esi,OFFSET32 filename
push 0
push 260d
mov eax, dword ptr [ebp+28d]
mov eax, dword ptr [eax+12d]
add eax, 4 ;
push eax ; push unicode filename --PROBLEM!!!!
push esi ; destination buffer
int 20h
dw UniToBCSPath
dw IFSMgr


