Daniel
Daniel

Reputation: 411

ReadDebuggeeMemoryEx failed to read debuggee

I have write a debugger extension for my VisualStuido2010 to display my class type. I write my code base on the EEAddin sample provided by Microsoft. But I failed on call ReadDebuggeeMemoryEx.

I can't get any reason for this fail. GetLastError() returns 0.

ObjectId objid;
DWORD nGot;
int state = E_FAIL;
if ( pHelper->ReadDebuggeeMemoryEx(pHelper, pHelper->GetRealAddress(pHelper), sizeof(ObjectId), &objid, &nGot) )
{
}else { log("Fail ReadDebuggeeMemoryEx %d\n", GetLastError());}

Upvotes: 0

Views: 334

Answers (1)

fies
fies

Reputation: 26

The function ReadDebuggeeMemoryEx(...) returns a HRESULT not a BOOL.
Try something like :

if (pHelper->ReadDebuggeeMemoryEx(...) == S_OK) {
  // good
} else {
  // bad
}

Upvotes: 1

Related Questions