What causes EngAssociateSurface to fail? This is in a user-mode printer
driver, and the return code is always 2 (file not found), whether I am
printing to file or not. The surface handle and device handle parameters
are ok, and the flags parameter doesn't appear to affect things (I changed
it to 0 and the same problem occurs).
Thanks,
That particular error code for EngAssociateSurface is really strange. I
am not sure what the problem is in your case. The best suggestion I have
is to use the msplot sample as a reference since it also calls
EngAssociateSurface in its DrvEnableSurface and CreateBitmapSURFOBJ
functions.
- Ashwin
This posting is provided "AS IS" with no warranties, and confers no
rights.
-----Original Message-----
From: Scott Robins [mailto:xxxxx@usa.xerox.com]
Sent: Tuesday, March 18, 2003 7:27 AM
To: NT Developers Interest List
Subject: [ntdev] EngAssociateSurface fails?
What causes EngAssociateSurface to fail? This is in a user-mode printer
driver, and the return code is always 2 (file not found), whether I am
printing to file or not. The surface handle and device handle
parameters are ok, and the flags parameter doesn't appear to affect
things (I changed it to 0 and the same problem occurs).
Thanks,
ScottR
You are currently subscribed to ntdev as: xxxxx@microsoft.com To
unsubscribe send a blank email to xxxxx@lists.osr.com
Ashwin,
Thanks. Further investigation reveals that EngCreateDeviceSurface,
although returning a non-NULL value, is also setting LastError to 2. I
don't expect that this helps either, but it's another bit of information.
I do the EngCreateDeviceSurface just before calling EngAssociateSurface.
For this test, I called SetLastError(0) just before calling
EngCreateDeviceSurface.
I also checked that the pdev and hdev parameters were the same as in the
EnablePDEV call just prior, and that the size parameter was reasonable.
Thanks,
ScottR
Scott Robins
xxxxx@usa.xerox.com
That particular error code for EngAssociateSurface is really strange. I
am not sure what the problem is in your case. The best suggestion I have
is to use the msplot sample as a reference since it also calls
EngAssociateSurface in its DrvEnableSurface and CreateBitmapSURFOBJ
functions.
Actually, I rearranged my TRACE statements and it turns out that both calls
(EngAssociate and EngCreateDevice) return 0 when GetLastError is called.
Apparently, my TRACE statements were setting the last error flag.
EngAssociateSurface returns FALSE, but a GetLastError call immediately
following it returns a zero.
I looked at msplot and didn't see anything different in the way my driver
does things.
Sorry for the confusion,
ScottR
-----Original Message-----
From: Scott Robins [mailto:xxxxx@usa.xerox.com]
Sent: Wednesday, March 19, 2003 7:15 AM
To: NT Developers Interest List
Subject: [ntdev] RE: EngAssociateSurface fails?
Ashwin,
Thanks. Further investigation reveals that EngCreateDeviceSurface, although
returning a non-NULL value, is also setting LastError to 2. I don't expect
that this helps either, but it's another bit of information. I do the
EngCreateDeviceSurface just before calling EngAssociateSurface.
For this test, I called SetLastError(0) just before calling
EngCreateDeviceSurface.
I also checked that the pdev and hdev parameters were the same as in the
EnablePDEV call just prior, and that the size parameter was reasonable.
Thanks,
ScottR
Scott Robins
xxxxx@usa.xerox.com
That particular error code for EngAssociateSurface is really strange.
I am not sure what the problem is in your case. The best suggestion I
have is to use the msplot sample as a reference since it also calls
EngAssociateSurface in its DrvEnableSurface and CreateBitmapSURFOBJ
functions.
You are currently subscribed to ntdev as: xxxxx@usa.xerox.com To
unsubscribe send a blank email to xxxxx@lists.osr.com