[pso] Observatie tema1 win

mihai sardarescu pso@cursuri.cs.pub.ro
Sat, 19 Mar 2005 03:05:31 -0800 (PST)


--0-420859065-1111230331=:95073
Content-Type: text/plain; charset=us-ascii

Salut,
Am vazut ca in tema1.h apare urmatoarea secventa de cod pe care e posibil sa nu o inteles:
 
if (!(*user=ExAllocatePoolWithTag(NonPagedPool, len, 'ot1t'))) {

status=STATUS_NO_MEMORY;

goto out;

}

if ((status=ZwQueryInformationToken(token, TokenUser, *user, len, &len)) != STATUS_SUCCESS) 

ExFreePoolWithTag(user, 'ot1t');

out:

.....................................

 

Intrebarea mea este:

daca este alocat pointerul: *user 

de ce este dealocat pointerul user

Multumesc,

Mihai. 


		
---------------------------------
Do you Yahoo!?
 Yahoo! Small Business - Try our new resources site! 
--0-420859065-1111230331=:95073
Content-Type: text/html; charset=us-ascii

<DIV>Salut,</DIV>
<DIV>Am vazut ca in tema1.h apare urmatoarea&nbsp;secventa de cod pe care e posibil sa nu o&nbsp;inteles:</DIV>
<DIV>&nbsp;<FONT size=2>
<P></FONT><FONT color=#0000ff size=2>if</FONT><FONT size=2> (!(*user=ExAllocatePoolWithTag(NonPagedPool, len, 'ot1t'))) {</P>
<P>status=STATUS_NO_MEMORY;</P>
<P></FONT><FONT color=#0000ff size=2>goto</FONT><FONT size=2> out;</P>
<P>}</P>
<P></FONT><FONT color=#0000ff size=2>if</FONT><FONT size=2> ((status=ZwQueryInformationToken(token, TokenUser, *user, len, &amp;len)) != STATUS_SUCCESS) </P>
<P>ExFreePoolWithTag(user, 'ot1t');</P>
<P>out:</P>
<P>.....................................</P>
<P>&nbsp;</P>
<P>Intrebarea mea este:</P>
<P>daca este alocat pointerul: *user </P>
<P>de ce este dealocat pointerul user</P>
<P>Multumesc,</P>
<P>Mihai.&nbsp;</P></FONT></DIV><p>
		<hr size=1>Do you Yahoo!?<br> 
Yahoo! Small Business - <a href="http://us.rd.yahoo.com/evt=31637/*http://smallbusiness.yahoo.com/resources/">Try our new resources site!</a> 
--0-420859065-1111230331=:95073--