http://bugs.winehq.org/show_bug.cgi?id=10225
Summary: SafeDisc 2.x triggers async device ioctl status code
propagation bug in wine server
Product: Wine
Version: CVS/GIT
Platform: PC
OS/Version: Linux
Status: UNCONFIRMED
Severity: major
Priority: P2
Component: wine-kernel
AssignedTo: wine-bugs(a)winehq.org
ReportedBy: focht(a)gmx.net
Created an attachment (id=8843)
--> (http://bugs.winehq.org/attachment.cgi?id=8843)
relevant trace which shows ioctl status code propagation bug
Hello,
while testing my proof-of-concept patch which makes SafeDisc v2 (yuck!) finally
work, I stumbled across a nasty ioctl status code propagation (completion) bug
in wine server.
Wasted several hours on it .. I was suspecting SD issue whole time, but its a
wine server bug :(
Attached is relevant trace (WINEDEBUG=+seh,+tid,+relay,+ntoskrnl,+server wine
./BfVietnam.exe)
Before the bug is triggered, the SafeDisc security driver makes several device
ioctl requests which return 0xC0000001 (unsuccessful) on purpose, e.g. reading
debug Drx registers with index that does not exist.
This is intended to fool reversers :-)
The next operation - checking IDT entries should succeed - but does not (as
seen from calling client).
The kernel driver completes the operation successfully and returns
irp.IoStatus.u.Status == 0 with xxxx bytes in output buffer.
I verified it several times by debugging the kernel driver.
Upon driver ioctl call return, get_next_device_request() is triggered again in
ntoskrnl event loop which sets the return data (and status code) ->
set_ioctl_result().
This queues an APC, waking up the client (alertable state).
The client process device ioctl completes with 0 (FALSE) which is wrong.
Further debugging showed that ioctl_completion APC (dlls/ntdll/file.c) returns
the errornous status code in get_ioctl_result() when woken up by server.
This error is then propagated in server_ioctl_file() to result in wrong
NtDeviceIoControlFile() return code.
What puzzled me is that "ioctl->status" is correctly set by set_ioctl_result()
(=0) but get_ioctl_result() - called within client context - yields the
previous error code (0xC0000001 of failed request).
This is either a problem of global vs. thread local error status (global_error
vs. current->error/thread) or the ioctl call data is the wrong one.
The following patch works for me, letting SD 2.x continue - though i'm not sure
if it's right:
--- snip ---
diff --git a/server/device.c b/server/device.c
index 46b2796..8fe8f7c 100644
--- a/server/device.c
+++ b/server/device.c
@@ -528,7 +528,7 @@ DECL_HANDLER(get_ioctl_result)
ioctl->out_data = NULL;
}
}
- set_error( ioctl->status );
+
list_remove( &ioctl->dev_entry );
release_object( ioctl ); /* no longer on the device queue */
}
--- snip ---
Regards
--
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=10293
Summary: sequentially running games/apps with different SafeDisc
versions fails
Product: Wine
Version: CVS/GIT
Platform: PC
OS/Version: Linux
Status: UNCONFIRMED
Severity: enhancement
Priority: P2
Component: wine-kernel
AssignedTo: wine-bugs(a)winehq.org
ReportedBy: focht(a)gmx.net
Created an attachment (id=8945)
--> (http://bugs.winehq.org/attachment.cgi?id=8945)
Patch which fixes various isses regarding kmode driver unload/reload
Hello,
currently wine's kernel mode driver cleanup/unloading facility has several
issues when it comes to applications/games that unload and reload different
driver versions on the fly.
Example: run multiple SafeDisc 2.x, 3.x and 4.x games sequentially.
Symptoms: game either hangs/crashes/exits silently
Usually the SD security driver is placed in
"c:\windows\system32\drivers\secdrv.sys"
If a SafeDisc protected program encounters a driver version that is
incompatible it does the following:
- stop the current security service (should unload the driver)
- unpack own security driver from resources to temp storage and move the binary
to "c:\windows\system32\drivers\secdrv.sys", overwriting the previous
- restart the service (loads the new driver)
This currently fails for various reasons:
(1)
The driver binary is loaded using LoadLibrary() -> the matching FreeLibrary()
is missing on service stop.
This leads to sharing violation when the driver binary going to be replaced
(CopyFile fails).
(2)
No driver unload routine called. Very problematic.
Various objects (symlinks) created by driver entry are not freed.
When the driver is reloaded the init routine usually fails with "object
exists".
(3)
Driver state objects (driver_obj, driver_extension) have undefined state due to
static storage.
Raises all sorts of problems because the driver entry routine does not init all
fields.
---------
Attached is a patch which fixes these problems, allowing to sequentially run
programs with different SafeDisc Versions.
Regards
--
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=10451
Summary: Various AutoDesk 2008 product installers fail due to
unimplemented msi.MsiEnumComponentCostsW
Product: Wine
Version: CVS/GIT
Platform: PC
OS/Version: Linux
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: wine-msi
AssignedTo: wine-bugs(a)winehq.org
ReportedBy: focht(a)gmx.net
Created an attachment (id=9156)
--> (http://bugs.winehq.org/attachment.cgi?id=9156)
stub impl of msi.MsiEnumComponentCostsW to keep AutoDesk 2008 installers happy
Hello,
various AutoDesk 2008 product installers fail due to unimplemented
msi.MsiEnumComponentCostsW API (mentioned in bug 9809).
--- snip ---
wine: Call from 0x7b841460 to unimplemented function
msi.dll.MsiEnumComponentCostsW, aborting
wine: Unimplemented function msi.dll.MsiEnumComponentCostsW called at address
0x7b841460 (thread 000e), starting debugger...
Unhandled exception: unimplemented function msi.dll.MsiEnumComponentCostsW
called in 32-bit code (0x7b8414d8).
--- snip ---
Attached patch makes installer happy.
Though that API (A/W) should be fleshed out some day ... this is left as
exercise for msi maintainers :-)
If you test this on AutoDesk 2008 installers, you need my shell32/shlfileop
patch from bug 9809 too.
Regards
--
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=11789
Summary: Recent Fls API additions break many installers/apps
Product: Wine
Version: CVS/GIT
Platform: PC
OS/Version: Linux
Status: UNCONFIRMED
Severity: critical
Priority: P2
Component: ntdll
AssignedTo: wine-bugs(a)winehq.org
ReportedBy: focht(a)gmx.net
Hello,
after upgrading to recent GIT (wine-0.9.56-264-g848383a) it seems the recent
Fls API additions broke almost every installer i'm working on ;-(
http://source.winehq.org/git/wine.git/?a=commit;h=6d6e9a42b13c827d1cc795c3b…http://source.winehq.org/git/wine.git/?a=commit;h=b2ad268a8b7d7ac65029bbdd7…
I won't question if there was a specific need to introduce this ...
Reason of crash in FlsAlloc() is simple.
Different TEB definition in <thread.h> vs. <winternl.h> leads to incorrect TEB
allocation size (ntdll -> thread.h) vs. usage (fiber/Fls -> winternl.h)
Solution: use winternl.h TEB definition to ensure correct TEB allocation size
in dlls/ntdll/thread.c
Either change include order of both (needs <stdarg.h>) .. or sync both .. or
better get rid of the thread.h one to avoid such recurring problem.
Regards
--
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
Do not reply to this email, post in Bugzilla using the
above URL to reply.
------- You are receiving this mail because: -------
You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=14499
Summary: ImageDirectoryEntryToDataEx: section header param [out,
optional], needs to be zeroed before RtlImageRvaToVa
Product: Wine
Version: CVS/GIT
Platform: PC
OS/Version: Linux
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: dbghelp
AssignedTo: wine-bugs(a)winehq.org
ReportedBy: focht(a)gmx.net
Hello,
a quickie, as title says.
Section header param passed to ImageDirectoryEntryToDataEx is [out, optional].
Crashes RtlImageRvaToVa if caller doesn't initialize the out param to zero
(stack var).
--- snip ---
..
0020:Call
dbghelp.ImageDirectoryEntryToDataEx(00340000,00000000,00000006,0032cc34,0032cc38)
ret=004048ec
0020:Call ntdll.RtlImageNtHeader(00340000) ret=6076ce7b
0020:Ret ntdll.RtlImageNtHeader() retval=003400e8 ret=6076ce7b
0020:Call ntdll.RtlImageRvaToVa(003400e8,00340000,00001270,0032cc38)
ret=6076ceeb
0020:trace:seh:raise_exception code=c0000005 flags=0 addr=0x7bc4337a
--- snip ---
Fix: unconditionally "if (section) *section = NULL" on
ImageDirectoryEntryToDataEx entry (like size).
Regards
--
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
Do not reply to this email, post in Bugzilla using the
above URL to reply.
------- You are receiving this mail because: -------
You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=14568
Summary: Silence FIXME from CoGetContextToken stub to prevent
flooding of trace output when COM+ context is queried
from .NET runtime
Product: Wine
Version: CVS/GIT
Platform: PC
OS/Version: Linux
Status: UNCONFIRMED
Severity: enhancement
Priority: P2
Component: ole32
AssignedTo: wine-bugs(a)winehq.org
ReportedBy: focht(a)gmx.net
Hello,
ole32.CoGetContextToken being currently a stub prints out large amounts of
FIXME's when .NET runtime queries COM+ context for run/debugged .NET
applications.
--- snip ---
..
fixme:ole:CoGetContextToken stub
fixme:ole:CoGetContextToken stub
fixme:ole:CoGetContextToken stub
fixme:ole:CoGetContextToken stub
fixme:ole:CoGetContextToken stub
..
<repeat this gazillion times>
--- snip ---
Please use a static or remove the FIXME.
It's really annoying and makes console tracing/debugging of .NET apps really
messy.
And no, WINEDEBUG=-ole is *not* an option, it actually hides other bugs.
Regards
--
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
Do not reply to this email, post in Bugzilla using the
above URL to reply.
------- You are receiving this mail because: -------
You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=16544
Summary: winmm: mixerOpen(): when CALLBACK_WINDOW flag given,
NULL Callback is also valid
Product: Wine
Version: 1.1.10
Platform: PC-x86-64
OS/Version: Linux
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: winmm&mci
AssignedTo: wine-bugs(a)winehq.org
ReportedBy: focht(a)gmx.net
Hello,
while revisiting a Battlefield 2 issue I came across another one...
BF2 voice setup (C:\Program Files\EA GAMES\Battlefield 2\BF2VoiceSetup.exe)
crashes when "Save Settings" button is clicked.
This happens from BF2 sub-installer (causing no harm) or when the voice setup
app is run stand alone.
--- snip ---
..
wine: Unhandled page fault on read access to 0x0000002c at address 0x408661
(thread 0044), starting debugger...
Unhandled exception: page fault on read access to 0x0000002c in 32-bit code
(0x00408661).
Register dump:
CS:0023 SS:002b DS:002b ES:002b FS:0063 GS:006b
EIP:00408661 ESP:0033dadc EBP:0033dbc0 EFLAGS:00010216( - 00 -RIAP1)
EAX:00000000 EBX:00000111 ECX:00000000 EDX:00000002
ESI:0033dadc EDI:0033dbc0
Stack dump:
0x0033dadc: 00000001 0033f60c 00000111 cccccccc
0x0033daec: cccccccc cccccccc cccccccc cccccccc
0x0033dafc: cccccccc cccccccc cccccccc cccccccc
0x0033db0c: cccccccc cccccccc cccccccc cccccccc
0x0033db1c: cccccccc cccccccc cccccccc cccccccc
0x0033db2c: cccccccc cccccccc cccccccc cccccccc
Backtrace:
=>0 0x00408661 in bf2voicesetup (+0x8661) (0x0033dbc0)
1 0x00403978 in bf2voicesetup (+0x3978) (0x0033dd8c)
2 0x7c171915 in mfc71 (+0x31915) (0x0033ddbc)
3 0x7c14db36 in mfc71 (+0xdb36) (0x0033dde0)
4 0x7c175cd8 in mfc71 (+0x35cd8) (0x0033de30)
5 0x7c175cf2 in mfc71 (+0x35cf2) (0x0033dec4)
..
--- snip ---
The crash location is only indirectly related to the problem, hence this was a
bit tricky to debug to the real cause.
The real problem seems to be a Wine's winmm.mixerOpen() handling fdwOpen flags
with CALLBACK_WINDOW when dwCallback is NULL.
Consider the following (WINEDEBUG=+winmm):
--- snip ---
0023:trace:winmm:DllMain 0x60380000 0x1 0x1
0023:trace:winmm:MMDRV_Init ()
..
0023:trace:winmm:MIXER_Open (0x425f0c, 0, 00000000, 00000000, 00010000)
..
--- snip ---
mixerOpen() with CALLBACK_WINDOW flags and NULL dwCallback results in
MMSYSERR_INVALPARAM.
Corresponding Wine code:
--- snip dlls/winmm/winmm.c:MIXER_Open ---
UINT MIXER_Open(LPHMIXER lphMix, UINT uDeviceID, DWORD_PTR dwCallback,
DWORD_PTR dwInstance, DWORD fdwOpen, BOOL bFrom32)
{
...
switch (fdwOpen & CALLBACK_TYPEMASK) {
..
case CALLBACK_WINDOW:
mod.dwInstance = dwCallback;
if (!IsWindow((HWND)dwCallback))
return MMSYSERR_INVALPARAM;
break;
}
..
}
--- snip dlls/winmm/winmm.c:MIXER_Open ---
MSDN: http://msdn.microsoft.com/en-us/library/ms712134.aspx
It says: "The dwCallback parameter is assumed to be a window handle (HWND)."
Unfortunately the app expects MMSYSERR_NOERROR but not a failure (bad app error
handling anyway).
Hence crucial data structures are not getting setup properly (C++
instances/member data), leading to NULL ptr dereference at much later time.
A small conformance test case (fdwOpen=CALLBACK_WINDOW, dwCallback=NULL) should
reveal this MSDN documentation insufficiency.
Regards
--
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
Do not reply to this email, post in Bugzilla using the
above URL to reply.
------- You are receiving this mail because: -------
You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=16598
Summary: winuser.rh misses some standard control ids (dialog
button, ...) resulting in wrc failure with windows.h
include only
Product: Wine
Version: 1.1.10
Platform: Other
OS/Version: other
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: -unknown
AssignedTo: wine-bugs(a)winehq.org
ReportedBy: focht(a)gmx.net
Hello,
while doing some occasional end user support on #winehq (*yuck*), one user
complained about wrc not compiling his .rc file.
Visual C++ and mingw toolchains compiled it in Windows without problems but
Wine's wrc didn't like it.
--- snip ---
...
resource.rc:114:31: Error: syntax error
--- snip ---
He sent me a link to the .rc file to have a look at.
Relevant parts:
Resource.rc:
--- snip ---
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include <windows.h>
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
...
/////////////////////////////////////////////////////////////////////////////
//
// Menu
//
IDR_MENU MENU
BEGIN
...
END
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_MEMTRANSFER DIALOGEX 100, 100, 174, 90
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION |
WS_SYSMENU
CAPTION "Memory Transfer"
FONT 8, "Courier New", 0, 0, 0x0
BEGIN
DEFPUSHBUTTON "&OK",IDOK,42,72,40,14
...
--- snip ---
Resource.h:
--- snip ---
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by resource.rc
//
#define IDR_MENU 100
#define IDI_ICON 101
#define IDB_BITMAP 102
#define IDR_MAIN_ACCEL 103
#define IDD_MEMTRANSFER 104
...
--- snip ---
The resource include chain is as follows:
resource.h
windows.h (due to RC_INVOKED defined by wrc) -> winresrc.h -> winuser.rh and
commctrl.rh
The problem is that winuser.rh defines only a subset of winuser.h control ids
This breaks resource scripts which for example reference standard dialog button
IDs.
Telling the user to explicitly include <winuser.h> solved his problems.
You might want to extend winuser.rh a bit to include often used standard
control ids (ex: dialog button).
Regards
--
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
Do not reply to this email, post in Bugzilla using the
above URL to reply.
------- You are receiving this mail because: -------
You are watching all bug changes.