22 char *szCmdLine =
NULL;
23 char *szComSpec =
NULL;
30 szComSpec =
getenv(
"COMSPEC");
35 return (szComSpec ==
NULL) ? 0 : 1;
41 strcat(cmd_exe,
"\\cmd.exe");
46 if (szCmdLine ==
NULL)
53 strcat(szCmdLine, szComSpec);
54 strcat(szCmdLine,
"\" /C ");
59 memset(&StartupInfo, 0,
sizeof(StartupInfo));
60 StartupInfo.
cb =
sizeof(StartupInfo);
101 wchar_t *comspec =
NULL;
113 return (comspec ==
NULL) ? 0 : 1;
137 memset(&startup_info, 0,
sizeof(startup_info));
138 startup_info.
cb =
sizeof(startup_info);
int system(const char *command)
int CDECL _wsystem(const wchar_t *cmd)
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
DWORD WINAPI GetFileAttributesA(LPCSTR lpFileName)
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
UINT WINAPI GetSystemDirectoryA(OUT LPSTR lpBuffer, IN UINT uSize)
BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessW(LPCWSTR lpApplicationName, LPWSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCWSTR lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation)
BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessA(LPCSTR lpApplicationName, LPSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCSTR lpCurrentDirectory, LPSTARTUPINFOA lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation)
wchar_t *CDECL _wgetenv(const wchar_t *name)
char *CDECL getenv(const char *name)
int CDECL _set_errno(int value)
_ACRTIMP size_t __cdecl wcslen(const wchar_t *)
_ACRTIMP intptr_t __cdecl _cwait(int *, intptr_t, int)
_ACRTIMP size_t __cdecl strlen(const char *)
void _dosmaperr(unsigned long oserrcode)
#define INVALID_FILE_ATTRIBUTES
DWORD WINAPI GetLastError(void)
#define STARTF_USESHOWWINDOW
#define CREATE_NEW_PROCESS_GROUP