Windows Service + CreateWindowEx
Robert D Kocisko
rkocisko at gmail.com
Wed Aug 19 13:40:24 CDT 2015
Thanks a million Andrew. That did the trick. Now there's some other
problem which I'll have to dive into--of course ;)
I appreciate and am humbled by your request about fixing the problem
properly. I'm afraid I won't have the bandwidth or desire to dive that
deep into Wine any time too soon, but it sounds like an interesting
challenge.
Bob
On Wed, Aug 19, 2015 at 1:29 PM, Andrew Eikum <aeikum at codeweavers.com>
wrote:
> On Wed, Aug 19, 2015 at 01:21:32PM -0400, Robert D Kocisko wrote:
> > I am attempting to make some tweaks to Wine so it can run a (3rd party)
> > windows service that uses CreateWindowEx, and I'm not sure whether I'm on
> > the right track or not. What is happening is that when the service
> calls
> > CreateWindowEx, I get this error:
> >
> > Application tried to create a window, but no driver could be loaded.
> > The explorer process failed to start.
> >
> > I traced it down to the following source code line in
> > wine/dlls/user32/driver.c:
> >
> > UINT guid_atom = HandleToULong( GetPropW( hwnd, display_device_guid_propW
> > ));
> >
> > What is happening is that guid_atom returns 0 which ultimately ends up
> > disallowing any connection to a graphics driver.
> >
> > Now it seems to me that the explorer.exe process is supposed to be
> > providing a desktop window and setting that atom value. But if I try to
> > run wine explorer.exe it doesn't make any difference. I am keeping Wine
> > alive by running wine notepad & and I am also running wine services to
> make
> > sure that the SCM is alive and available for the services.
> >
> > OS: Elementary OS Freya 0.3
> >
> >
> > Is this something that Wine should support? I have had success getting
> > other 3rd party services to work so it seems that it shouldn't be too
> > difficult to make this work. Could anyone provide guidance on how I
> should
> > proceed to tweak the code to support this? Or if this is going to be a
> > huge project to make this work I would appreciate knowing that too :).
> >
>
> I've run into the same issue with the MSOffice 2013 installer. Your
> diagnosis is correct. I'm not aware of a proper fix.
>
> There is an ugly hack that will work around the bug. At the beginning
> of <dlls/user32/user_main.c:winstation_init>, set "info.lpDesktop" to
> NULL just after the GetStartupInfo() call. This will force Wine to
> create a new desktop for your service's winstation, which should then
> load the graphics driver.
>
> Again, this is just a crummy hack to work around the issue. If you'd
> like to dig into Wine's desktop and winstation implementations further
> and find a correct fix for this, it would be appreciated.
>
> Andrew
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20150819/67f92bb0/attachment.html>
More information about the wine-devel
mailing list