I am working on a system where I want to intercept Direct3D calls to create tiled displays. I am using an APITrace like interceptor to create a message stream and recreating the calls in a second program, much like the old Chromium project. The application side works fine but the program that processes the message stream does not. What I find is that when I call CreateSwapChain() the function returns S_OK but GetLastError() returns 'error = 0x00000594 : Cannot set nonlocal hook without a module handle.' I check the error state with GetLastError() just prior to calling CreateSwapChain() and there is no error. This error makes no sense to me. Can anyone shed any light on this?
I found the problem. The parameters for the CreateSwapChain function the pDesc structure includes an output window handle. Since the message stream is packed with the arguments for the message processing side the window handle has to be replaced with correct handle before the function is called be the processor side.
User contributions licensed under CC BY-SA 3.0