Quantcast
Channel: Active questions tagged kernel - Stack Overflow
Viewing all articles
Browse latest Browse all 6393

Porting 32bit structures for use in ZwQuerySystemInformation to 64-bit and getting compile errors

$
0
0

OK so I've been reading the book Undocumented Windows 2000 Secrets by Sven B. Schreiber that provides source code to obtain the base address of ntoskrnl.exe. But the issue that I'm running into is that the source code (namely the structure declaration) are written in 32 bits and I need the code to run on a 64 bit OS mostly on Windows 8.1 and eventually on Windows 10.

Here are the structure declarations that are quoted directly from the book:

#define SystemModuleInformation 11 // SYSTEMINFOCLASS#define MODULE_INFO_ sizeof (MODULE_INFO)#define MODULE_LIST_ sizeof (MODULE_LIST)typedef struct _MODULE_INFO{    DWORD dReserved1;    DWORD dReserved2;    PVOID pBase;    DWORD dSize;    DWORD dFlags;    WORD wIndex;    WORD wRank;    WORD wLoadCount;    WORD wNameOffset;    BYTE abPath[MAXIMUM_FILENAME_LENGTH];} MODULE_INFO, * PMODULE_INFO, ** PPMODULE_INFO;typedef struct _MODULE_LIST{    DWORD dModules;    MODULE_INFO aModules[];} MODULE_LIST, * PMODULE_LIST, ** PPMODULE_LIST;

The Visual Studio 2019 Community compile errors are here as follows: Please help with these errors and converting 32 bit types to 64 bit. Just one further piece of detail and that is I'm calling ZwQuerySystemInformtion and using these declarations above in a kernel mode driver. Thanks

Severity    Code    Description Project File    Line    Suppression StateError (active)  E0020   identifier "DWORD" is undefined TestDrv C:\Users\XFMUSER\Documents\Visual Studio 2019\Projects\XFL\TestDrv\TestDrv\Internals.h  15  Error (active)  E0020   identifier "DWORD" is undefined TestDrv C:\Users\XFMUSER\Documents\Visual Studio 2019\Projects\XFL\TestDrv\TestDrv\Internals.h  11  Error (active)  E0020   identifier "DWORD" is undefined TestDrv C:\Users\XFMUSER\Documents\Visual Studio 2019\Projects\XFL\TestDrv\TestDrv\Internals.h  12  Error (active)  E0020   identifier "DWORD" is undefined TestDrv C:\Users\XFMUSER\Documents\Visual Studio 2019\Projects\XFL\TestDrv\TestDrv\Internals.h  14  Error (active)  E0020   identifier "WORD" is undefined  TestDrv C:\Users\XFMUSER\Documents\Visual Studio 2019\Projects\XFL\TestDrv\TestDrv\Internals.h  16  Error (active)  E0020   identifier "WORD" is undefined  TestDrv C:\Users\XFMUSER\Documents\Visual Studio 2019\Projects\XFL\TestDrv\TestDrv\Internals.h  17  Error (active)  E0020   identifier "WORD" is undefined  TestDrv C:\Users\XFMUSER\Documents\Visual Studio 2019\Projects\XFL\TestDrv\TestDrv\Internals.h  18  Error (active)  E0020   identifier "WORD" is undefined  TestDrv C:\Users\XFMUSER\Documents\Visual Studio 2019\Projects\XFL\TestDrv\TestDrv\Internals.h  19  Error (active)  E0020   identifier "DWORD" is undefined TestDrv C:\Users\XFMUSER\Documents\Visual Studio 2019\Projects\XFL\TestDrv\TestDrv\Internals.h  25  

Viewing all articles
Browse latest Browse all 6393

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>