What do you mean that you patched a Win32 API function?
Plus, what kind of error are you getting? Which OS?
I have stolen 5 bytes from the address of SetUnhandledExceptionFilter in Kernel32.dll and added my patch bytes( 0x33, 0xC0, 0xC2, 0x04, 0x00 ) to it.
So, the SetUnhandledExceptionFilter will never get executed when ever a call is made. This technique is used to enforce your own exception filter so that no one can re-set their own filter once you patched.
When I executed the same in my 64-bit machine it give access violation error.
Thanks,
Sendil