Click here to Skip to main content
15,396,019 members
Home / Discussions / Windows Development
   

Windows Development

 
GeneralRe: Disable Hardware in W10 Pin
Brisingr Aerowing4-Sep-15 15:11
professionalBrisingr Aerowing4-Sep-15 15:11 
GeneralRe: Disable Hardware in W10 Pin
GenJerDan6-Sep-15 5:40
MemberGenJerDan6-Sep-15 5:40 
GeneralRe: Disable Hardware in W10 Pin
Brisingr Aerowing7-Jan-16 0:04
professionalBrisingr Aerowing7-Jan-16 0:04 
GeneralRe: Disable Hardware in W10 Pin
GenJerDan7-Jan-16 3:10
MemberGenJerDan7-Jan-16 3:10 
GeneralRe: Disable Hardware in W10 Pin
Philippe Mori26-Feb-16 14:51
MemberPhilippe Mori26-Feb-16 14:51 
GeneralRe: Disable Hardware in W10 Pin
Dainim1-Apr-16 21:24
MemberDainim1-Apr-16 21:24 
GeneralRe: Disable Hardware in W10 Pin
Munchies_Matt9-Dec-16 2:44
MemberMunchies_Matt9-Dec-16 2:44 
QuestionReadProcessMemory fails in Windows 10 64 bit Pin
11917640 Member 23-Aug-15 20:54
Member11917640 Member 23-Aug-15 20:54 
Consider the following two programs. One is the console application with this code:
C++
int main()
{
    char *p = new char[100];
    return 0;
}

I run this program in Debug configuration and break on return 0 line. I the Watch window I see p variable value. The second program:

C++
HANDLE hProcess = OpenProcess( PROCESS_VM_READ, FALSE , 
    processId );            // ID of the process under debugger

if ( hProcess == NULL ) return;
char p[100];

if (!ReadProcessMemory(hProcess, 
    address,                        // value of p variable from the process under debugger
    p, 100, 
    &NumberOfBytesRead))
{
    // error handling
}


ReadProcessMemory is successful both in 32 and 64 bit (both program are compiled in Win32 or x64 configuration). Environment: Windows 7 64 bit, Visual Studio 2010. It also works in previous Windows versions.

Now I try the same in Windows 10 64 bit. Both programs in 32 bit - OK. 64 bit: ReadProcessMemory returns FALSE with last error 299: Only part of a ReadProcessMemory request was completed.

I tried:
1. To replace PROCESS_VM_READ with PROCESS_ALL_ACCESS
2. To run the second program as administrator
3. To use different Visual Studio versions (2010, 2015).
Still doesn't help. ReadProcessMemory fails in Windows 10 for 64 bit processes.

Edit: I tried to write this code from scratch, and it is working. So, the problem is somewhere in the original project, I don't know the solution yet, but API is working.

modified 25-Aug-15 6:24am.

AnswerRe: ReadProcessMemory fails in Windows 10 64 bit Pin
Richard MacCutchan23-Aug-15 21:12
mveRichard MacCutchan23-Aug-15 21:12 
GeneralRe: ReadProcessMemory fails in Windows 10 64 bit Pin
11917640 Member 23-Aug-15 21:43
Member11917640 Member 23-Aug-15 21:43 
GeneralRe: ReadProcessMemory fails in Windows 10 64 bit Pin
Richard MacCutchan23-Aug-15 22:19
mveRichard MacCutchan23-Aug-15 22:19 
GeneralRe: ReadProcessMemory fails in Windows 10 64 bit Pin
11917640 Member 23-Aug-15 23:11
Member11917640 Member 23-Aug-15 23:11 
AnswerRe: ReadProcessMemory fails in Windows 10 64 bit Pin
Richard Andrew x6424-Aug-15 7:21
professionalRichard Andrew x6424-Aug-15 7:21 
GeneralRe: ReadProcessMemory fails in Windows 10 64 bit Pin
11917640 Member 24-Aug-15 19:03
Member11917640 Member 24-Aug-15 19:03 
GeneralRe: ReadProcessMemory fails in Windows 10 64 bit Pin
11917640 Member 25-Aug-15 0:26
Member11917640 Member 25-Aug-15 0:26 
AnswerRe: ReadProcessMemory fails in Windows 10 64 bit Pin
Richard MacCutchan24-Aug-15 21:43
mveRichard MacCutchan24-Aug-15 21:43 
GeneralRe: ReadProcessMemory fails in Windows 10 64 bit Pin
11917640 Member 25-Aug-15 0:28
Member11917640 Member 25-Aug-15 0:28 
GeneralRe: ReadProcessMemory fails in Windows 10 64 bit Pin
Richard MacCutchan25-Aug-15 1:12
mveRichard MacCutchan25-Aug-15 1:12 
GeneralRe: ReadProcessMemory fails in Windows 10 64 bit Pin
11917640 Member 25-Aug-15 1:23
Member11917640 Member 25-Aug-15 1:23 
QuestionVB5 on WIndows 10 Pin
Wombaticus20-Aug-15 0:04
MemberWombaticus20-Aug-15 0:04 
AnswerRe: VB5 on WIndows 10 Pin
Eddy Vluggen20-Aug-15 0:31
professionalEddy Vluggen20-Aug-15 0:31 
GeneralRe: VB5 on WIndows 10 Pin
Wombaticus20-Aug-15 0:41
MemberWombaticus20-Aug-15 0:41 
GeneralRe: VB5 on WIndows 10 Pin
Pete O'Hanlon20-Aug-15 1:04
mvaPete O'Hanlon20-Aug-15 1:04 
GeneralRe: VB5 on WIndows 10 Pin
Wombaticus20-Aug-15 3:51
MemberWombaticus20-Aug-15 3:51 
GeneralRe: VB5 on WIndows 10 Pin
Wombaticus20-Aug-15 8:06
MemberWombaticus20-Aug-15 8:06 

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.