How do i send a captured data to print spooler for printing.

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Hi,

let me explain you what actually am trying to do.
writeprinter() function in a rendering plug-in of a Unidrv printer driver if
implemented , enables us to capture the out put data generated by the Unidrv
printer driver.
So am trying to implement this function there by capturing the data the
driver is giving out. So , for this i have written a function which opens a
file captures the driver data .But to my surprise am not able to get any data
,but NULL is being captured.
You can see my implementation as below..

HRESULT __stdcall
COemUni2::
WritePrinter(
PDEVOBJ pdevobj,
PVOID pBuf,
DWORD cbBuffer,
PDWORD pcbWritten
)
{

BOOL bResult;


bResult = GetDriverOutput(pdevobj, pBuf, cbBuffer, pcbWritten);

if(bResult)
{
return S_OK;
}
return S_FALSE;
}


BOOL GetDriverOutput(PDEVOBJ pdevobj, PVOID pBuf, DWORD cbBuffer, PDWORD
pcbWritten) {

FILE *fp1;
char* sFile;

sFile = "E:\\result.txt";


HANDLE hFile1 = CreateFile((LPCTSTR)sFile, GENERIC_WRITE |
GENERIC_READ,
FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, NULL,
CREATE_ALWAYS,
FILE_ATTRIBUTE_NORMAL, NULL);

if( (fp1 = fopen( sFile, "w" )) == NULL ){
return FALSE;
}

fprintf(fp1, "%s", pBuf);


fclose(fp1);

CloseHandle(hFile1);

return TRUE;
}

This is what i implemented. I dont know why NULL is being captured ....
Now my objective is to capture the correct out put data generated by Unidrv
driver and also i should send this data what ever captured ,to the print
spooler for printing and this should be done automatically by my function .
So please throw some light , by giving me some idea on how do i do this and
please let me know where exactly am going wrong.
Thanks in advance for your time and help.

Please let me know if you still want any more details from my side.
Thanks,
.



Relevant Pages

  • Re: Desktop Capture (Vista)
    ... I understood that the composition of whole desktop is dependent on GPU. ... In order to support the screen capture functionlity, ... you should see why a display driver (a mirror driver is ... Catching a snapshot of a single window with a mirror driver, ...
    (microsoft.public.development.device.drivers)
  • Re: Saving Screen Capture
    ... If you allow PrintScr but not Alt+PrintScr, then someone can still capture your pixels. ... it is there so if I download a driver and use it to "steal" what I've ... Note that it is not possible to run ordinary apps in the trusted core, ...
    (microsoft.public.vc.mfc)
  • Re: Virtual video capture device driver
    ... IMO you are better off to use TestCap. ... VFW capture driver might be your best bet as some people advocate. ... > as a genuine capture device even though AMCAP and WM encoder do so. ...
    (microsoft.public.development.device.drivers)
  • Re: Desktop Capture (Vista)
    ... It's not uncommon that screen capture the way you described takes a couple ... the render pass is itself ... processor, 512 MB RAM, Windows Vista Business with AERO theme. ... you should see why a display driver (a mirror driver is ...
    (microsoft.public.development.device.drivers)
  • Re: Desktop Capture (Vista)
    ... It's not uncommon that screen capture the way you described takes a couple ... the render pass is itself ... processor, 512 MB RAM, Windows Vista Business with AERO theme. ... you should see why a display driver (a mirror driver is ...
    (microsoft.public.development.device.drivers)