Fixed ctypes/wintypes issue

The c_void_p and HRESULT are not accessible from wintypes in Python3.
This patch fixes the issue and it keeps functionality for Python27

Change-Id: I0a1c5d0770a66529528d1e2f7f1ba08368e53fe7
This commit is contained in:
Robert Tingirica 2014-10-28 12:29:39 +02:00
parent 36928c1613
commit 8b8a34731d

View File

@ -71,11 +71,11 @@ class VDS_DISK_PROP(ctypes.Structure):
("BusType", ctypes.c_int), ("BusType", ctypes.c_int),
("PartitionStyle", ctypes.c_int), ("PartitionStyle", ctypes.c_int),
("switch_type", VDS_DISK_PROP_SWITCH_TYPE), ("switch_type", VDS_DISK_PROP_SWITCH_TYPE),
("pwszDiskAddress", wintypes.c_void_p), ("pwszDiskAddress", ctypes.c_void_p),
("pwszName", wintypes.c_void_p), ("pwszName", ctypes.c_void_p),
("pwszFriendlyName", wintypes.c_void_p), ("pwszFriendlyName", ctypes.c_void_p),
("pwszAdaptorName", wintypes.c_void_p), ("pwszAdaptorName", ctypes.c_void_p),
("pwszDevicePath", wintypes.c_void_p), ("pwszDevicePath", ctypes.c_void_p),
] ]
@ -101,7 +101,7 @@ class VDS_VOLUME_PROP(ctypes.Structure):
("ullSize", wintypes.ULARGE_INTEGER), ("ullSize", wintypes.ULARGE_INTEGER),
("ulFlags", wintypes.ULONG), ("ulFlags", wintypes.ULONG),
("RecommendedFileSystemType", ctypes.c_int), ("RecommendedFileSystemType", ctypes.c_int),
("pwszName", wintypes.c_void_p), ("pwszName", ctypes.c_void_p),
] ]
@ -278,12 +278,12 @@ class IVdsAsync(comtypes.IUnknown):
comtypes.COMMETHOD([], comtypes.HRESULT, 'Cancel'), comtypes.COMMETHOD([], comtypes.HRESULT, 'Cancel'),
comtypes.COMMETHOD([], comtypes.HRESULT, 'Wait', comtypes.COMMETHOD([], comtypes.HRESULT, 'Wait',
(['out'], ctypes.POINTER( (['out'], ctypes.POINTER(
wintypes.HRESULT), 'pHrResult'), ctypes.HRESULT), 'pHrResult'),
(['out'], ctypes.POINTER(VDS_ASYNC_OUTPUT), (['out'], ctypes.POINTER(VDS_ASYNC_OUTPUT),
'pAsyncOut')), 'pAsyncOut')),
comtypes.COMMETHOD([], comtypes.HRESULT, 'QueryStatus', comtypes.COMMETHOD([], comtypes.HRESULT, 'QueryStatus',
(['out'], ctypes.POINTER( (['out'], ctypes.POINTER(
wintypes.HRESULT), 'pHrResult'), ctypes.HRESULT), 'pHrResult'),
(['out'], ctypes.POINTER(wintypes.ULONG), (['out'], ctypes.POINTER(wintypes.ULONG),
'pulPercentCompleted')), 'pulPercentCompleted')),
] ]