Mail Archives: cygwin/2002/09/08/12:50:41
When I compile and run the program below with g++ version 2 or 3 under
Cygwin it crashes. It makes no difference whether I use the -mno-cygwin
parameter or not. The same program using the ANSI APIs doesn't crash. What
am I doing wrong?
Chris
---
#define UNICODE
#include <windows.h>
#include <stdio.h>
BOOL LogonAndRun (WCHAR * appname,
WCHAR * UserName,
WCHAR * Domain,
WCHAR * Password);
int
main (int argc,
char *argv[])
{
LogonAndRun (L"cmd.exe", L"", L"",
L"");
}
BOOL
LogonAndRun (WCHAR * appname,
WCHAR * UserName,
WCHAR * Domain,
WCHAR * Password)
{
STARTUPINFO sui;
PROCESS_INFORMATION pi;
ZeroMemory ((PVOID) & sui, sizeof (sui));
sui.cb = sizeof (sui);
sui.dwFlags = 0;
BOOL c = CreateProcessW (NULL,
appname,
NULL,
NULL,
1,
0,
NULL,
NULL,
&sui,
&pi);
return 1;
}
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
- Raw text -