|
-
Oct 6th, 2020, 05:11 PM
#4
Thread Starter
Lively Member
Re: How to call IEnumVARIANT::Next() with DispCallFunc() - Without external TLBs
 Originally Posted by LaVolpe
This is likely one reason why you are crashing...
Code:
hResult = EnumCall(e, 4, ...)
4 cannot be correct. Since IEnumVARIANT inherits from IUnknown, then the 1st 3 entries of IEnumVARIANT vTable are QueryInterface, AddRef & Release. The value 4 would be AddRef. The IEnumVARIANT:Next would be 16 not 4 (if you were trying to call the that method). I didn't verify the method order in IEnumVARIANT, it looks like ?...
-- IUnknown:QueryInterface
-- IUnknown:AddRef
-- IUnknown:Release
-- IEnumVARIANT:Clone
-- IEnumVARIANT:Next
-- IEnumVARIANT:Reset
-- IEnumVARIANT:Skip
double check these against oleexp3.IEnumVARIANT maybe.
Honestly, I stopped examining your code after I saw that initial error.
Waiiit... The value is multiplied by 4?! Woops... That's the ptr size right?
I used the vtable order from here: https://sourcegraph.com/github.com/g...enumvariant.go
I have no clue how to get the real vtable order to be honest, other than from looking at other existing source code...
Edit: Mhm I see now, so given this is the vtable order:
Code:
type IEnumVARIANTVtbl struct {
IUnknownVtbl
Next uintptr
Skip uintptr
Reset uintptr
Clone uintptr
}
The method is at position 4 correct so to translate this to the VTable location I guess each pointer is 4 bytes long, so we do (4-1)*4 as the vTable offset?
Edit: I've changed that and I'm still getting all the crashes sadly... Damn I wish it errored and didn't just crash on me...
Last edited by sancarn; Oct 6th, 2020 at 05:23 PM.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|