Moved thunking functions off to kernel32.dll.
[wine] / dlls / dplayx / dplayx_messages.c
1 /* DirectPlay & DirectPlayLobby messaging implementation
2  *
3  * Copyright 2000 - Peter Hunnisett
4  *
5  * <presently under construction - contact hunnise@nortelnetworks.com>
6  *
7  */
8
9 #include "winbase.h"
10 #include "debugtools.h"
11
12 #include "dplayx_messages.h"
13
14 DEFAULT_DEBUG_CHANNEL(dplay)
15
16
17 static DWORD CALLBACK DPLAYX_MSG_ThreadMain( LPVOID lpContext );
18
19 /* Create the message reception thread to allow the application to receive
20  * asynchronous message reception
21  */
22 DWORD CreateMessageReceptionThread( HANDLE hNotifyEvent )
23 {
24   DWORD dwMsgThreadId;
25
26   if( !DuplicateHandle( 0, hNotifyEvent, 0, NULL, 0, FALSE, 0 ) )
27   {
28     ERR( "Unable to duplicate event handle\n" );
29     return 0;
30   }
31
32   /* FIXME: Should most likely store that thread handle */
33   CreateThread( NULL,                  /* Security attribs */
34                 0,                     /* Stack */ 
35                 DPLAYX_MSG_ThreadMain, /* Msg reception function */
36                 (LPVOID)hNotifyEvent,  /* Msg reception function parameter */
37                 0,                     /* Flags */
38                 &dwMsgThreadId         /* Updated with thread id */
39               );
40  
41   return dwMsgThreadId;
42 }
43 static DWORD CALLBACK DPLAYX_MSG_ThreadMain( LPVOID lpContext )
44 {
45   HANDLE hMsgEvent = (HANDLE)lpContext;
46
47   for ( ;; )
48   {
49     FIXME( "Ho Hum. Msg thread with nothing to do on handle %u\n", hMsgEvent );
50
51     SleepEx( 10000, FALSE );  /* 10 secs */
52   }
53
54   CloseHandle( hMsgEvent );
55 }
56