API-MS-Win-Core-ErrorHandling-L1-1-0.dll" failed

Questions about Wine on Linux
Locked
Dillybob
Level 1
Level 1
Posts: 9
Joined: Wed Feb 13, 2013 11:38 pm

API-MS-Win-Core-ErrorHandling-L1-1-0.dll" failed

Post by Dillybob »

Code: Select all

root@:~/src/pvpgn/d2g# wine ./D2GS.exe
err:module:attach_process_dlls "API-MS-Win-Core-ErrorHandling-L1-1-0.dll" failed                                             to initialize, aborting
err:module:LdrInitializeThunk Main exe initialization for L"Z:\\root\\src\\pvpgn                                            \\d2g\\D2GS.exe" failed, status c0000142
root@:~/src/pvpgn/d2g#

Hi guys, so above is the error I am having. I am running a 32 bit debian and I just installed wine via apt-get, everything went smooth.

This error is happening when I am trying to load up my D2GS.exe file (win32 .exe). I really do not want to buy/move to a windows VPS, but if I cant fix/solve this issue I will have to :( I Will do love linux and am looking for some help.

I've googled everything, I cant find nothing, asking for your help, thank you all.
User avatar
dimesio
Moderator
Moderator
Posts: 13202
Joined: Tue Mar 25, 2008 10:30 pm

Re: API-MS-Win-Core-ErrorHandling-L1-1-0.dll" failed

Post by dimesio »

What is your Windows version set to in winecfg? It should be XP unless this app explicitly requires a different version.
Dillybob
Level 1
Level 1
Posts: 9
Joined: Wed Feb 13, 2013 11:38 pm

Re: API-MS-Win-Core-ErrorHandling-L1-1-0.dll" failed

Post by Dillybob »

dimesio wrote:What is your Windows version set to in winecfg? It should be XP unless this app explicitly requires a different version.
I can't even read my config.

And yes I just reinstalled wine, apt-get remove wine, then apt-get install.

Code: Select all

ALSA lib seq_hw.c:457:(snd_seq_hw_open) open /dev/snd/seq failed: No such file or directory
Application tried to create a window, but no driver could be loaded.
Make sure that your X server is running and that $DISPLAY is set correctly.
Application tried to create a window, but no driver could be loaded.
Make sure that your X server is running and that $DISPLAY is set correctly.
err:ole:apartment_createwindowifneeded CreateWindow failed with error 1114
I'm running Debian 6 32 bit, is there any pre-requisites I need before I install wine?

This is really frustrating.
User avatar
dimesio
Moderator
Moderator
Posts: 13202
Joined: Tue Mar 25, 2008 10:30 pm

Re: API-MS-Win-Core-ErrorHandling-L1-1-0.dll" failed

Post by dimesio »

Dillybob wrote:

Code: Select all

Make sure that your X server is running and that $DISPLAY is set correctly.
Application tried to create a window, but no driver could be loaded.
You can't run Wine without X.

Code: Select all

root@:~/src/pvpgn/d2g# wine ./D2GS.exe
Never run Wine as root. http://wiki.winehq.org/FAQ#run_as_root
Dillybob
Level 1
Level 1
Posts: 9
Joined: Wed Feb 13, 2013 11:38 pm

Re: API-MS-Win-Core-ErrorHandling-L1-1-0.dll" failed

Post by Dillybob »

Okay, I'm about to tear my hair apart now.

Never even knew we had to a use a VNC to use WINECFG function to work? Why the fvck doesn't it work in putty? Why do we need a whole VNC/Desktop environment for it? Makes no sense.

In any event, same dam error, I am this close of buying a windows vps... this is just pathetic.

http://img545.imageshack.us/img545/4256/ez12s.png


This has to be a wine problem? I just don't understand.

http://appdb.winehq.org/objectManager.p ... ngId=17590

Someone said here it was 100% a wine problem, but not sure.

Hope someone can help, im not trying to sound like an ass, but i've been googling that ""API-MS-Win-Core-ErrorHandling-L1-1-0.dll" error for ages now, havn't found 1 page or advice on how to fix it.

Heaven forbid I move to windows, firewall on that os is absolutely dog shit. I'd rather burn in hell than use windows.
User avatar
dimesio
Moderator
Moderator
Posts: 13202
Joined: Tue Mar 25, 2008 10:30 pm

Re: API-MS-Win-Core-ErrorHandling-L1-1-0.dll" failed

Post by dimesio »

Wine can't draw windows without X. Pure terminal apps that do not create any windows will work without X.

There's a longstanding bug for d2gs.exe not working, but the error reported there appears to be different than what you're seeing. File a bug for the API-MS-Win-Core-ErrorHandling-L1-1-0.dll error.
Dillybob
Level 1
Level 1
Posts: 9
Joined: Wed Feb 13, 2013 11:38 pm

Re: API-MS-Win-Core-ErrorHandling-L1-1-0.dll" failed

Post by Dillybob »

I've gotten some work I need to show you.


That API-MS-Win-Core-ErrorHandling-L1-1-0.dll error only happens on wine version < 1.0.1.


I ran my d2gs.exe on a wine version 1.4 but it has a new error now. I installed vcrun6 too. (WineTricks)



Screenshot here:


Image

Error written out to text: "call from 0x7b839cf2 to unimplemented function msvcp60.dll??"


I am getting closer or what? :D

Like I said, I really.... REALLY do not want to run this game server on a windows machine, I'd rather burn in hell.

Hopefully this error can shed some light on a new fix, i'll be searching google.

Edit: Looks like this guy has the same problem:
http://www.ubuntu-forum.de/artikel/5747 ... 0-dll.html

I'm re-installing vcrun6 and it still did not work.. blah fml.
User avatar
dimesio
Moderator
Moderator
Posts: 13202
Joined: Tue Mar 25, 2008 10:30 pm

Re: API-MS-Win-Core-ErrorHandling-L1-1-0.dll" failed

Post by dimesio »

Upgrade to the latest development release. The function it's crashing on was implemented in 1.5.15.
Dillybob
Level 1
Level 1
Posts: 9
Joined: Wed Feb 13, 2013 11:38 pm

Re: API-MS-Win-Core-ErrorHandling-L1-1-0.dll" failed

Post by Dillybob »

dimesio wrote:Upgrade to the latest development release. The function it's crashing on was implemented in 1.5.15.

Done, upgraded to 1.5

I Followed this guide:
http://www.noobslab.com/2012/12/install ... buntu.html


Now, we are almost there man!! Thanks for sticking with me!

Image


It runs w/o errors, but does not show up in process listing, any idea?

Not showing up in "top" command either? Hmm

Edit: I think it's not starting because I am missing some .mpq files that the .exe needs to have or it won't run. (I tried to remove them on my windows system at home, and it didn't start). So I am uploading those files now to see if it starts. My upload speed is terrible so might be a while.
Dillybob
Level 1
Level 1
Posts: 9
Joined: Wed Feb 13, 2013 11:38 pm

Re: API-MS-Win-Core-ErrorHandling-L1-1-0.dll" failed

Post by Dillybob »

When I try to launch the D2GS.exe it works, but these errors pop up:

Image

(Written error:

unsupported ioctl 24000 (device=2 access=1 func=0 method=0)

)
(The d2gs.exe service does indeed run, these error's are not stopping it for some reason?)


But I do believe those errors is messing up the d2gs executable.

It spits out:

Code: Select all

02/20 21:30:09.047 D2GSNetRecvPacket: CS socket become writable
02/20 21:30:09.048 D2GSNetRecvPacket: CS socket become writable
02/20 21:30:09.048 D2GSNetRecvPacket: CS socket become writable
02/20 21:30:09.048 D2GSNetRecvPacket: CS socket become writable
02/20 21:30:09.048 D2GSNetRecvPacket: CS socket become writable
02/20 21:30:09.048 D2GSNetRecvPacket: CS socket become writable
02/20 21:30:09.048 D2GSNetRecvPacket: CS socket become writable
02/20 21:30:09.048 D2GSNetRecvPacket: CS socket become writable
02/20 21:30:09.048 D2GSNetRecvPacket: CS socket become writable
02/20 21:30:09.048 D2GSNetRecvPacket: CS socket become writable
02/20 21:30:09.048 D2GSNetRecvPacket: CS socket become writable
02/20 21:30:09.048 D2GSNetRecvPacket: CS socket become writable
02/20 21:30:09.048 D2GSNetRecvPacket: CS socket become writable
02/20 21:30:09.048 D2GSNetRecvPacket: CS socket become writable
02/20 21:30:09.048 D2GSNetRecvPacket: CS socket become writable
02/20 21:30:09.048 D2GSNetRecvPacket: CS socket become writable
02/20 21:30:09.048 D2GSNetRecvPacket: CS socket become writable
02/20 21:30:09.048 D2GSNetRecvPacket: CS socket become writable
Inside my d2gs.log file, about 20megabytes per 20seconds....... So I have to kill the process or it will eat resources.

So something is obviously screwing with it. (It does work and I can login to the game, but cannot create a game, hence why this d2gs.exe thing is raping the processes).

This DOES not happen on my windows, the d2gs.exe is fine and doesn't produce any of these errors.

I've googled the

"CS socket become writable" error which leads to the a page of the d2gs source code on why it's spitting out this error:

Code: Select all

if (NetEvents.lNetworkEvents & FD_WRITE) {   
            if (NetEvents.iErrorCode[FD_WRITE_BIT])   
                return ERROR_D2CS_CONNCLOSE;   
            nsbCS.writable = TRUE;   
            D2GSEventLog("D2GSNetRecvPacket", "CS socket become writable");   
            retval = 0;   
        }  
Source: http://read.pudn.com/downloads188/sourc ... et.c__.htm

So it has something to do with FD_WRITE_BIT that's messing with it? Maybe something to do with wine? Not sure, but hopefully this can be fixed.. This is pretty sad I made it all this way, can login to the system, character creation/selection works but cannot create games because of this stupid d2gs.exe compatibility issue with wine, or its self.

:(

Edit: Like I said, i'd rather burn in hell than move on windows... I am trying my best..
User avatar
dimesio
Moderator
Moderator
Posts: 13202
Joined: Tue Mar 25, 2008 10:30 pm

Re: API-MS-Win-Core-ErrorHandling-L1-1-0.dll" failed

Post by dimesio »

So it has something to do with FD_WRITE_BIT that's messing with it?
http://bugs.winehq.org/show_bug.cgi?id=10204

The bug report hasn't been updated in awhile. You should add a comment that this is still an issue in 1.5.24.
Dillybob
Level 1
Level 1
Posts: 9
Joined: Wed Feb 13, 2013 11:38 pm

Re: API-MS-Win-Core-ErrorHandling-L1-1-0.dll" failed

Post by Dillybob »

Looks like the bug is fixed here:

http://bugs.winehq.org/attachment.cgi?id=8866

Should I just re-download wine1.5, edit socket.c and attach the bug patch then re-compile and see if it works?

Edit:

Changed sock.c line 395 to:

Code: Select all

else if ((event & POLLOUT) && (sock->state & FD_WRITE)){
   /* According to WS2 spec, FD_WRITE is only delivered
      after connect and WSAEWOULDBLOCK while sending,
      so we clear FD_WRITE here. */
            sock->state &= ~FD_WRITE;
            /* we got connected */
            sock->state |= FD_WINE_CONNECTED|FD_READ|FD_WRITE;
            sock->state &= ~FD_CONNECT;
        }
Now i'm recompiling... hopefully this works fellas!
Dillybob
Level 1
Level 1
Posts: 9
Joined: Wed Feb 13, 2013 11:38 pm

Re: API-MS-Win-Core-ErrorHandling-L1-1-0.dll" failed

Post by Dillybob »

For some reason I cannot edit my post, apologize for the double post again.


But I recompiled it, took about 25minutes... wine 1.5.24...

Now when D2GS runs, I get

Code: Select all

02/21 10:07:23.862 D2GEThread: Server Thread 37 Created
02/21 10:07:24.597 D2GEThread: Game Server Thread Start Successfully
02/21 10:07:24.597 D2GSResetGameList: End all game in the Game List and in the GE
02/21 10:07:24.597 watchdog_init: CreateThread watchdog_thread, 44
02/21 10:07:24.598 main: Entering Main Server Loop
02/21 10:07:24.602 D2GSConnectToD2xS: Connected to D2DBS Successfully
02/21 10:07:24.603 D2GSSendClassToD2DBS: Send connection class packet to D2DBS
02/21 10:07:24.604 D2GSConnectToD2xS: Connected to D2CS Successfully
02/21 10:07:24.604 D2GSSendClassToD2CS: Send connection class packet to D2CS

And I applied the patch above on line 395 in sock.c on wine1.5.24?

Did I do it correctly or what? Now it doesn't even connect.
Dillybob
Level 1
Level 1
Posts: 9
Joined: Wed Feb 13, 2013 11:38 pm

Re: API-MS-Win-Core-ErrorHandling-L1-1-0.dll" failed

Post by Dillybob »

Alrighty fellas found a fix and it's working.


You must compile wine 1.3.6 from source, but before compiling, edit sock.c

And this change to it:

http://bugs.winehq.org/attachment.cgi?i ... ction=diff

And then you need to install winetricks

Code: Select all

wget http://winetricks.org/winetricks
chmod + x winetricks 
./winetricks vcrun6
And you should beable to run d2gs via wine ./D2GS.exe.

It will show this:
Image

But it still does work. And that sock.c is not FIXED in the latest or development release. So that is why I am using the 1.3.6 version. (Don't give a shit about other program compatibility errors or whatnot) if D2GS works, it works and that's all I care for this particular server.


Thanks @dimesio for helping me through this troubleshooting, such a shame I have to spend so much quality time to get this working. But it indeed does work and it should be worth it.

Cheers.

This was a great learning experience for me, learned new commands that are now forever stuck in my head :P
Locked