sorry to bump this old topic but I have another question. I've been using EP_X0FF's method on Win XP and it has been working well, but just recently I tried it on Win7 and it appears that FilePointer in the CONTROL_AREA structure is no longer a PFILE_OBJECT, but EX_FAST_REF. I use it like this, but it gives me a BSOD:
Code: Select allPSECTION_OBJECT sectionObject;
PFILE_OBJECT file;
sectionObject = (PSECTION_OBJECT)((PEPROCESS)process)->SectionObject;
file = ((PSEGMENT)sectionObject->Segment)->ControlArea->FilePointer.Object;
if (file && MmIsAddressValid(file))
{
//anything done with file causes BSOD
}
and 1 last question, what is the best way to store all of these structures? right now my code looks like this, and it causes a LOT of copy-paste:
if (WIN_VER == XP_SP3_32)
{
#include "struct_XP_SP3_32.h"
PEPROCESS process;
PSECTION_OBJECT;
...
}
else if (WIN_VER == VISTA_SP2_32)
{
#include "struct_VISTA_SP2_32.h"
PEPROCESS process;
PSECTION_OBJECT;
...
}