2024-10-22 08:21:55 +02:00

124 lines
3.5 KiB
Diff

diff --git a/SWIG/swig_lib/python/pythoncom.i b/SWIG/swig_lib/python/pythoncom.i
index f37ae9f..609d227 100644
--- a/SWIG/swig_lib/python/pythoncom.i
+++ b/SWIG/swig_lib/python/pythoncom.i
@@ -8,6 +8,10 @@ typedef long HRESULT; // This will raise COM Exception.
%typedef long HRESULT_KEEP; // This will keep HRESULT, and return
typedef long FLAGS;
+typedef WCHAR OLECHAR;
+typedef OLECHAR* BSTR;
+typedef MAPIERROR MAPIERROR;
+typedef ADRLIST ADRLIST;
%typemap(python,out) HRESULT {
$target = Py_None;
diff --git a/SWIG/swig_lib/python/pywintypes.i b/SWIG/swig_lib/python/pywintypes.i
index 7ef58a4..cd61a0e 100644
--- a/SWIG/swig_lib/python/pywintypes.i
+++ b/SWIG/swig_lib/python/pywintypes.i
@@ -33,6 +33,8 @@ typedef long LONG;
typedef unsigned long ULONG;
%apply unsigned long {ULONG};
+typedef STARTUPINFO STARTUPINFO;
+%apply STARTUPINFO {STARTUPINFO};
%{
#define PyInt_FromLong PyLong_FromLong // py3k pain.
@@ -55,6 +57,7 @@ typedef unsigned long ULONG;
}
// Override the SWIG default for this.
+%typedef PyObject PyObject;
%typemap(python,out) PyObject *{
if ($source==NULL) return NULL; // get out now!
$target = $source;
@@ -64,7 +67,7 @@ typedef unsigned long ULONG;
// Map API functions that return BOOL to
// functions that return None, but raise exceptions.
// These functions must set the win32 LastError.
-%typedef BOOL BOOLAPI
+%typedef BOOL BOOLAPI;
%typemap(python,out) BOOLAPI {
$target = Py_None;
@@ -81,7 +84,7 @@ typedef unsigned long ULONG;
}
}
-%typedef DWORD DWORDAPI
+%typedef DWORD DWORDAPI;
%typemap(python,out) DWORDAPI {
$target = Py_None;
@@ -110,11 +113,13 @@ typedef unsigned long ULONG;
}
}
+%typedef TCHAR TCHAR;
%typemap(python,in) TCHAR * {
if (!PyWinObject_AsTCHAR($source, &$target, FALSE))
return NULL;
}
+%typedef WCHAR WCHAR;
%typemap(python,arginit) TCHAR *,OLECHAR *, WCHAR *
{
$target = NULL;
@@ -200,6 +205,7 @@ typedef unsigned long ULONG;
return NULL;
}
+%typedef OVERLAPPED OVERLAPPED;
%typemap(python,in) OVERLAPPED *
{
if (!PyWinObject_AsOVERLAPPED($source, &$target, TRUE))
@@ -254,6 +260,7 @@ typedef unsigned long ULONG;
}
+%typedef SECURITY_ATTRIBUTES SECURITY_ATTRIBUTES;
%typemap(python,in) SECURITY_ATTRIBUTES *{
if (!PyWinObject_AsSECURITY_ATTRIBUTES($source, &$target))
@@ -412,6 +419,7 @@ typedef float HWND;
// LARGE_INTEGER support
//
//---------------------------------------------------------------------------
+%typedef LARGE_INTEGER LARGE_INTEGER;
%typemap(python,in) LARGE_INTEGER {
if (!PyWinObject_AsLARGE_INTEGER($source, &$target))
return NULL;
@@ -421,6 +429,7 @@ typedef float HWND;
if (!PyWinObject_AsLARGE_INTEGER($source, $target))
return NULL;
}
+%typedef ULARGE_INTEGER ULARGE_INTEGER;
%typemap(python,in) ULARGE_INTEGER {
if (!PyWinObject_AsULARGE_INTEGER($source, &$target))
return NULL;
@@ -535,6 +544,7 @@ typedef float HWND;
// TIME
//
//---------------------------------------------------------------------------
+%typedef FILETIME FILETIME;
%typemap(python,in) FILETIME * {
if (!PyWinObject_AsFILETIME($source, $target, FALSE))
return NULL;
@@ -573,6 +583,7 @@ typedef float HWND;
// SOCKET support.
//
//---------------------------------------------------------------------------
+%typedef UINT_PTR SOCKET;
%typemap(python,in) SOCKET *(SOCKET sockettemp)
{
$target = &sockettemp;
@@ -596,5 +607,5 @@ typedef float HWND;
#endif
PyWinGlobals_Ensure();
PyDict_SetItemString(d, "error", PyWinExc_ApiError);
-#endif SWIG_PYTHONCOM
+#endif // SWIG_PYTHONCOM
%}