Click here to Skip to main content
15,911,141 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionGUI Pin
Sarriss3-Oct-08 3:59
Sarriss3-Oct-08 3:59 
AnswerRe: GUI Pin
Mark Salsbery3-Oct-08 4:47
Mark Salsbery3-Oct-08 4:47 
GeneralRe: GUI Pin
Sarriss3-Oct-08 4:53
Sarriss3-Oct-08 4:53 
GeneralRe: GUI Pin
led mike3-Oct-08 5:59
led mike3-Oct-08 5:59 
GeneralRe: GUI Pin
Mark Salsbery3-Oct-08 6:12
Mark Salsbery3-Oct-08 6:12 
GeneralRe: GUI Pin
Sarriss3-Oct-08 6:33
Sarriss3-Oct-08 6:33 
GeneralRe: GUI Pin
Mark Salsbery3-Oct-08 6:57
Mark Salsbery3-Oct-08 6:57 
QuestionFailed to retrieve process arguments in 64 bit Windows Pin
Jack Rong3-Oct-08 3:59
Jack Rong3-Oct-08 3:59 
I have coded application to retrieve any running process's arguments and worked very well in Win32, but falied in 64 bit Windows(x64).

The approache is to use NtQueryInformationProcess to get PROCESS_BASIC_INFORMATION which has the data structure like:
typedef struct _PROCESS_BASIC_INFORMATION {
PVOID Reserved1;
PPEB PebBaseAddress;
PVOID Reserved2[2];
ULONG_PTR UniqueProcessId;
PVOID Reserved3;
} PROCESS_BASIC_INFORMATION;

and then use ReadProcessMemory() to get dwInfoBlockAddress in PEB2, like
struct _PEB2
{
DWORD dwFiller[4];
DWORD dwInfoBlockAddress;
} PEB2;

and so on

Here is the partial sample code:

NtQueryInformationProcess)(hProcess, ProcessBasicInformation,
&pbi, sizeof(pbi), &dwSize);

ReadProcessMemory(hProcess, (LPCVOID)pbi.PebBaseAddress,
&PEB2, sizeof(PEB2), &dwSize);
ReadProcessMemory(hProcess, (LPCVOID) PEB2.dwInfoBlockAddress,
&Block, sizeof(Block), &dwSize);
cmdLine = (TCHAR *) malloc (Block.wMaxLength+10);
ReadProcessMemory(hProcess, (LPCVOID) Block.dwCmdLineAddress,
cmdLine, Block.wMaxLength+10, &dwSize);

It failed in getting dwInfoBlockAddress of PEB2. Can any of you provide some hints/helps. Maybe the memory structures/address are totally different between 32 and 64 bit data models....??? The problem is there is no useful documents I could look at.

Thanks a lot.

Jack Rong
QuestionHow to get windows driver kit Pin
Deepu Antony3-Oct-08 3:05
Deepu Antony3-Oct-08 3:05 
AnswerRe: How to get windows driver kit Pin
Matthew Faithfull3-Oct-08 3:11
Matthew Faithfull3-Oct-08 3:11 
GeneralRe: How to get windows driver kit Pin
Deepu Antony3-Oct-08 3:26
Deepu Antony3-Oct-08 3:26 
AnswerRe: How to get windows driver kit Pin
Matthew Faithfull3-Oct-08 3:31
Matthew Faithfull3-Oct-08 3:31 
GeneralRe: How to get windows driver kit Pin
Deepu Antony3-Oct-08 3:39
Deepu Antony3-Oct-08 3:39 
GeneralRe: How to get windows driver kit Pin
Matthew Faithfull3-Oct-08 3:47
Matthew Faithfull3-Oct-08 3:47 
GeneralRe: How to get windows driver kit Pin
Deepu Antony3-Oct-08 3:54
Deepu Antony3-Oct-08 3:54 
AnswerRe: How to get windows driver kit Pin
Saurabh.Garg3-Oct-08 18:23
Saurabh.Garg3-Oct-08 18:23 
GeneralRe: How to get windows driver kit Pin
cofi++4-Oct-08 9:08
cofi++4-Oct-08 9:08 
GeneralRe: How to get windows driver kit Pin
Saurabh.Garg4-Oct-08 15:03
Saurabh.Garg4-Oct-08 15:03 
QuestionHow can I found which control in a dialog box is focused? Pin
Joseph Marzbani3-Oct-08 2:06
Joseph Marzbani3-Oct-08 2:06 
AnswerRe: How can I found which control in a dialog box is focused? Pin
Rajesh R Subramanian3-Oct-08 2:10
professionalRajesh R Subramanian3-Oct-08 2:10 
QuestionRe: How can I found which control in a dialog box is focused? Pin
CPallini3-Oct-08 2:22
mveCPallini3-Oct-08 2:22 
JokeRe: How can I found which control in a dialog box is focused? Pin
Rajesh R Subramanian3-Oct-08 2:26
professionalRajesh R Subramanian3-Oct-08 2:26 
GeneralRe: How can I found which control in a dialog box is focused? Pin
CPallini3-Oct-08 2:32
mveCPallini3-Oct-08 2:32 
JokeRe: How can I found which control in a dialog box is focused? Pin
David Crow3-Oct-08 2:40
David Crow3-Oct-08 2:40 
GeneralRe: How can I found which control in a dialog box is focused? Pin
CPallini6-Oct-08 0:31
mveCPallini6-Oct-08 0:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.