10#define WIN32_LEAN_AND_MEAN
15#define PIPEREAD_VERSION "0.3"
16#define PIPEREAD_NOPIPE (-101)
19#ifndef FILE_FLAG_FIRST_PIPE_INSTANCE
20#define FILE_FLAG_FIRST_PIPE_INSTANCE 0x00080000
118 fprintf(
stderr,
"Could not open pipe: 20 second wait timed out.");
181 fprintf(
stderr,
"Example: piperead -c \\\\.\\pipe\\kdbg | log2lines -c\n\n");
187 const char* pipe_name;
188 const char* clientMode;
195 clientMode = *++
argv;
196 if (
strcmp(clientMode,
"-c") != 0) {
204 if (
strcmp(pipe_name,
"-h") == 0) {
217 if ( pipe_name[0] ==
'\\' ) {
#define ReadFile(a, b, c, d, e)
#define INVALID_HANDLE_VALUE
char *CDECL strerror(int err)
int CDECL fclose(FILE *file)
int WINAPIV fprintf(FILE *file, const char *format,...)
FILE *CDECL fopen(const char *path, const char *mode)
int CDECL fgetc(FILE *file)
int CDECL fputc(int c, FILE *file)
int CDECL setvbuf(FILE *file, char *buf, int mode, size_t size)
size_t CDECL fwrite(const void *ptr, size_t size, size_t nmemb, FILE *file)
_ACRTIMP int __cdecl strcmp(const char *, const char *)
#define ERROR_FILE_NOT_FOUND
#define FILE_FLAG_FIRST_PIPE_INSTANCE
static void print_error(DWORD win32_error)
static int fileClient(const char *path)
static int pipeServer(char *path)
static int pipeClient(char *path)
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
DWORD WINAPI GetLastError(void)
#define PIPE_ACCESS_DUPLEX
#define ERROR_BROKEN_PIPE
#define ERROR_PIPE_LISTENING