Another unkown error

Any ideas what I should look for from this? I've tried using breakpoints to find where it complains but that didn't yield much - Got to exe.Printf( wxT( "%s" ), pe32.szExeFile ); but I didn't have the patience to check each iteration ( too many system processes ).
1
2
3
4
5
#0 773E2353	ntdll!LdrQueryProcessModuleInformation() (C:\Windows\system32\ntdll.dll:??)
#1 00000000	0x0028e460 in ??() (??:??)
#2 00000000	0x0028e3e0 in ??() (??:??)
#3 00000000	0x0028e3b0 in ??() (??:??)
#4 77420CAF	ntdll!RtlNumberOfSetBitsUlongPtr() (C:\Windows\system32\ntdll.dll:??) 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
bool LaunchExe( xStr path )
{
#ifdef __WXMSW__
	STARTUPINFO si;
    PROCESS_INFORMATION pi;
	return ( CreateProcess( path.data(), ( WCHAR* )"",
		NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi ) );
#else
	return false;
#endif
}
uHandle GetAppHandle( const xStr appExe )
{
	uHandle ah = NULL;
#ifdef __WXMSW__
	xStr exe;
	PROCESSENTRY32 pe32;
	pe32.dwSize = sizeof( pe32 );
	HANDLE shot = CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS, 0 );
	Process32First( shot, &pe32 );
	do {
		exe.Printf( wxT( "%s" ), pe32.szExeFile );
		if ( exe.CmpNoCase( appExe ) == 0 ) {
			ah = OpenProcess( PROCESS_ALL_ACCESS,
								FALSE, pe32.th32ProcessID );
			break;
		}
	} while ( Process32Next( shot, &pe32 ) );
#endif
	return ah;
}
void G::NewHook( void )
{
	++isHooked;
	if ( isHooked > 1 ) return;
	xStr binPath = binPath_TXT->GetValue();
	xStr binFile = binBind_TXT->GetValue();
	xStr text = binPath + gGetSlash() + binFile;
	if ( hookApp )
	{
		appHandle = GetAppHandle( binFile );
		if ( appHandle == NULL )
		{
			if ( LaunchExe( text ) )
				appHandle = GetAppHandle( binFile );
		}
		if ( appHandle == NULL ) --isHooked;
	}
	else
	{
		if ( !wxFileExists( text ) ) --isHooked;
		else bin_BF.Open( text );
	}
}
but I didn't have the patience to check each iteration ( too many system processes ).

That's the debugging process - learn to live with that kind of work ;o)

What kind of error occurs?
Well the test situation is the automatic launching of PCSX2 from a known directory, when I comment out the first test of appHandle == NULL everything is dandy but no launched process. As stated before I tried tracking the issue source but had no errors until the above call stack. I have work later so I plan to do the individual iterations after that. In the meantime I was hoping that someone with experience in this area could point out any potential issues.
Never mind I found what I needed:
1
2
3
4
5
6
7
8
9
bool LaunchExe( xStr path )
{
	xStr text = wxT( '"' ) + path + wxT( '"' );
#ifdef __WXMSW__
	return ( WinExec( text.mb_str().data(), SW_HIDE ) );
#else
	return false;
#endif
}
Topic archived. No new replies allowed.