Using wince 6, I added the reg entries to redirect the console to COM1
and to run Subproject1 at boot. Now, Subproject1 will execute CMD
Here is the code!
result = CreateProcess(TEXT("cmd.exe"), NULL, NULL, NULL, 0,
CREATE_NEW_CONSOLE, NULL, NULL, NULL, &new_cmd_exe);
[HKEY_LOCAL_MACHINE\Drivers\Console]
"OutputTo"=dword:1
[HKEY_LOCAL_MACHINE\Drivers\Console]
"COMSpeed"=dword:5c3
[HKEY_LOCAL_MACHINE\init]
"Launch60"="Subproject1.exe"
"Depend60"=hex:14,00, 1e,00
This is what I get on boot on COM1. Note that I am using COM1 for all
boot messages and now want to use it for the shell. You can see below
how I got an invalid handle. Any help is appreciated
OSAXST1: >>> Loading Module 'coredll.dll' (0x83FEA4F8) at address
0x40010000-0x4
0085000 in Process 'cmd.exe' (0x83F34BE4)
OSAXST1: >>> Loading Module 'cmd.exe' (0x83F34BE4) at address
0x00010000-0x00026
000 in Process 'cmd.exe' (0x83F34BE4)
Heap Statistics at 0x40080740
Console redirected to COM1 for process 0xE50002
!!DecodeAPI: invalid handle! (h = ffffffff, iApiSet = 00000007 'NONE',
pActvProc
->dwId = 00e50002)
Invalid handle: Set=7 'W32H' Method=3
ObjectCall: returning 8027fbf0
OSAXST1: <<< Unloading Module 'coredll.dll' (0x83FEA4F8) at address
0x40010000-0
x40085000 in Process 'Subproject1.eConsole redirected to COM1 for
process 0xE700
02
!!DecodeAPI: invalid handle! (h = ffffffff, iApiSet = 00000007 'NONE',
pActvProc
->dwId = 00e70002)
Invalid handle: Set=7 'W32H' Method=3
ObjectCall: returning 8027fbf0
MessageBox - Customizeable
xe' (0x83F340C0)
OSAXST1: <<< Unloading Module 'coredll.dll' (0x83FEA4F8) at address
0x40010000-0
x40085000 in Process 'cmd.exe' (0x83F34BE4)
OSAXST1: <<< Unloading Module 'Subproject1.exe' (0x83F340C0) at address
0x000100
00-0x00013000 in Process 'Subproject1.exe' (0x83F340C0)
OSAXST1: <<< Unloading Module 'cmd.exe' (0x83F34BE4) at address
0x00010000-0x000
26000 in Process 'cmd.exe' (0x83F34BE4)