ReactOS 0.4.16-dev-92-g0c2cdca
terminate.c File Reference
#include <windows.h>
#include <stdio.h>
#include <ndk/ntndk.h>
#include <debug.h>
Include dependency graph for terminate.c:

Go to the source code of this file.

Macros

#define UNICODE
 
#define WIN32_NO_STATUS
 
#define NTOS_MODE_USER
 
#define NDEBUG
 

Functions

static NTSTATUS WINAPI thread_1 (PVOID Param)
 
int main (int argc, char *argv[])
 

Variables

static volatile DWORD z
 
static volatile DWORD x =0
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 8 of file terminate.c.

◆ NTOS_MODE_USER

#define NTOS_MODE_USER

Definition at line 5 of file terminate.c.

◆ UNICODE

Definition at line 1 of file terminate.c.

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 2 of file terminate.c.

Function Documentation

◆ main()

int main ( int argc  ,
char argv[] 
)

Definition at line 32 of file terminate.c.

33{
37 DWORD z = 0;
38
39 context.ContextFlags=CONTEXT_CONTROL;
40
41 while (z < 50)
42 {
43 z++;
45 0x1000,
47 NULL,
48 0,
49 &thread_id);
50
51 if(!thread)
52 {
53 printf("Error: could not create thread ...\n");
54 ExitProcess(0);
55 }
56
57 Sleep(1000);
58
59 printf("T");
60 if ((z % 5) == 0)
61 {
63 }
64 printf("C");
66 printf("S");
68 printf("R");
71 }
72
73 ExitProcess(0);
74 return(0);
75}
static HANDLE thread
Definition: service.c:33
#define NULL
Definition: types.h:112
VOID WINAPI ExitProcess(IN UINT uExitCode)
Definition: proc.c:1487
DWORD WINAPI ResumeThread(IN HANDLE hThread)
Definition: thread.c:567
DWORD WINAPI SuspendThread(IN HANDLE hThread)
Definition: thread.c:642
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:137
BOOL WINAPI TerminateThread(IN HANDLE hThread, IN DWORD dwExitCode)
Definition: thread.c:587
BOOL WINAPI GetThreadContext(IN HANDLE hThread, OUT LPCONTEXT lpContext)
Definition: thread.c:501
unsigned long DWORD
Definition: ntddk_ex.h:95
#define printf
Definition: freeldr.h:97
GLdouble GLdouble z
Definition: glext.h:5874
static DWORD thread_id
Definition: protocol.c:159
#define CONTEXT_CONTROL
Definition: nt_native.h:1369
Definition: http.c:7252
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
Definition: synch.c:790
static NTSTATUS WINAPI thread_1(PVOID Param)
Definition: terminate.c:15
DWORD(WINAPI * LPTHREAD_START_ROUTINE)(LPVOID)
Definition: winbase.h:729

◆ thread_1()

static NTSTATUS WINAPI thread_1 ( PVOID  Param)
static

Definition at line 15 of file terminate.c.

16{
17 DWORD y=0;
18
19 for(;;)
20 {
21 z++;
22 if(x>50)
23 {
24 Sleep(100);
25 x=0;y++;
26 if(y==3) return(0);
27 }
28 }
29}
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548

Referenced by main().

Variable Documentation

◆ x

volatile DWORD x =0
static

Definition at line 12 of file terminate.c.

◆ z

volatile DWORD z
static

Definition at line 11 of file terminate.c.