My apologies if this is the wrong list for this question... it seemed the most appropriate on the list.
I'm doing a proof-of-concept for my boss to demonstrate that we can port a large-ish application developed on Windows (using mostly crossplatform libraries like wxWindows, STLport, Xerces) to Linux using winelib to cover a few WIN32 API calls we've made.
I've just started into it, and have compiled a dozen files so far, but ran into trouble with the thread code. I cannot find SwitchToThread anywhere, not even in the winbase.h header file I expected it in. There are some changelogs to indicate that it exists, and the symbol does live in libntdll.dll.so, but I cannot find a header file that defines it.
Can anyone point me in the right direction?
Cheers,
Sean
+----------------------------------------------------------+ | Sean Mitchell Phoenix Interactive Design | | Software Engineer 137 Dundas St | | smitchell@phoenix-interactive.com London, ON | | 519-679-2913 x237 Canada | | 519-679-6773 fax N6A 1E9 | +----------------------------------------------------------+
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
- From what I can see, it doesn't appear to be in any header files, yet the function is there in kernel32, both the code and the spec file. The only thing that is anywhere near similiar is SwitchToThreadStack defined in thread.h. According to MSDN, it should be in winbase.h. Anyone know why it isn't?
- -- Andrew :-)
Please avoid sending me Word or PowerPoint attachments. See http://www.fsf.org/philosophy/no-word-attachments.html
On Tuesday 26 November 2002 10:31 pm, Sean Mitchell wrote:
My apologies if this is the wrong list for this question... it seemed the most appropriate on the list.
I'm doing a proof-of-concept for my boss to demonstrate that we can port a large-ish application developed on Windows (using mostly crossplatform libraries like wxWindows, STLport, Xerces) to Linux using winelib to cover a few WIN32 API calls we've made.
I've just started into it, and have compiled a dozen files so far, but ran into trouble with the thread code. I cannot find SwitchToThread anywhere, not even in the winbase.h header file I expected it in. There are some changelogs to indicate that it exists, and the symbol does live in libntdll.dll.so, but I cannot find a header file that defines it.
Can anyone point me in the right direction?
Cheers,
Sean
+----------------------------------------------------------+
| Sean Mitchell Phoenix Interactive Design | | Software Engineer 137 Dundas St | | smitchell@phoenix-interactive.com London, ON | | 519-679-2913 x237 Canada | | 519-679-6773 fax N6A 1E9 |
+----------------------------------------------------------+
On Wed, 27 Nov 2002, Andrew John Hughes wrote: [...]
- From what I can see, it doesn't appear to be in any header files, yet the
function is there in kernel32, both the code and the spec file. The only thing that is anywhere near similiar is SwitchToThreadStack defined in thread.h. According to MSDN, it should be in winbase.h. Anyone know why it isn't?
Because someone forgot to update winbase.h, that's all. Use this patch:
Index: include/winbase.h =================================================================== RCS file: /home/wine/wine/include/winbase.h,v retrieving revision 1.167 diff -u -r1.167 winbase.h --- include/winbase.h 25 Nov 2002 20:51:31 -0000 1.167 +++ include/winbase.h 27 Nov 2002 00:31:45 -0000 @@ -1496,6 +1496,7 @@ VOID WINAPI Sleep(DWORD); DWORD WINAPI SleepEx(DWORD,BOOL); DWORD WINAPI SuspendThread(HANDLE); +BOOL WINAPI SwitchToThread(void); BOOL WINAPI SystemTimeToFileTime(const SYSTEMTIME*,LPFILETIME); DWORD WINAPI TlsAlloc(void); BOOL WINAPI TlsFree(DWORD);
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On November 26, 2002 16:33, Francois Gouget wrote:
According to MSDN, it should be in winbase.h. Anyone know why it isn't?
Because someone forgot to update winbase.h, that's all. Use this patch:
...
+BOOL WINAPI SwitchToThread(void);
Looking at MSDN, at the very bottom of SwitchToThread's remarks section it says: "To compile an application that uses this function, define the _WIN32_WINNT macro as 0x0400 or later." Should we put an #ifdef around its definition also, or is it not worth it?
- -Ryan
On Tue, 26 Nov 2002, Ryan Cumming wrote: [...]
+BOOL WINAPI SwitchToThread(void);
Looking at MSDN, at the very bottom of SwitchToThread's remarks section it says: "To compile an application that uses this function, define the _WIN32_WINNT macro as 0x0400 or later." Should we put an #ifdef around its definition also, or is it not worth it?
I think it's not worth it. It seems we rarely put such checks in the headers although there are a couple (3 to be exact). It might be worth clarifying our position though. Anybody for or against?
Francois Gouget fgouget@free.fr writes:
I think it's not worth it. It seems we rarely put such checks in the headers although there are a couple (3 to be exact). It might be worth clarifying our position though. Anybody for or against?
Against. The features are always available in Wine anyway so the prototypes may as well be available too. If there's really an app out there that breaks because of an extra prototype it's easy to add a #ifdef at that point; but I doubt this will happen.