_stat() return error when used inside WUDFHost service

Hi,

We are trying to use the _stat() function to determine the log file size. When we run this in a win32 application, the files available in %windir%\Temp are read correctly with _stat() returning 0 indicating success. But when we run the same code in WPDDriver, the function returns -1 and the error number is 2 [the filename or path could not be found]. With _wstat() also it returns with the same error.

Is the function doesn’t work when in local service [WUDFHost.exe]?

Shyam

It is not that the function does not work in local service, it is that local service probably does not have access to the file in question regardless of being umdf driver or anything else.

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@wipro.com
Sent: Tuesday, August 25, 2009 11:22 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] _stat() return error when used inside WUDFHost service

Hi,

We are trying to use the _stat() function to determine the log file size. When we run this in a win32 application, the files available in %windir%\Temp are read correctly with _stat() returning 0 indicating success. But when we run the same code in WPDDriver, the function returns -1 and the error number is 2 [the filename or path could not be found]. With _wstat() also it returns with the same error.

Is the function doesn’t work when in local service [WUDFHost.exe]?

Shyam


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Thanks Doron. I didn’t quite understand.

But when I try to use API GetFileSize() it works…

Perhaps you are not linking against the right CRT or not initializing the CRT correctly.

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@wipro.com
Sent: Tuesday, August 25, 2009 12:51 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] _stat() return error when used inside WUDFHost service

Thanks Doron. I didn’t quite understand.

But when I try to use API GetFileSize() it works…


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer