Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

NetFileEnum : not getting any result

Status
Not open for further replies.

b99csd

Programmer
Jul 14, 2002
1
IN
hi,
I want to know all the open file on my system(Win-2000 Server).
I am using NetFileEnum function in following way

FILE_INFO_3 *buff,*curf;

DWORD read, total, resumeh=0, rc, i;
buff = NULL;

rc=NetFileEnum(
NULL,
NULL,
NULL,
3,
(BYTE**)&buff,
2048,
&read,
&total,
&resumeh );
for ( i = 0, curf = buff; i < 1; ++ i, ++ curf )
{
printf( &quot;%-12S %-15S \n&quot;,
curf->fi3_username, curf->fi3_pathname
);

}
if ( buff != NULL )
NetApiBufferFree( buff );

but after execution system is not allocating memory for buff
and value of read is 0.
I am stuck now. Please help me out
thanks
 
Check that the first three params you are passing are definitely Unicode strings. I've had a similar problem myself where an ANSI string was causing function failure.

Alternatively, try doing the memory allocation/deallocation yourself (as with Win9x) and see what happens. Phil
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top