Hi,
I have to get printer utilization information such as number of jobs done,
AveragePPM etc.
Win32 API gives all these info as NULL or 0.
So I thought of using driver level programming to extract such information
from printer.
I am new to driver level programming.
Can someone help me know if it is possible through device driver programming
like if I use "DrvDeviceCapabilities" method.
I am using Windows 2000 server machine.


Also I tried to use this method in my code, but the code just not compiles.
It gives these errors -
c:\ntddk\inc\ddrawint.h(1863) : error C2146: syntax error : missing ';'
before identifier 'dwhContext'
c:\ntddk\inc\ddrawint.h(1863) : error C2501: 'DWORD_PTR' : missing
storage-class or type specifiers
c:\ntddk\inc\ddrawint.h(1863) : error C2501: 'dwhContext' : missing
storage-class or type specifiers
c:\ntddk\inc\winddi.h(532) : error C2059: syntax error : '__stdcall'
c:\ntddk\inc\winddi.h(532) : error C2091: function returns function
c:\ntddk\inc\winddi.h(537) : error C2146: syntax error : missing ';' before
identifier 'pfn'
c:\ntddk\inc\winddi.h(537) : error C2501: 'PFN' : missing storage-class or
type specifiers
c:\ntddk\inc\winddi.h(537) : error C2501: 'pfn' : missing storage-class or
type specifiers
c:\ntddk\inc\winddi.h(2124) : error C2061: syntax error : identifier
'DESIGNVECTOR'
c:\ntddk\inc\winddi.h(3790) : error C2061: syntax error : identifier
'DESIGNVECTOR'

What I am missing here ?


Thanks
Ashish

Re: printer info by Carey

Carey
Tue Dec 09 21:32:14 CST 2003

"Ashish Nigam" <ashishnigam@sbcglobal.net> wrote:

>Hi,
>I have to get printer utilization information such as number of jobs done,
>AveragePPM etc.
>Win32 API gives all these info as NULL or 0.
>So I thought of using driver level programming to extract such information
>from printer.
>I am new to driver level programming.
>Can someone help me know if it is possible through device driver programming
>like if I use "DrvDeviceCapabilities" method.
>I am using Windows 2000 server machine.

Functions like DrvDeviceCapabilities aren't functions you can call from an
application (these are entry points in device drivers). This approach will
not work.

Frankly, I've never seen anyone successfully extract the information you
need from the printer APIs. It would be nice if MS documented which fields
are valid and reliable, but so far that hasn't happened.....


--
Carey Gregory
Windows Print Drivers & Components
http://www.gw-tech.com