ReactOS  0.4.14-dev-317-g96040ec
threadwait.c File Reference
#include <windows.h>
#include <stdio.h>
#include <ndk/ntndk.h>
Include dependency graph for threadwait.c:

Go to the source code of this file.

Macros

#define WIN32_NO_STATUS
 
#define NTOS_MODE_USER
 

Functions

DWORD __stdcall threadfunc (void *UNREFERENCED)
 
int main (int ac, char **av)
 

Macro Definition Documentation

◆ NTOS_MODE_USER

#define NTOS_MODE_USER

Definition at line 11 of file threadwait.c.

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 7 of file threadwait.c.

Function Documentation

◆ main()

int main ( int  ac,
char **  av 
)

Definition at line 22 of file threadwait.c.

23 {
24  DWORD id;
25  HANDLE Thread;
26 
27  Thread = CreateThread(0, 0, threadfunc, 0, 0, &id);
28  printf("Main: ThreadId for new thread is %08lx\n", id);
29  printf("Main: Waiting on thread...\n");
31  printf("Main: OK, somebody fixed the PsUnblockThread spinlock double-acquire crash\n");
32  NtClose(Thread);
33  printf("Main: Terminating...\n");
34  return 0;
35 }
DWORD __stdcall threadfunc(void *UNREFERENCED)
Definition: threadwait.c:14
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:136
unsigned long DWORD
Definition: ntddk_ex.h:95
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD Thread
Definition: fltkernel.h:2653
NTSTATUS NTAPI NtClose(IN HANDLE Handle)
Definition: obhandle.c:3399
GLenum GLuint id
Definition: glext.h:5579
#define INFINITE
Definition: serial.h:102
#define printf
Definition: config.h:203

◆ threadfunc()

DWORD __stdcall threadfunc ( void UNREFERENCED)

Definition at line 14 of file threadwait.c.

15 {
16  printf("Thread: Initialized\n");
17  Sleep(2500);
18  printf("Thread: Terminating...\n");
19  return 0;
20 }
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
Definition: synch.c:790
#define printf
Definition: config.h:203

Referenced by main().