Why are the pointers in my 64-bit ISAPI library messed up?

I am working on porting a 32-bit ISAPI library to 64-bit. I am using Visual Studio 2008. I am having problems with the EXTENSION_CONTROL_BLOCK pointer in the HttpExtensionProc function. The char pointers in the EXTENSION_CONTROL_BLOCK structure are invalid on function entry; they are marked in the clock window. If I manually change the char pointers, replacing the first 4 bytes and the last 4 bytes of the pointer, the correct values ​​are displayed. Any ideas why this is happening?

This is the viewport before changing the pointer, notice the lpszQueryString: link text alt text http://i41.tinypic.com/2rxwbr4.jpg

This is the viewport after changing the pointer, notice the lpszQueryString: link text alt text http://i39.tinypic.com/2hnar7n.jpg

0


a source to share


1 answer


The problem was that I was building with 1 byte alignment. I needed to do this:

#pragma pack(push, 8)
#include <httpext.h>
#pragma pack(pop)

      



Thanks to nobugz for the answer.

+1


a source







All Articles