123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186 |
- #ifndef _WINDOWS_SPAWN_H
- #define _WINDOWS_SPAWN_H
- #include <stdint.h>
- #include <stdlib.h>
- #define WIN32_LEAN_AND_MEAN
- #include <windows.h>
- extern const char ** prepare_spawn (const char * const *argv,
- char **mem_to_free);
- extern char * compose_command (const char * const *argv)
- _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE;
- extern char * compose_envblock (const char * const *envp)
- _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE;
- struct IHANDLE
- {
-
- HANDLE handle;
-
- unsigned short flags;
- #define KEEP_OPEN_IN_CHILD 0x100
- #define KEEP_OPEN_IN_PARENT 0x200
- #define DELAYED_DUP2_OLDFD 0x400
- #define DELAYED_DUP2_NEWFD 0x800
-
- int linked_fd;
- };
- struct inheritable_handles
- {
-
- size_t count;
-
- size_t allocated;
-
- struct IHANDLE *ih;
- };
- extern int init_inheritable_handles (struct inheritable_handles *inh_handles,
- bool duplicate);
- extern int compose_handles_block (const struct inheritable_handles *inh_handles,
- STARTUPINFOA *sinfo);
- extern void free_inheritable_handles (struct inheritable_handles *inh_handles);
- extern int convert_CreateProcess_error (DWORD error);
- extern intptr_t spawnpvech (int mode,
- const char *progname, const char * const *argv,
- const char * const *envp,
- const char *currdir,
- HANDLE stdin_handle, HANDLE stdout_handle,
- HANDLE stderr_handle);
- #endif
|