CeCreateProcess (RAPI)

This function is used to run a new program. It creates a new process and its primary thread. The new process executes the specified executable file.

CeCreateProcess is a remote application interface (RAPI), which enables an application running on a desktop computer to make function calls on a Windows CE–based device.

BOOL CeCreateProcess(
LPCWSTR lpApplicationName, 
LPCWSTR lpCommandLine, 
LPSECURITY_ATTRIBUTES lpProcessAttributes, 
LPSECURITY_ATTRIBUTES lpThreadAttributes, 
BOOL bInheritHandles, 
DWORD dwCreationFlags, 
LPVOID lpEnvironment, 
LPWSTR lpCurrentDirectory, 
LPSTARTUPINFO lpStartupInfo, 
LPPROCESS_INFORMATION lpProcessInformation); 

Parameters

  • lpApplicationName
    [in] Long pointer to a null-terminated string that specifies the module to execute.

    The string can specify the full path and filename of the module to execute to execute or it can specify a partial name.

  • lpCommandLine
    [in] Long pointer to a null-terminated string that specifies the command line to execute.

    The lpCommandLine parameter can be NULL. In that case, the function uses the string pointed to by lpApplicationName as the command line.

    If lpCommandLine is non-NULL, lpApplicationName specifies the module to execute, and lpCommandLine specifies the command line. C runtime processes can use the argc and argv arguments.

    If lpApplicationName does not contain an extension, .EXE is assumed. If the filename ends in a period (.) with no extension, or the filename contains a path, .EXE is not appended.

    If the filename does not contain a directory path, Windows CE versions 2.10 and later search for the executable file in the following sequence:

    • The windows (\windows) directory
    • The root (\) directory of the device
    • An OEM-dependent directory
    • The OEM-defined shell (\ceshell) directory — Platform Builder users only

    Windows CE versions 1.0 through 2.01 search for the executable file in the following sequence:

    • The root of the PC Card if it exists
    • The windows (\windows) directory
    • The root (\ ) directory of the device
  • lpProcessAttributes
    [in] Not supported; set to NULL.

  • lpThreadAttributes
    [in] Not supported; set to NULL.

  • bInheritHandles
    [in] Not supported; set to FALSE.

  • dwCreationFlags
    [in] Specifies additional flags that control the priority class and the creation of the process. For Windows CE versions 1.0 and later, specify either zero or the following flag:

    Value Description
    CREATE_SUSPENDED The primary thread of the new process is created in a suspended state, and does not run until the ResumeThread function is called.

    For Windows CE versions 2.0 and later, you can specify one of the following flags in addition to CREATE_SUSPENDED:

    Value Description
    DEBUG_PROCESS If this flag is set, the calling process is treated as a debugger, and the new process is a process being debugged. Child processes of the new process are also debugged. The system notifies the debugger of all debug events that occur in the process being debugged.
      If you create a process with this flag set, only the calling thread — the thread that called CreateProcess —can call the WaitForDebugEvent function.
    DEBUG_ONLY_THIS_PROCESS If this flag is set, the calling process is treated as a debugger, and the new process is a process being debugged. No child processes of the new process are debugged. The system notifies the debugger of all debug events that occur in the process being debugged.
  • lpEnvironment
    [in] Not supported; set to NULL.

  • lpCurrentDirectory
    [in] Not supported; set to NULL.

  • lpStartupInfo
    [in] Not supported; set to NULL.

  • lpProcessInformation
    [out] Long pointer to a PROCESS_INFORMATION structure that receives identification information about the new process.

Return Values

Nonzero indicates success. Zero indicates failure. To determine if a function failed because of RAPI errors, call CeRapiGetError. To determine if a function failed because of non-RAPI errors, call CeGetLastError.

Remarks

When writing applications for Windows CE versions 1.0 and 1.01, use the PegCreateProcess function.

Requirements

Runs On Versions Defined in Include Link to
Windows CE OS 2.0 and later Rapi.h    

See Also

CeGetLastError, CeRapiGetError, CreateProcess, ResumeThread, WaitForDebugEvent, PROCESS_INFORMATION

 Last updated on Tuesday, July 13, 2004

© 1992-2000 Microsoft Corporation. All rights reserved.