Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
platform
active.directory
adsi
adsi.iis-admin
base
com_ole
complus_mts
component_svcs
database
directx
gdi
graphics_mm
internet.client
internet.server
internet.server.isapi-dev
localization
mapi
messaging
msi
mslayerforunicode
multimedia
networking
networking.ipv6
sdk_install
security
shell
telephony.tapi_2
telephony.tapi_3
telephony.tsp
telephony.wte
tools
ui
ui_shell
win_base_svcs
win16
  
 
date: Wed, 21 May 2008 18:47:48 +0200,    group: microsoft.public.platformsdk.gdi        back       


Problem with printer port   
HI i've developed a simple printer driver that doesn't communicate with a 
physical printer but instead creates a PDF or TIF file for every page.

Now i've written an application to automate printer installation
The app does this:
- copy driver files
- install new driver
- creates a new local port
- creates a new printer

and vverything workf fine(the install is run as administrator).
The problem is that when i try to use the printer with a non-admin user it 
doesn't and i get this message in the event viewer

Event Type: Error
Event Source: Print
Event Category: None
Event ID: 6161
Date:  21/5/2008
Time:  6:31:33 PM
User:  NICOLAXP\Roberto
Computer: NICOLAXP
Description:
The document Test Page owned by Roberto failed to print on printer 
EasyPrinter. Data type: NT EMF 1.008. Size of the spool file in bytes: 
74996. Number of bytes printed: 0. Total number of pages in the document: 1. 
Number of pages printed: 0. Client machine: \\NICOLAXP. Win32 error code 
returned by the print processor: 5 (0x5).
For more information, see Help and Support Center at 
http://go.microsoft.com/fwlink/events.asp.



The problem is the same if a manully install the driver and manully create 
the local port.
Setting the printer non to spool will not resolve the problem, i've also 
added full control to everyone to the c:\windows\system32 folder.

PLEASE HELP
Regards
Nicola
date: Wed, 21 May 2008 18:47:48 +0200   author:   Nicola Righetti

Re: Problem with printer port   
I assume that you've to set the proper rights on the created file. Every 
local port has a file in "System32" directory or whatever path you've 
specified during your installation procedure.

Best regards Lela

"Nicola Righetti"  wrote in message 
news:OHpCyL2uIHA.4560@TK2MSFTNGP03.phx.gbl...
> HI i've developed a simple printer driver that doesn't communicate with a 
> physical printer but instead creates a PDF or TIF file for every page.
>
> Now i've written an application to automate printer installation
> The app does this:
> - copy driver files
> - install new driver
> - creates a new local port
> - creates a new printer
>
> and vverything workf fine(the install is run as administrator).
> The problem is that when i try to use the printer with a non-admin user it 
> doesn't and i get this message in the event viewer
>
> Event Type: Error
> Event Source: Print
> Event Category: None
> Event ID: 6161
> Date:  21/5/2008
> Time:  6:31:33 PM
> User:  NICOLAXP\Roberto
> Computer: NICOLAXP
> Description:
> The document Test Page owned by Roberto failed to print on printer 
> EasyPrinter. Data type: NT EMF 1.008. Size of the spool file in bytes: 
> 74996. Number of bytes printed: 0. Total number of pages in the document: 
> 1. Number of pages printed: 0. Client machine: \\NICOLAXP. Win32 error 
> code returned by the print processor: 5 (0x5).
> For more information, see Help and Support Center at 
> http://go.microsoft.com/fwlink/events.asp.
>
>
>
> The problem is the same if a manully install the driver and manully create 
> the local port.
> Setting the printer non to spool will not resolve the problem, i've also 
> added full control to everyone to the c:\windows\system32 folder.
>
> PLEASE HELP
> Regards
> Nicola
>
date: Mon, 26 May 2008 07:01:00 +0200   author:   lela

Re: Problem with printer port   
thanks lela,
do you mean that every local port creates a file with the same name of the 
port in sys32? So the users need write access to sys32?
I don't specify any path during installation, AddPrinterDriverEx does the 
file copy for me.
The error catches up before my driver is loaded in memory so i'm still not 
creating any file.
brgds

"lela"  wrote in message 
news:uwUO$1uvIHA.2068@TK2MSFTNGP05.phx.gbl...
>I assume that you've to set the proper rights on the created file. Every 
>local port has a file in "System32" directory or whatever path you've 
>specified during your installation procedure.
>
> Best regards Lela
>
> "Nicola Righetti"  wrote in message 
> news:OHpCyL2uIHA.4560@TK2MSFTNGP03.phx.gbl...
>> HI i've developed a simple printer driver that doesn't communicate with a 
>> physical printer but instead creates a PDF or TIF file for every page.
>>
>> Now i've written an application to automate printer installation
>> The app does this:
>> - copy driver files
>> - install new driver
>> - creates a new local port
>> - creates a new printer
>>
>> and vverything workf fine(the install is run as administrator).
>> The problem is that when i try to use the printer with a non-admin user 
>> it doesn't and i get this message in the event viewer
>>
>> Event Type: Error
>> Event Source: Print
>> Event Category: None
>> Event ID: 6161
>> Date:  21/5/2008
>> Time:  6:31:33 PM
>> User:  NICOLAXP\Roberto
>> Computer: NICOLAXP
>> Description:
>> The document Test Page owned by Roberto failed to print on printer 
>> EasyPrinter. Data type: NT EMF 1.008. Size of the spool file in bytes: 
>> 74996. Number of bytes printed: 0. Total number of pages in the document: 
>> 1. Number of pages printed: 0. Client machine: \\NICOLAXP. Win32 error 
>> code returned by the print processor: 5 (0x5).
>> For more information, see Help and Support Center at 
>> http://go.microsoft.com/fwlink/events.asp.
>>
>>
>>
>> The problem is the same if a manully install the driver and manully 
>> create the local port.
>> Setting the printer non to spool will not resolve the problem, i've also 
>> added full control to everyone to the c:\windows\system32 folder.
>>
>> PLEASE HELP
>> Regards
>> Nicola
>>
>
>
date: Mon, 2 Jun 2008 10:45:17 +0200   author:   Nicola Righetti

Re: Problem with printer port   
Hi Nicola,

yes thats the experiences I've made. I struggled with this issue during 
porting our virtual printer driver (quite similar to your driver) from W2K, 
XP to Vista.

No the users don't have to have write accesss to sys32, you can specify a 
path for the new local port during installation procedure. So you can select 
a writable path in AllUsers or whatever you want.

To ensure that we are speaking about the same issue, you could just go to 
the file of your port in sys32 add the mentioned file system rights and have 
a look what happens.

Best regards, Lela

"Nicola Righetti"  wrote in message 
news:OMLrB0IxIHA.3680@TK2MSFTNGP05.phx.gbl...
> thanks lela,
> do you mean that every local port creates a file with the same name of the 
> port in sys32? So the users need write access to sys32?
> I don't specify any path during installation, AddPrinterDriverEx does the 
> file copy for me.
> The error catches up before my driver is loaded in memory so i'm still not 
> creating any file.
> brgds
>
> "lela"  wrote in message 
> news:uwUO$1uvIHA.2068@TK2MSFTNGP05.phx.gbl...
>>I assume that you've to set the proper rights on the created file. Every 
>>local port has a file in "System32" directory or whatever path you've 
>>specified during your installation procedure.
>>
>> Best regards Lela
>>
>> "Nicola Righetti"  wrote in message 
>> news:OHpCyL2uIHA.4560@TK2MSFTNGP03.phx.gbl...
>>> HI i've developed a simple printer driver that doesn't communicate with 
>>> a physical printer but instead creates a PDF or TIF file for every page.
>>>
>>> Now i've written an application to automate printer installation
>>> The app does this:
>>> - copy driver files
>>> - install new driver
>>> - creates a new local port
>>> - creates a new printer
>>>
>>> and vverything workf fine(the install is run as administrator).
>>> The problem is that when i try to use the printer with a non-admin user 
>>> it doesn't and i get this message in the event viewer
>>>
>>> Event Type: Error
>>> Event Source: Print
>>> Event Category: None
>>> Event ID: 6161
>>> Date:  21/5/2008
>>> Time:  6:31:33 PM
>>> User:  NICOLAXP\Roberto
>>> Computer: NICOLAXP
>>> Description:
>>> The document Test Page owned by Roberto failed to print on printer 
>>> EasyPrinter. Data type: NT EMF 1.008. Size of the spool file in bytes: 
>>> 74996. Number of bytes printed: 0. Total number of pages in the 
>>> document: 1. Number of pages printed: 0. Client machine: \\NICOLAXP. 
>>> Win32 error code returned by the print processor: 5 (0x5).
>>> For more information, see Help and Support Center at 
>>> http://go.microsoft.com/fwlink/events.asp.
>>>
>>>
>>>
>>> The problem is the same if a manully install the driver and manully 
>>> create the local port.
>>> Setting the printer non to spool will not resolve the problem, i've also 
>>> added full control to everyone to the c:\windows\system32 folder.
>>>
>>> PLEASE HELP
>>> Regards
>>> Nicola
>>>
>>
>>
>
date: Tue, 3 Jun 2008 06:36:25 +0200   author:   lela

Re: Problem with printer port   
Great i did it!

Now i'm asling how i can set the new path programmatically or if there is a 
way to set Vista not to create this file at all
THis is the code i use to create the port

PORT_DATA_1 PortData, OutData;
  memset(&PortData, 0, sizeof(PortData));
  PortData.dwVersion= 1;
  wcscpy(PortData.sztPortName, PortNameW);
  PortData.cbSize= sizeof(PortData);
  PortData.dwProtocol= PROTOCOL_RAWTCP_TYPE;

  memset(&OutData, 0, sizeof(OutData));
  OutData.dwVersion= 1;
  OutData.cbSize= sizeof(OutData);

  PRINTER_DEFAULTS Defaults = { NULL, NULL, SERVER_ACCESS_ADMINISTER };
  HANDLE hXcv= NULL;

  Ret= OpenPrinter(",XcvMonitor Local Port", &hXcv, &Defaults);
  Err= GetLastError();
  Log.Log("OpenPrinter returned %d(%d)", Ret, Err);
  Log.Log("hXcv=%08X", hXcv);
  Ret= XcvData(hXcv, L"AddPort", (LPBYTE) PortNameW, 
(wcslen(PortNameW)+1)*2, (LPBYTE) &OutData, sizeof(OutData), &dwNeed, 
&dwRet);
  Err= GetLastError();
  Log.Log("XcvData returned %d(%d)", Ret, Err);
  ClosePrinter(hXcv);


Where should i specify the path?


Another question for you, i install the driver using AddPrinterDriverEx. Is 
there a way to know the path where this function is copyiing my files? Or 
can i always assume it is c:\windows\system32\spool\drivers\w32x86\3 ??

Regards
Nicola


"lela"  wrote in message 
news:OW6TjNTxIHA.548@TK2MSFTNGP06.phx.gbl...
> Hi Nicola,
>
> yes thats the experiences I've made. I struggled with this issue during 
> porting our virtual printer driver (quite similar to your driver) from 
> W2K, XP to Vista.
>
> No the users don't have to have write accesss to sys32, you can specify a 
> path for the new local port during installation procedure. So you can 
> select a writable path in AllUsers or whatever you want.
>
> To ensure that we are speaking about the same issue, you could just go to 
> the file of your port in sys32 add the mentioned file system rights and 
> have a look what happens.
>
> Best regards, Lela
>
> "Nicola Righetti"  wrote in message 
> news:OMLrB0IxIHA.3680@TK2MSFTNGP05.phx.gbl...
>> thanks lela,
>> do you mean that every local port creates a file with the same name of 
>> the port in sys32? So the users need write access to sys32?
>> I don't specify any path during installation, AddPrinterDriverEx does the 
>> file copy for me.
>> The error catches up before my driver is loaded in memory so i'm still 
>> not creating any file.
>> brgds
>>
>> "lela"  wrote in message 
>> news:uwUO$1uvIHA.2068@TK2MSFTNGP05.phx.gbl...
>>>I assume that you've to set the proper rights on the created file. Every 
>>>local port has a file in "System32" directory or whatever path you've 
>>>specified during your installation procedure.
>>>
>>> Best regards Lela
>>>
>>> "Nicola Righetti"  wrote in message 
>>> news:OHpCyL2uIHA.4560@TK2MSFTNGP03.phx.gbl...
>>>> HI i've developed a simple printer driver that doesn't communicate with 
>>>> a physical printer but instead creates a PDF or TIF file for every 
>>>> page.
>>>>
>>>> Now i've written an application to automate printer installation
>>>> The app does this:
>>>> - copy driver files
>>>> - install new driver
>>>> - creates a new local port
>>>> - creates a new printer
>>>>
>>>> and vverything workf fine(the install is run as administrator).
>>>> The problem is that when i try to use the printer with a non-admin user 
>>>> it doesn't and i get this message in the event viewer
>>>>
>>>> Event Type: Error
>>>> Event Source: Print
>>>> Event Category: None
>>>> Event ID: 6161
>>>> Date:  21/5/2008
>>>> Time:  6:31:33 PM
>>>> User:  NICOLAXP\Roberto
>>>> Computer: NICOLAXP
>>>> Description:
>>>> The document Test Page owned by Roberto failed to print on printer 
>>>> EasyPrinter. Data type: NT EMF 1.008. Size of the spool file in bytes: 
>>>> 74996. Number of bytes printed: 0. Total number of pages in the 
>>>> document: 1. Number of pages printed: 0. Client machine: \\NICOLAXP. 
>>>> Win32 error code returned by the print processor: 5 (0x5).
>>>> For more information, see Help and Support Center at 
>>>> http://go.microsoft.com/fwlink/events.asp.
>>>>
>>>>
>>>>
>>>> The problem is the same if a manully install the driver and manully 
>>>> create the local port.
>>>> Setting the printer non to spool will not resolve the problem, i've 
>>>> also added full control to everyone to the c:\windows\system32 folder.
>>>>
>>>> PLEASE HELP
>>>> Regards
>>>> Nicola
>>>>
>>>
>>>
>>
>
>
date: Tue, 3 Jun 2008 09:18:23 +0200   author:   Nicola Righetti

Re: Problem with printer port   
Hi Nicola,

to specifiy the path for the new port please refer to the article I've 
examined it from
http://www.codeguru.com/cpp/w-p/printing/comments.php/c5893/?thread=64108
I've specified the path of the port to be in a writable directory because of 
Vista, another reason would be to have your driver run under "normal" User 
rights.

Regarding the path for your drivers, it depends on the platform your OS is 
running on and the version of your driver (UM, KM).

http://support.microsoft.com/kb/q162258

Kind regards, Lela (AUT:CRO >> 2:0, at least I hope so)


"Nicola Righetti"  wrote in message 
news:%23BlTMsUxIHA.5620@TK2MSFTNGP04.phx.gbl...
> Great i did it!
>
> Now i'm asling how i can set the new path programmatically or if there is 
> a way to set Vista not to create this file at all
> THis is the code i use to create the port
>
> PORT_DATA_1 PortData, OutData;
>  memset(&PortData, 0, sizeof(PortData));
>  PortData.dwVersion= 1;
>  wcscpy(PortData.sztPortName, PortNameW);
>  PortData.cbSize= sizeof(PortData);
>  PortData.dwProtocol= PROTOCOL_RAWTCP_TYPE;
>
>  memset(&OutData, 0, sizeof(OutData));
>  OutData.dwVersion= 1;
>  OutData.cbSize= sizeof(OutData);
>
>  PRINTER_DEFAULTS Defaults = { NULL, NULL, SERVER_ACCESS_ADMINISTER };
>  HANDLE hXcv= NULL;
>
>  Ret= OpenPrinter(",XcvMonitor Local Port", &hXcv, &Defaults);
>  Err= GetLastError();
>  Log.Log("OpenPrinter returned %d(%d)", Ret, Err);
>  Log.Log("hXcv=%08X", hXcv);
>  Ret= XcvData(hXcv, L"AddPort", (LPBYTE) PortNameW, 
> (wcslen(PortNameW)+1)*2, (LPBYTE) &OutData, sizeof(OutData), &dwNeed, 
> &dwRet);
>  Err= GetLastError();
>  Log.Log("XcvData returned %d(%d)", Ret, Err);
>  ClosePrinter(hXcv);
>
>
> Where should i specify the path?
>
>
> Another question for you, i install the driver using AddPrinterDriverEx. 
> Is there a way to know the path where this function is copyiing my files? 
> Or can i always assume it is c:\windows\system32\spool\drivers\w32x86\3 ??
>
> Regards
> Nicola
>
>
> "lela"  wrote in message 
> news:OW6TjNTxIHA.548@TK2MSFTNGP06.phx.gbl...
>> Hi Nicola,
>>
>> yes thats the experiences I've made. I struggled with this issue during 
>> porting our virtual printer driver (quite similar to your driver) from 
>> W2K, XP to Vista.
>>
>> No the users don't have to have write accesss to sys32, you can specify a 
>> path for the new local port during installation procedure. So you can 
>> select a writable path in AllUsers or whatever you want.
>>
>> To ensure that we are speaking about the same issue, you could just go to 
>> the file of your port in sys32 add the mentioned file system rights and 
>> have a look what happens.
>>
>> Best regards, Lela
>>
>> "Nicola Righetti"  wrote in message 
>> news:OMLrB0IxIHA.3680@TK2MSFTNGP05.phx.gbl...
>>> thanks lela,
>>> do you mean that every local port creates a file with the same name of 
>>> the port in sys32? So the users need write access to sys32?
>>> I don't specify any path during installation, AddPrinterDriverEx does 
>>> the file copy for me.
>>> The error catches up before my driver is loaded in memory so i'm still 
>>> not creating any file.
>>> brgds
>>>
>>> "lela"  wrote in message 
>>> news:uwUO$1uvIHA.2068@TK2MSFTNGP05.phx.gbl...
>>>>I assume that you've to set the proper rights on the created file. Every 
>>>>local port has a file in "System32" directory or whatever path you've 
>>>>specified during your installation procedure.
>>>>
>>>> Best regards Lela
>>>>
>>>> "Nicola Righetti"  wrote in message 
>>>> news:OHpCyL2uIHA.4560@TK2MSFTNGP03.phx.gbl...
>>>>> HI i've developed a simple printer driver that doesn't communicate 
>>>>> with a physical printer but instead creates a PDF or TIF file for 
>>>>> every page.
>>>>>
>>>>> Now i've written an application to automate printer installation
>>>>> The app does this:
>>>>> - copy driver files
>>>>> - install new driver
>>>>> - creates a new local port
>>>>> - creates a new printer
>>>>>
>>>>> and vverything workf fine(the install is run as administrator).
>>>>> The problem is that when i try to use the printer with a non-admin 
>>>>> user it doesn't and i get this message in the event viewer
>>>>>
>>>>> Event Type: Error
>>>>> Event Source: Print
>>>>> Event Category: None
>>>>> Event ID: 6161
>>>>> Date:  21/5/2008
>>>>> Time:  6:31:33 PM
>>>>> User:  NICOLAXP\Roberto
>>>>> Computer: NICOLAXP
>>>>> Description:
>>>>> The document Test Page owned by Roberto failed to print on printer 
>>>>> EasyPrinter. Data type: NT EMF 1.008. Size of the spool file in bytes: 
>>>>> 74996. Number of bytes printed: 0. Total number of pages in the 
>>>>> document: 1. Number of pages printed: 0. Client machine: \\NICOLAXP. 
>>>>> Win32 error code returned by the print processor: 5 (0x5).
>>>>> For more information, see Help and Support Center at 
>>>>> http://go.microsoft.com/fwlink/events.asp.
>>>>>
>>>>>
>>>>>
>>>>> The problem is the same if a manully install the driver and manully 
>>>>> create the local port.
>>>>> Setting the printer non to spool will not resolve the problem, i've 
>>>>> also added full control to everyone to the c:\windows\system32 folder.
>>>>>
>>>>> PLEASE HELP
>>>>> Regards
>>>>> Nicola
>>>>>
>>>>
>>>>
>>>
>>
>>
>
date: Wed, 4 Jun 2008 07:23:51 +0200   author:   lela

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us