Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com X-WM-Posted-At: avacado.atomice.net; Sun, 8 Sep 02 17:25:04 +0100 From: "Chris January" To: "Cygwin AT Cygwin DOT Com" Subject: Problem using Unicode Windows API with g++ Date: Sun, 8 Sep 2002 17:25:00 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 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 #include 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/