I’m writing software only printer driver based on XPSDrv. Inside filter I’m calling CreateFile, on VISTA its returning invalid handle. GetLastError code 5 (ERROR_ACCESS_DENIED).
Below is code that i’m using
hTempFile = CreateFileA(“C:\Users\software\Desktop\xpstest.jpg”,
GENERIC_READ | GENERIC_WRITE,
0,
NULL,
CREATE_ALWAYS,
FILE_ATTRIBUTE_NORMAL,
NULL);
Is there anything wrong i’m doing in CreateFile?
xxxxx@hotmail.com wrote:
I’m writing software only printer driver based on XPSDrv. Inside filter I’m calling CreateFile, on VISTA its returning invalid handle. GetLastError code 5 (ERROR_ACCESS_DENIED).
Below is code that i’m using
hTempFile = CreateFileA(“C:\Users\software\Desktop\xpstest.jpg”,
GENERIC_READ | GENERIC_WRITE,
0,
NULL,
CREATE_ALWAYS,
FILE_ATTRIBUTE_NORMAL,
NULL);
Is there anything wrong i’m doing in CreateFile?
Printer drivers run as part of a service under a special user account.
You probably don’t have permission to write to the logged in user’s desktop.
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.