#include <process.h>
#include <windows.h>
#include <stdio.h>
Go to the source code of this file.
◆ READ_OVERLAPPED
◆ anonymous enum
Enumerator |
---|
PIPEBUF_INITIAL_SIZE | |
PIPEBUF_MAX_SIZE | |
Definition at line 52 of file pipespy.cpp.
◆ dumphex()
Definition at line 32 of file pipespy.cpp.
33{
35 for(
j = 0;
j <
len;
j += 16) {
36 for(
i = 0;
i < 16;
i++) {
39 else
41 }
42 for(
i = 0;
i < 16;
i++) {
45 else
47 }
49 }
50}
GLenum GLuint GLenum GLsizei const GLchar * buf
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
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 GLint GLint j
Referenced by ReadPipeCompletion().
◆ main()
Definition at line 152 of file pipespy.cpp.
153{
154 if(ac != 3) {
155 printf(
"syntax: pipespy serverpipe clientpipe\n");
156 return 0;
157 }
158
161
164 return 0;
165 }
166
169
173 return 0;
174 }
175
180 return 0;
181}
#define INVALID_HANDLE_VALUE
#define FILE_FLAG_OVERLAPPED
CRITICAL_SECTION g_OutputLock
void __cdecl pipeserver(void *param)
_CRTIMP uintptr_t __cdecl _beginthread(_In_ void(__cdecl *_StartAddress)(void *), _In_ unsigned _StackSize, _In_opt_ void *_ArgList)
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
#define PIPE_READMODE_BYTE
DWORD WINAPI GetLastError(void)
#define NMPWAIT_WAIT_FOREVER
#define PIPE_ACCESS_DUPLEX
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
◆ pipeserver()
Definition at line 116 of file pipespy.cpp.
117{
119
123
124 for(;;) {
126 printf(ReadOverlapped.
Server ?
"Server> Error %u accepting pipe connection\n" :
"Client> Error %u accepting pipe connection\n",
128 break;
129 }
130
132 printf(ReadOverlapped.
Server ?
"Server> Connected\n" :
"Client> Connected\n");
133
136
137 do {
140
142 printf(ReadOverlapped.
Server ?
"Server> Disconnected\n" :
"Client> Disconnected\n");
143 }
144
145 printf(ReadOverlapped.
Server ?
"Server> Shutting down\n" :
"Client> Shutting down\n");
146
150}
BOOL WINAPI ReadFileEx(IN HANDLE hFile, IN LPVOID lpBuffer, IN DWORD nNumberOfBytesToRead OPTIONAL, IN LPOVERLAPPED lpOverlapped, IN LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine)
BOOL WINAPI ConnectNamedPipe(IN HANDLE hNamedPipe, IN LPOVERLAPPED lpOverlapped)
BOOL WINAPI DisconnectNamedPipe(HANDLE hNamedPipe)
VOID WINAPI ReadPipeCompletion(DWORD dwErrorCode, DWORD dwNumberOfBytesTransferred, LPOVERLAPPED lpOverlapped)
OVERLAPPED ReadOverlapped
DWORD WINAPI SleepEx(IN DWORD dwMilliseconds, IN BOOL bAlertable)
#define ERROR_PIPE_CONNECTED
Referenced by main().
◆ ReadPipeCompletion()
Definition at line 76 of file pipespy.cpp.
77{
80
82
83 if(dwErrorCode) {
84 printf(ReadOverlapped->
Server ?
"Server> Error %u reading from pipe\n" :
"Client> Error %u reading from pipe\n", dwErrorCode);
86 } else {
88
90 printf(ReadOverlapped->
Server ?
"Server> [%02u:%02u:%02u.%03u] Received %u byte message:\n" :
"Client> [%02u:%02u:%02u.%03u] Received %u byte message:\n",
92 dumphex(ReadOverlapped->
Buffer, (
int)dwNumberOfBytesTransferred, -1);
94 }
95
97
99
100 if(!WriteOverlapped)
101 printf(ReadOverlapped->
Server ?
"Server> Out of memory\n" :
"Client> Out of memory\n");
102 else {
108 }
109
110 if(!dwErrorCode) {
113 }
114}
BOOL WINAPI WriteFileEx(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, IN LPOVERLAPPED lpOverlapped, IN LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine)
VOID WINAPI GetLocalTime(OUT LPSYSTEMTIME lpSystemTime)
#define memcpy(s1, s2, n)
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED lpOverlapped
void dumphex(const char *buf, int len, int pos)
VOID WINAPI WritePipeCompletion(DWORD dwErrorCode, DWORD dwNumberOfBytesTransferred, LPOVERLAPPED lpOverlapped)
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
struct _OVERLAPPED OVERLAPPED
struct _OVERLAPPED * LPOVERLAPPED
Referenced by pipeserver(), and ReadPipeCompletion().
◆ WritePipeCompletion()
◆ g_DebugClientPipe
◆ g_DebugServerPipe
◆ g_OutputLock