[Bug 27708] New: GetThreadSelectorEntry fails
http://bugs.winehq.org/show_bug.cgi?id=27708 Summary: GetThreadSelectorEntry fails Product: Wine Version: 1.2.2 Platform: x86 OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: ntdll AssignedTo: wine-bugs(a)winehq.org ReportedBy: nitsuja-(a)hotmail.com Created an attachment (id=35459) --> (http://bugs.winehq.org/attachment.cgi?id=35459) binary (and source code) of the test case When a program calls GetThreadSelectorEntry after creating a process, it fails in Wine (returns FALSE and sets lasterror to 5), but succeeds in Windows. This is a problem for a program I made which needs this function to work, so I've boiled it down to a tiny test case which still fails in the same way, and is attached. When run on Windows, this exe brings up a messagebox saying "ALL OK", but when run on Wine, it says "ERROR: GetThreadSelectorEntry failed". Here's the source code: #define WIN32_LEAN_AND_MEAN #define _WIN32_WINNT 0x0500 #include <windows.h> void AssertSuccess(BOOL success, const char* errorMessage); int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd) { // it doesn't matter which exe I start, so for this example I use the current exe path CHAR filename[MAX_PATH]; GetModuleFileName(NULL, filename, MAX_PATH); STARTUPINFO startupInfo = {sizeof(STARTUPINFO)}; PROCESS_INFORMATION processInfo = {}; BOOL success = CreateProcess(filename, NULL, NULL, NULL, FALSE, CREATE_SUSPENDED | DEBUG_PROCESS, NULL, NULL, &startupInfo, &processInfo); AssertSuccess(success, "ERROR: CreateProcess failed.\n"); HANDLE hThread = processInfo.hThread; CONTEXT context; context.ContextFlags = CONTEXT_SEGMENTS; success = GetThreadContext(hThread, &context); AssertSuccess(success, "ERROR: GetThreadContext failed.\n"); LDT_ENTRY ldtEntry; success = GetThreadSelectorEntry(hThread, context.SegFs, &ldtEntry); AssertSuccess(success, "ERROR: GetThreadSelectorEntry failed.\n"); if(success) MessageBox(NULL, "ALL OK.", "DONE", MB_ICONASTERISK); return success ? 0 : -1; } void AssertSuccess(BOOL success, const char* errorMessage) { if(!success) MessageBox(NULL, errorMessage, "ERROR", MB_ICONERROR); } -- 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=27708 nitsuja-(a)hotmail.com changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download, source, testcase -- 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=27708 --- Comment #1 from André H. <nerv(a)dawncrow.de> 2011-07-06 12:13:49 CDT --- Created an attachment (id=35463) --> (http://bugs.winehq.org/attachment.cgi?id=35463) bad test for the wine testsuite attached is a bad implemented test for our testsuite in case someone ones to pick it up. -- 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=27708 --- Comment #2 from nitsuja-(a)hotmail.com 2011-07-08 01:35:10 CDT --- (In reply to comment #1)
attached is a bad implemented test for our testsuite in case someone ones to pick it up.
Thanks, although, I'm not sure it's OK to remove CREATE_SUSPENDED from the test case. Without that, won't the spawned process start doing who-knows-what (potentially spawning itself again or already exiting) while we're trying to query its information? Also, the actual program that this test code was derived from needs to use CREATE_SUSPENDED for other reasons (it wasn't added arbitrarily). As for DEBUG_PROCESS, the only reason for that was to guarantee that the spawned process will be terminated when the current process exits. -- 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=27708 Austin English <austinenglish(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 --- Comment #3 from Austin English <austinenglish(a)gmail.com> 2013-09-18 17:09:22 CDT --- Still in wine-1.7.2-78-gfb96cb5 -- 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.
https://bugs.winehq.org/show_bug.cgi?id=27708 super_man(a)post.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |super_man(a)post.com --- Comment #4 from super_man(a)post.com --- still fails and I get a crash too. wine 1.7.51 -- 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.
https://bugs.winehq.org/show_bug.cgi?id=27708 zaplo00(a)mailfence.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |zaplo00(a)mailfence.com --- Comment #5 from zaplo00(a)mailfence.com --- This works in wine-3.10, test program returns ALL OK. -- 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.
https://bugs.winehq.org/show_bug.cgi?id=27708 Dmitry Timoshkov <dmitry(a)baikal.ru> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Fixed by SHA1| |d039d188f49d97b92694dbebcbb | |c72a8b30f29e0 Resolution|--- |FIXED --- Comment #6 from Dmitry Timoshkov <dmitry(a)baikal.ru> --- The bug was fixed some time ago. -- 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.
https://bugs.winehq.org/show_bug.cgi?id=27708 Alexandre Julliard <julliard(a)winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED --- Comment #7 from Alexandre Julliard <julliard(a)winehq.org> --- Closing bugs fixed in 3.11. -- 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.
https://bugs.winehq.org/show_bug.cgi?id=27708 Anastasius Focht <focht(a)gmx.net> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |pjb82(a)outlook.com --- Comment #8 from Anastasius Focht <focht(a)gmx.net> --- *** Bug 40583 has been marked as a duplicate of this bug. *** -- 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.
participants (2)
-
wine-bugs@winehq.org -
WineHQ Bugzilla