I'm having a problem with my monolithic, user mode
printer driver. The problem is: The driver is installed
on windows 2000 server or windows 2003 server and shared.
An XP client connects to it. When the user on the client
attempts to change printer properties, the changes are
not saved.

I think it is caused by a problem I am having handling
DrvConvertDevmode's CMD_DRIVER_DEFAULT. In the driver, I
attempt to save the devmode by doing a SetPrinter with a
PRINTER_INFO_2 structure. As soon as I call it, Windows
calls my driver's DrvConvertDevmode, with *pcbNeeded=0
and pdmOut=NULL. I fill in *pcbNeeded with the size of
my devmode and return FALSE. Windows immediately calls
me back, with *pcbNeeded=0 and pdmOut=NULL again.

I expect that windows should call me back the second time
with *pcbNeeded=<size of my devmode> and pdmOut=<pointer
to a devmode-sized piece of memory>.

Is there something that I am misunderstanding?

Thanks,
ScottR
--
Scott Robins
ScottRobins@nospam.usa.xerox.com.nospam

Shared printer driver and DrvConvertDevmode by Scott

Scott
Fri Dec 12 12:05:38 CST 2003

I meant to say, I fill in *pcbNeeded with the size of
my devmode, call SetLastError(ERROR_INSUFFICIENT_BUFFER),
and return FALSE.

ScottR


RE: Shared printer driver and DrvConvertDevmode by bobbym

bobbym
Fri Dec 12 17:36:47 CST 2003

------=_NextPart_0001_49F64835
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Scott,
>I expect that windows should call me back the second time
>with *pcbNeeded=<size of my devmode> and pdmOut=<pointer
>to a devmode-sized piece of memory>.
>Is there something that I am misunderstanding?

That is the expected behaviour.
Not sure is what is going on here.
Does everything work in the local scenario?

--------------------
Content-Class: urn:content-classes:message
From: "Scott Robins" <ScottRobins@nospam.usa.xerox.com.nospam>
Sender: "Scott Robins" <ScottRobins@nospam.usa.xerox.com.nospam>
References: <0ba101c3c0d3$8c4488c0$a501280a@phx.gbl>
Subject: Shared printer driver and DrvConvertDevmode
Date: Fri, 12 Dec 2003 10:05:38 -0800
Lines: 6
Message-ID: <12dfd01c3c0da$8c29d0a0$a601280a@phx.gbl>
I meant to say, I fill in *pcbNeeded with the size of
my devmode, call SetLastError(ERROR_INSUFFICIENT_BUFFER),
and return FALSE.

In this case,

Hope this helps.

Thank you,
Bobby Mattappally
Microsoft DDK Support

This posting is provided "AS IS" with no warranties, and confers no rights.

------=_NextPart_0001_49F64835
Content-Type: text/x-rtf
Content-Transfer-Encoding: 7bit

{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fswiss\fprq2\fcharset0 MS Sans Serif;}}
\viewkind4\uc1\pard\f0\fs20 Scott,
\par >I expect that windows should call me back the second time
\par >with *pcbNeeded=<size of my devmode> and pdmOut=<pointer
\par >to a devmode-sized piece of memory>.
\par >Is there something that I am misunderstanding?
\par
\par That is the expected behaviour.
\par Not sure is what is going on here.
\par Does everything work in the local scenario?
\par
\par \pard\li720 --------------------
\par Content-Class: urn:content-classes:message
\par From: "Scott Robins" <ScottRobins@nospam.usa.xerox.com.nospam>
\par Sender: "Scott Robins" <ScottRobins@nospam.usa.xerox.com.nospam>
\par References: <0ba101c3c0d3$8c4488c0$a501280a@phx.gbl>
\par Subject: Shared printer driver and DrvConvertDevmode
\par Date: Fri, 12 Dec 2003 10:05:38 -0800
\par Lines: 6
\par Message-ID: <12dfd01c3c0da$8c29d0a0$a601280a@phx.gbl>
\par I meant to say, I fill in *pcbNeeded with the size of
\par my devmode, call SetLastError(ERROR_INSUFFICIENT_BUFFER),
\par and return FALSE.
\par
\par \pard In this case,
\par
\par Hope this helps.
\par
\par Thank you,
\par Bobby Mattappally
\par Microsoft DDK Support
\par
\par This posting is provided "AS IS" with no warranties, and confers no rights.
\par
\par
\par }
------=_NextPart_0001_49F64835--


Re: Shared printer driver and DrvConvertDevmode by Carey

Carey
Fri Dec 12 18:16:11 CST 2003

"Scott Robins" <ScottRobins@nospam.usa.xerox.com.nospam> wrote:

>I expect that windows should call me back the second time
>with *pcbNeeded=<size of my devmode> and pdmOut=<pointer
>to a devmode-sized piece of memory>.
>
>Is there something that I am misunderstanding?

Nope, you've got it right. Are you calling SetLastError() and setting it
to ERROR_INSUFFICIENT_BUFFER ?


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

RE: Shared printer driver and DrvConvertDevmode by Scott

Scott
Mon Dec 15 08:33:19 CST 2003

>That is the expected behaviour.
>Not sure is what is going on here.
>Does everything work in the local scenario?
>
Yes, locally it works fine, settings are saved no problem.

ScottR
--
Scott Robins
ScottRobins@nospam.usa.xerox.com.nospam


RE: Shared printer driver and DrvConvertDevmode by bobbym

bobbym
Mon Dec 15 18:18:32 CST 2003

------=_NextPart_0001_5993086B
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Check whether this is some kind of permissions issue.

--------------------
Content-Class: urn:content-classes:message
From: "Scott Robins" <ScottRobins@nospam.usa.xerox.com.nospam>
Sender: "Scott Robins" <ScottRobins@nospam.usa.xerox.com.nospam>
References: <0ba101c3c0d3$8c4488c0$a501280a@phx.gbl>
<12dfd01c3c0da$8c29d0a0$a601280a@phx.gbl>
<opJtZjQwDHA.560@cpmsftngxa07.phx.gbl>
Subject: RE: Shared printer driver and DrvConvertDevmode

>That is the expected behaviour.
>Not sure is what is going on here.
>Does everything work in the local scenario?
>
Yes, locally it works fine, settings are saved no problem.

ScottR
--
Scott Robins
ScottRobins@nospam.usa.xerox.com.nospam



Hope this helps.

Thank you,
Bobby Mattappally
Microsoft DDK Support

This posting is provided "AS IS" with no warranties, and confers no rights.

------=_NextPart_0001_5993086B
Content-Type: text/x-rtf
Content-Transfer-Encoding: 7bit

{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fswiss\fprq2\fcharset0 MS Sans Serif;}}
\viewkind4\uc1\pard\f0\fs20 Check whether this is some kind of permissions issue.
\par
\par \pard\li720 --------------------
\par Content-Class: urn:content-classes:message
\par From: "Scott Robins" <ScottRobins@nospam.usa.xerox.com.nospam>
\par Sender: "Scott Robins" <ScottRobins@nospam.usa.xerox.com.nospam>
\par References: <0ba101c3c0d3$8c4488c0$a501280a@phx.gbl> <12dfd01c3c0da$8c29d0a0$a601280a@phx.gbl> <opJtZjQwDHA.560@cpmsftngxa07.phx.gbl>
\par Subject: RE: Shared printer driver and DrvConvertDevmode
\par
\par >That is the expected behaviour.
\par >Not sure is what is going on here.
\par >Does everything work in the local scenario?
\par >
\par Yes, locally it works fine, settings are saved no problem.
\par
\par ScottR
\par --
\par Scott Robins
\par ScottRobins@nospam.usa.xerox.com.nospam
\par
\par \pard
\par
\par Hope this helps.
\par
\par Thank you,
\par Bobby Mattappally
\par Microsoft DDK Support
\par
\par This posting is provided "AS IS" with no warranties, and confers no rights.
\par
\par
\par }
------=_NextPart_0001_5993086B--


RE: Shared printer driver and DrvConvertDevmode by Scott

Scott
Tue Dec 16 07:51:35 CST 2003

>-----Original Message-----
>Check whether this is some kind of permissions issue.
>

What kind of permissions issue? When I install the
driver on the server, I am logged in as an
administrator. When I connect to it from the client, I
am logged in as an administrator (the same login name to
be exact).

Thanks,
ScottR
--
Scott Robins
ScottRobins@nospam.usa.xerox.com.nospam


RE: Shared printer driver and DrvConvertDevmode by bobbym

bobbym
Tue Dec 16 14:39:50 CST 2003

------=_NextPart_0001_5DEDB470
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

>>
What kind of permissions issue? When I install the
driver on the server, I am logged in as an
administrator. When I connect to it from the client, I
am logged in as an administrator (the same login name to
be exact).
>>

That was what I meant by permissions.
I wouldn't know what is going on without debugging it, which is beyond
what can be done in newsgroup.

I would suggest creating a support incident, if you need any assistance
from us on this.

Thank you,
Bobby Mattappally
Microsoft DDK Support

This posting is provided "AS IS" with no warranties, and confers no rights.

------=_NextPart_0001_5DEDB470
Content-Type: text/x-rtf
Content-Transfer-Encoding: 7bit

{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fswiss\fprq2\fcharset0 MS Sans Serif;}}
\viewkind4\uc1\pard\f0\fs20 >>
\par What kind of permissions issue? When I install the
\par driver on the server, I am logged in as an
\par administrator. When I connect to it from the client, I
\par am logged in as an administrator (the same login name to
\par be exact).
\par >>
\par
\par That was what I meant by permissions.
\par I wouldn't know what is going on without debugging it, which is beyond what can be done in newsgroup.
\par
\par I would suggest creating a support incident, if you need any assistance from us on this.
\par
\par Thank you,
\par Bobby Mattappally
\par Microsoft DDK Support
\par
\par This posting is provided "AS IS" with no warranties, and confers no rights.
\par
\par
\par }
------=_NextPart_0001_5DEDB470--