how to assign null to nonpaged memory buf

Hi,

when I am allocating nonpaged memory for a character pointer in My filesystem minifilter driver and assigning NULL to it,then it is not initialized to NULL. Why I am saying that this pointer does not initialize with NULL because next time when I am searching for the NULL value of the pointer I am unable to get the pointer.

The code of my filesystem minifilter driver is given below

PVOID buffer3;

struct Fnstr
{
char * FName;
struct Fnstr* NxFnstr;
struct Pnstr * HPnstr;
}*fnstr1,*fnstrh,*fnstrptr;

struct Pnstr
{
char *PName;
struct Pnstr *NxPnstr;

}*pnstr1,*pnstrh,*pnstrptr;

buffer3 = ExAllocatePoolWithTag( 0,sizeof(struct Fnstr),10);
fnstr1 = (struct Fnstr *)buffer3 ;
fnstr1->FName = buffer2;
fnstr1->NxFnstr = NULL;
fnstr1->HPnstr = NULL;

Now when i am searching for the NULL value of fnstr1->NxFnstr then it doesn’t get that node.

Can any one throw some light on this?

Thanks in advance.

Regards,

prasanta jena

PRASANTA JENA:

How are we supposed to help you figure out why you’re search is failing
without the source code for the search itself? You need to present the
entire relevant section of code, unmodified. In particular, what is
buffer2, how is it initialized, and how are you searching? Some more
information is needed, I think, as I don’t see how what is here could
compile, as the first structure references the second structure with no
forward declaration. If the FName member is, in fact, initialized with
a true NULL terminated C style string, then I think you would find that
one first. You probably already know this and account for it, but
without the rest of the code, I can’t say.

MM

>> xxxxx@patni.com 2006-08-08 05:30 >>>
Hi,

when I am allocating nonpaged memory for a character pointer in My
filesystem minifilter driver and assigning NULL to it,then it is not
initialized to NULL. Why I am saying that this pointer does not
initialize with NULL because next time when I am searching for the NULL
value of the pointer I am unable to get the pointer.

The code of my filesystem minifilter driver is given below

PVOID buffer3;

struct Fnstr
{
char * FName;
struct Fnstr* NxFnstr;
struct Pnstr * HPnstr;
}*fnstr1,*fnstrh,*fnstrptr;

struct Pnstr
{
char *PName;
struct Pnstr *NxPnstr;

}*pnstr1,*pnstrh,*pnstrptr;

buffer3 = ExAllocatePoolWithTag( 0,sizeof(struct Fnstr),10);
fnstr1 = (struct Fnstr *)buffer3 ;
fnstr1->FName = buffer2;
fnstr1->NxFnstr = NULL;
fnstr1->HPnstr = NULL;

Now when i am searching for the NULL value of fnstr1->NxFnstr then it
doesn’t get that node.

Can any one throw some light on this?

Thanks in advance.

Regards,

prasanta jena


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@evitechnology.com
To unsubscribe send a blank email to xxxxx@lists.osr.com