13 HANDLE h_process_in_parent;
27 fprintf(
stderr,
"%lu: Could not duplicate my own process handle.\n",
38 memset( &si, 0,
sizeof( si ) );
50 fprintf(
stderr,
"%lu: Failed to wait for child process to terminate.\n",
62 fprintf(
stderr,
"%lu: Could not duplicate my handle into the parent.\n",
#define GetCurrentProcess()
BOOL WINAPI DuplicateHandle(IN HANDLE hSourceProcessHandle, IN HANDLE hSourceHandle, IN HANDLE hTargetProcessHandle, OUT LPHANDLE lpTargetHandle, IN DWORD dwDesiredAccess, IN BOOL bInheritHandle, IN DWORD dwOptions)
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
#define sprintf(buf, format,...)
_Check_return_ int __cdecl atoi(_In_z_ const char *_Str)
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
DWORD WINAPI GetCurrentProcessId(void)
#define DUPLICATE_SAME_ACCESS