Discussion:
CreateDC fails on Windows 7 64bit for mirror driver
(too old to reply)
Edigin
2011-10-10 13:39:37 UTC
Permalink
I have a mirror driver for screen capture and a recording application
that works on XP and Windows 7 32bit. On Windows 7 64 bit, the call
to CreateDC fails with a last error = 0;

hdc = GDI32.CreateDC(driverName, devName, null, ref
devmode);

I am running in Session 1 as an application.
devName = "\\\\.\\DISPLAYV4"

There are 5 virtual displays and CreateDC fails on all of them not
just my mirror driver. I can CreateDC for DISPLAY1. Is there some
reason this code will run on 32bit Windows 7 and not 64bit? Is there
a reason you can't CreateDC on a virtual display in x64 Windows 7.
Leo Davidson
2011-10-11 08:33:40 UTC
Permalink
 Is there some
reason this code will run on 32bit Windows 7 and not 64bit?  Is there
a reason you can't CreateDC on a virtual display in x64 Windows 7.
This is probably a stupid question :) but have you compiled and
installed a 64bit version of your driver?
Edigin
2011-10-11 16:46:16 UTC
Permalink
Post by Leo Davidson
 Is there some
reason this code will run on 32bit Windows 7 and not 64bit?  Is there
a reason you can't CreateDC on a virtual display in x64 Windows 7.
This is probably a stupid question :) but have you compiled and
installed a 64bit version of your driver?
Yes I installed the 64bit version and the Device Manager shows its
functioning. I also install Ultra VNC 64bit driver and it is on
DISPLAYV5 and cannot CreateDC on it either.
Leo Davidson
2011-10-12 08:25:09 UTC
Permalink
Post by Edigin
Post by Leo Davidson
 Is there some
reason this code will run on 32bit Windows 7 and not 64bit?  Is there
a reason you can't CreateDC on a virtual display in x64 Windows 7.
This is probably a stupid question :) but have you compiled and
installed a 64bit version of your driver?
Yes I installed the 64bit version and the Device Manager shows its
functioning.  I also install Ultra VNC 64bit driver and it is on
DISPLAYV5 and cannot CreateDC on it either.
Is the driver signed? I think x64 Windows requires signed drivers by
default while x86 did not. (I'd expect the VNC driver to be signed,
but maybe it's failing to load for an unrelated reason.)

Sorry if that is also an obvious thing. :) I don't know much about
writing drivers so I'm just trying to think of things that are
different between x64 and x86 Windows.
Edigin
2011-10-12 18:23:36 UTC
Permalink
No the driver is not signed, but I have the system running in test
mode for now to get around that requirement during development.

Loading...