#include <windows.h>
#include <string.h>
#include <stdio.h>
Go to the source code of this file.
◆ dprintf()
Definition at line 14 of file mutex.c.
15{
18
23}
ACPI_SIZE strlen(const char *String)
BOOL WINAPI DECLSPEC_HOTPATCH WriteConsoleA(IN HANDLE hConsoleOutput, IN CONST VOID *lpBuffer, IN DWORD nNumberOfCharsToWrite, OUT LPDWORD lpNumberOfCharsWritten, LPVOID lpReserved)
int __cdecl vsprintf(char *_Dest, const char *_Format, va_list _Args)
◆ main()
Definition at line 88 of file mutex.c.
89{
92
96
97 dprintf(
"Calling CreateMutex()\n");
100 {
102 return 0;
103 }
104 dprintf(
"CreateMutex() succeeded!\n");
105
108
109 dprintf(
"Calling WaitForMultipleObject()\n");
111 dprintf(
"WaitForMultipleObject() Error: %lu\n", dwError);
112
115
117
118 dprintf(
"Main thread done!\n");
119
120 return 0;
121}
HANDLE WINAPI GetStdHandle(IN DWORD nStdHandle)
BOOL WINAPI AllocConsole(VOID)
#define INVALID_HANDLE_VALUE
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)
DWORD WINAPI thread1(LPVOID crap)
DWORD WINAPI thread2(LPVOID crap)
DWORD WINAPI WaitForMultipleObjects(IN DWORD nCount, IN CONST HANDLE *lpHandles, IN BOOL bWaitAll, IN DWORD dwMilliseconds)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateMutexW(IN LPSECURITY_ATTRIBUTES lpMutexAttributes OPTIONAL, IN BOOL bInitialOwner, IN LPCWSTR lpName OPTIONAL)
#define STD_OUTPUT_HANDLE
DWORD WINAPI GetLastError(void)
◆ thread1()
Definition at line 26 of file mutex.c.
27{
30
32
33 for (
i = 0;
i < 10;
i++)
34 {
37 {
38 dprintf(
"Thread2: WaitForSingleObject failed!\n");
39 return 1;
40 }
42 {
43 dprintf(
"Thread2: WaitForSingleObject returned WAIT_ABANDONED_0\n");
44 }
45
50 }
51
53
54 return 1;
55}
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
BOOL WINAPI DECLSPEC_HOTPATCH ReleaseMutex(IN HANDLE hMutex)
Referenced by main().
◆ thread2()
Definition at line 57 of file mutex.c.
58{
62
63 for (
i = 0;
i < 10;
i++)
64 {
67 {
68 dprintf(
"Thread2: WaitForSingleObject failed!\n");
69 return 1;
70 }
72 {
73 dprintf(
"Thread2: WaitForSingleObject returned WAIT_ABANDONED_0\n");
74 }
75
80 }
81
83
84 return 1;
85}
Referenced by main().
◆ dwCounter
◆ hMutex
Definition at line 11 of file mutex.c.
Referenced by _tWinMain(), CloseSharedMemory(), ATL::CMutex::Create(), CreateProfileMutex(), CSafeMutex::Enter(), K32CreateDBMonMutex(), main(), NPCancelConnection(), NPEnumResource(), NPGetConnection(), ATL::CMutex::Open(), ParseCmdAndExecute(), ReleaseMutex(), StoreConnectionInfo(), TF_IsCtfmonRunning(), thread1(), thread2(), UManStartDlg(), and wWinMain().
◆ hThread
◆ InputHandle
◆ OutputHandle