mirror of
https://github.com/hakril/PythonForWindows
synced 2026-06-08 14:31:45 +00:00
Trying to improve print output when stubborn call fails
This commit is contained in:
+16
-2
@@ -16,7 +16,14 @@ from .pfwtest import *
|
||||
# A second check about in parameters can be done with put_Left / get_Left or put_Visible
|
||||
def test_orpc_iexplore():
|
||||
iid = gdef.IWebBrowser2.IID
|
||||
client, ipid = windows.rpc.stubborn.stubborn_create_instance("0002DF01-0000-0000-C000-000000000046", iid)
|
||||
try:
|
||||
client, ipid = windows.rpc.stubborn.stubborn_create_instance("0002DF01-0000-0000-C000-000000000046", iid)
|
||||
except Exception as e:
|
||||
dbginfo = getattr(e, "stubborn_info", None)
|
||||
if dbginfo:
|
||||
for x in dbginfo.items():
|
||||
print(x)
|
||||
raise
|
||||
|
||||
# get_FullName
|
||||
addrep = client.call(iid, 38, b"", ipid=ipid)
|
||||
@@ -45,7 +52,14 @@ def test_orpc_iexplore():
|
||||
def test_orpc_network_manager():
|
||||
"""ORPC: Testing ORPCTHAT size using a method that takes no arguments and returns a single bytes"""
|
||||
iid = gdef.GUID.from_string("D0074FFD-570F-4A9B-8D69-199FDBA5723B")
|
||||
client, ipid = windows.rpc.stubborn.stubborn_create_instance("A47979D2-C419-11D9-A5B4-001185AD2B89", iid)
|
||||
try:
|
||||
client, ipid = windows.rpc.stubborn.stubborn_create_instance("A47979D2-C419-11D9-A5B4-001185AD2B89", iid)
|
||||
except Exception as e:
|
||||
dbginfo = getattr(e, "stubborn_info", None)
|
||||
if dbginfo:
|
||||
for x in dbginfo.items():
|
||||
print(x)
|
||||
raise
|
||||
response = client.call(iid, 17, b"", ipid=ipid)
|
||||
assert response[0] not in (b"\x00", 0)
|
||||
|
||||
|
||||
+12
-1
@@ -73,7 +73,18 @@ def stubborn_create_instance(clsid, iid):
|
||||
# Bad alignement for everythin -> Legacy
|
||||
resolver_info = ctypes.cast(rpiv_infoptr, gdef.PPRIV_RESOLVER_INFO_LEGACY)[0]
|
||||
|
||||
psa = resolver_info.OxidInfo.psa[0] # Retrieve the bidings to our COM server
|
||||
try:
|
||||
psa = resolver_info.OxidInfo.psa[0] # Retrieve the bidings to our COM server
|
||||
except ValueError as e:
|
||||
# Seen case of NULL DEREF
|
||||
# Embed more value to the except for better debugging
|
||||
e.stubborn_info = {
|
||||
"resolver_info.OxidInfo.containerVersion.version": resolver_info.OxidInfo.containerVersion.version,
|
||||
"dcomversion": (dcomversionstruct.MajorVersion, dcomversionstruct.MinorVersion),
|
||||
"resolver_info": resolver_info,
|
||||
}
|
||||
raise
|
||||
|
||||
# print("psa.bidings: {0}".format(psa.bidings))
|
||||
# ipidRemUnknown = resolver_info.OxidInfo.ipidRemUnknown # Useful for IRemQueryInterface
|
||||
|
||||
|
||||
Reference in New Issue
Block a user