Changeset 1975 for trunk/src


Ignore:
Timestamp:
Dec 5, 1999, 11:02:31 AM (26 years ago)
Author:
sandervl
Message:

Changed definition of lstrcpy(n)AtoW/WtoA + CreateProcessA logging change

Location:
trunk/src/kernel32
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kernel32/heapstring.cpp

    r1670 r1975  
    1 /* $Id: heapstring.cpp,v 1.19 1999-11-09 19:22:32 sandervl Exp $ */
     1/* $Id: heapstring.cpp,v 1.20 1999-12-05 10:02:30 sandervl Exp $ */
    22
    33/*
     
    509509
    510510int WIN32API lstrcpynWtoA(LPSTR  astring,
    511                           LPWSTR ustring,
     511                          LPCWSTR ustring,
    512512                          int    unilen)
    513513{
     
    588588// @@@PH 0 termination is NOT necessarily included !
    589589int WIN32API lstrcpynAtoW(LPWSTR unicode,
    590                           LPSTR  ascii,
     590                          LPCSTR  ascii,
    591591                          int    asciilen)
    592592{
     
    623623    }
    624624
    625     in_buf        = ascii;
     625    in_buf        = (LPSTR)ascii;
    626626
    627627    //@@@PH what's this?
     
    679679 *****************************************************************************/
    680680
    681 LPSTR WIN32API lstrcpyWtoA(LPSTR ascii, LPWSTR unicode)
     681LPSTR WIN32API lstrcpyWtoA(LPSTR ascii, LPCWSTR unicode)
    682682{
    683683  //@@@PH huh? wuz dat?
    684684  if (unicode == NULL)
    685685  {
    686     if (unicode != NULL) unicode[0] = 0; //CB: set at least end
     686    if (unicode != NULL) ((LPWSTR)unicode)[0] = 0; //CB: set at least end
    687687    return NULL;
    688688  }
     
    712712 *****************************************************************************/
    713713
    714 LPWSTR WIN32API lstrcpyAtoW(LPWSTR unicode, LPSTR ascii)
     714LPWSTR WIN32API lstrcpyAtoW(LPWSTR unicode, LPCSTR ascii)
    715715{
    716716  /* achimha for security, strlen might trap if garbage in */
  • trunk/src/kernel32/wprocess.cpp

    r1924 r1975  
    1 /* $Id: wprocess.cpp,v 1.54 1999-12-01 18:40:49 sandervl Exp $ */
     1/* $Id: wprocess.cpp,v 1.55 1999-12-05 10:02:31 sandervl Exp $ */
    22
    33/*
     
    624624//******************************************************************************
    625625//******************************************************************************
    626 BOOL WIN32API CreateProcessA(LPCSTR lpszImageName, LPSTR lpszCommandLine,
    627                        PSECURITY_ATTRIBUTES arg3,
    628                              PSECURITY_ATTRIBUTES arg4, BOOL arg5, DWORD arg6,
    629                              PVOID arg7, LPCSTR arg8, LPSTARTUPINFOA arg9,
    630                              LPPROCESS_INFORMATION arg10)
     626BOOL WINAPI CreateProcessA( LPCSTR lpApplicationName, LPSTR lpCommandLine,
     627                            LPSECURITY_ATTRIBUTES lpProcessAttributes,
     628                            LPSECURITY_ATTRIBUTES lpThreadAttributes,
     629                            BOOL bInheritHandles, DWORD dwCreationFlags,
     630                            LPVOID lpEnvironment, LPCSTR lpCurrentDirectory,
     631                            LPSTARTUPINFOA lpStartupInfo,
     632                            LPPROCESS_INFORMATION lpProcessInfo )
    631633{
    632634 BOOL  rc;
     
    634636 BOOL  fAllocStr = FALSE;
    635637
    636     if(O32_CreateProcess(lpszImageName, lpszCommandLine, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10) == TRUE)
     638    dprintf(("KERNEL32: CreateProcessA %s cline:%s inherit:%d cFlags:%x Env:%x CurDir:%s StartupFlags:%x\n",
     639            lpApplicationName, lpCommandLine, bInheritHandles, dwCreationFlags,
     640            lpEnvironment, lpCurrentDirectory, lpStartupInfo));
     641
     642    if(O32_CreateProcess(lpApplicationName, lpCommandLine, lpProcessAttributes,
     643                         lpThreadAttributes, bInheritHandles, dwCreationFlags,
     644                         lpEnvironment, lpCurrentDirectory, lpStartupInfo,
     645                         lpProcessInfo) == TRUE)
    637646        return(TRUE);
    638647
    639648    //probably a win32 exe, so run it in the pe loader
    640     if(lpszImageName) {
    641          if(lpszCommandLine) {
    642                 cmdline = (char *)malloc(strlen(lpszImageName)+strlen(lpszCommandLine) + 16);
    643                 sprintf(cmdline, "PE.EXE %s %s", lpszImageName, lpszCommandLine);
     649    if(lpApplicationName) {
     650       if(lpCommandLine) {
     651          cmdline = (char *)malloc(strlen(lpApplicationName)+strlen(lpCommandLine) + 16);
     652          sprintf(cmdline, "PE.EXE %s %s", lpApplicationName, lpCommandLine);
    644653                fAllocStr = TRUE;
    645654         }
    646655         else {
    647                 cmdline = (char *)malloc(strlen(lpszImageName) + 16);
    648                 sprintf(cmdline, "PE.EXE %s", lpszImageName);
     656          cmdline = (char *)malloc(strlen(lpApplicationName) + 16);
     657          sprintf(cmdline, "PE.EXE %s", lpApplicationName);
    649658                fAllocStr = TRUE;
    650659         }
    651660    }
    652661    else {
    653         cmdline = (char *)malloc(strlen(lpszCommandLine) + 16);
    654         sprintf(cmdline, "PE.EXE %s", lpszCommandLine);
     662        cmdline = (char *)malloc(strlen(lpCommandLine) + 16);
     663        sprintf(cmdline, "PE.EXE %s", lpCommandLine);
    655664        fAllocStr = TRUE;
    656665    }
    657666    dprintf(("KERNEL32:  CreateProcess %s\n", cmdline));
    658     rc = O32_CreateProcess("PE.EXE", (LPCSTR)cmdline, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10);
     667    rc = O32_CreateProcess("PE.EXE", (LPCSTR)cmdline,lpProcessAttributes,
     668                         lpThreadAttributes, bInheritHandles, dwCreationFlags,
     669                         lpEnvironment, lpCurrentDirectory, lpStartupInfo,
     670                         lpProcessInfo);
    659671    if(fAllocStr)
    660672        free(cmdline);
    661673
    662     dprintf(("KERNEL32:  CreateProcess returned %d\n", rc));
     674    if(lpProcessInfo)
     675      dprintf(("KERNEL32:  CreateProcess returned %d hPro:%x hThr:%x pid:%x tid:%x\n",
     676               rc, lpProcessInfo->hProcess, lpProcessInfo->hThread,
     677                   lpProcessInfo->dwProcessId,lpProcessInfo->dwThreadId));
     678    else
     679      dprintf(("KERNEL32:  CreateProcess returned %d\n", rc));
    663680    return(rc);
    664681}
Note: See TracChangeset for help on using the changeset viewer.