If you are trying to use Python with the Windows Scripting Host, note that
diff --git a/com/win32comext/axscript/demos/client/ie/foo2.htm b/com/win32comext/axscript/demos/client/ie/foo2.htm
index d967822b9e..7849dfb8db 100644
--- a/com/win32comext/axscript/demos/client/ie/foo2.htm
+++ b/com/win32comext/axscript/demos/client/ie/foo2.htm
@@ -61,7 +61,7 @@
@@ -84,7 +84,7 @@
print("Y is ", y)
def PythonGlobalFunction():
- window.alert("Hello from Python - Im about to call JScript!")
+ window.alert("Hello from Python - I'm about to call JScript!")
window.JScriptFunction()
def Window_OnLoad():
diff --git a/com/win32comext/axscript/src/AXScript.h b/com/win32comext/axscript/src/AXScript.h
index 687e065233..902e7cce63 100644
--- a/com/win32comext/axscript/src/AXScript.h
+++ b/com/win32comext/axscript/src/AXScript.h
@@ -126,7 +126,7 @@ class PYAXSCRIPT_EXPORT PyGActiveScript : public PyGatewayBase, public IActiveSc
STDMETHOD(GetScriptState)
(THIS_
- /* [out] */ SCRIPTSTATE *pssState);
+ /* [out] */ SCRIPTSTATE *pssState);
STDMETHOD(Close)(void);
diff --git a/com/win32comext/axscript/src/PyGActiveScript.cpp b/com/win32comext/axscript/src/PyGActiveScript.cpp
index 88bc70fe94..dad76db297 100644
--- a/com/win32comext/axscript/src/PyGActiveScript.cpp
+++ b/com/win32comext/axscript/src/PyGActiveScript.cpp
@@ -143,7 +143,7 @@ STDMETHODIMP PyGActiveScript::GetScriptThreadID(
hr = PyCom_SetCOMErrorFromPyException(GetIID());
}
else
- hr = PyCom_SetCOMErrorFromSimple(E_FAIL, GetIID(), L"Python didnt return an integer");
+ hr = PyCom_SetCOMErrorFromSimple(E_FAIL, GetIID(), L"Python didn't return an integer");
return hr;
}
diff --git a/com/win32comext/axscript/test/leakTest.py b/com/win32comext/axscript/test/leakTest.py
index 98a589d3ef..7b52e36a98 100644
--- a/com/win32comext/axscript/test/leakTest.py
+++ b/com/win32comext/axscript/test/leakTest.py
@@ -51,7 +51,7 @@ def echo(self, *args):
# self._connect_server_.Broadcast(last)
-#### Connections currently wont work, as there is no way for the engine to
+#### Connections currently won't work, as there is no way for the engine to
#### know what events we support. We need typeinfo support.
IID_ITestEvents = pythoncom.MakeIID("{8EB72F90-0D44-11d1-9C4B-00AA00125A98}")
@@ -145,7 +145,7 @@ def doTestEngine(engine, echoer):
print("***** Calling 'hello' failed", exc)
return
if echoer.last != "Goober":
- print("***** Function call didnt set value correctly", repr(echoer.last))
+ print("***** Function call didn't set value correctly", repr(echoer.last))
if str(ob.prop) != "Property Value":
print("***** Property Value not correct - ", repr(ob.prop))
diff --git a/com/win32comext/axscript/test/testHost.py b/com/win32comext/axscript/test/testHost.py
index 1dba19ed11..3b1181bb6c 100644
--- a/com/win32comext/axscript/test/testHost.py
+++ b/com/win32comext/axscript/test/testHost.py
@@ -69,7 +69,7 @@ def fail(self, *args):
# self._connect_server_.Broadcast(last)
-#### Connections currently wont work, as there is no way for the engine to
+#### Connections currently won't work, as there is no way for the engine to
#### know what events we support. We need typeinfo support.
IID_ITestEvents = pythoncom.MakeIID("{8EB72F90-0D44-11d1-9C4B-00AA00125A98}")
diff --git a/com/win32comext/directsound/src/PyIDirectSoundCaptureBuffer.cpp b/com/win32comext/directsound/src/PyIDirectSoundCaptureBuffer.cpp
index 9654529b61..75ccf1f8de 100644
--- a/com/win32comext/directsound/src/PyIDirectSoundCaptureBuffer.cpp
+++ b/com/win32comext/directsound/src/PyIDirectSoundCaptureBuffer.cpp
@@ -322,7 +322,7 @@ PyObject *PyIDirectSoundCaptureBuffer::Update(PyObject *self, PyObject *args)
return obData;
-error : {
+error: {
// need extra block for local variables from PY_INTERFACE_UPCALL macro
PY_INTERFACE_PRECALL;
hr = pIDSCB->Unlock(lpAudioPtr1, dwAudioBytes1, lpAudioPtr2, dwAudioBytes2);
diff --git a/com/win32comext/directsound/src/directsound.cpp b/com/win32comext/directsound/src/directsound.cpp
index dc4c2d42c7..fa56e6acbc 100644
--- a/com/win32comext/directsound/src/directsound.cpp
+++ b/com/win32comext/directsound/src/directsound.cpp
@@ -422,7 +422,7 @@ PYWIN_MODULE_INIT_FUNC(directsound)
ADD_CONSTANT(DS_OK);
ADD_CONSTANT(DS_NO_VIRTUALIZATION);
-// ADD_CONSTANT(DS_INCOMPLETE); not sure why this can't be found?
+ // ADD_CONSTANT(DS_INCOMPLETE); not sure why this can't be found?
ADD_CONSTANT(DSERR_ACCESSDENIED);
ADD_CONSTANT(DSERR_ALLOCATED);
ADD_CONSTANT(DSERR_ALREADYINITIALIZED);
diff --git a/com/win32comext/ifilter/demo/filterDemo.py b/com/win32comext/ifilter/demo/filterDemo.py
index 513f70081c..5c598fa98b 100644
--- a/com/win32comext/ifilter/demo/filterDemo.py
+++ b/com/win32comext/ifilter/demo/filterDemo.py
@@ -126,11 +126,11 @@ def Parse(self, fileName, maxErrors=10):
errCnt = 0
if flags == CHUNK_TEXT:
- # its a text segment - get all available text for this chunk.
+ # it's a text segment - get all available text for this chunk.
body_chunks = properties.setdefault(propName, [])
self._get_text(body_chunks)
elif flags == CHUNK_VALUE:
- # its a data segment - get the value
+ # it's a data segment - get the value
properties[propName] = self.f.GetValue()
else:
self._trace("Unknown flag returned by GetChunk:", flags)
diff --git a/com/win32comext/ifilter/src/stdafx.h b/com/win32comext/ifilter/src/stdafx.h
index 6672c006db..8a9b1c26c5 100644
--- a/com/win32comext/ifilter/src/stdafx.h
+++ b/com/win32comext/ifilter/src/stdafx.h
@@ -4,7 +4,7 @@
//
// _WIN32_DCOM screws win95 and NT :-( However, we need to define this
-// so we dont lose all the constants etc that come with DCOM
+// so we don't lose all the constants etc that come with DCOM
//
#define _WIN32_DCOM
diff --git a/com/win32comext/internet/src/internet.cpp b/com/win32comext/internet/src/internet.cpp
index c16f9e2f70..741af00070 100644
--- a/com/win32comext/internet/src/internet.cpp
+++ b/com/win32comext/internet/src/internet.cpp
@@ -106,7 +106,7 @@ BOOL PyObject_AsBINDINFO(PyObject *ob, BINDINFO *pPD)
if (!PyWinObject_AsTaskAllocatedWCHAR(obExtra, &pPD->szExtraInfo, /*bNoneOK=*/TRUE))
goto done;
if (obSTGM != Py_None) {
- PyErr_SetString(PyExc_TypeError, "Sorry - dont support STGMEDIUM yet - must be None");
+ PyErr_SetString(PyExc_TypeError, "Sorry - don't support STGMEDIUM yet - must be None");
goto done;
}
if (!PyWinObject_AsTaskAllocatedWCHAR(obCustomVerb, &pPD->szCustomVerb, /*bNoneOK=*/TRUE))
diff --git a/com/win32comext/mapi/mapiutil.py b/com/win32comext/mapi/mapiutil.py
index 8716a650a9..896a8b0d0e 100644
--- a/com/win32comext/mapi/mapiutil.py
+++ b/com/win32comext/mapi/mapiutil.py
@@ -86,7 +86,7 @@ def GetMapiTypeName(propType, rawType=True):
ptTable[value] = name
if rawType:
- propType = propType & ~mapitags.MV_FLAG
+ propType &= ~mapitags.MV_FLAG
return ptTable.get(propType, str(hex(propType)))
@@ -206,6 +206,6 @@ def SetProperties(msg, propDict):
f"The type of object {repr(val)}({type(val)}) can not be written"
)
key = mapitags.PROP_TAG(tagType, mapitags.PROP_ID(newIds[newIdNo]))
- newIdNo = newIdNo + 1
+ newIdNo += 1
newProps.append((key, val))
msg.SetProps(newProps)
diff --git a/com/win32comext/mapi/src/PyIMAPIAdviseSink.cpp b/com/win32comext/mapi/src/PyIMAPIAdviseSink.cpp
index 96cc759018..60cfe1ad31 100644
--- a/com/win32comext/mapi/src/PyIMAPIAdviseSink.cpp
+++ b/com/win32comext/mapi/src/PyIMAPIAdviseSink.cpp
@@ -54,8 +54,8 @@ PyObject *PyObject_FromNOTIFICATION(NOTIFICATION *n)
#else
"k(s#s#kNk)",
#endif
- n->ulEventType, newmail.lpEntryID, (Py_ssize_t)newmail.cbEntryID, newmail.lpParentID, (Py_ssize_t)newmail.cbParentID,
- newmail.ulFlags, msg_class, newmail.ulMessageFlags);
+ n->ulEventType, newmail.lpEntryID, (Py_ssize_t)newmail.cbEntryID, newmail.lpParentID,
+ (Py_ssize_t)newmail.cbParentID, newmail.ulFlags, msg_class, newmail.ulMessageFlags);
break;
}
case fnevObjectCopied:
@@ -74,8 +74,9 @@ PyObject *PyObject_FromNOTIFICATION(NOTIFICATION *n)
#else
"k(s#is#s#s#N)",
#endif
- n->ulEventType, obj.lpEntryID, (Py_ssize_t)obj.cbEntryID, obj.ulObjType, obj.lpParentID, (Py_ssize_t)obj.cbParentID,
- obj.lpOldID, (Py_ssize_t)obj.cbOldID, obj.lpOldParentID, (Py_ssize_t)obj.cbOldParentID, obArray);
+ n->ulEventType, obj.lpEntryID, (Py_ssize_t)obj.cbEntryID, obj.ulObjType, obj.lpParentID,
+ (Py_ssize_t)obj.cbParentID, obj.lpOldID, (Py_ssize_t)obj.cbOldID, obj.lpOldParentID,
+ (Py_ssize_t)obj.cbOldParentID, obArray);
break;
}
case fnevTableModified: {
diff --git a/com/win32comext/mapi/src/mapi_headers/EdkMdb.h b/com/win32comext/mapi/src/mapi_headers/EdkMdb.h
index 887d64c351..6de3859165 100644
--- a/com/win32comext/mapi/src/mapi_headers/EdkMdb.h
+++ b/com/win32comext/mapi/src/mapi_headers/EdkMdb.h
@@ -17,22 +17,21 @@
* literals declared here instead of the numerical values.
*/
-#define pidStoreNonTransMin 0x0E40
-#define pidExchangeXmitReservedMin 0x3FE0
-#define pidExchangeNonXmitReservedMin 0x65E0
-#define pidProfileMin 0x6600
-#define pidStoreMin 0x6618
-#define pidFolderMin 0x6638
-#define pidMessageReadOnlyMin 0x6640
-#define pidMessageWriteableMin 0x6658
-#define pidAttachReadOnlyMin 0x666C
-#define pidSpecialMin 0x6670
-#define pidAdminMin 0x6690
-#define pidSecureProfileMin PROP_ID_SECURE_MIN
-#define pidRenMsgFldMin 0x1080
-#define pidLocalStoreInternalMin 0x6500 // Using a portion of the user-defined non-tranmittable prop for local store
-#define pidLocalStoreInternalMax 0x65C0
-
+#define pidStoreNonTransMin 0x0E40
+#define pidExchangeXmitReservedMin 0x3FE0
+#define pidExchangeNonXmitReservedMin 0x65E0
+#define pidProfileMin 0x6600
+#define pidStoreMin 0x6618
+#define pidFolderMin 0x6638
+#define pidMessageReadOnlyMin 0x6640
+#define pidMessageWriteableMin 0x6658
+#define pidAttachReadOnlyMin 0x666C
+#define pidSpecialMin 0x6670
+#define pidAdminMin 0x6690
+#define pidSecureProfileMin PROP_ID_SECURE_MIN
+#define pidRenMsgFldMin 0x1080
+#define pidLocalStoreInternalMin 0x6500 // Using a portion of the user-defined non-tranmittable prop for local store
+#define pidLocalStoreInternalMax 0x65C0
/*------------------------------------------------------------------------
*
@@ -49,136 +48,132 @@
/* GUID of the global section */
-#define pbGlobalProfileSectionGuid "\x13\xDB\xB0\xC8\xAA\x05\x10\x1A\x9B\xB0\x00\xAA\x00\x2F\xC4\x5A"
-
+#define pbGlobalProfileSectionGuid "\x13\xDB\xB0\xC8\xAA\x05\x10\x1A\x9B\xB0\x00\xAA\x00\x2F\xC4\x5A"
/* Properties in the global section */
-#define PR_PROFILE_VERSION PROP_TAG( PT_LONG, pidProfileMin+0x00)
-#define PR_PROFILE_CONFIG_FLAGS PROP_TAG( PT_LONG, pidProfileMin+0x01)
-#define PR_PROFILE_HOME_SERVER PROP_TAG( PT_STRING8, pidProfileMin+0x02)
-#define PR_PROFILE_HOME_SERVER_DN PROP_TAG( PT_STRING8, pidProfileMin+0x12)
-#define PR_PROFILE_HOME_SERVER_ADDRS PROP_TAG( PT_MV_STRING8, pidProfileMin+0x13)
-#define PR_PROFILE_USER PROP_TAG( PT_STRING8, pidProfileMin+0x03)
-#define PR_PROFILE_CONNECT_FLAGS PROP_TAG( PT_LONG, pidProfileMin+0x04)
-#define PR_PROFILE_TRANSPORT_FLAGS PROP_TAG( PT_LONG, pidProfileMin+0x05)
-#define PR_PROFILE_UI_STATE PROP_TAG( PT_LONG, pidProfileMin+0x06)
-#define PR_PROFILE_UNRESOLVED_NAME PROP_TAG( PT_STRING8, pidProfileMin+0x07)
-#define PR_PROFILE_UNRESOLVED_SERVER PROP_TAG( PT_STRING8, pidProfileMin+0x08)
-#define PR_PROFILE_BINDING_ORDER PROP_TAG( PT_STRING8, pidProfileMin+0x09)
-#define PR_PROFILE_MAX_RESTRICT PROP_TAG( PT_LONG, pidProfileMin+0x0D)
-#define PR_PROFILE_AB_FILES_PATH PROP_TAG( PT_STRING8, pidProfileMin+0xE)
-#define PR_PROFILE_OFFLINE_STORE_PATH PROP_TAG( PT_STRING8, pidProfileMin+0x10)
-#define PR_PROFILE_OFFLINE_INFO PROP_TAG( PT_BINARY, pidProfileMin+0x11)
-#define PR_PROFILE_ADDR_INFO PROP_TAG( PT_BINARY, pidSpecialMin+0x17)
-#define PR_PROFILE_OPTIONS_DATA PROP_TAG( PT_BINARY, pidSpecialMin+0x19)
-#define PR_PROFILE_SECURE_MAILBOX PROP_TAG( PT_BINARY, pidSecureProfileMin + 0)
-#define PR_DISABLE_WINSOCK PROP_TAG( PT_LONG, pidProfileMin+0x18)
-#define PR_PROFILE_AUTH_PACKAGE PROP_TAG( PT_LONG, pidProfileMin+0x19) // dup tag of PR_USER_ENTRYID
-#define PR_PROFILE_RECONNECT_INTERVAL PROP_TAG( PT_LONG, pidProfileMin+0x1a) // dup tag of PR_USER_NAME
-#define PR_PROFILE_SERVER_VERSION PROP_TAG( PT_LONG, pidProfileMin+0x1b)
+#define PR_PROFILE_VERSION PROP_TAG(PT_LONG, pidProfileMin + 0x00)
+#define PR_PROFILE_CONFIG_FLAGS PROP_TAG(PT_LONG, pidProfileMin + 0x01)
+#define PR_PROFILE_HOME_SERVER PROP_TAG(PT_STRING8, pidProfileMin + 0x02)
+#define PR_PROFILE_HOME_SERVER_DN PROP_TAG(PT_STRING8, pidProfileMin + 0x12)
+#define PR_PROFILE_HOME_SERVER_ADDRS PROP_TAG(PT_MV_STRING8, pidProfileMin + 0x13)
+#define PR_PROFILE_USER PROP_TAG(PT_STRING8, pidProfileMin + 0x03)
+#define PR_PROFILE_CONNECT_FLAGS PROP_TAG(PT_LONG, pidProfileMin + 0x04)
+#define PR_PROFILE_TRANSPORT_FLAGS PROP_TAG(PT_LONG, pidProfileMin + 0x05)
+#define PR_PROFILE_UI_STATE PROP_TAG(PT_LONG, pidProfileMin + 0x06)
+#define PR_PROFILE_UNRESOLVED_NAME PROP_TAG(PT_STRING8, pidProfileMin + 0x07)
+#define PR_PROFILE_UNRESOLVED_SERVER PROP_TAG(PT_STRING8, pidProfileMin + 0x08)
+#define PR_PROFILE_BINDING_ORDER PROP_TAG(PT_STRING8, pidProfileMin + 0x09)
+#define PR_PROFILE_MAX_RESTRICT PROP_TAG(PT_LONG, pidProfileMin + 0x0D)
+#define PR_PROFILE_AB_FILES_PATH PROP_TAG(PT_STRING8, pidProfileMin + 0xE)
+#define PR_PROFILE_OFFLINE_STORE_PATH PROP_TAG(PT_STRING8, pidProfileMin + 0x10)
+#define PR_PROFILE_OFFLINE_INFO PROP_TAG(PT_BINARY, pidProfileMin + 0x11)
+#define PR_PROFILE_ADDR_INFO PROP_TAG(PT_BINARY, pidSpecialMin + 0x17)
+#define PR_PROFILE_OPTIONS_DATA PROP_TAG(PT_BINARY, pidSpecialMin + 0x19)
+#define PR_PROFILE_SECURE_MAILBOX PROP_TAG(PT_BINARY, pidSecureProfileMin + 0)
+#define PR_DISABLE_WINSOCK PROP_TAG(PT_LONG, pidProfileMin + 0x18)
+#define PR_PROFILE_AUTH_PACKAGE PROP_TAG(PT_LONG, pidProfileMin + 0x19) // dup tag of PR_USER_ENTRYID
+#define PR_PROFILE_RECONNECT_INTERVAL PROP_TAG(PT_LONG, pidProfileMin + 0x1a) // dup tag of PR_USER_NAME
+#define PR_PROFILE_SERVER_VERSION PROP_TAG(PT_LONG, pidProfileMin + 0x1b)
/* SE 233155 - MarkH: EMSABP DCR /*
/* Properties in the abp section - I got these values from AlecDun (Outlook team) */
-#define PR_PROFILE_ABP_ALLOW_RECONNECT PROP_TAG( PT_LONG, pidProfileMin+0x39)
-#define PR_PROFILE_ABP_MTHREAD_TIMEOUT_SECS PROP_TAG( PT_LONG, pidProfileMin+0x3A)
+#define PR_PROFILE_ABP_ALLOW_RECONNECT PROP_TAG(PT_LONG, pidProfileMin + 0x39)
+#define PR_PROFILE_ABP_MTHREAD_TIMEOUT_SECS PROP_TAG(PT_LONG, pidProfileMin + 0x3A)
/* Properties passed through the Service Entry to the OST */
-#define PR_OST_ENCRYPTION PROP_TAG(PT_LONG, 0x6702)
+#define PR_OST_ENCRYPTION PROP_TAG(PT_LONG, 0x6702)
/* Values for PR_OST_ENCRYPTION */
-#define OSTF_NO_ENCRYPTION ((DWORD)0x80000000)
-#define OSTF_COMPRESSABLE_ENCRYPTION ((DWORD)0x40000000)
-#define OSTF_BEST_ENCRYPTION ((DWORD)0x20000000)
+#define OSTF_NO_ENCRYPTION ((DWORD)0x80000000)
+#define OSTF_COMPRESSABLE_ENCRYPTION ((DWORD)0x40000000)
+#define OSTF_BEST_ENCRYPTION ((DWORD)0x20000000)
/* Properties in each profile section */
-#define PR_PROFILE_OPEN_FLAGS PROP_TAG( PT_LONG, pidProfileMin+0x09)
-#define PR_PROFILE_TYPE PROP_TAG( PT_LONG, pidProfileMin+0x0A)
-#define PR_PROFILE_MAILBOX PROP_TAG( PT_STRING8, pidProfileMin+0x0B)
-#define PR_PROFILE_SERVER PROP_TAG( PT_STRING8, pidProfileMin+0x0C)
-#define PR_PROFILE_SERVER_DN PROP_TAG( PT_STRING8, pidProfileMin+0x14)
+#define PR_PROFILE_OPEN_FLAGS PROP_TAG(PT_LONG, pidProfileMin + 0x09)
+#define PR_PROFILE_TYPE PROP_TAG(PT_LONG, pidProfileMin + 0x0A)
+#define PR_PROFILE_MAILBOX PROP_TAG(PT_STRING8, pidProfileMin + 0x0B)
+#define PR_PROFILE_SERVER PROP_TAG(PT_STRING8, pidProfileMin + 0x0C)
+#define PR_PROFILE_SERVER_DN PROP_TAG(PT_STRING8, pidProfileMin + 0x14)
/* Properties in the Public Folders section */
-#define PR_PROFILE_FAVFLD_DISPLAY_NAME PROP_TAG(PT_STRING8, pidProfileMin+0x0F)
-#define PR_PROFILE_FAVFLD_COMMENT PROP_TAG(PT_STRING8, pidProfileMin+0x15)
-#define PR_PROFILE_ALLPUB_DISPLAY_NAME PROP_TAG(PT_STRING8, pidProfileMin+0x16)
-#define PR_PROFILE_ALLPUB_COMMENT PROP_TAG(PT_STRING8, pidProfileMin+0x17)
+#define PR_PROFILE_FAVFLD_DISPLAY_NAME PROP_TAG(PT_STRING8, pidProfileMin + 0x0F)
+#define PR_PROFILE_FAVFLD_COMMENT PROP_TAG(PT_STRING8, pidProfileMin + 0x15)
+#define PR_PROFILE_ALLPUB_DISPLAY_NAME PROP_TAG(PT_STRING8, pidProfileMin + 0x16)
+#define PR_PROFILE_ALLPUB_COMMENT PROP_TAG(PT_STRING8, pidProfileMin + 0x17)
/* Properties for Multiple Offline Address Book support (MOAB) */
-#define PR_PROFILE_MOAB PROP_TAG( PT_STRING8, pidSpecialMin + 0x0B )
-#define PR_PROFILE_MOAB_GUID PROP_TAG( PT_STRING8, pidSpecialMin + 0x0C )
-#define PR_PROFILE_MOAB_SEQ PROP_TAG( PT_LONG, pidSpecialMin + 0x0D )
+#define PR_PROFILE_MOAB PROP_TAG(PT_STRING8, pidSpecialMin + 0x0B)
+#define PR_PROFILE_MOAB_GUID PROP_TAG(PT_STRING8, pidSpecialMin + 0x0C)
+#define PR_PROFILE_MOAB_SEQ PROP_TAG(PT_LONG, pidSpecialMin + 0x0D)
// Property for setting a list of prop_ids to be excluded
// from the GetProps(NULL) call.
-#define PR_GET_PROPS_EXCLUDE_PROP_ID_LIST PROP_TAG( PT_BINARY, pidSpecialMin + 0x0E )
+#define PR_GET_PROPS_EXCLUDE_PROP_ID_LIST PROP_TAG(PT_BINARY, pidSpecialMin + 0x0E)
// Current value for PR_PROFILE_VERSION
-#define PROFILE_VERSION ((ULONG)0x501)
+#define PROFILE_VERSION ((ULONG)0x501)
// Bit values for PR_PROFILE_CONFIG_FLAGS
-#define CONFIG_SERVICE ((ULONG)0x00000001)
-#define CONFIG_SHOW_STARTUP_UI ((ULONG)0x00000002)
-#define CONFIG_SHOW_CONNECT_UI ((ULONG)0x00000004)
-#define CONFIG_PROMPT_FOR_CREDENTIALS ((ULONG)0x00000008)
-#define CONFIG_NO_AUTO_DETECT ((ULONG)0x00000010)
-#define CONFIG_OST_CACHE_ONLY ((ULONG)0x00000020)
+#define CONFIG_SERVICE ((ULONG)0x00000001)
+#define CONFIG_SHOW_STARTUP_UI ((ULONG)0x00000002)
+#define CONFIG_SHOW_CONNECT_UI ((ULONG)0x00000004)
+#define CONFIG_PROMPT_FOR_CREDENTIALS ((ULONG)0x00000008)
+#define CONFIG_NO_AUTO_DETECT ((ULONG)0x00000010)
+#define CONFIG_OST_CACHE_ONLY ((ULONG)0x00000020)
// Bit values for PR_PROFILE_CONNECT_FLAGS
-#define CONNECT_USE_ADMIN_PRIVILEGE ((ULONG)1)
-#define CONNECT_NO_RPC_ENCRYPTION ((ULONG)2)
-#define CONNECT_USE_SEPARATE_CONNECTION ((ULONG)4)
-#define CONNECT_NO_UNDER_COVER_CONNECTION ((ULONG)8)
-#define CONNECT_ANONYMOUS_ACCESS ((ULONG)16)
-#define CONNECT_NO_NOTIFICATIONS ((ULONG)32)
-#define CONNECT_NO_TABLE_NOTIFICATIONS ((ULONG)32) /* BUGBUG: TEMPORARY */
-#define CONNECT_NO_ADDRESS_RESOLUTION ((ULONG)64)
-#define CONNECT_RESTORE_DATABASE ((ULONG)128)
-
+#define CONNECT_USE_ADMIN_PRIVILEGE ((ULONG)1)
+#define CONNECT_NO_RPC_ENCRYPTION ((ULONG)2)
+#define CONNECT_USE_SEPARATE_CONNECTION ((ULONG)4)
+#define CONNECT_NO_UNDER_COVER_CONNECTION ((ULONG)8)
+#define CONNECT_ANONYMOUS_ACCESS ((ULONG)16)
+#define CONNECT_NO_NOTIFICATIONS ((ULONG)32)
+#define CONNECT_NO_TABLE_NOTIFICATIONS ((ULONG)32) /* BUGBUG: TEMPORARY */
+#define CONNECT_NO_ADDRESS_RESOLUTION ((ULONG)64)
+#define CONNECT_RESTORE_DATABASE ((ULONG)128)
// Bit values for PR_PROFILE_TRANSPORT_FLAGS
-#define TRANSPORT_DOWNLOAD ((ULONG)1)
-#define TRANSPORT_UPLOAD ((ULONG)2)
+#define TRANSPORT_DOWNLOAD ((ULONG)1)
+#define TRANSPORT_UPLOAD ((ULONG)2)
// Bit values for PR_PROFILE_OPEN_FLAGS
-#define OPENSTORE_USE_ADMIN_PRIVILEGE ((ULONG)0x00000001)
-#define OPENSTORE_PUBLIC ((ULONG)0x00000002)
-#define OPENSTORE_HOME_LOGON ((ULONG)0x00000004)
-#define OPENSTORE_TAKE_OWNERSHIP ((ULONG)0x00000008)
-#define OPENSTORE_OVERRIDE_HOME_MDB ((ULONG)0x00000010)
-#define OPENSTORE_TRANSPORT ((ULONG)0x00000020)
-#define OPENSTORE_REMOTE_TRANSPORT ((ULONG)0x00000040)
-#define OPENSTORE_INTERNET_ANONYMOUS ((ULONG)0x00000080)
-#define OPENSTORE_ALTERNATE_SERVER ((ULONG)0x00000100) /* reserved for internal use */
-#define OPENSTORE_IGNORE_HOME_MDB ((ULONG)0x00000200) /* reserved for internal use */
-#define OPENSTORE_NO_MAIL ((ULONG)0x00000400) /* reserved for internal use */
-#define OPENSTORE_OVERRIDE_LAST_MODIFIER ((ULONG)0x00000800)
-#define OPENSTORE_CALLBACK_LOGON ((ULONG)0x00001000) /* reserved for internal use */
-#define OPENSTORE_LOCAL ((ULONG)0x00002000)
-#define OPENSTORE_FAIL_IF_NO_MAILBOX ((ULONG)0x00004000) /* reserved for internal use */
-#define OPENSTORE_CACHE_EXCHANGE ((ULONG)0x00008000)
-#define OPENSTORE_CLI_WITH_NAMEDPROP_FIX ((ULONG)0x00010000) /* reserved for internal use */
-#define OPENSTORE_ENABLE_LAZY_LOGGING ((ULONG)0x00020000) /* reserved for internal use */
-#define OPENSTORE_CLI_WITH_REPLID_GUID_MAPPING_FIX ((ULONG)0x00040000) /* reserved for internal use */
-#define OPENSTORE_NO_LOCALIZATION ((ULONG)0x00080000) /* reserved for internal use */
-#define OPENSTORE_RESTORE_DATABASE ((ULONG)0x00100000)
-#define OPENSTORE_XFOREST_MOVE ((ULONG)0x00200000) /* reserved for internal use */
-
+#define OPENSTORE_USE_ADMIN_PRIVILEGE ((ULONG)0x00000001)
+#define OPENSTORE_PUBLIC ((ULONG)0x00000002)
+#define OPENSTORE_HOME_LOGON ((ULONG)0x00000004)
+#define OPENSTORE_TAKE_OWNERSHIP ((ULONG)0x00000008)
+#define OPENSTORE_OVERRIDE_HOME_MDB ((ULONG)0x00000010)
+#define OPENSTORE_TRANSPORT ((ULONG)0x00000020)
+#define OPENSTORE_REMOTE_TRANSPORT ((ULONG)0x00000040)
+#define OPENSTORE_INTERNET_ANONYMOUS ((ULONG)0x00000080)
+#define OPENSTORE_ALTERNATE_SERVER ((ULONG)0x00000100) /* reserved for internal use */
+#define OPENSTORE_IGNORE_HOME_MDB ((ULONG)0x00000200) /* reserved for internal use */
+#define OPENSTORE_NO_MAIL ((ULONG)0x00000400) /* reserved for internal use */
+#define OPENSTORE_OVERRIDE_LAST_MODIFIER ((ULONG)0x00000800)
+#define OPENSTORE_CALLBACK_LOGON ((ULONG)0x00001000) /* reserved for internal use */
+#define OPENSTORE_LOCAL ((ULONG)0x00002000)
+#define OPENSTORE_FAIL_IF_NO_MAILBOX ((ULONG)0x00004000) /* reserved for internal use */
+#define OPENSTORE_CACHE_EXCHANGE ((ULONG)0x00008000)
+#define OPENSTORE_CLI_WITH_NAMEDPROP_FIX ((ULONG)0x00010000) /* reserved for internal use */
+#define OPENSTORE_ENABLE_LAZY_LOGGING ((ULONG)0x00020000) /* reserved for internal use */
+#define OPENSTORE_CLI_WITH_REPLID_GUID_MAPPING_FIX ((ULONG)0x00040000) /* reserved for internal use */
+#define OPENSTORE_NO_LOCALIZATION ((ULONG)0x00080000) /* reserved for internal use */
+#define OPENSTORE_RESTORE_DATABASE ((ULONG)0x00100000)
+#define OPENSTORE_XFOREST_MOVE ((ULONG)0x00200000) /* reserved for internal use */
// Values for PR_PROFILE_TYPE
-#define PROFILE_PRIMARY_USER ((ULONG)1)
-#define PROFILE_DELEGATE ((ULONG)2)
-#define PROFILE_PUBLIC_STORE ((ULONG)3)
-#define PROFILE_SUBSCRIPTION ((ULONG)4)
-
+#define PROFILE_PRIMARY_USER ((ULONG)1)
+#define PROFILE_DELEGATE ((ULONG)2)
+#define PROFILE_PUBLIC_STORE ((ULONG)3)
+#define PROFILE_SUBSCRIPTION ((ULONG)4)
/*------------------------------------------------------------------------
*
@@ -188,111 +183,111 @@
/* PR_MDB_PROVIDER GUID in stores table */
-#define pbExchangeProviderPrimaryUserGuid "\x54\x94\xA1\xC0\x29\x7F\x10\x1B\xA5\x87\x08\x00\x2B\x2A\x25\x17"
-#define pbExchangeProviderDelegateGuid "\x9e\xb4\x77\x00\x74\xe4\x11\xce\x8c\x5e\x00\xaa\x00\x42\x54\xe2"
-#define pbExchangeProviderPublicGuid "\x78\xb2\xfa\x70\xaf\xf7\x11\xcd\x9b\xc8\x00\xaa\x00\x2f\xc4\x5a"
-#define pbExchangeProviderXportGuid "\xa9\x06\x40\xe0\xd6\x93\x11\xcd\xaf\x95\x00\xaa\x00\x4a\x35\xc3"
-#define pbExchangeProviderLocalStoreGuid "\x2D\xE5\x6B\xA1\x64\x6E\x11\xd2\x8D\x4E\x00\xC0\x4F\xAE\x23\x71"
-#define pbExchangeProviderPersistStoreGuid "\x98\xA2\x3D\x67\x62\xCF\x4d\x34\x82\x79\xDB\xFA\x6A\x50\x8B\x31"
+#define pbExchangeProviderPrimaryUserGuid "\x54\x94\xA1\xC0\x29\x7F\x10\x1B\xA5\x87\x08\x00\x2B\x2A\x25\x17"
+#define pbExchangeProviderDelegateGuid "\x9e\xb4\x77\x00\x74\xe4\x11\xce\x8c\x5e\x00\xaa\x00\x42\x54\xe2"
+#define pbExchangeProviderPublicGuid "\x78\xb2\xfa\x70\xaf\xf7\x11\xcd\x9b\xc8\x00\xaa\x00\x2f\xc4\x5a"
+#define pbExchangeProviderXportGuid "\xa9\x06\x40\xe0\xd6\x93\x11\xcd\xaf\x95\x00\xaa\x00\x4a\x35\xc3"
+#define pbExchangeProviderLocalStoreGuid "\x2D\xE5\x6B\xA1\x64\x6E\x11\xd2\x8D\x4E\x00\xC0\x4F\xAE\x23\x71"
+#define pbExchangeProviderPersistStoreGuid "\x98\xA2\x3D\x67\x62\xCF\x4d\x34\x82\x79\xDB\xFA\x6A\x50\x8B\x31"
// All properties in this section are readonly
// Identity of store
- // All stores
-#define PR_USER_ENTRYID PROP_TAG( PT_BINARY, pidStoreMin+0x01)
-#define PR_USER_NAME PROP_TAG( PT_STRING8, pidStoreMin+0x02)
+// All stores
+#define PR_USER_ENTRYID PROP_TAG(PT_BINARY, pidStoreMin + 0x01)
+#define PR_USER_NAME PROP_TAG(PT_STRING8, pidStoreMin + 0x02)
- // All mailbox stores
-#define PR_MAILBOX_OWNER_ENTRYID PROP_TAG( PT_BINARY, pidStoreMin+0x03)
-#define PR_MAILBOX_OWNER_NAME PROP_TAG( PT_STRING8, pidStoreMin+0x04)
-#define PR_OOF_STATE PROP_TAG( PT_BOOLEAN, pidStoreMin+0x05)
+// All mailbox stores
+#define PR_MAILBOX_OWNER_ENTRYID PROP_TAG(PT_BINARY, pidStoreMin + 0x03)
+#define PR_MAILBOX_OWNER_NAME PROP_TAG(PT_STRING8, pidStoreMin + 0x04)
+#define PR_OOF_STATE PROP_TAG(PT_BOOLEAN, pidStoreMin + 0x05)
// Bug#255023 Provide quota information to MAPI clients to avoid large emails from ever reaching the server
-#define PR_MAX_SUBMIT_MESSAGE_SIZE PROP_TAG( PT_LONG, 0x666D)
-#define PR_PROHIBIT_SEND_QUOTA PROP_TAG( PT_LONG, 0x666E)
+#define PR_MAX_SUBMIT_MESSAGE_SIZE PROP_TAG(PT_LONG, 0x666D)
+#define PR_PROHIBIT_SEND_QUOTA PROP_TAG(PT_LONG, 0x666E)
- // Public stores -- name of hierarchy server
-#define PR_HIERARCHY_SERVER PROP_TAG( PT_TSTRING, pidStoreMin+0x1B)
+// Public stores -- name of hierarchy server
+#define PR_HIERARCHY_SERVER PROP_TAG(PT_TSTRING, pidStoreMin + 0x1B)
// Entryids of special folders
- // All mailbox stores
-#define PR_SCHEDULE_FOLDER_ENTRYID PROP_TAG( PT_BINARY, pidStoreMin+0x06)
-
- // All mailbox and gateway stores
-#define PR_IPM_DAF_ENTRYID PROP_TAG( PT_BINARY, pidStoreMin+0x07)
-
- // Public store
-#define PR_NON_IPM_SUBTREE_ENTRYID PROP_TAG( PT_BINARY, pidStoreMin+0x08)
-#define PR_EFORMS_REGISTRY_ENTRYID PROP_TAG( PT_BINARY, pidStoreMin+0x09)
-#define PR_SPLUS_FREE_BUSY_ENTRYID PROP_TAG( PT_BINARY, pidStoreMin+0x0A)
-#define PR_OFFLINE_ADDRBOOK_ENTRYID PROP_TAG( PT_BINARY, pidStoreMin+0x0B)
-#define PR_NNTP_CONTROL_FOLDER_ENTRYID PROP_TAG( PT_BINARY, pidSpecialMin+0x1B)
-#define PR_EFORMS_FOR_LOCALE_ENTRYID PROP_TAG( PT_BINARY, pidStoreMin+0x0C)
-#define PR_FREE_BUSY_FOR_LOCAL_SITE_ENTRYID PROP_TAG( PT_BINARY, pidStoreMin+0x0D)
-#define PR_ADDRBOOK_FOR_LOCAL_SITE_ENTRYID PROP_TAG( PT_BINARY, pidStoreMin+0x0E)
-#define PR_NEWSGROUP_ROOT_FOLDER_ENTRYID PROP_TAG( PT_BINARY, pidSpecialMin+0x1C)
-#define PR_OFFLINE_MESSAGE_ENTRYID PROP_TAG( PT_BINARY, pidStoreMin+0x0F)
-#define PR_IPM_FAVORITES_ENTRYID PROP_TAG( PT_BINARY, pidStoreMin+0x18)
-#define PR_IPM_PUBLIC_FOLDERS_ENTRYID PROP_TAG( PT_BINARY, pidStoreMin+0x19)
-#define PR_FAVORITES_DEFAULT_NAME PROP_TAG( PT_STRING8, pidStoreMin+0x1D)
-#define PR_SYS_CONFIG_FOLDER_ENTRYID PROP_TAG( PT_BINARY, pidStoreMin+0x1E)
-#define PR_NNTP_ARTICLE_FOLDER_ENTRYID PROP_TAG( PT_BINARY, pidSpecialMin+0x1A)
-#define PR_EVENTS_ROOT_FOLDER_ENTRYID PROP_TAG( PT_BINARY, pidSpecialMin+0xA)
-
- // Gateway stores
-#define PR_GW_MTSIN_ENTRYID PROP_TAG( PT_BINARY, pidStoreMin+0x10)
-#define PR_GW_MTSOUT_ENTRYID PROP_TAG( PT_BINARY, pidStoreMin+0x11)
-#define PR_TRANSFER_ENABLED PROP_TAG( PT_BOOLEAN, pidStoreMin+0x12)
+// All mailbox stores
+#define PR_SCHEDULE_FOLDER_ENTRYID PROP_TAG(PT_BINARY, pidStoreMin + 0x06)
+
+// All mailbox and gateway stores
+#define PR_IPM_DAF_ENTRYID PROP_TAG(PT_BINARY, pidStoreMin + 0x07)
+
+// Public store
+#define PR_NON_IPM_SUBTREE_ENTRYID PROP_TAG(PT_BINARY, pidStoreMin + 0x08)
+#define PR_EFORMS_REGISTRY_ENTRYID PROP_TAG(PT_BINARY, pidStoreMin + 0x09)
+#define PR_SPLUS_FREE_BUSY_ENTRYID PROP_TAG(PT_BINARY, pidStoreMin + 0x0A)
+#define PR_OFFLINE_ADDRBOOK_ENTRYID PROP_TAG(PT_BINARY, pidStoreMin + 0x0B)
+#define PR_NNTP_CONTROL_FOLDER_ENTRYID PROP_TAG(PT_BINARY, pidSpecialMin + 0x1B)
+#define PR_EFORMS_FOR_LOCALE_ENTRYID PROP_TAG(PT_BINARY, pidStoreMin + 0x0C)
+#define PR_FREE_BUSY_FOR_LOCAL_SITE_ENTRYID PROP_TAG(PT_BINARY, pidStoreMin + 0x0D)
+#define PR_ADDRBOOK_FOR_LOCAL_SITE_ENTRYID PROP_TAG(PT_BINARY, pidStoreMin + 0x0E)
+#define PR_NEWSGROUP_ROOT_FOLDER_ENTRYID PROP_TAG(PT_BINARY, pidSpecialMin + 0x1C)
+#define PR_OFFLINE_MESSAGE_ENTRYID PROP_TAG(PT_BINARY, pidStoreMin + 0x0F)
+#define PR_IPM_FAVORITES_ENTRYID PROP_TAG(PT_BINARY, pidStoreMin + 0x18)
+#define PR_IPM_PUBLIC_FOLDERS_ENTRYID PROP_TAG(PT_BINARY, pidStoreMin + 0x19)
+#define PR_FAVORITES_DEFAULT_NAME PROP_TAG(PT_STRING8, pidStoreMin + 0x1D)
+#define PR_SYS_CONFIG_FOLDER_ENTRYID PROP_TAG(PT_BINARY, pidStoreMin + 0x1E)
+#define PR_NNTP_ARTICLE_FOLDER_ENTRYID PROP_TAG(PT_BINARY, pidSpecialMin + 0x1A)
+#define PR_EVENTS_ROOT_FOLDER_ENTRYID PROP_TAG(PT_BINARY, pidSpecialMin + 0xA)
+
+// Gateway stores
+#define PR_GW_MTSIN_ENTRYID PROP_TAG(PT_BINARY, pidStoreMin + 0x10)
+#define PR_GW_MTSOUT_ENTRYID PROP_TAG(PT_BINARY, pidStoreMin + 0x11)
+#define PR_TRANSFER_ENABLED PROP_TAG(PT_BOOLEAN, pidStoreMin + 0x12)
// This property is preinitialized to 256 bytes of zeros
// GetProp on this property is guaranteed to RPC. May be used
// to determine line speed of connection to server.
-#define PR_TEST_LINE_SPEED PROP_TAG( PT_BINARY, pidStoreMin+0x13)
+#define PR_TEST_LINE_SPEED PROP_TAG(PT_BINARY, pidStoreMin + 0x13)
// Used with OpenProperty to get interface, also on folders
-#define PR_HIERARCHY_SYNCHRONIZER PROP_TAG( PT_OBJECT, pidStoreMin+0x14)
-#define PR_CONTENTS_SYNCHRONIZER PROP_TAG( PT_OBJECT, pidStoreMin+0x15)
-#define PR_COLLECTOR PROP_TAG( PT_OBJECT, pidStoreMin+0x16)
+#define PR_HIERARCHY_SYNCHRONIZER PROP_TAG(PT_OBJECT, pidStoreMin + 0x14)
+#define PR_CONTENTS_SYNCHRONIZER PROP_TAG(PT_OBJECT, pidStoreMin + 0x15)
+#define PR_COLLECTOR PROP_TAG(PT_OBJECT, pidStoreMin + 0x16)
// Used with OpenProperty to get interface for folders, messages, attachmentson
-#define PR_FAST_TRANSFER PROP_TAG( PT_OBJECT, pidStoreMin+0x17)
+#define PR_FAST_TRANSFER PROP_TAG(PT_OBJECT, pidStoreMin + 0x17)
// Used with OpenProperty to get interface for store object
-#define PR_CHANGE_ADVISOR PROP_TAG( PT_OBJECT, pidStoreMin+0x1C)
+#define PR_CHANGE_ADVISOR PROP_TAG(PT_OBJECT, pidStoreMin + 0x1C)
// used to set the ics notification suppression guid
-#define PR_CHANGE_NOTIFICATION_GUID PROP_TAG( PT_CLSID, pidStoreMin+0x1F)
+#define PR_CHANGE_NOTIFICATION_GUID PROP_TAG(PT_CLSID, pidStoreMin + 0x1F)
// This property is available on mailbox and public stores. If it exists
// and its value is TRUE, the store is connected to the offline store provider.
-#define PR_STORE_OFFLINE PROP_TAG( PT_BOOLEAN, pidStoreMin+0x1A)
+#define PR_STORE_OFFLINE PROP_TAG(PT_BOOLEAN, pidStoreMin + 0x1A)
// In transit state for store object. This state is
// set when mail is being moved and it pauses mail delivery
// to the mail box
-#define PR_IN_TRANSIT PROP_TAG( PT_BOOLEAN, pidStoreMin)
+#define PR_IN_TRANSIT PROP_TAG(PT_BOOLEAN, pidStoreMin)
// Writable only with Admin rights, available on public stores and folders
-#define PR_REPLICATION_STYLE PROP_TAG( PT_LONG, pidAdminMin)
-#define PR_REPLICATION_SCHEDULE PROP_TAG( PT_BINARY, pidAdminMin+0x01)
-#define PR_REPLICATION_MESSAGE_PRIORITY PROP_TAG( PT_LONG, pidAdminMin+0x02)
+#define PR_REPLICATION_STYLE PROP_TAG(PT_LONG, pidAdminMin)
+#define PR_REPLICATION_SCHEDULE PROP_TAG(PT_BINARY, pidAdminMin + 0x01)
+#define PR_REPLICATION_MESSAGE_PRIORITY PROP_TAG(PT_LONG, pidAdminMin + 0x02)
// Writable only with Admin rights, available on public stores
-#define PR_OVERALL_MSG_AGE_LIMIT PROP_TAG( PT_LONG, pidAdminMin+0x03 )
-#define PR_REPLICATION_ALWAYS_INTERVAL PROP_TAG( PT_LONG, pidAdminMin+0x04 )
-#define PR_REPLICATION_MSG_SIZE PROP_TAG( PT_LONG, pidAdminMin+0x05 )
+#define PR_OVERALL_MSG_AGE_LIMIT PROP_TAG(PT_LONG, pidAdminMin + 0x03)
+#define PR_REPLICATION_ALWAYS_INTERVAL PROP_TAG(PT_LONG, pidAdminMin + 0x04)
+#define PR_REPLICATION_MSG_SIZE PROP_TAG(PT_LONG, pidAdminMin + 0x05)
// default replication style=always interval (minutes)
-#define STYLE_ALWAYS_INTERVAL_DEFAULT (ULONG) 15
+#define STYLE_ALWAYS_INTERVAL_DEFAULT (ULONG)15
// default replication message size limit (KB)
-#define REPLICATION_MESSAGE_SIZE_LIMIT_DEFAULT (ULONG) 300
+#define REPLICATION_MESSAGE_SIZE_LIMIT_DEFAULT (ULONG)300
// Values for PR_REPLICATION_STYLE
-#define STYLE_NEVER (ULONG) 0 // never replicate
-#define STYLE_NORMAL (ULONG) 1 // use 84 byte schedule TIB
-#define STYLE_ALWAYS (ULONG) 2 // replicate at fastest rate
-#define STYLE_DEFAULT (ULONG) -1 // default value
+#define STYLE_NEVER (ULONG)0 // never replicate
+#define STYLE_NORMAL (ULONG)1 // use 84 byte schedule TIB
+#define STYLE_ALWAYS (ULONG)2 // replicate at fastest rate
+#define STYLE_DEFAULT (ULONG) - 1 // default value
/*------------------------------------------------------------------------
*
@@ -301,16 +296,16 @@
*
*-----------------------------------------------------------------------*/
-#define PR_SOURCE_KEY PROP_TAG( PT_BINARY, pidExchangeNonXmitReservedMin+0x0)
-#define PR_PARENT_SOURCE_KEY PROP_TAG( PT_BINARY, pidExchangeNonXmitReservedMin+0x1)
-#define PR_CHANGE_KEY PROP_TAG( PT_BINARY, pidExchangeNonXmitReservedMin+0x2)
-#define PR_PREDECESSOR_CHANGE_LIST PROP_TAG( PT_BINARY, pidExchangeNonXmitReservedMin+0x3)
+#define PR_SOURCE_KEY PROP_TAG(PT_BINARY, pidExchangeNonXmitReservedMin + 0x0)
+#define PR_PARENT_SOURCE_KEY PROP_TAG(PT_BINARY, pidExchangeNonXmitReservedMin + 0x1)
+#define PR_CHANGE_KEY PROP_TAG(PT_BINARY, pidExchangeNonXmitReservedMin + 0x2)
+#define PR_PREDECESSOR_CHANGE_LIST PROP_TAG(PT_BINARY, pidExchangeNonXmitReservedMin + 0x3)
// msg-folder only property
// actual FID for a msg-folder row
// ptagFID for message rows
// ptagInstanceID for subfolder rows
-#define PR_SOURCE_FID PROP_TAG(PT_I8, pidStoreNonTransMin+0x1F)
+#define PR_SOURCE_FID PROP_TAG(PT_I8, pidStoreNonTransMin + 0x1F)
/*------------------------------------------------------------------------
*
@@ -320,92 +315,91 @@
// folders table property used by PKM to define the catalog guid for content
// indexing and searching; doubles as index enable/disable
-#define PR_CATALOG PROP_TAG(PT_BINARY, pidStoreNonTransMin+0x1B)
+#define PR_CATALOG PROP_TAG(PT_BINARY, pidStoreNonTransMin + 0x1B)
// Is CI searching enabled on this folder?
-#define PR_CI_SEARCH_ENABLED PROP_TAG(PT_BOOLEAN, pidStoreNonTransMin+0x1C)
+#define PR_CI_SEARCH_ENABLED PROP_TAG(PT_BOOLEAN, pidStoreNonTransMin + 0x1C)
// Is notification-based indexing enabled on this folder?
-#define PR_CI_NOTIFICATION_ENABLED PROP_TAG(PT_BOOLEAN, pidStoreNonTransMin+0x1D)
+#define PR_CI_NOTIFICATION_ENABLED PROP_TAG(PT_BOOLEAN, pidStoreNonTransMin + 0x1D)
// Max number of cached view allowed
-#define PR_MAX_CACHED_VIEWS PROP_TAG(PT_LONG, pidStoreNonTransMin+0x28)
+#define PR_MAX_CACHED_VIEWS PROP_TAG(PT_LONG, pidStoreNonTransMin + 0x28)
// Max number of indices allowed
// Review : this ptag is used for PR_MIME_HANDLER_CLASSIDS, but because the context
// is different I am reusing it here.
-#define PR_MAX_INDICES PROP_TAG(PT_LONG, pidStoreNonTransMin+0x1E)
+#define PR_MAX_INDICES PROP_TAG(PT_LONG, pidStoreNonTransMin + 0x1E)
// folders table property containing list of guid/restriction pairs
-#define PR_IMPLIED_RESTRICTIONS PROP_TAG( PT_MV_BINARY, pidSpecialMin+0x0F)
+#define PR_IMPLIED_RESTRICTIONS PROP_TAG(PT_MV_BINARY, pidSpecialMin + 0x0F)
// Read only, available on all folders
-#define PR_FOLDER_CHILD_COUNT PROP_TAG( PT_LONG, pidFolderMin)
-#define PR_RIGHTS PROP_TAG( PT_LONG, pidFolderMin+0x01)
-#define PR_ACL_TABLE PROP_TAG( PT_OBJECT, pidExchangeXmitReservedMin)
-#define PR_RULES_TABLE PROP_TAG( PT_OBJECT, pidExchangeXmitReservedMin+0x1)
-#define PR_HAS_RULES PROP_TAG( PT_BOOLEAN, pidFolderMin+0x02)
-#define PR_HAS_MODERATOR_RULES PROP_TAG( PT_BOOLEAN, pidFolderMin+0x07 )
-
-//Read only, available only for public folders
-#define PR_ADDRESS_BOOK_ENTRYID PROP_TAG( PT_BINARY, pidFolderMin+0x03)
-
-//Writable, available on folders in all stores
-#define PR_ACL_DATA PROP_TAG( PT_BINARY, pidExchangeXmitReservedMin)
-#define PR_RULES_DATA PROP_TAG( PT_BINARY, pidExchangeXmitReservedMin+0x1)
-#define PR_EXTENDED_ACL_DATA PROP_TAG( PT_BINARY, pidExchangeXmitReservedMin+0x1E)
-#define PR_FOLDER_DESIGN_FLAGS PROP_TAG( PT_LONG, pidExchangeXmitReservedMin+0x2)
-#define PR_DESIGN_IN_PROGRESS PROP_TAG( PT_BOOLEAN, pidExchangeXmitReservedMin+0x4)
-#define PR_SECURE_ORIGINATION PROP_TAG( PT_BOOLEAN, pidExchangeXmitReservedMin+0x5)
-
-//Writable, available only for public folders
-#define PR_PUBLISH_IN_ADDRESS_BOOK PROP_TAG( PT_BOOLEAN, pidExchangeXmitReservedMin+0x6)
-#define PR_RESOLVE_METHOD PROP_TAG( PT_LONG, pidExchangeXmitReservedMin+0x7)
-#define PR_ADDRESS_BOOK_DISPLAY_NAME PROP_TAG( PT_TSTRING, pidExchangeXmitReservedMin+0x8)
-
-//Writable, used to indicate locale id for eforms registry subfolders
-#define PR_EFORMS_LOCALE_ID PROP_TAG( PT_LONG, pidExchangeXmitReservedMin+0x9)
+#define PR_FOLDER_CHILD_COUNT PROP_TAG(PT_LONG, pidFolderMin)
+#define PR_RIGHTS PROP_TAG(PT_LONG, pidFolderMin + 0x01)
+#define PR_ACL_TABLE PROP_TAG(PT_OBJECT, pidExchangeXmitReservedMin)
+#define PR_RULES_TABLE PROP_TAG(PT_OBJECT, pidExchangeXmitReservedMin + 0x1)
+#define PR_HAS_RULES PROP_TAG(PT_BOOLEAN, pidFolderMin + 0x02)
+#define PR_HAS_MODERATOR_RULES PROP_TAG(PT_BOOLEAN, pidFolderMin + 0x07)
+
+// Read only, available only for public folders
+#define PR_ADDRESS_BOOK_ENTRYID PROP_TAG(PT_BINARY, pidFolderMin + 0x03)
+
+// Writable, available on folders in all stores
+#define PR_ACL_DATA PROP_TAG(PT_BINARY, pidExchangeXmitReservedMin)
+#define PR_RULES_DATA PROP_TAG(PT_BINARY, pidExchangeXmitReservedMin + 0x1)
+#define PR_EXTENDED_ACL_DATA PROP_TAG(PT_BINARY, pidExchangeXmitReservedMin + 0x1E)
+#define PR_FOLDER_DESIGN_FLAGS PROP_TAG(PT_LONG, pidExchangeXmitReservedMin + 0x2)
+#define PR_DESIGN_IN_PROGRESS PROP_TAG(PT_BOOLEAN, pidExchangeXmitReservedMin + 0x4)
+#define PR_SECURE_ORIGINATION PROP_TAG(PT_BOOLEAN, pidExchangeXmitReservedMin + 0x5)
+
+// Writable, available only for public folders
+#define PR_PUBLISH_IN_ADDRESS_BOOK PROP_TAG(PT_BOOLEAN, pidExchangeXmitReservedMin + 0x6)
+#define PR_RESOLVE_METHOD PROP_TAG(PT_LONG, pidExchangeXmitReservedMin + 0x7)
+#define PR_ADDRESS_BOOK_DISPLAY_NAME PROP_TAG(PT_TSTRING, pidExchangeXmitReservedMin + 0x8)
+
+// Writable, used to indicate locale id for eforms registry subfolders
+#define PR_EFORMS_LOCALE_ID PROP_TAG(PT_LONG, pidExchangeXmitReservedMin + 0x9)
// Writable only with Admin rights, available only for public folders
-#define PR_REPLICA_LIST PROP_TAG( PT_BINARY, pidAdminMin+0x8)
-#define PR_OVERALL_AGE_LIMIT PROP_TAG( PT_LONG, pidAdminMin+0x9)
+#define PR_REPLICA_LIST PROP_TAG(PT_BINARY, pidAdminMin + 0x8)
+#define PR_OVERALL_AGE_LIMIT PROP_TAG(PT_LONG, pidAdminMin + 0x9)
// Newsgroup related properties. Writable only with Admin rights.
-#define PR_IS_NEWSGROUP_ANCHOR PROP_TAG( PT_BOOLEAN, pidAdminMin+0x06)
-#define PR_IS_NEWSGROUP PROP_TAG( PT_BOOLEAN, pidAdminMin+0x07)
-#define PR_NEWSGROUP_COMPONENT PROP_TAG( PT_STRING8, pidAdminMin+0x15)
-#define PR_INTERNET_NEWSGROUP_NAME PROP_TAG( PT_STRING8, pidAdminMin+0x17)
-#define PR_NEWSFEED_INFO PROP_TAG( PT_BINARY, pidAdminMin+0x16)
+#define PR_IS_NEWSGROUP_ANCHOR PROP_TAG(PT_BOOLEAN, pidAdminMin + 0x06)
+#define PR_IS_NEWSGROUP PROP_TAG(PT_BOOLEAN, pidAdminMin + 0x07)
+#define PR_NEWSGROUP_COMPONENT PROP_TAG(PT_STRING8, pidAdminMin + 0x15)
+#define PR_INTERNET_NEWSGROUP_NAME PROP_TAG(PT_STRING8, pidAdminMin + 0x17)
+#define PR_NEWSFEED_INFO PROP_TAG(PT_BINARY, pidAdminMin + 0x16)
// Newsgroup related property.
-#define PR_PREVENT_MSG_CREATE PROP_TAG( PT_BOOLEAN, pidExchangeNonXmitReservedMin+0x14)
+#define PR_PREVENT_MSG_CREATE PROP_TAG(PT_BOOLEAN, pidExchangeNonXmitReservedMin + 0x14)
// IMAP internal date
-#define PR_IMAP_INTERNAL_DATE PROP_TAG( PT_SYSTIME, pidExchangeNonXmitReservedMin+0x15)
+#define PR_IMAP_INTERNAL_DATE PROP_TAG(PT_SYSTIME, pidExchangeNonXmitReservedMin + 0x15)
// Virtual properties to refer to Newsfeed DNs. Cannot get/set these on
// any object. Supported currently only in specifying restrictions.
-#define PR_INBOUND_NEWSFEED_DN PROP_TAG( PT_STRING8, pidSpecialMin+0x1D)
-#define PR_OUTBOUND_NEWSFEED_DN PROP_TAG( PT_STRING8, pidSpecialMin+0x1E)
+#define PR_INBOUND_NEWSFEED_DN PROP_TAG(PT_STRING8, pidSpecialMin + 0x1D)
+#define PR_OUTBOUND_NEWSFEED_DN PROP_TAG(PT_STRING8, pidSpecialMin + 0x1E)
// Used for controlling content conversion in NNTP
-#define PR_INTERNET_CHARSET PROP_TAG( PT_TSTRING, pidAdminMin+0xA)
+#define PR_INTERNET_CHARSET PROP_TAG(PT_TSTRING, pidAdminMin + 0xA)
-//PR_RESOLVE_METHOD values
-#define RESOLVE_METHOD_DEFAULT ((LONG)0) // default handling attach conflicts
-#define RESOLVE_METHOD_LAST_WRITER_WINS ((LONG)1) // the last writer will win conflict
-#define RESOLVE_METHOD_NO_CONFLICT_NOTIFICATION ((LONG)2) // no conflict notif
+// PR_RESOLVE_METHOD values
+#define RESOLVE_METHOD_DEFAULT ((LONG)0) // default handling attach conflicts
+#define RESOLVE_METHOD_LAST_WRITER_WINS ((LONG)1) // the last writer will win conflict
+#define RESOLVE_METHOD_NO_CONFLICT_NOTIFICATION ((LONG)2) // no conflict notif
-//Read only, available only for public folder favorites
-#define PR_PUBLIC_FOLDER_ENTRYID PROP_TAG( PT_BINARY, pidFolderMin+0x04)
+// Read only, available only for public folder favorites
+#define PR_PUBLIC_FOLDER_ENTRYID PROP_TAG(PT_BINARY, pidFolderMin + 0x04)
-//Read only. changes everytime a subfolder is created or deleted
-#define PR_HIERARCHY_CHANGE_NUM PROP_TAG( PT_LONG, pidFolderMin+0x06)
+// Read only. changes everytime a subfolder is created or deleted
+#define PR_HIERARCHY_CHANGE_NUM PROP_TAG(PT_LONG, pidFolderMin + 0x06)
// For IFS/OLEDB to set and get user sid in LOGON
-#define PR_USER_SID PROP_TAG(PT_BINARY, PROP_ID(ptagSearchState)) // pidInternalNoAccessNonTransMin+0x23)
-#define PR_CREATOR_TOKEN PR_USER_SID
-
+#define PR_USER_SID PROP_TAG(PT_BINARY, PROP_ID(ptagSearchState)) // pidInternalNoAccessNonTransMin+0x23)
+#define PR_CREATOR_TOKEN PR_USER_SID
/*------------------------------------------------------------------------
*
@@ -414,141 +408,140 @@
*-----------------------------------------------------------------------*/
// Read only, automatically set on all messages in all stores
-#define PR_HAS_NAMED_PROPERTIES PROP_TAG(PT_BOOLEAN, pidMessageReadOnlyMin+0x0A)
+#define PR_HAS_NAMED_PROPERTIES PROP_TAG(PT_BOOLEAN, pidMessageReadOnlyMin + 0x0A)
// Read only but outside the provider specific range for replication thru GDK-GWs
-#define PR_CREATOR_NAME PROP_TAG(PT_TSTRING, pidExchangeXmitReservedMin+0x18)
-#define PR_CREATOR_ENTRYID PROP_TAG(PT_BINARY, pidExchangeXmitReservedMin+0x19)
-#define PR_LAST_MODIFIER_NAME PROP_TAG(PT_TSTRING, pidExchangeXmitReservedMin+0x1A)
-#define PR_LAST_MODIFIER_ENTRYID PROP_TAG(PT_BINARY, pidExchangeXmitReservedMin+0x1B)
-#define PR_REPLY_RECIPIENT_SMTP_PROXIES PROP_TAG(PT_TSTRING, pidExchangeXmitReservedMin+0x1C)
+#define PR_CREATOR_NAME PROP_TAG(PT_TSTRING, pidExchangeXmitReservedMin + 0x18)
+#define PR_CREATOR_ENTRYID PROP_TAG(PT_BINARY, pidExchangeXmitReservedMin + 0x19)
+#define PR_LAST_MODIFIER_NAME PROP_TAG(PT_TSTRING, pidExchangeXmitReservedMin + 0x1A)
+#define PR_LAST_MODIFIER_ENTRYID PROP_TAG(PT_BINARY, pidExchangeXmitReservedMin + 0x1B)
+#define PR_REPLY_RECIPIENT_SMTP_PROXIES PROP_TAG(PT_TSTRING, pidExchangeXmitReservedMin + 0x1C)
// Read only, appears on messages which have DAM's pointing to them
-#define PR_HAS_DAMS PROP_TAG( PT_BOOLEAN, pidExchangeXmitReservedMin+0x0A)
-#define PR_RULE_TRIGGER_HISTORY PROP_TAG( PT_BINARY, pidExchangeXmitReservedMin+0x12)
-#define PR_MOVE_TO_STORE_ENTRYID PROP_TAG( PT_BINARY, pidExchangeXmitReservedMin+0x13)
-#define PR_MOVE_TO_FOLDER_ENTRYID PROP_TAG( PT_BINARY, pidExchangeXmitReservedMin+0x14)
+#define PR_HAS_DAMS PROP_TAG(PT_BOOLEAN, pidExchangeXmitReservedMin + 0x0A)
+#define PR_RULE_TRIGGER_HISTORY PROP_TAG(PT_BINARY, pidExchangeXmitReservedMin + 0x12)
+#define PR_MOVE_TO_STORE_ENTRYID PROP_TAG(PT_BINARY, pidExchangeXmitReservedMin + 0x13)
+#define PR_MOVE_TO_FOLDER_ENTRYID PROP_TAG(PT_BINARY, pidExchangeXmitReservedMin + 0x14)
// Read only, available only on messages in the public store
-#define PR_REPLICA_SERVER PROP_TAG(PT_TSTRING, pidMessageReadOnlyMin+0x04)
-#define PR_REPLICA_VERSION PROP_TAG(PT_I8, pidMessageReadOnlyMin+0x0B)
+#define PR_REPLICA_SERVER PROP_TAG(PT_TSTRING, pidMessageReadOnlyMin + 0x04)
+#define PR_REPLICA_VERSION PROP_TAG(PT_I8, pidMessageReadOnlyMin + 0x0B)
// SID versions of standard messaging properties
-#define PR_CREATOR_SID PROP_TAG(PT_BINARY, pidStoreNonTransMin+0x18)
-#define PR_LAST_MODIFIER_SID PROP_TAG(PT_BINARY, pidStoreNonTransMin+0x19)
-#define PR_SENDER_SID PROP_TAG(PT_BINARY, pidStoreNonTransMin+0x0d)
-#define PR_SENT_REPRESENTING_SID PROP_TAG(PT_BINARY, pidStoreNonTransMin+0x0e)
-#define PR_ORIGINAL_SENDER_SID PROP_TAG(PT_BINARY, pidStoreNonTransMin+0x0f)
-#define PR_ORIGINAL_SENT_REPRESENTING_SID PROP_TAG(PT_BINARY, pidStoreNonTransMin+0x10)
-#define PR_READ_RECEIPT_SID PROP_TAG(PT_BINARY, pidStoreNonTransMin+0x11)
-#define PR_REPORT_SID PROP_TAG(PT_BINARY, pidStoreNonTransMin+0x12)
-#define PR_ORIGINATOR_SID PROP_TAG(PT_BINARY, pidStoreNonTransMin+0x13)
-#define PR_REPORT_DESTINATION_SID PROP_TAG(PT_BINARY, pidStoreNonTransMin+0x14)
-#define PR_ORIGINAL_AUTHOR_SID PROP_TAG(PT_BINARY, pidStoreNonTransMin+0x15)
-#define PR_RECEIVED_BY_SID PROP_TAG(PT_BINARY, pidStoreNonTransMin+0x16)
-#define PR_RCVD_REPRESENTING_SID PROP_TAG(PT_BINARY, pidStoreNonTransMin+0x17)
-
-#define PR_TRUST_SENDER_NO 0x00000000L
-#define PR_TRUST_SENDER_YES 0x00000001L
-#define PR_TRUST_SENDER PROP_TAG(PT_LONG, pidStoreNonTransMin+0x39)
+#define PR_CREATOR_SID PROP_TAG(PT_BINARY, pidStoreNonTransMin + 0x18)
+#define PR_LAST_MODIFIER_SID PROP_TAG(PT_BINARY, pidStoreNonTransMin + 0x19)
+#define PR_SENDER_SID PROP_TAG(PT_BINARY, pidStoreNonTransMin + 0x0d)
+#define PR_SENT_REPRESENTING_SID PROP_TAG(PT_BINARY, pidStoreNonTransMin + 0x0e)
+#define PR_ORIGINAL_SENDER_SID PROP_TAG(PT_BINARY, pidStoreNonTransMin + 0x0f)
+#define PR_ORIGINAL_SENT_REPRESENTING_SID PROP_TAG(PT_BINARY, pidStoreNonTransMin + 0x10)
+#define PR_READ_RECEIPT_SID PROP_TAG(PT_BINARY, pidStoreNonTransMin + 0x11)
+#define PR_REPORT_SID PROP_TAG(PT_BINARY, pidStoreNonTransMin + 0x12)
+#define PR_ORIGINATOR_SID PROP_TAG(PT_BINARY, pidStoreNonTransMin + 0x13)
+#define PR_REPORT_DESTINATION_SID PROP_TAG(PT_BINARY, pidStoreNonTransMin + 0x14)
+#define PR_ORIGINAL_AUTHOR_SID PROP_TAG(PT_BINARY, pidStoreNonTransMin + 0x15)
+#define PR_RECEIVED_BY_SID PROP_TAG(PT_BINARY, pidStoreNonTransMin + 0x16)
+#define PR_RCVD_REPRESENTING_SID PROP_TAG(PT_BINARY, pidStoreNonTransMin + 0x17)
+
+#define PR_TRUST_SENDER_NO 0x00000000L
+#define PR_TRUST_SENDER_YES 0x00000001L
+#define PR_TRUST_SENDER PROP_TAG(PT_LONG, pidStoreNonTransMin + 0x39)
// XML versions of SID properties
-#define PR_CREATOR_SID_AS_XML PROP_TAG(PT_TSTRING, pidStoreNonTransMin+0x2C)
-#define PR_LAST_MODIFIER_SID_AS_XML PROP_TAG(PT_TSTRING, pidStoreNonTransMin+0x2D)
-#define PR_SENDER_SID_AS_XML PROP_TAG(PT_TSTRING, pidStoreNonTransMin+0x2E)
-#define PR_SENT_REPRESENTING_SID_AS_XML PROP_TAG(PT_TSTRING, pidStoreNonTransMin+0x2F)
-#define PR_ORIGINAL_SENDER_SID_AS_XML PROP_TAG(PT_TSTRING, pidStoreNonTransMin+0x30)
-#define PR_ORIGINAL_SENT_REPRESENTING_SID_AS_XML PROP_TAG(PT_TSTRING, pidStoreNonTransMin+0x31)
-#define PR_READ_RECEIPT_SID_AS_XML PROP_TAG(PT_TSTRING, pidStoreNonTransMin+0x32)
-#define PR_REPORT_SID_AS_XML PROP_TAG(PT_TSTRING, pidStoreNonTransMin+0x33)
-#define PR_ORIGINATOR_SID_AS_XML PROP_TAG(PT_TSTRING, pidStoreNonTransMin+0x34)
-#define PR_REPORT_DESTINATION_SID_AS_XML PROP_TAG(PT_TSTRING, pidStoreNonTransMin+0x35)
-#define PR_ORIGINAL_AUTHOR_SID_AS_XML PROP_TAG(PT_TSTRING, pidStoreNonTransMin+0x36)
-#define PR_RECEIVED_BY_SID_AS_XML PROP_TAG(PT_TSTRING, pidStoreNonTransMin+0x37)
-#define PR_RCVD_REPRESENTING_SID_AS_XML PROP_TAG(PT_TSTRING, pidStoreNonTransMin+0x38)
-
+#define PR_CREATOR_SID_AS_XML PROP_TAG(PT_TSTRING, pidStoreNonTransMin + 0x2C)
+#define PR_LAST_MODIFIER_SID_AS_XML PROP_TAG(PT_TSTRING, pidStoreNonTransMin + 0x2D)
+#define PR_SENDER_SID_AS_XML PROP_TAG(PT_TSTRING, pidStoreNonTransMin + 0x2E)
+#define PR_SENT_REPRESENTING_SID_AS_XML PROP_TAG(PT_TSTRING, pidStoreNonTransMin + 0x2F)
+#define PR_ORIGINAL_SENDER_SID_AS_XML PROP_TAG(PT_TSTRING, pidStoreNonTransMin + 0x30)
+#define PR_ORIGINAL_SENT_REPRESENTING_SID_AS_XML PROP_TAG(PT_TSTRING, pidStoreNonTransMin + 0x31)
+#define PR_READ_RECEIPT_SID_AS_XML PROP_TAG(PT_TSTRING, pidStoreNonTransMin + 0x32)
+#define PR_REPORT_SID_AS_XML PROP_TAG(PT_TSTRING, pidStoreNonTransMin + 0x33)
+#define PR_ORIGINATOR_SID_AS_XML PROP_TAG(PT_TSTRING, pidStoreNonTransMin + 0x34)
+#define PR_REPORT_DESTINATION_SID_AS_XML PROP_TAG(PT_TSTRING, pidStoreNonTransMin + 0x35)
+#define PR_ORIGINAL_AUTHOR_SID_AS_XML PROP_TAG(PT_TSTRING, pidStoreNonTransMin + 0x36)
+#define PR_RECEIVED_BY_SID_AS_XML PROP_TAG(PT_TSTRING, pidStoreNonTransMin + 0x37)
+#define PR_RCVD_REPRESENTING_SID_AS_XML PROP_TAG(PT_TSTRING, pidStoreNonTransMin + 0x38)
// those two are pseudo-properties on folder. calling OFOLD::EcGetProps(PR_RESERVE_RANGE_OF_IDS) is
// equivalent to calling EcGetLocalRepIdsOp(), calling OFOLD::EcSetProps(PR_MERGE_MIDSET_DELETED)
// is equivalen to calling OFOLD::EcSetLocalRepMidsetDeleted()
-#define PR_MERGE_MIDSET_DELETED PROP_TAG(PT_BINARY, pidStoreNonTransMin+0x3a) // 0x0E7A0102
-#define PR_RESERVE_RANGE_OF_IDS PROP_TAG(PT_BINARY, pidStoreNonTransMin+0x3b) // 0x0E7B0102
+#define PR_MERGE_MIDSET_DELETED PROP_TAG(PT_BINARY, pidStoreNonTransMin + 0x3a) // 0x0E7A0102
+#define PR_RESERVE_RANGE_OF_IDS PROP_TAG(PT_BINARY, pidStoreNonTransMin + 0x3b) // 0x0E7B0102
// computed message property (read only)
// 44 byte binary property - used by PKM as globally unique message key
// 22 bytes of global ID for FID
// 22 bytes of global ID for VID
-#define PR_FID_VID PROP_TAG(PT_BINARY, pidMessageReadOnlyMin+0x0C)
-#define PR_FID_MID PR_FID_VID //NSK : temporary to allow transition
+#define PR_FID_VID PROP_TAG(PT_BINARY, pidMessageReadOnlyMin + 0x0C)
+#define PR_FID_MID PR_FID_VID // NSK : temporary to allow transition
// message property - read only, xref ID in global ID format - used by PKM
-#define PR_ORIGIN_ID PROP_TAG( PT_BINARY, pidMessageReadOnlyMin+0x0D)
+#define PR_ORIGIN_ID PROP_TAG(PT_BINARY, pidMessageReadOnlyMin + 0x0D)
// computed message property used in search folders to determine quality of
// search hit match
// NOTE: ptag.h consumers, see also ptagMsgFolderTemplateRes3
-#define PR_RANK PROP_TAG( PT_LONG, pidAdminMin+0x82 )
+#define PR_RANK PROP_TAG(PT_LONG, pidAdminMin + 0x82)
// msg-folder property, read only
// value is PR_MSG_DELIVERY_TIME if it exists, else PR_CREATION_TIME
// used as the default sort time when subfolder rows are returned in views
-#define PR_MSG_FOLD_TIME PROP_TAG( PT_SYSTIME, pidMessageReadOnlyMin+0x14)
-#define PR_ICS_CHANGE_KEY PROP_TAG( PT_BINARY, pidMessageReadOnlyMin+0x15)
+#define PR_MSG_FOLD_TIME PROP_TAG(PT_SYSTIME, pidMessageReadOnlyMin + 0x14)
+#define PR_ICS_CHANGE_KEY PROP_TAG(PT_BINARY, pidMessageReadOnlyMin + 0x15)
-#define PR_DEFERRED_SEND_NUMBER PROP_TAG( PT_LONG, pidExchangeXmitReservedMin+0xB)
-#define PR_DEFERRED_SEND_UNITS PROP_TAG( PT_LONG, pidExchangeXmitReservedMin+0xC)
-#define PR_EXPIRY_NUMBER PROP_TAG( PT_LONG, pidExchangeXmitReservedMin+0xD)
-#define PR_EXPIRY_UNITS PROP_TAG( PT_LONG, pidExchangeXmitReservedMin+0xE)
+#define PR_DEFERRED_SEND_NUMBER PROP_TAG(PT_LONG, pidExchangeXmitReservedMin + 0xB)
+#define PR_DEFERRED_SEND_UNITS PROP_TAG(PT_LONG, pidExchangeXmitReservedMin + 0xC)
+#define PR_EXPIRY_NUMBER PROP_TAG(PT_LONG, pidExchangeXmitReservedMin + 0xD)
+#define PR_EXPIRY_UNITS PROP_TAG(PT_LONG, pidExchangeXmitReservedMin + 0xE)
// Writeable, deferred send time
-#define PR_DEFERRED_SEND_TIME PROP_TAG( PT_SYSTIME, pidExchangeXmitReservedMin+0xF)
+#define PR_DEFERRED_SEND_TIME PROP_TAG(PT_SYSTIME, pidExchangeXmitReservedMin + 0xF)
-//Writeable, intended for both folders and messages in gateway mailbox
-#define PR_GW_ADMIN_OPERATIONS PROP_TAG( PT_LONG, pidMessageWriteableMin)
+// Writeable, intended for both folders and messages in gateway mailbox
+#define PR_GW_ADMIN_OPERATIONS PROP_TAG(PT_LONG, pidMessageWriteableMin)
-//Writeable, used for DMS messages
-#define PR_P1_CONTENT PROP_TAG( PT_BINARY, 0x1100)
-#define PR_P1_CONTENT_TYPE PROP_TAG( PT_BINARY, 0x1101)
+// Writeable, used for DMS messages
+#define PR_P1_CONTENT PROP_TAG(PT_BINARY, 0x1100)
+#define PR_P1_CONTENT_TYPE PROP_TAG(PT_BINARY, 0x1101)
// Properties on deferred action messages
-#define PR_CLIENT_ACTIONS PROP_TAG(PT_BINARY, pidMessageReadOnlyMin+0x5)
-#define PR_DAM_ORIGINAL_ENTRYID PROP_TAG(PT_BINARY, pidMessageReadOnlyMin+0x6)
-#define PR_DAM_BACK_PATCHED PROP_TAG( PT_BOOLEAN, pidMessageReadOnlyMin+0x7)
+#define PR_CLIENT_ACTIONS PROP_TAG(PT_BINARY, pidMessageReadOnlyMin + 0x5)
+#define PR_DAM_ORIGINAL_ENTRYID PROP_TAG(PT_BINARY, pidMessageReadOnlyMin + 0x6)
+#define PR_DAM_BACK_PATCHED PROP_TAG(PT_BOOLEAN, pidMessageReadOnlyMin + 0x7)
// Properties on deferred action error messages
-#define PR_RULE_ERROR PROP_TAG(PT_LONG, pidMessageReadOnlyMin+0x8)
-#define PR_RULE_ACTION_TYPE PROP_TAG(PT_LONG, pidMessageReadOnlyMin+0x9)
-#define PR_RULE_ACTION_NUMBER PROP_TAG(PT_LONG, pidMessageReadOnlyMin+0x10)
-#define PR_RULE_FOLDER_ENTRYID PROP_TAG(PT_BINARY, pidMessageReadOnlyMin+0x11)
+#define PR_RULE_ERROR PROP_TAG(PT_LONG, pidMessageReadOnlyMin + 0x8)
+#define PR_RULE_ACTION_TYPE PROP_TAG(PT_LONG, pidMessageReadOnlyMin + 0x9)
+#define PR_RULE_ACTION_NUMBER PROP_TAG(PT_LONG, pidMessageReadOnlyMin + 0x10)
+#define PR_RULE_FOLDER_ENTRYID PROP_TAG(PT_BINARY, pidMessageReadOnlyMin + 0x11)
// Mime representation of a message.
// Defined as 3 different types for convenience. Will be stored as file handle
// internally.
-#define PR_INTERNET_CONTENT PROP_TAG(PT_BINARY, pidMessageWriteableMin+0x1)
-#define PR_INTERNET_CONTENT_HANDLE PROP_TAG(PT_FILE_HANDLE, pidMessageWriteableMin+0x1)
-#define PR_INTERNET_CONTENT_EA PROP_TAG(PT_FILE_EA, pidMessageWriteableMin+0x1)
+#define PR_INTERNET_CONTENT PROP_TAG(PT_BINARY, pidMessageWriteableMin + 0x1)
+#define PR_INTERNET_CONTENT_HANDLE PROP_TAG(PT_FILE_HANDLE, pidMessageWriteableMin + 0x1)
+#define PR_INTERNET_CONTENT_EA PROP_TAG(PT_FILE_EA, pidMessageWriteableMin + 0x1)
// Dot-stuff state property on message
-#define PR_DOTSTUFF_STATE PROP_TAG(PT_LONG, pidUserNonTransmitMin+0x1)
+#define PR_DOTSTUFF_STATE PROP_TAG(PT_LONG, pidUserNonTransmitMin + 0x1)
// Raw byte count of mime stream, if mime exists.
-#define PR_MIME_SIZE PROP_TAG(PT_LONG, 0x6746)
-#define PR_MIME_SIZE_EXTENDED PROP_TAG(PT_I8, 0x6746)
+#define PR_MIME_SIZE PROP_TAG(PT_LONG, 0x6746)
+#define PR_MIME_SIZE_EXTENDED PROP_TAG(PT_I8, 0x6746)
// Raw byte count of ptagInternetContent, whether it is a mime message
// or freedoc using OURL
-#define PR_FILE_SIZE PROP_TAG(PT_LONG, 0x6747)
-#define PR_FILE_SIZE_EXTENDED PROP_TAG(PT_I8, 0x6747)
+#define PR_FILE_SIZE PROP_TAG(PT_LONG, 0x6747)
+#define PR_FILE_SIZE_EXTENDED PROP_TAG(PT_I8, 0x6747)
// Sender's editor format
-#define PR_MSG_EDITOR_FORMAT PROP_TAG( PT_LONG, 0x5909 )
+#define PR_MSG_EDITOR_FORMAT PROP_TAG(PT_LONG, 0x5909)
-#define EDITOR_FORMAT_DONTKNOW ((ULONG)0)
-#define EDITOR_FORMAT_PLAINTEXT ((ULONG)1)
-#define EDITOR_FORMAT_HTML ((ULONG)2)
-#define EDITOR_FORMAT_RTF ((ULONG)3)
+#define EDITOR_FORMAT_DONTKNOW ((ULONG)0)
+#define EDITOR_FORMAT_PLAINTEXT ((ULONG)1)
+#define EDITOR_FORMAT_HTML ((ULONG)2)
+#define EDITOR_FORMAT_RTF ((ULONG)3)
-#ifdef pidInternalWriteableNonTransMin
+#ifdef pidInternalWriteableNonTransMin
#if pidInternalWritableNonTranMin - 0x6740
#pragma error("pidInternalWritableNonTransMin definition has changed, must change definition of PR_MIME_SIZE")
#endif
@@ -556,72 +549,70 @@
// State of this inid as far as conversion is concerned.
// Reusing mailbox table property
-#define PR_CONVERSION_STATE PROP_TAG(PT_LONG, PROP_ID(ptagAdminNickName))
+#define PR_CONVERSION_STATE PROP_TAG(PT_LONG, PROP_ID(ptagAdminNickName))
// Property to represent native html content - assumed to be in the internet
// codepage as determined by PR_INTERNET_CPID
//
-#define PR_HTML PROP_TAG( PT_BINARY, PROP_ID( PR_BODY_HTML ) )
+#define PR_HTML PROP_TAG(PT_BINARY, PROP_ID(PR_BODY_HTML))
// computed property used for moderated folder rule
-// its an EntryId whose value is:
+// it's an EntryId whose value is:
// ptagSenderEntryId on delivery
// LOGON::PbUserEntryId() for all other cases (move/copy/post)
-#define PR_ACTIVE_USER_ENTRYID PROP_TAG(PT_BINARY, pidMessageReadOnlyMin+0x12)
+#define PR_ACTIVE_USER_ENTRYID PROP_TAG(PT_BINARY, pidMessageReadOnlyMin + 0x12)
// Property on conflict notification indicating entryid of conflicting object
-#define PR_CONFLICT_ENTRYID PROP_TAG(PT_BINARY, pidExchangeXmitReservedMin+0x10)
+#define PR_CONFLICT_ENTRYID PROP_TAG(PT_BINARY, pidExchangeXmitReservedMin + 0x10)
// Property on messages to indicate the language client used to create this message
-#define PR_MESSAGE_LOCALE_ID PROP_TAG(PT_LONG, pidExchangeXmitReservedMin+0x11)
-#define PR_MESSAGE_CODEPAGE PROP_TAG( PT_LONG, pidExchangeXmitReservedMin+0x1D)
+#define PR_MESSAGE_LOCALE_ID PROP_TAG(PT_LONG, pidExchangeXmitReservedMin + 0x11)
+#define PR_MESSAGE_CODEPAGE PROP_TAG(PT_LONG, pidExchangeXmitReservedMin + 0x1D)
// Properties on Quota warning messages to indicate Storage quota and Excess used
-#define PR_STORAGE_QUOTA_LIMIT PROP_TAG(PT_LONG, pidExchangeXmitReservedMin+0x15)
-#define PR_EXCESS_STORAGE_USED PROP_TAG(PT_LONG, pidExchangeXmitReservedMin+0x16)
-#define PR_SVR_GENERATING_QUOTA_MSG PROP_TAG(PT_TSTRING, pidExchangeXmitReservedMin+0x17)
+#define PR_STORAGE_QUOTA_LIMIT PROP_TAG(PT_LONG, pidExchangeXmitReservedMin + 0x15)
+#define PR_EXCESS_STORAGE_USED PROP_TAG(PT_LONG, pidExchangeXmitReservedMin + 0x16)
+#define PR_SVR_GENERATING_QUOTA_MSG PROP_TAG(PT_TSTRING, pidExchangeXmitReservedMin + 0x17)
// Property affixed by delegation rule and deleted on forwards
-#define PR_DELEGATED_BY_RULE PROP_TAG( PT_BOOLEAN, pidExchangeXmitReservedMin+0x3)
+#define PR_DELEGATED_BY_RULE PROP_TAG(PT_BOOLEAN, pidExchangeXmitReservedMin + 0x3)
// Message status bit used to indicate message is in conflict
-#define MSGSTATUS_IN_CONFLICT ((ULONG) 0x800)
+#define MSGSTATUS_IN_CONFLICT ((ULONG)0x800)
// Message status bit used to indicate the IMAP4 $MDNSent flag
-#define MSGSTATUS_MDNSENT ((ULONG) 0x4000)
+#define MSGSTATUS_MDNSENT ((ULONG)0x4000)
// used to indicate how much X400 private extension data is present: none, just the
// message level, or both the message and recipient levels
// !!The high order byte of this ULONG is reserved.!!
-#define ENV_BLANK ((ULONG)0x00000000)
-#define ENV_RECIP_NUM ((ULONG)0x00000001)
-#define ENV_MSG_EXT ((ULONG)0x00000002)
-#define ENV_RECIP_EXT ((ULONG)0x00000004)
+#define ENV_BLANK ((ULONG)0x00000000)
+#define ENV_RECIP_NUM ((ULONG)0x00000001)
+#define ENV_MSG_EXT ((ULONG)0x00000002)
+#define ENV_RECIP_EXT ((ULONG)0x00000004)
-
-
-#define PR_X400_ENVELOPE_TYPE PROP_TAG(PT_LONG, pidMessageReadOnlyMin+0x13)
-#define X400_ENV_PLAIN (ENV_BLANK) // no extension
-#define X400_ENV_VALID_RECIP (ENV_RECIP_NUM | ENV_MSG_EXT) // just the message level extension
-#define X400_ENV_FULL_EXT (ENV_RECIP_NUM | ENV_MSG_EXT | ENV_RECIP_EXT) // both message and recipient levels
+#define PR_X400_ENVELOPE_TYPE PROP_TAG(PT_LONG, pidMessageReadOnlyMin + 0x13)
+#define X400_ENV_PLAIN (ENV_BLANK) // no extension
+#define X400_ENV_VALID_RECIP (ENV_RECIP_NUM | ENV_MSG_EXT) // just the message level extension
+#define X400_ENV_FULL_EXT (ENV_RECIP_NUM | ENV_MSG_EXT | ENV_RECIP_EXT) // both message and recipient levels
//
// bitmask that indicates whether RN, NRN, DR, NDR, OOF, Auto-Reply should be suppressed
//
-#define AUTO_RESPONSE_SUPPRESS_DR ((ULONG)0x00000001)
-#define AUTO_RESPONSE_SUPPRESS_NDR ((ULONG)0x00000002)
-#define AUTO_RESPONSE_SUPPRESS_RN ((ULONG)0x00000004)
-#define AUTO_RESPONSE_SUPPRESS_NRN ((ULONG)0x00000008)
-#define AUTO_RESPONSE_SUPPRESS_OOF ((ULONG)0x00000010)
-#define AUTO_RESPONSE_SUPPRESS_AUTO_REPLY ((ULONG)0x00000020)
+#define AUTO_RESPONSE_SUPPRESS_DR ((ULONG)0x00000001)
+#define AUTO_RESPONSE_SUPPRESS_NDR ((ULONG)0x00000002)
+#define AUTO_RESPONSE_SUPPRESS_RN ((ULONG)0x00000004)
+#define AUTO_RESPONSE_SUPPRESS_NRN ((ULONG)0x00000008)
+#define AUTO_RESPONSE_SUPPRESS_OOF ((ULONG)0x00000010)
+#define AUTO_RESPONSE_SUPPRESS_AUTO_REPLY ((ULONG)0x00000020)
// raid 91101 - Flag indicates No RFC821 From field
#define AUTO_RESPONSE_SUPPRESS_NORFC821FROM ((ULONG)0x00000040)
-#define PR_AUTO_RESPONSE_SUPPRESS PROP_TAG(PT_LONG, pidExchangeXmitReservedMin - 0x01)
-#define PR_INTERNET_CPID PROP_TAG(PT_LONG, pidExchangeXmitReservedMin - 0x02)
+#define PR_AUTO_RESPONSE_SUPPRESS PROP_TAG(PT_LONG, pidExchangeXmitReservedMin - 0x01)
+#define PR_INTERNET_CPID PROP_TAG(PT_LONG, pidExchangeXmitReservedMin - 0x02)
-#define PR_SYNCEVENT_FIRED PROP_TAG(PT_BOOLEAN, pidMessageReadOnlyMin + 0x0F)
+#define PR_SYNCEVENT_FIRED PROP_TAG(PT_BOOLEAN, pidMessageReadOnlyMin + 0x0F)
/*------------------------------------------------------------------------
*
@@ -631,8 +622,7 @@
// Appears on attachments to a message marked to be in conflict. Identifies
// those attachments which are conflicting versions of the top level message
-#define PR_IN_CONFLICT PROP_TAG(PT_BOOLEAN, pidAttachReadOnlyMin)
-
+#define PR_IN_CONFLICT PROP_TAG(PT_BOOLEAN, pidAttachReadOnlyMin)
/*------------------------------------------------------------------------
*
@@ -642,67 +632,66 @@
// Indicates when a message, folder, or mailbox has been deleted.
// (Read only, non transmittable property).
-#define PR_DELETED_ON PROP_TAG(PT_SYSTIME, pidSpecialMin+0x1F)
+#define PR_DELETED_ON PROP_TAG(PT_SYSTIME, pidSpecialMin + 0x1F)
// Read-only folder properties which indicate the number of messages, and child folders
// that have been "soft" deleted in this folder (and the time the first message was deleted).
-#define PR_DELETED_MSG_COUNT PROP_TAG(PT_LONG, pidFolderMin+0x08)
-#define PR_DELETED_ASSOC_MSG_COUNT PROP_TAG(PT_LONG, pidFolderMin+0x0B)
-#define PR_DELETED_FOLDER_COUNT PROP_TAG(PT_LONG, pidFolderMin + 0x09)
-#define PR_OLDEST_DELETED_ON PROP_TAG(PT_SYSTIME, pidFolderMin + 0x0A)
+#define PR_DELETED_MSG_COUNT PROP_TAG(PT_LONG, pidFolderMin + 0x08)
+#define PR_DELETED_ASSOC_MSG_COUNT PROP_TAG(PT_LONG, pidFolderMin + 0x0B)
+#define PR_DELETED_FOLDER_COUNT PROP_TAG(PT_LONG, pidFolderMin + 0x09)
+#define PR_OLDEST_DELETED_ON PROP_TAG(PT_SYSTIME, pidFolderMin + 0x0A)
// Total size of all soft deleted messages
-#define PR_DELETED_MESSAGE_SIZE_EXTENDED PROP_TAG(PT_I8, pidAdminMin+0xB)
+#define PR_DELETED_MESSAGE_SIZE_EXTENDED PROP_TAG(PT_I8, pidAdminMin + 0xB)
// Total size of all normal soft deleted messages
-#define PR_DELETED_NORMAL_MESSAGE_SIZE_EXTENDED PROP_TAG(PT_I8, pidAdminMin+0xC)
+#define PR_DELETED_NORMAL_MESSAGE_SIZE_EXTENDED PROP_TAG(PT_I8, pidAdminMin + 0xC)
// Total size of all associated soft deleted messages
-#define PR_DELETED_ASSOC_MESSAGE_SIZE_EXTENDED PROP_TAG(PT_I8, pidAdminMin+0xD)
+#define PR_DELETED_ASSOC_MESSAGE_SIZE_EXTENDED PROP_TAG(PT_I8, pidAdminMin + 0xD)
// This property controls the retention age limit (minutes) for the Private/Public MDB,
// Mailbox (private only), or Folder (public).
// Note - the Folder/Mailbox retention, if set, overrides the MDB retention.
-#define PR_RETENTION_AGE_LIMIT PROP_TAG(PT_LONG, pidAdminMin+0x34)
+#define PR_RETENTION_AGE_LIMIT PROP_TAG(PT_LONG, pidAdminMin + 0x34)
// This property controls if we maintain per user read/unread for a public
// folder. By default (if this property is missing or set to FALSE) we will
// maintain per user read/unread.
-#define PR_DISABLE_PERUSER_READ PROP_TAG(PT_BOOLEAN, pidAdminMin+0x35)
+#define PR_DISABLE_PERUSER_READ PROP_TAG(PT_BOOLEAN, pidAdminMin + 0x35)
// This property is set by JET after a full backup has occurred.
// It is used to determine whether or not messages and folders can be "hard" deleted
// before a full backup has captured the last modification to the object.
-#define PR_LAST_FULL_BACKUP PROP_TAG(PT_SYSTIME, pidSpecialMin+0x15)
+#define PR_LAST_FULL_BACKUP PROP_TAG(PT_SYSTIME, pidSpecialMin + 0x15)
/*------------------------------------------------------------------------
* URL related properties
*-----------------------------------------------------------------------*/
// This is read only property.
-#define PR_URL_NAME PROP_TAG(PT_TSTRING, pidAdminMin+0x77) //0x6707
-#define PR_URL_NAME_A PROP_TAG(PT_STRING8, pidAdminMin+0x77)
-#define PR_URL_NAME_W PROP_TAG(PT_UNICODE, pidAdminMin+0x77)
+#define PR_URL_NAME PROP_TAG(PT_TSTRING, pidAdminMin + 0x77) // 0x6707
+#define PR_URL_NAME_A PROP_TAG(PT_STRING8, pidAdminMin + 0x77)
+#define PR_URL_NAME_W PROP_TAG(PT_UNICODE, pidAdminMin + 0x77)
// This is a read-write property.
-#define PR_URL_COMP_NAME PROP_TAG(PT_TSTRING, pidRenMsgFldMin+0x73)
-#define PR_URL_COMP_NAME_A PROP_TAG(PT_STRING8, pidRenMsgFldMin+0x73)
-#define PR_URL_COMP_NAME_W PROP_TAG(PT_UNICODE, pidRenMsgFldMin+0x73)
+#define PR_URL_COMP_NAME PROP_TAG(PT_TSTRING, pidRenMsgFldMin + 0x73)
+#define PR_URL_COMP_NAME_A PROP_TAG(PT_STRING8, pidRenMsgFldMin + 0x73)
+#define PR_URL_COMP_NAME_W PROP_TAG(PT_UNICODE, pidRenMsgFldMin + 0x73)
// this is a read-only property
-#define PR_PARENT_URL_NAME PROP_TAG(PT_TSTRING, pidAdminMin+0x7D) // 0x670d
-#define PR_PARENT_URL_NAME_A PROP_TAG(PT_STRING8, pidAdminMin+0x7D)
-#define PR_PARENT_URL_NAME_W PROP_TAG(PT_UNICODE, pidAdminMin+0x7D)
+#define PR_PARENT_URL_NAME PROP_TAG(PT_TSTRING, pidAdminMin + 0x7D) // 0x670d
+#define PR_PARENT_URL_NAME_A PROP_TAG(PT_STRING8, pidAdminMin + 0x7D)
+#define PR_PARENT_URL_NAME_W PROP_TAG(PT_UNICODE, pidAdminMin + 0x7D)
// read-only property
-#define PR_FLAT_URL_NAME PROP_TAG(PT_TSTRING, pidAdminMin+0x7E) // 0x670e
-#define PR_FLAT_URL_NAME_A PROP_TAG(PT_STRING8, pidAdminMin+0x7E)
-#define PR_FLAT_URL_NAME_W PROP_TAG(PT_UNICODE, pidAdminMin+0x7E)
+#define PR_FLAT_URL_NAME PROP_TAG(PT_TSTRING, pidAdminMin + 0x7E) // 0x670e
+#define PR_FLAT_URL_NAME_A PROP_TAG(PT_STRING8, pidAdminMin + 0x7E)
+#define PR_FLAT_URL_NAME_W PROP_TAG(PT_UNICODE, pidAdminMin + 0x7E)
// read-only property
-#define PR_SRC_URL_NAME PROP_TAG(PT_TSTRING, pidAdminMin+0x7F) // 0x670f
-#define PR_SRC_URL_NAME_A PROP_TAG(PT_STRING8, pidAdminMin+0x7F)
-#define PR_SRC_URL_NAME_W PROP_TAG(PT_UNICODE, pidAdminMin+0x7F)
-
+#define PR_SRC_URL_NAME PROP_TAG(PT_TSTRING, pidAdminMin + 0x7F) // 0x670f
+#define PR_SRC_URL_NAME_A PROP_TAG(PT_STRING8, pidAdminMin + 0x7F)
+#define PR_SRC_URL_NAME_W PROP_TAG(PT_UNICODE, pidAdminMin + 0x7F)
// Constant wstring to specify URL with fid encoded directly in the URL
// For example, URL L"/~FlatUrlSpace/1-401" will refer to folder with FID 1-401
@@ -710,23 +699,23 @@
// in that folder.
// But remember that the FID/MID have to be long term, i.e GUID-Globcnt,
// the replid used above is simply to explain the idea simpler.
-#define WSZ_URL_FLAT_FOLDER_SPACE L"/-FlatUrlSpace-/"
-#define cwchUrlFlatFolderSpace 16
+#define WSZ_URL_FLAT_FOLDER_SPACE L"/-FlatUrlSpace-/"
+#define cwchUrlFlatFolderSpace 16
// Property that defines whether a folder is secure or not
-#define PR_SECURE_IN_SITE PROP_TAG(PT_BOOLEAN, pidAdminMin+0xE)
+#define PR_SECURE_IN_SITE PROP_TAG(PT_BOOLEAN, pidAdminMin + 0xE)
// PR_LOCAL_COMMIT_TIME is maintained on folders and messages. It is the
// FileTime when the object was modified last on the given MDB. It is updated
// any time the object is modified (including replicated in change).This is
// strictly computed, non-transmittable and non-copyable.
-#define PR_LOCAL_COMMIT_TIME PROP_TAG(PT_SYSTIME, pidAdminMin+0x79)
+#define PR_LOCAL_COMMIT_TIME PROP_TAG(PT_SYSTIME, pidAdminMin + 0x79)
// PR_LOCAL_COMMIT_TIME_MAX is maintained on folders only.
// It is >= PR_LOCAL_COMMIT_TIME of all messages in the folder. It is updated
// any time any message in the folder is modified. This is strictly computed,
// non-transmittable and non-copyable.
-#define PR_LOCAL_COMMIT_TIME_MAX PROP_TAG(PT_SYSTIME, pidAdminMin+0x7a)
+#define PR_LOCAL_COMMIT_TIME_MAX PROP_TAG(PT_SYSTIME, pidAdminMin + 0x7a)
// PR_DELETED_COUNT_TOTAL is maintained on folders only.
// It is the total number of messages deleted in this folder from the beginning
@@ -735,14 +724,14 @@
// 4 bytes, it will start again at 0. This is updated whenever a message in the
// folder is deleted. This is strictly computed, non-transmitabble and
// non-copyable.
-#define PR_DELETED_COUNT_TOTAL PROP_TAG(PT_LONG, pidAdminMin+0x7b)
+#define PR_DELETED_COUNT_TOTAL PROP_TAG(PT_LONG, pidAdminMin + 0x7b)
-// PR_AUTO_RESET is maintained on messages only. Its PT_MV_CLSID and is deleted
+// PR_AUTO_RESET is maintained on messages only. It's PT_MV_CLSID and is deleted
// (by the store) anytime a message is saved, if it has not been
// explicitly set on the message between the time it was opened and saved
// (by the user/app that opened and later saved the message).
// It is intended to be used by async callback agents.
-#define PR_AUTO_RESET PROP_TAG(PT_MV_CLSID, pidAdminMin+0x7c)
+#define PR_AUTO_RESET PROP_TAG(PT_MV_CLSID, pidAdminMin + 0x7c)
/*------------------------------------------------------------------------
*
@@ -752,14 +741,13 @@
*
*-----------------------------------------------------------------------*/
-//This property can be used in a contents table to get PR_ENTRYID returned
-//as a long term entryid instead of a short term entryid.
-#define PR_LONGTERM_ENTRYID_FROM_TABLE PROP_TAG(PT_BINARY, pidSpecialMin)
+// This property can be used in a contents table to get PR_ENTRYID returned
+// as a long term entryid instead of a short term entryid.
+#define PR_LONGTERM_ENTRYID_FROM_TABLE PROP_TAG(PT_BINARY, pidSpecialMin)
// This is read only property that is used for contents tables that include
// subfolder entries.
-#define PR_SUBFOLDER PROP_TAG(PT_BOOLEAN, pidAdminMin+0x78)
-
+#define PR_SUBFOLDER PROP_TAG(PT_BOOLEAN, pidAdminMin + 0x78)
/*------------------------------------------------------------------------
*
@@ -769,25 +757,25 @@
*
*-----------------------------------------------------------------------*/
-#define PR_ORIGINATOR_NAME PROP_TAG( PT_TSTRING, pidMessageWriteableMin+0x3)
-#define PR_ORIGINATOR_ADDR PROP_TAG( PT_TSTRING, pidMessageWriteableMin+0x4)
-#define PR_ORIGINATOR_ADDRTYPE PROP_TAG( PT_TSTRING, pidMessageWriteableMin+0x5)
-#define PR_ORIGINATOR_ENTRYID PROP_TAG( PT_BINARY, pidMessageWriteableMin+0x6)
-#define PR_ARRIVAL_TIME PROP_TAG( PT_SYSTIME, pidMessageWriteableMin+0x7)
-#define PR_TRACE_INFO PROP_TAG( PT_BINARY, pidMessageWriteableMin+0x8)
-#define PR_INTERNAL_TRACE_INFO PROP_TAG( PT_BINARY, pidMessageWriteableMin+0x12)
-#define PR_SUBJECT_TRACE_INFO PROP_TAG( PT_BINARY, pidMessageWriteableMin+0x9)
-#define PR_RECIPIENT_NUMBER PROP_TAG( PT_LONG, pidMessageWriteableMin+0xA)
-#define PR_MTS_SUBJECT_ID PROP_TAG(PT_BINARY, pidMessageWriteableMin+0xB)
-#define PR_REPORT_DESTINATION_NAME PROP_TAG(PT_TSTRING, pidMessageWriteableMin+0xC)
-#define PR_REPORT_DESTINATION_ENTRYID PROP_TAG(PT_BINARY, pidMessageWriteableMin+0xD)
-#define PR_CONTENT_SEARCH_KEY PROP_TAG(PT_BINARY, pidMessageWriteableMin+0xE)
-#define PR_FOREIGN_ID PROP_TAG(PT_BINARY, pidMessageWriteableMin+0xF)
-#define PR_FOREIGN_REPORT_ID PROP_TAG(PT_BINARY, pidMessageWriteableMin+0x10)
-#define PR_FOREIGN_SUBJECT_ID PROP_TAG(PT_BINARY, pidMessageWriteableMin+0x11)
-#define PR_PROMOTE_PROP_ID_LIST PROP_TAG(PT_BINARY, pidMessageWriteableMin+0x13)
-#define PR_MTS_ID PR_MESSAGE_SUBMISSION_ID
-#define PR_MTS_REPORT_ID PR_MESSAGE_SUBMISSION_ID
+#define PR_ORIGINATOR_NAME PROP_TAG(PT_TSTRING, pidMessageWriteableMin + 0x3)
+#define PR_ORIGINATOR_ADDR PROP_TAG(PT_TSTRING, pidMessageWriteableMin + 0x4)
+#define PR_ORIGINATOR_ADDRTYPE PROP_TAG(PT_TSTRING, pidMessageWriteableMin + 0x5)
+#define PR_ORIGINATOR_ENTRYID PROP_TAG(PT_BINARY, pidMessageWriteableMin + 0x6)
+#define PR_ARRIVAL_TIME PROP_TAG(PT_SYSTIME, pidMessageWriteableMin + 0x7)
+#define PR_TRACE_INFO PROP_TAG(PT_BINARY, pidMessageWriteableMin + 0x8)
+#define PR_INTERNAL_TRACE_INFO PROP_TAG(PT_BINARY, pidMessageWriteableMin + 0x12)
+#define PR_SUBJECT_TRACE_INFO PROP_TAG(PT_BINARY, pidMessageWriteableMin + 0x9)
+#define PR_RECIPIENT_NUMBER PROP_TAG(PT_LONG, pidMessageWriteableMin + 0xA)
+#define PR_MTS_SUBJECT_ID PROP_TAG(PT_BINARY, pidMessageWriteableMin + 0xB)
+#define PR_REPORT_DESTINATION_NAME PROP_TAG(PT_TSTRING, pidMessageWriteableMin + 0xC)
+#define PR_REPORT_DESTINATION_ENTRYID PROP_TAG(PT_BINARY, pidMessageWriteableMin + 0xD)
+#define PR_CONTENT_SEARCH_KEY PROP_TAG(PT_BINARY, pidMessageWriteableMin + 0xE)
+#define PR_FOREIGN_ID PROP_TAG(PT_BINARY, pidMessageWriteableMin + 0xF)
+#define PR_FOREIGN_REPORT_ID PROP_TAG(PT_BINARY, pidMessageWriteableMin + 0x10)
+#define PR_FOREIGN_SUBJECT_ID PROP_TAG(PT_BINARY, pidMessageWriteableMin + 0x11)
+#define PR_PROMOTE_PROP_ID_LIST PROP_TAG(PT_BINARY, pidMessageWriteableMin + 0x13)
+#define PR_MTS_ID PR_MESSAGE_SUBMISSION_ID
+#define PR_MTS_REPORT_ID PR_MESSAGE_SUBMISSION_ID
/*------------------------------------------------------------------------
*
@@ -797,62 +785,58 @@
*
*-----------------------------------------------------------------------*/
-#define MAX_ADMD_NAME_SIZ 17
-#define MAX_PRMD_NAME_SIZ 17
-#define MAX_COUNTRY_NAME_SIZ 4
-#define MAX_MTA_NAME_SIZ 33
+#define MAX_ADMD_NAME_SIZ 17
+#define MAX_PRMD_NAME_SIZ 17
+#define MAX_COUNTRY_NAME_SIZ 4
+#define MAX_MTA_NAME_SIZ 33
-#define ADMN_PAD 3
-#define PRMD_PAD 3
-#define COUNTRY_PAD 0
-#define MTA_PAD 3
-#define PRMD_PAD_FOR_ACTIONS 2
-#define MTA_PAD_FOR_ACTIONS 2
+#define ADMN_PAD 3
+#define PRMD_PAD 3
+#define COUNTRY_PAD 0
+#define MTA_PAD 3
+#define PRMD_PAD_FOR_ACTIONS 2
+#define MTA_PAD_FOR_ACTIONS 2
typedef struct {
- LONG lAction; // The routing action the tracing site
- // took.(1984 actions only)
- FILETIME ftArrivalTime; // The time at which the communique
- // entered the tracing site.
- FILETIME ftDeferredTime; // The time are which the tracing site
- // released the message.
- char rgchADMDName[MAX_ADMD_NAME_SIZ+ADMN_PAD]; // ADMD
- char rgchCountryName[MAX_COUNTRY_NAME_SIZ+COUNTRY_PAD]; // Country
- char rgchPRMDId[MAX_PRMD_NAME_SIZ+PRMD_PAD]; // PRMD
- char rgchAttADMDName[MAX_ADMD_NAME_SIZ+ADMN_PAD]; // Attempted ADMD
- char rgchAttCountryName[MAX_COUNTRY_NAME_SIZ+COUNTRY_PAD]; // Attempted Country
- char rgchAttPRMDId[MAX_PRMD_NAME_SIZ+PRMD_PAD_FOR_ACTIONS]; // Attempted PRMD
- BYTE bAdditionalActions; // 1998 additional actions
-} TRACEENTRY, FAR * LPTRACEENTRY;
+ LONG lAction; // The routing action the tracing site
+ // took.(1984 actions only)
+ FILETIME ftArrivalTime; // The time at which the communique
+ // entered the tracing site.
+ FILETIME ftDeferredTime; // The time are which the tracing site
+ // released the message.
+ char rgchADMDName[MAX_ADMD_NAME_SIZ + ADMN_PAD]; // ADMD
+ char rgchCountryName[MAX_COUNTRY_NAME_SIZ + COUNTRY_PAD]; // Country
+ char rgchPRMDId[MAX_PRMD_NAME_SIZ + PRMD_PAD]; // PRMD
+ char rgchAttADMDName[MAX_ADMD_NAME_SIZ + ADMN_PAD]; // Attempted ADMD
+ char rgchAttCountryName[MAX_COUNTRY_NAME_SIZ + COUNTRY_PAD]; // Attempted Country
+ char rgchAttPRMDId[MAX_PRMD_NAME_SIZ + PRMD_PAD_FOR_ACTIONS]; // Attempted PRMD
+ BYTE bAdditionalActions; // 1998 additional actions
+} TRACEENTRY, FAR *LPTRACEENTRY;
typedef struct {
- ULONG cEntries; // Number of trace entries
- TRACEENTRY rgtraceentry[MAPI_DIM]; // array of trace entries
-} TRACEINFO, FAR * LPTRACEINFO;
-
-typedef struct
-{
- LONG lAction; // The 1984 routing action the tracing domain took.
- FILETIME ftArrivalTime; // The time at which the communique entered the tracing domain.
- FILETIME ftDeferredTime; // The time are which the tracing domain released the message.
- char rgchADMDName[MAX_ADMD_NAME_SIZ+ADMN_PAD]; // ADMD
- char rgchCountryName[MAX_COUNTRY_NAME_SIZ+COUNTRY_PAD]; // Country
- char rgchPRMDId[MAX_PRMD_NAME_SIZ+PRMD_PAD]; // PRMD
- char rgchAttADMDName[MAX_ADMD_NAME_SIZ+ADMN_PAD]; // Attempted ADMD
- char rgchAttCountryName[MAX_COUNTRY_NAME_SIZ+COUNTRY_PAD]; // Attempted Country
- char rgchAttPRMDId[MAX_PRMD_NAME_SIZ+PRMD_PAD]; // Attempted PRMD
- char rgchMTAName[MAX_MTA_NAME_SIZ+MTA_PAD]; // MTA Name
- char rgchAttMTAName[MAX_MTA_NAME_SIZ+MTA_PAD_FOR_ACTIONS]; // Attempted MTA Name
- BYTE bAdditionalActions; // 1988 additional actions
-}INTTRACEENTRY, *PINTTRACEENTRY;
-
-
-typedef struct
-{
- ULONG cEntries; // Number of trace entries
- INTTRACEENTRY rgIntTraceEntry[MAPI_DIM]; // array of internal trace entries
-}INTTRACEINFO, *PINTTRACEINFO;
+ ULONG cEntries; // Number of trace entries
+ TRACEENTRY rgtraceentry[MAPI_DIM]; // array of trace entries
+} TRACEINFO, FAR *LPTRACEINFO;
+typedef struct {
+ LONG lAction; // The 1984 routing action the tracing domain took.
+ FILETIME ftArrivalTime; // The time at which the communique entered the tracing domain.
+ FILETIME ftDeferredTime; // The time are which the tracing domain released the message.
+ char rgchADMDName[MAX_ADMD_NAME_SIZ + ADMN_PAD]; // ADMD
+ char rgchCountryName[MAX_COUNTRY_NAME_SIZ + COUNTRY_PAD]; // Country
+ char rgchPRMDId[MAX_PRMD_NAME_SIZ + PRMD_PAD]; // PRMD
+ char rgchAttADMDName[MAX_ADMD_NAME_SIZ + ADMN_PAD]; // Attempted ADMD
+ char rgchAttCountryName[MAX_COUNTRY_NAME_SIZ + COUNTRY_PAD]; // Attempted Country
+ char rgchAttPRMDId[MAX_PRMD_NAME_SIZ + PRMD_PAD]; // Attempted PRMD
+ char rgchMTAName[MAX_MTA_NAME_SIZ + MTA_PAD]; // MTA Name
+ char rgchAttMTAName[MAX_MTA_NAME_SIZ + MTA_PAD_FOR_ACTIONS]; // Attempted MTA Name
+ BYTE bAdditionalActions; // 1988 additional actions
+} INTTRACEENTRY, *PINTTRACEENTRY;
+
+typedef struct {
+ ULONG cEntries; // Number of trace entries
+ INTTRACEENTRY rgIntTraceEntry[MAPI_DIM]; // array of internal trace entries
+} INTTRACEINFO, *PINTTRACEINFO;
/*------------------------------------------------------------------------
*
@@ -862,85 +846,74 @@ typedef struct
*
*-----------------------------------------------------------------------*/
-
/* ulRowFlags */
-#define ROWLIST_REPLACE ((ULONG)1)
-
-#define ROW_ADD ((ULONG)1)
-#define ROW_MODIFY ((ULONG)2)
-#define ROW_REMOVE ((ULONG)4)
-#define ROW_EMPTY (ROW_ADD|ROW_REMOVE)
-
-typedef struct _ROWENTRY
-{
- ULONG ulRowFlags;
- ULONG cValues;
- LPSPropValue rgPropVals;
-} ROWENTRY, FAR * LPROWENTRY;
-
-typedef struct _ROWLIST
-{
- ULONG cEntries;
- ROWENTRY aEntries[MAPI_DIM];
-} ROWLIST, FAR * LPROWLIST;
-
-#define EXCHANGE_IEXCHANGEMODIFYTABLE_METHODS(IPURE) \
- MAPIMETHOD(GetLastError) \
- (THIS_ HRESULT hResult, \
- ULONG ulFlags, \
- LPMAPIERROR FAR * lppMAPIError) IPURE; \
- MAPIMETHOD(GetTable) \
- (THIS_ ULONG ulFlags, \
- LPMAPITABLE FAR * lppTable) IPURE; \
- MAPIMETHOD(ModifyTable) \
- (THIS_ ULONG ulFlags, \
- LPROWLIST lpMods) IPURE;
-
-#undef INTERFACE
-#define INTERFACE IExchangeModifyTable
-DECLARE_MAPI_INTERFACE_(IExchangeModifyTable, IUnknown)
-{
- MAPI_IUNKNOWN_METHODS(PURE)
- EXCHANGE_IEXCHANGEMODIFYTABLE_METHODS(PURE)
-};
-#undef IMPL
+#define ROWLIST_REPLACE ((ULONG)1)
+
+#define ROW_ADD ((ULONG)1)
+#define ROW_MODIFY ((ULONG)2)
+#define ROW_REMOVE ((ULONG)4)
+#define ROW_EMPTY (ROW_ADD | ROW_REMOVE)
+
+typedef struct _ROWENTRY {
+ ULONG ulRowFlags;
+ ULONG cValues;
+ LPSPropValue rgPropVals;
+} ROWENTRY, FAR *LPROWENTRY;
+
+typedef struct _ROWLIST {
+ ULONG cEntries;
+ ROWENTRY aEntries[MAPI_DIM];
+} ROWLIST, FAR *LPROWLIST;
+
+#define EXCHANGE_IEXCHANGEMODIFYTABLE_METHODS(IPURE) \
+ MAPIMETHOD(GetLastError) \
+ (THIS_ HRESULT hResult, ULONG ulFlags, LPMAPIERROR FAR * lppMAPIError) IPURE; \
+ MAPIMETHOD(GetTable) \
+ (THIS_ ULONG ulFlags, LPMAPITABLE FAR * lppTable) IPURE; \
+ MAPIMETHOD(ModifyTable) \
+ (THIS_ ULONG ulFlags, LPROWLIST lpMods) IPURE;
+
+#undef INTERFACE
+#define INTERFACE IExchangeModifyTable
+DECLARE_MAPI_INTERFACE_(IExchangeModifyTable,
+ IUnknown){MAPI_IUNKNOWN_METHODS(PURE) EXCHANGE_IEXCHANGEMODIFYTABLE_METHODS(PURE)};
+#undef IMPL
#define IMPL
-DECLARE_MAPI_INTERFACE_PTR(IExchangeModifyTable, LPEXCHANGEMODIFYTABLE);
+DECLARE_MAPI_INTERFACE_PTR(IExchangeModifyTable, LPEXCHANGEMODIFYTABLE);
/* Special flag bit for GetContentsTable, GetHierarchyTable and
- OpenEntry.
- Supported by > 5.x servers
- If set in GetContentsTable and GetHierarchyTable
- we will show only items that are soft deleted, i.e deleted
- by user but not yet purged from the system. If set in OpenEntry
- we will open this item even if it is soft deleted */
+ OpenEntry.
+ Supported by > 5.x servers
+ If set in GetContentsTable and GetHierarchyTable
+ we will show only items that are soft deleted, i.e deleted
+ by user but not yet purged from the system. If set in OpenEntry
+ we will open this item even if it is soft deleted */
/* Flag bits must not collide by existing definitions in Mapi */
/****** MAPI_UNICODE ((ULONG) 0x80000000) above */
/****** MAPI_DEFERRED_ERRORS ((ULONG) 0x00000008) below */
/****** MAPI_ASSOCIATED ((ULONG) 0x00000040) below */
/****** CONVENIENT_DEPTH ((ULONG) 0x00000001) */
-#define SHOW_SOFT_DELETES ((ULONG) 0x00000002)
-#define SHOW_SUBFOLDERS ((ULONG) 0x00000004)
+#define SHOW_SOFT_DELETES ((ULONG)0x00000002)
+#define SHOW_SUBFOLDERS ((ULONG)0x00000004)
// reserved flag bit(s) - do not set
-#define MAPI_RESERVED1 ((ULONG) 0x00010000)
+#define MAPI_RESERVED1 ((ULONG)0x00010000)
// Do not block this OpenMessage (MAPI's OpenEntry)
-#define MDB_OPEN_MSG_NO_BLOCK ((ULONG) 0x00000020)
+#define MDB_OPEN_MSG_NO_BLOCK ((ULONG)0x00000020)
// Unlock a MID at SaveChanges
/****** KEEP_OPEN_READONLY ((ULONG) 0x00000001) */
/****** KEEP_OPEN_READWRITE ((ULONG) 0x00000002) */
/****** FORCE_SAVE ((ULONG) 0x00000004) */
/****** MAPI_DEFERRED_ERRORS ((ULONG) 0x00000008) */
-#define MDB_SAVE_MSG_UNLOCK ((ULONG) 0x00000040)
-
+#define MDB_SAVE_MSG_UNLOCK ((ULONG)0x00000040)
/* Special flag bit for DeleteFolder
- Supported by > 5.x servers
- If set the server will hard delete the folder (i.e it will not be
- retained for later recovery) */
+ Supported by > 5.x servers
+ If set the server will hard delete the folder (i.e it will not be
+ retained for later recovery) */
/* Flag bits must not collide by existing definitions in Mapi */
/* DeleteFolder */
/***** #define DEL_MESSAGES ((ULONG) 0x00000001) */
@@ -949,33 +922,32 @@ DECLARE_MAPI_INTERFACE_PTR(IExchangeModifyTable, LPEXCHANGEMODIFYTABLE);
/* EmptyFolder */
/***** #define DEL_ASSOCIATED ((ULONG) 0x00000008) */
-#define DELETE_HARD_DELETE ((ULONG) 0x00000010)
+#define DELETE_HARD_DELETE ((ULONG)0x00000010)
/* Access Control Specifics */
-//Properties
-#define PR_MEMBER_ID PROP_TAG(PT_I8, pidSpecialMin+0x01)
-#define PR_MEMBER_NAME PROP_TAG(PT_TSTRING, pidSpecialMin+0x02)
-#define PR_MEMBER_ENTRYID PR_ENTRYID
-#define PR_MEMBER_RIGHTS PROP_TAG(PT_LONG, pidSpecialMin+0x03)
+// Properties
+#define PR_MEMBER_ID PROP_TAG(PT_I8, pidSpecialMin + 0x01)
+#define PR_MEMBER_NAME PROP_TAG(PT_TSTRING, pidSpecialMin + 0x02)
+#define PR_MEMBER_ENTRYID PR_ENTRYID
+#define PR_MEMBER_RIGHTS PROP_TAG(PT_LONG, pidSpecialMin + 0x03)
-//Security bits
+// Security bits
typedef DWORD RIGHTS;
-#define frightsReadAny 0x0000001L
-#define frightsCreate 0x0000002L
-#define frightsEditOwned 0x0000008L
-#define frightsDeleteOwned 0x0000010L
-#define frightsEditAny 0x0000020L
-#define frightsDeleteAny 0x0000040L
-#define frightsCreateSubfolder 0x0000080L
-#define frightsOwner 0x0000100L
-#define frightsContact 0x0000200L // NOTE: not part of rightsAll
-#define frightsVisible 0x0000400L
-#define rightsNone 0x00000000
-#define rightsReadOnly frightsReadAny
-#define rightsReadWrite (frightsReadAny|frightsEditAny)
-#define rightsAll 0x00005FBL
-
+#define frightsReadAny 0x0000001L
+#define frightsCreate 0x0000002L
+#define frightsEditOwned 0x0000008L
+#define frightsDeleteOwned 0x0000010L
+#define frightsEditAny 0x0000020L
+#define frightsDeleteAny 0x0000040L
+#define frightsCreateSubfolder 0x0000080L
+#define frightsOwner 0x0000100L
+#define frightsContact 0x0000200L // NOTE: not part of rightsAll
+#define frightsVisible 0x0000400L
+#define rightsNone 0x00000000
+#define rightsReadOnly frightsReadAny
+#define rightsReadWrite (frightsReadAny | frightsEditAny)
+#define rightsAll 0x00005FBL
//
// Mailbox specific access rights.
@@ -988,91 +960,94 @@ typedef DWORD RIGHTS;
//
#define fsdpermUserDeleteMailbox DELETE
#define fsdpermUserMailboxOwner 0x00000001
-#define fsdpermUserSendAs 0x00000002
-#define fsdpermUserPrimaryUser 0x00000004
-
+#define fsdpermUserSendAs 0x00000002
+#define fsdpermUserPrimaryUser 0x00000004
-#define sdpermUserGenericRead (STANDARD_RIGHTS_READ)
+#define sdpermUserGenericRead (STANDARD_RIGHTS_READ)
// generic execute
-#define sdpermUserGenericExecute (STANDARD_RIGHTS_EXECUTE)
+#define sdpermUserGenericExecute (STANDARD_RIGHTS_EXECUTE)
// generic write
-#define sdpermUserGenericWrite (STANDARD_RIGHTS_WRITE | fsdpermUserDeleteMailbox)
+#define sdpermUserGenericWrite (STANDARD_RIGHTS_WRITE | fsdpermUserDeleteMailbox)
// generic all
-#define sdpermUserGenericAll (STANDARD_RIGHTS_ALL | fsdpermUserMailboxOwner | fsdpermUserSendAs | fsdpermUserPrimaryUser)
+#define sdpermUserGenericAll \
+ (STANDARD_RIGHTS_ALL | fsdpermUserMailboxOwner | fsdpermUserSendAs | fsdpermUserPrimaryUser)
//
// Message specific rights.
//
typedef DWORD SDRIGHTS;
-#define fsdrightReadBody 0x00000001 //** ONLY ON MESSAGES, SAME AS FILE_READ_DATA
-#define fsdrightListContents 0x00000001 //** ONLY ON FOLDERS, SAME AS FILE_LIST_DATA - IGNORED
-#define fsdrightWriteBody 0x00000002 //** ONLY ON MESSAGES, SAME AS FILE_WRITE_DATA
-#define fsdrightCreateItem 0x00000002 //** ONLY ON FOLDERs, SAME AS FILE_ADD_FILE
+#define fsdrightReadBody 0x00000001 //** ONLY ON MESSAGES, SAME AS FILE_READ_DATA
+#define fsdrightListContents 0x00000001 //** ONLY ON FOLDERS, SAME AS FILE_LIST_DATA - IGNORED
+#define fsdrightWriteBody 0x00000002 //** ONLY ON MESSAGES, SAME AS FILE_WRITE_DATA
+#define fsdrightCreateItem 0x00000002 //** ONLY ON FOLDERs, SAME AS FILE_ADD_FILE
-#define fsdrightAppendMsg 0x00000004 //** ONLY ON MESSAGES, SAME AS FILE_WRITE_DATA. ENFORCED BY IFS.
-#define fsdrightCreateContainer 0x00000004 //** ONLY ON FOLDERS, SAME AS FILE_ADD_FILE
+#define fsdrightAppendMsg 0x00000004 //** ONLY ON MESSAGES, SAME AS FILE_WRITE_DATA. ENFORCED BY IFS.
+#define fsdrightCreateContainer 0x00000004 //** ONLY ON FOLDERS, SAME AS FILE_ADD_FILE
-#define fsdrightReadProperty 0x00000008 //** SAME AS FILE_READ_EA
-#define fsdrightWriteProperty 0x00000010 //** SAME AS FILE_WRITE_EA
+#define fsdrightReadProperty 0x00000008 //** SAME AS FILE_READ_EA
+#define fsdrightWriteProperty 0x00000010 //** SAME AS FILE_WRITE_EA
-#define fsdrightExecute 0x00000020 // Same as FILE_EXECUTE/FILE_TRAVERSE. ENFORCED BY IFS
-#define fsdrightReserved1 0x00000040 // Same as FILE_DELETE_CHILD.. Currently unused
-#define fsdrightReadAttributes 0x00000080 // Same as FILE_READ_ATTRIBUTES. Currently unused
-#define fsdrightWriteAttributes 0x00000100 // Same as FILE_WRITE_ATTRIBUTES. Currently unused
+#define fsdrightExecute 0x00000020 // Same as FILE_EXECUTE/FILE_TRAVERSE. ENFORCED BY IFS
+#define fsdrightReserved1 0x00000040 // Same as FILE_DELETE_CHILD.. Currently unused
+#define fsdrightReadAttributes 0x00000080 // Same as FILE_READ_ATTRIBUTES. Currently unused
+#define fsdrightWriteAttributes 0x00000100 // Same as FILE_WRITE_ATTRIBUTES. Currently unused
-#define fsdrightWriteOwnProperty 0x00000200 //** ONLY ON MESSAGES
-#define fsdrightDeleteOwnItem 0x00000400 //** ONLY ON MESSAGES
-#define fsdrightViewItem 0x00000800
-#define fsdrightOwner 0x00004000 //** ONLY ON FOLDERS
-#define fsdrightContact 0x00008000 //** ONLY ON FOLDERS
+#define fsdrightWriteOwnProperty 0x00000200 //** ONLY ON MESSAGES
+#define fsdrightDeleteOwnItem 0x00000400 //** ONLY ON MESSAGES
+#define fsdrightViewItem 0x00000800
+#define fsdrightOwner 0x00004000 //** ONLY ON FOLDERS
+#define fsdrightContact 0x00008000 //** ONLY ON FOLDERS
//
// Standard NT rights.
//
-#define fsdrightWriteSD WRITE_DAC
-#define fsdrightDelete DELETE
-#define fsdrightWriteOwner WRITE_OWNER
-#define fsdrightReadControl READ_CONTROL
-#define fsdrightSynchronize SYNCHRONIZE
-
-#define sdrightsNone 0x00000000
-#define sdrightsBestAccess MAXIMUM_ALLOWED
-#define sdrightsReadOnly GENERIC_READ
-#define sdrightsReadWrite GENERIC_READ | GENERIC_WRITE
-
-#define sdrightsGenericRead (fsdrightReadControl | fsdrightReadBody | fsdrightReadAttributes | fsdrightReadProperty | fsdrightViewItem |\
- fsdrightSynchronize)
-#define sdrightsGenericWrite (fsdrightReadControl | fsdrightWriteBody | fsdrightWriteAttributes | fsdrightWriteProperty | \
- fsdrightAppendMsg | fsdrightCreateItem | fsdrightDelete | fsdrightCreateContainer | \
- fsdrightOwner | fsdrightSynchronize | fsdrightWriteSD | fsdrightWriteOwner)
-
-#define sdrightsGenericExecute (fsdrightReadControl | fsdrightReadAttributes | fsdrightExecute | fsdrightViewItem | fsdrightSynchronize)
-
-#define sdrightsGenericAll (fsdrightDelete | fsdrightReadProperty | fsdrightWriteProperty |\
- fsdrightCreateItem | fsdrightCreateContainer | fsdrightReadControl | fsdrightWriteSD |\
- fsdrightWriteOwner | fsdrightReadControl | \
- fsdrightViewItem | fsdrightOwner | \
- fsdrightWriteOwnProperty | fsdrightDeleteOwnItem | fsdrightSynchronize | \
- fsdrightExecute | fsdrightReserved1 | fsdrightReadAttributes | fsdrightWriteAttributes | \
- fsdrightReadBody | fsdrightWriteBody | fsdrightSynchronize | fsdrightContact)
+#define fsdrightWriteSD WRITE_DAC
+#define fsdrightDelete DELETE
+#define fsdrightWriteOwner WRITE_OWNER
+#define fsdrightReadControl READ_CONTROL
+#define fsdrightSynchronize SYNCHRONIZE
+
+#define sdrightsNone 0x00000000
+#define sdrightsBestAccess MAXIMUM_ALLOWED
+#define sdrightsReadOnly GENERIC_READ
+#define sdrightsReadWrite GENERIC_READ | GENERIC_WRITE
+
+#define sdrightsGenericRead \
+ (fsdrightReadControl | fsdrightReadBody | fsdrightReadAttributes | fsdrightReadProperty | fsdrightViewItem | \
+ fsdrightSynchronize)
+#define sdrightsGenericWrite \
+ (fsdrightReadControl | fsdrightWriteBody | fsdrightWriteAttributes | fsdrightWriteProperty | fsdrightAppendMsg | \
+ fsdrightCreateItem | fsdrightDelete | fsdrightCreateContainer | fsdrightOwner | fsdrightSynchronize | \
+ fsdrightWriteSD | fsdrightWriteOwner)
+
+#define sdrightsGenericExecute \
+ (fsdrightReadControl | fsdrightReadAttributes | fsdrightExecute | fsdrightViewItem | fsdrightSynchronize)
+
+#define sdrightsGenericAll \
+ (fsdrightDelete | fsdrightReadProperty | fsdrightWriteProperty | fsdrightCreateItem | fsdrightCreateContainer | \
+ fsdrightReadControl | fsdrightWriteSD | fsdrightWriteOwner | fsdrightReadControl | fsdrightViewItem | \
+ fsdrightOwner | fsdrightWriteOwnProperty | fsdrightDeleteOwnItem | fsdrightSynchronize | fsdrightExecute | \
+ fsdrightReserved1 | fsdrightReadAttributes | fsdrightWriteAttributes | fsdrightReadBody | fsdrightWriteBody | \
+ fsdrightSynchronize | fsdrightContact)
//
// SDRights that together make up rightsOwner.
//
-#define sdrightsFolderOwner (fsdrightWriteProperty | fsdrightOwner | fsdrightWriteSD | fsdrightDelete | \
- fsdrightWriteOwner | fsdrightWriteAttributes)
+#define sdrightsFolderOwner \
+ (fsdrightWriteProperty | fsdrightOwner | fsdrightWriteSD | fsdrightDelete | fsdrightWriteOwner | \
+ fsdrightWriteAttributes)
//
// Rights that are valid on folders.
//
-#define sdrightsFolders (fsdrightDelete | fsdrightReadProperty | fsdrightReadAttributes | \
- fsdrightWriteProperty | fsdrightWriteAttributes | fsdrightWriteOwner | \
- fsdrightReadControl | fsdrightWriteSD | fsdrightExecute | \
- fsdrightCreateContainer | fsdrightViewItem | fsdrightOwner | \
- fsdrightContact | fsdrightCreateItem | fsdrightSynchronize | fsdrightListContents | fsdrightReserved1)
+#define sdrightsFolders \
+ (fsdrightDelete | fsdrightReadProperty | fsdrightReadAttributes | fsdrightWriteProperty | \
+ fsdrightWriteAttributes | fsdrightWriteOwner | fsdrightReadControl | fsdrightWriteSD | fsdrightExecute | \
+ fsdrightCreateContainer | fsdrightViewItem | fsdrightOwner | fsdrightContact | fsdrightCreateItem | \
+ fsdrightSynchronize | fsdrightListContents | fsdrightReserved1)
//
// Rights that are valid on messages.
@@ -1080,30 +1055,31 @@ typedef DWORD SDRIGHTS;
//
// NB: fsdrightWriteOwnProperty/fsdrightDeleteOwnItem are NOT in this list.
//
-#define sdrightsItems (fsdrightDelete | fsdrightReadBody | fsdrightReadAttributes | fsdrightReadProperty | \
- fsdrightWriteProperty | fsdrightWriteBody | fsdrightWriteAttributes | fsdrightReadControl | \
- fsdrightWriteOwner | fsdrightWriteSD | fsdrightViewItem | fsdrightWriteOwnProperty | \
- fsdrightDeleteOwnItem | fsdrightSynchronize | fsdrightExecute | fsdrightAppendMsg)
+#define sdrightsItems \
+ (fsdrightDelete | fsdrightReadBody | fsdrightReadAttributes | fsdrightReadProperty | fsdrightWriteProperty | \
+ fsdrightWriteBody | fsdrightWriteAttributes | fsdrightReadControl | fsdrightWriteOwner | fsdrightWriteSD | \
+ fsdrightViewItem | fsdrightWriteOwnProperty | fsdrightDeleteOwnItem | fsdrightSynchronize | fsdrightExecute | \
+ fsdrightAppendMsg)
//
// These access rights are ignored in the determination of a canonical ACL. Since the exchange store ignores
// these rights, their presence or absense doesn't make an ACL canonical.
//
-#define sdrightsIgnored (fsdrightExecute | fsdrightAppendMsg | fsdrightContact | fsdrightReserved1)
+#define sdrightsIgnored (fsdrightExecute | fsdrightAppendMsg | fsdrightContact | fsdrightReserved1)
//
// Backwards Compatible rights definitions.
//
-#define msgrightsGenericRead (sdrightsGenericRead & sdrightsItems)
-#define msgrightsGenericWrite (sdrightsGenericWrite & sdrightsItems)
-#define msgrightsGenericExecute (sdrightsGenericExecute & sdrightsItems)
-#define msgrightsGenericAll (sdrightsGenericAll & sdrightsItems)
+#define msgrightsGenericRead (sdrightsGenericRead & sdrightsItems)
+#define msgrightsGenericWrite (sdrightsGenericWrite & sdrightsItems)
+#define msgrightsGenericExecute (sdrightsGenericExecute & sdrightsItems)
+#define msgrightsGenericAll (sdrightsGenericAll & sdrightsItems)
-#define fldrightsGenericRead (sdrightsGenericRead & sdrightsFolders)
-#define fldrightsGenericWrite (sdrightsGenericWrite & sdrightsFolders)
-#define fldrightsGenericExecute (sdrightsGenericExecute & sdrightsFolders)
-#define fldrightsGenericAll (sdrightsGenericAll & sdrightsFolders)
+#define fldrightsGenericRead (sdrightsGenericRead & sdrightsFolders)
+#define fldrightsGenericWrite (sdrightsGenericWrite & sdrightsFolders)
+#define fldrightsGenericExecute (sdrightsGenericExecute & sdrightsFolders)
+#define fldrightsGenericAll (sdrightsGenericAll & sdrightsFolders)
//
// If set in the RM control field of an NTSD, allows
@@ -1120,14 +1096,15 @@ typedef DWORD SDRIGHTS;
#define SET_GUID_PROP_ID(pguid, ptag) (pguid)->Data1 = PROP_ID(ptag)
#define SET_GUID_SUB_PROP_ID(pguid, ptag, subptag) (pguid)->Data1 = (PROP_ID(ptag) | PROP_ID(subptag) << 16)
-#define PROPERTY_GUID(ptag) { PROP_ID(ptag), \
- 0x6585, 0x11d3, \
- {0xb6, 0x19, 0x00, 0xaa, 0x00, 0x4b, 0x9c, 0x30}} \
-
-#define SUB_PROPERTY_GUID(ptag, subptag) { PROP_ID(subptag) << 16 | PROP_ID(ptag), \
- 0x6585, 0x11d3, \
- {0xb6, 0x19, 0x00, 0xaa, 0x00, 0x4b, 0x9c, 0x30}} \
+#define PROPERTY_GUID(ptag) \
+ { \
+ PROP_ID(ptag), 0x6585, 0x11d3, { 0xb6, 0x19, 0x00, 0xaa, 0x00, 0x4b, 0x9c, 0x30 } \
+ }
+#define SUB_PROPERTY_GUID(ptag, subptag) \
+ { \
+ PROP_ID(subptag) << 16 | PROP_ID(ptag), 0x6585, 0x11d3, { 0xb6, 0x19, 0x00, 0xaa, 0x00, 0x4b, 0x9c, 0x30 } \
+ }
//
// Transfer version for PR_NT_SECURITY_DESCRIPTOR.
@@ -1156,12 +1133,12 @@ typedef DWORD SDRIGHTS;
//
// Please note that OLEDB/DAV reserves the even numbers of the transfer version, so it must ALWAYS be an odd number.
//
-#define SECURITY_DESCRIPTOR_TRANSFER_VERSION 0x0003
+#define SECURITY_DESCRIPTOR_TRANSFER_VERSION 0x0003
-#define SECURITY_DESCRIPTOR_OF(pb) (((BYTE *)(pb)) + *((WORD *)(pb)))
+#define SECURITY_DESCRIPTOR_OF(pb) (((BYTE *)(pb)) + *((WORD *)(pb)))
#define SECURITY_DESCRIPTOR_VERSION(pb) (*((WORD *)((pb) + sizeof(WORD))))
#define SECURITY_INFORMATION_OF(pb) (*((DWORD *)((pb) + sizeof(WORD) + sizeof(WORD))))
-#define CbSecurityDescriptorHeader(pb) (*((WORD *)(pb)))
+#define CbSecurityDescriptorHeader(pb) (*((WORD *)(pb)))
//
// To check to see if the security descriptor version matches the currently compiled
@@ -1173,57 +1150,56 @@ typedef DWORD SDRIGHTS;
// Role scopes
//
typedef BYTE ROLESCOPE;
-#define ROLESCOPE_OBJECT 0x00 // Roles will be read from the object (folder or item) itself
-#define ROLESCOPE_FOLDER 0x01 // Roles will be read from the folder itself, or the containing folder if it is an item
-#define ROLESCOPE_MAX ROLESCOPE_FOLDER
+#define ROLESCOPE_OBJECT 0x00 // Roles will be read from the object (folder or item) itself
+#define ROLESCOPE_FOLDER 0x01 // Roles will be read from the folder itself, or the containing folder if it is an item
+#define ROLESCOPE_MAX ROLESCOPE_FOLDER
//
// Security authority used for role sids
//
-#define SECURITY_EXCHANGE_AUTHORITY {0,0,0,0,0,8}
+#define SECURITY_EXCHANGE_AUTHORITY {0, 0, 0, 0, 0, 8}
//
// Application role properties
//
-#define PR_XMT_SECURITY_ROLE_1 PROP_TAG(PT_BINARY,0x3d25)
-#define PR_XMT_SECURITY_ROLE_1_AS_XML PROP_TAG(PT_TSTRING,0x3d25)
-#define PR_XMT_SECURITY_ROLE_2 PROP_TAG(PT_BINARY,0x3d26)
-#define PR_XMT_SECURITY_ROLE_2_AS_XML PROP_TAG(PT_TSTRING,0x3d26)
-#define PR_XMT_SECURITY_ROLE_3 PROP_TAG(PT_BINARY,0x3d27)
-#define PR_XMT_SECURITY_ROLE_3_AS_XML PROP_TAG(PT_TSTRING,0x3d27)
-#define PR_XMT_SECURITY_ROLE_4 PROP_TAG(PT_BINARY,0x3d28)
-#define PR_XMT_SECURITY_ROLE_4_AS_XML PROP_TAG(PT_TSTRING,0x3d28)
-#define PR_XMT_SECURITY_ROLE_5 PROP_TAG(PT_BINARY,0x3d29)
-#define PR_XMT_SECURITY_ROLE_5_AS_XML PROP_TAG(PT_TSTRING,0x3d29)
-#define PR_XMT_SECURITY_ROLE_6 PROP_TAG(PT_BINARY,0x3d2A)
-#define PR_XMT_SECURITY_ROLE_6_AS_XML PROP_TAG(PT_TSTRING,0x3d2A)
-#define PR_XMT_SECURITY_ROLE_7 PROP_TAG(PT_BINARY,0x3d2B)
-#define PR_XMT_SECURITY_ROLE_7_AS_XML PROP_TAG(PT_TSTRING,0x3d2B)
-#define PR_XMT_SECURITY_ROLE_8 PROP_TAG(PT_BINARY,0x3d2C)
-#define PR_XMT_SECURITY_ROLE_8_AS_XML PROP_TAG(PT_TSTRING,0x3d2C)
-#define PR_NON_XMT_SECURITY_ROLE_1 PROP_TAG(PT_BINARY,0x0E7C)
-#define PR_NON_XMT_SECURITY_ROLE_1_AS_XML PROP_TAG(PT_TSTRING,0x0E7C)
-#define PR_NON_XMT_SECURITY_ROLE_2 PROP_TAG(PT_BINARY,0x0E7D)
-#define PR_NON_XMT_SECURITY_ROLE_2_AS_XML PROP_TAG(PT_TSTRING,0x0E7D)
-#define PR_NON_XMT_SECURITY_ROLE_3 PROP_TAG(PT_BINARY,0x0E7E)
-#define PR_NON_XMT_SECURITY_ROLE_3_AS_XML PROP_TAG(PT_TSTRING,0x0E7E)
-#define PR_NON_XMT_SECURITY_ROLE_4 PROP_TAG(PT_BINARY,0x0E7F)
-#define PR_NON_XMT_SECURITY_ROLE_4_AS_XML PROP_TAG(PT_TSTRING,0x0E7F)
-#define PR_NON_XMT_SECURITY_ROLE_5 PROP_TAG(PT_BINARY,0x0E80)
-#define PR_NON_XMT_SECURITY_ROLE_5_AS_XML PROP_TAG(PT_TSTRING,0x0E80)
-#define PR_NON_XMT_SECURITY_ROLE_6 PROP_TAG(PT_BINARY,0x0E81)
-#define PR_NON_XMT_SECURITY_ROLE_6_AS_XML PROP_TAG(PT_TSTRING,0x0E81)
-#define PR_NON_XMT_SECURITY_ROLE_7 PROP_TAG(PT_BINARY,0x0E82)
-#define PR_NON_XMT_SECURITY_ROLE_7_AS_XML PROP_TAG(PT_TSTRING,0x0E82)
-#define PR_NON_XMT_SECURITY_ROLE_8 PROP_TAG(PT_BINARY,0x0E83)
-#define PR_NON_XMT_SECURITY_ROLE_8_AS_XML PROP_TAG(PT_TSTRING,0x0E83)
-
+#define PR_XMT_SECURITY_ROLE_1 PROP_TAG(PT_BINARY, 0x3d25)
+#define PR_XMT_SECURITY_ROLE_1_AS_XML PROP_TAG(PT_TSTRING, 0x3d25)
+#define PR_XMT_SECURITY_ROLE_2 PROP_TAG(PT_BINARY, 0x3d26)
+#define PR_XMT_SECURITY_ROLE_2_AS_XML PROP_TAG(PT_TSTRING, 0x3d26)
+#define PR_XMT_SECURITY_ROLE_3 PROP_TAG(PT_BINARY, 0x3d27)
+#define PR_XMT_SECURITY_ROLE_3_AS_XML PROP_TAG(PT_TSTRING, 0x3d27)
+#define PR_XMT_SECURITY_ROLE_4 PROP_TAG(PT_BINARY, 0x3d28)
+#define PR_XMT_SECURITY_ROLE_4_AS_XML PROP_TAG(PT_TSTRING, 0x3d28)
+#define PR_XMT_SECURITY_ROLE_5 PROP_TAG(PT_BINARY, 0x3d29)
+#define PR_XMT_SECURITY_ROLE_5_AS_XML PROP_TAG(PT_TSTRING, 0x3d29)
+#define PR_XMT_SECURITY_ROLE_6 PROP_TAG(PT_BINARY, 0x3d2A)
+#define PR_XMT_SECURITY_ROLE_6_AS_XML PROP_TAG(PT_TSTRING, 0x3d2A)
+#define PR_XMT_SECURITY_ROLE_7 PROP_TAG(PT_BINARY, 0x3d2B)
+#define PR_XMT_SECURITY_ROLE_7_AS_XML PROP_TAG(PT_TSTRING, 0x3d2B)
+#define PR_XMT_SECURITY_ROLE_8 PROP_TAG(PT_BINARY, 0x3d2C)
+#define PR_XMT_SECURITY_ROLE_8_AS_XML PROP_TAG(PT_TSTRING, 0x3d2C)
+#define PR_NON_XMT_SECURITY_ROLE_1 PROP_TAG(PT_BINARY, 0x0E7C)
+#define PR_NON_XMT_SECURITY_ROLE_1_AS_XML PROP_TAG(PT_TSTRING, 0x0E7C)
+#define PR_NON_XMT_SECURITY_ROLE_2 PROP_TAG(PT_BINARY, 0x0E7D)
+#define PR_NON_XMT_SECURITY_ROLE_2_AS_XML PROP_TAG(PT_TSTRING, 0x0E7D)
+#define PR_NON_XMT_SECURITY_ROLE_3 PROP_TAG(PT_BINARY, 0x0E7E)
+#define PR_NON_XMT_SECURITY_ROLE_3_AS_XML PROP_TAG(PT_TSTRING, 0x0E7E)
+#define PR_NON_XMT_SECURITY_ROLE_4 PROP_TAG(PT_BINARY, 0x0E7F)
+#define PR_NON_XMT_SECURITY_ROLE_4_AS_XML PROP_TAG(PT_TSTRING, 0x0E7F)
+#define PR_NON_XMT_SECURITY_ROLE_5 PROP_TAG(PT_BINARY, 0x0E80)
+#define PR_NON_XMT_SECURITY_ROLE_5_AS_XML PROP_TAG(PT_TSTRING, 0x0E80)
+#define PR_NON_XMT_SECURITY_ROLE_6 PROP_TAG(PT_BINARY, 0x0E81)
+#define PR_NON_XMT_SECURITY_ROLE_6_AS_XML PROP_TAG(PT_TSTRING, 0x0E81)
+#define PR_NON_XMT_SECURITY_ROLE_7 PROP_TAG(PT_BINARY, 0x0E82)
+#define PR_NON_XMT_SECURITY_ROLE_7_AS_XML PROP_TAG(PT_TSTRING, 0x0E82)
+#define PR_NON_XMT_SECURITY_ROLE_8 PROP_TAG(PT_BINARY, 0x0E83)
+#define PR_NON_XMT_SECURITY_ROLE_8_AS_XML PROP_TAG(PT_TSTRING, 0x0E83)
/* Rules specifics */
// Property types
-#define PT_SRESTRICTION ((ULONG) 0x00FD)
-#define PT_ACTIONS ((ULONG) 0x00FE)
+#define PT_SRESTRICTION ((ULONG)0x00FD)
+#define PT_ACTIONS ((ULONG)0x00FE)
/*-----------------------------------------------------------------------
* PT_FILE_HANDLE: real data is in file specified by handle.
@@ -1236,205 +1212,194 @@ typedef BYTE ROLESCOPE;
* is not supported for outside calls.
*-----------------------------------------------------------------------*/
-#define PT_FILE_HANDLE ((ULONG) 0x0103)
-#define PT_FILE_EA ((ULONG) 0x0104)
-#define PT_VIRTUAL ((ULONG) 0x0105)
-
-#define FVirtualProp(ptag) (PROP_TYPE(ptag) == PT_VIRTUAL)
-#define FFileHandleProp(ptag) (PROP_TYPE(ptag) == PT_FILE_HANDLE || PROP_TYPE(ptag) == PT_FILE_EA)
-
-//Properties in rule table
-#define PR_RULE_ID PROP_TAG(PT_I8, pidSpecialMin+0x04)
-#define PR_RULE_IDS PROP_TAG(PT_BINARY, pidSpecialMin+0x05)
-#define PR_RULE_SEQUENCE PROP_TAG(PT_LONG, pidSpecialMin+0x06)
-#define PR_RULE_STATE PROP_TAG(PT_LONG, pidSpecialMin+0x07)
-#define PR_RULE_USER_FLAGS PROP_TAG(PT_LONG, pidSpecialMin+0x08)
-#define PR_RULE_CONDITION PROP_TAG(PT_SRESTRICTION, pidSpecialMin+0x09)
-#define PR_RULE_ACTIONS PROP_TAG(PT_ACTIONS, pidSpecialMin+0x10)
-#define PR_RULE_PROVIDER PROP_TAG(PT_STRING8, pidSpecialMin+0x11)
-#define PR_RULE_NAME PROP_TAG(PT_TSTRING, pidSpecialMin+0x12)
-#define PR_RULE_LEVEL PROP_TAG(PT_LONG, pidSpecialMin+0x13)
-#define PR_RULE_PROVIDER_DATA PROP_TAG(PT_BINARY, pidSpecialMin+0x14)
-
-#define PR_EXTENDED_RULE_ACTIONS PROP_TAG(PT_BINARY, pidStoreNonTransMin+0x59)
-#define PR_EXTENDED_RULE_CONDITION PROP_TAG(PT_BINARY, pidStoreNonTransMin+0x5a)
-#define PR_EXTENDED_RULE_SIZE_LIMIT PROP_TAG(PT_LONG, pidStoreNonTransMin+0x5b)
+#define PT_FILE_HANDLE ((ULONG)0x0103)
+#define PT_FILE_EA ((ULONG)0x0104)
+#define PT_VIRTUAL ((ULONG)0x0105)
+
+#define FVirtualProp(ptag) (PROP_TYPE(ptag) == PT_VIRTUAL)
+#define FFileHandleProp(ptag) (PROP_TYPE(ptag) == PT_FILE_HANDLE || PROP_TYPE(ptag) == PT_FILE_EA)
+
+// Properties in rule table
+#define PR_RULE_ID PROP_TAG(PT_I8, pidSpecialMin + 0x04)
+#define PR_RULE_IDS PROP_TAG(PT_BINARY, pidSpecialMin + 0x05)
+#define PR_RULE_SEQUENCE PROP_TAG(PT_LONG, pidSpecialMin + 0x06)
+#define PR_RULE_STATE PROP_TAG(PT_LONG, pidSpecialMin + 0x07)
+#define PR_RULE_USER_FLAGS PROP_TAG(PT_LONG, pidSpecialMin + 0x08)
+#define PR_RULE_CONDITION PROP_TAG(PT_SRESTRICTION, pidSpecialMin + 0x09)
+#define PR_RULE_ACTIONS PROP_TAG(PT_ACTIONS, pidSpecialMin + 0x10)
+#define PR_RULE_PROVIDER PROP_TAG(PT_STRING8, pidSpecialMin + 0x11)
+#define PR_RULE_NAME PROP_TAG(PT_TSTRING, pidSpecialMin + 0x12)
+#define PR_RULE_LEVEL PROP_TAG(PT_LONG, pidSpecialMin + 0x13)
+#define PR_RULE_PROVIDER_DATA PROP_TAG(PT_BINARY, pidSpecialMin + 0x14)
+
+#define PR_EXTENDED_RULE_ACTIONS PROP_TAG(PT_BINARY, pidStoreNonTransMin + 0x59)
+#define PR_EXTENDED_RULE_CONDITION PROP_TAG(PT_BINARY, pidStoreNonTransMin + 0x5a)
+#define PR_EXTENDED_RULE_SIZE_LIMIT PROP_TAG(PT_LONG, pidStoreNonTransMin + 0x5b)
// moved to ptag.h (scottno) - still needed for 2.27 upgrader
// #define PR_RULE_VERSION PROP_TAG( PT_I2, pidSpecialMin+0x1D)
-//PR_STATE property values
-#define ST_DISABLED 0x0000
-#define ST_ENABLED 0x0001
-#define ST_ERROR 0x0002
-#define ST_ONLY_WHEN_OOF 0x0004
-#define ST_KEEP_OOF_HIST 0x0008
-#define ST_EXIT_LEVEL 0x0010
-#define ST_SKIP_IF_SCL_IS_SAFE 0x0020
-#define ST_RULE_PARSE_ERROR 0x0040
-#define ST_CLEAR_OOF_HIST 0x80000000
+// PR_STATE property values
+#define ST_DISABLED 0x0000
+#define ST_ENABLED 0x0001
+#define ST_ERROR 0x0002
+#define ST_ONLY_WHEN_OOF 0x0004
+#define ST_KEEP_OOF_HIST 0x0008
+#define ST_EXIT_LEVEL 0x0010
+#define ST_SKIP_IF_SCL_IS_SAFE 0x0020
+#define ST_RULE_PARSE_ERROR 0x0040
+#define ST_CLEAR_OOF_HIST 0x80000000
-//Empty restriction
-#define NULL_RESTRICTION 0xff
+// Empty restriction
+#define NULL_RESTRICTION 0xff
// special RELOP for Member of DL
-#define RELOP_MEMBER_OF_DL 100
-
-//Action types
-typedef enum
-{
- OP_MOVE = 1,
- OP_COPY,
- OP_REPLY,
- OP_OOF_REPLY,
- OP_DEFER_ACTION,
- OP_BOUNCE,
- OP_FORWARD,
- OP_DELEGATE,
- OP_TAG,
- OP_DELETE,
- OP_MARK_AS_READ,
+#define RELOP_MEMBER_OF_DL 100
+
+// Action types
+typedef enum {
+ OP_MOVE = 1,
+ OP_COPY,
+ OP_REPLY,
+ OP_OOF_REPLY,
+ OP_DEFER_ACTION,
+ OP_BOUNCE,
+ OP_FORWARD,
+ OP_DELEGATE,
+ OP_TAG,
+ OP_DELETE,
+ OP_MARK_AS_READ,
} ACTTYPE;
// provider name for moderator rules
-#define szProviderModeratorRule "MSFT:MR"
-#define wszProviderModeratorRule L"MSFT:MR"
+#define szProviderModeratorRule "MSFT:MR"
+#define wszProviderModeratorRule L"MSFT:MR"
// action flavors
// for OP_REPLY
-#define DO_NOT_SEND_TO_ORIGINATOR 1
-#define STOCK_REPLY_TEMPLATE 2
+#define DO_NOT_SEND_TO_ORIGINATOR 1
+#define STOCK_REPLY_TEMPLATE 2
// for OP_FORWARD
-#define FWD_PRESERVE_SENDER 1
-#define FWD_DO_NOT_MUNGE_MSG 2
-#define FWD_AS_ATTACHMENT 4
-
-//scBounceCode values
-#define BOUNCE_MESSAGE_SIZE_TOO_LARGE (SCODE) MAPI_DIAG_LENGTH_CONSTRAINT_VIOLATD
-#define BOUNCE_FORMS_MISMATCH (SCODE) MAPI_DIAG_RENDITION_UNSUPPORTED
-#define BOUNCE_ACCESS_DENIED (SCODE) MAPI_DIAG_MAIL_REFUSED
-
-//Message class prefix for Reply and OOF Reply templates
-#define szReplyTemplateMsgClassPrefix "IPM.Note.Rules.ReplyTemplate."
-#define szOofTemplateMsgClassPrefix "IPM.Note.Rules.OofTemplate."
-
-//Action structure
-typedef struct _action
-{
- ACTTYPE acttype;
-
- // to indicate which flavor of the action.
- ULONG ulActionFlavor;
-
- // Action restriction
- // currently unused and must be set to NULL
- LPSRestriction lpRes;
-
- // currently unused and must be set to NULL.
- LPSPropTagArray lpPropTagArray;
-
- // User defined flags
- ULONG ulFlags;
-
- // padding to align the union on 8 byte boundary
- ULONG dwAlignPad;
-
- union
- {
- // used for OP_MOVE and OP_COPY actions
- struct
- {
- ULONG cbStoreEntryId;
- LPENTRYID lpStoreEntryId;
- ULONG cbFldEntryId;
- LPENTRYID lpFldEntryId;
- } actMoveCopy;
-
- // used for OP_REPLY and OP_OOF_REPLY actions
- struct
- {
- ULONG cbEntryId;
- LPENTRYID lpEntryId;
- GUID guidReplyTemplate;
- } actReply;
-
- // used for OP_DEFER_ACTION action
- struct
- {
- ULONG cbData;
- BYTE *pbData;
- } actDeferAction;
-
- // Error code to set for OP_BOUNCE action
- SCODE scBounceCode;
-
- // list of address for OP_FORWARD and OP_DELEGATE action
- LPADRLIST lpadrlist;
-
- // prop value for OP_TAG action
- SPropValue propTag;
- };
-} ACTION, FAR * LPACTION;
+#define FWD_PRESERVE_SENDER 1
+#define FWD_DO_NOT_MUNGE_MSG 2
+#define FWD_AS_ATTACHMENT 4
+
+// scBounceCode values
+#define BOUNCE_MESSAGE_SIZE_TOO_LARGE (SCODE) MAPI_DIAG_LENGTH_CONSTRAINT_VIOLATD
+#define BOUNCE_FORMS_MISMATCH (SCODE) MAPI_DIAG_RENDITION_UNSUPPORTED
+#define BOUNCE_ACCESS_DENIED (SCODE) MAPI_DIAG_MAIL_REFUSED
+
+// Message class prefix for Reply and OOF Reply templates
+#define szReplyTemplateMsgClassPrefix "IPM.Note.Rules.ReplyTemplate."
+#define szOofTemplateMsgClassPrefix "IPM.Note.Rules.OofTemplate."
+
+// Action structure
+typedef struct _action {
+ ACTTYPE acttype;
+
+ // to indicate which flavor of the action.
+ ULONG ulActionFlavor;
+
+ // Action restriction
+ // currently unused and must be set to NULL
+ LPSRestriction lpRes;
+
+ // currently unused and must be set to NULL.
+ LPSPropTagArray lpPropTagArray;
+
+ // User defined flags
+ ULONG ulFlags;
+
+ // padding to align the union on 8 byte boundary
+ ULONG dwAlignPad;
+
+ union {
+ // used for OP_MOVE and OP_COPY actions
+ struct {
+ ULONG cbStoreEntryId;
+ LPENTRYID lpStoreEntryId;
+ ULONG cbFldEntryId;
+ LPENTRYID lpFldEntryId;
+ } actMoveCopy;
+
+ // used for OP_REPLY and OP_OOF_REPLY actions
+ struct {
+ ULONG cbEntryId;
+ LPENTRYID lpEntryId;
+ GUID guidReplyTemplate;
+ } actReply;
+
+ // used for OP_DEFER_ACTION action
+ struct {
+ ULONG cbData;
+ BYTE *pbData;
+ } actDeferAction;
+
+ // Error code to set for OP_BOUNCE action
+ SCODE scBounceCode;
+
+ // list of address for OP_FORWARD and OP_DELEGATE action
+ LPADRLIST lpadrlist;
+
+ // prop value for OP_TAG action
+ SPropValue propTag;
+ };
+} ACTION, FAR *LPACTION;
// Rules version
-#define EDK_RULES_VERSION 1
-
-//Array of actions
-typedef struct _actions
-{
- ULONG ulVersion; // use the #define above
- UINT cActions;
- LPACTION lpAction;
+#define EDK_RULES_VERSION 1
+
+// Array of actions
+typedef struct _actions {
+ ULONG ulVersion; // use the #define above
+ UINT cActions;
+ LPACTION lpAction;
} ACTIONS;
#ifdef __cplusplus
extern "C" {
#endif
-HRESULT WINAPI
-HrSerializeSRestriction(IMAPIProp * pprop, LPSRestriction prest, BYTE ** ppbRest, ULONG * pcbRest);
+HRESULT WINAPI HrSerializeSRestriction(IMAPIProp *pprop, LPSRestriction prest, BYTE **ppbRest, ULONG *pcbRest);
-HRESULT WINAPI
-HrDeserializeSRestriction(IMAPIProp * pprop, BYTE * pbRest, ULONG cbRest, LPSRestriction * pprest);
+HRESULT WINAPI HrDeserializeSRestriction(IMAPIProp *pprop, BYTE *pbRest, ULONG cbRest, LPSRestriction *pprest);
-HRESULT WINAPI
-HrSerializeActions(IMAPIProp * pprop, ACTIONS * pActions, BYTE ** ppbActions, ULONG * pcbActions);
+HRESULT WINAPI HrSerializeActions(IMAPIProp *pprop, ACTIONS *pActions, BYTE **ppbActions, ULONG *pcbActions);
-HRESULT WINAPI
-HrDeserializeActions(IMAPIProp * pprop, BYTE * pbActions, ULONG cbActions, ACTIONS ** ppActions);
+HRESULT WINAPI HrDeserializeActions(IMAPIProp *pprop, BYTE *pbActions, ULONG cbActions, ACTIONS **ppActions);
#ifdef __cplusplus
-} // extern "C"
+} // extern "C"
#endif
// message class definitions for Deferred Action and Deffered Error messages
-#define szDamMsgClass "IPC.Microsoft Exchange 4.0.Deferred Action"
-#define szDemMsgClass "IPC.Microsoft Exchange 4.0.Deferred Error"
+#define szDamMsgClass "IPC.Microsoft Exchange 4.0.Deferred Action"
+#define szDemMsgClass "IPC.Microsoft Exchange 4.0.Deferred Error"
-#define szExRuleMsgClass "IPM.ExtendedRule.Message"
-#define wszExRuleMsgClass L"IPM.ExtendedRule.Message"
+#define szExRuleMsgClass "IPM.ExtendedRule.Message"
+#define wszExRuleMsgClass L"IPM.ExtendedRule.Message"
/*
* Rule error codes
* Values for PR_RULE_ERROR
*/
-#define RULE_ERR_UNKNOWN 1 //general catchall error
-#define RULE_ERR_LOAD 2 //unable to load folder rules
-#define RULE_ERR_DELIVERY 3 //unable to deliver message temporarily
-#define RULE_ERR_PARSING 4 //error while parsing
-#define RULE_ERR_CREATE_DAE 5 //error creating DAE message
-#define RULE_ERR_NO_FOLDER 6 //folder to move/copy doesn't exist
-#define RULE_ERR_NO_RIGHTS 7 //no rights to move/copy into folder
-#define RULE_ERR_CREATE_DAM 8 //error creating DAM
-#define RULE_ERR_NO_SENDAS 9 //can not send as another user
-#define RULE_ERR_NO_TEMPLATE 10 //reply template is missing
-#define RULE_ERR_EXECUTION 11 //error in rule execution
-#define RULE_ERR_QUOTA_EXCEEDED 12 //mailbox quota size exceeded
-#define RULE_ERR_TOO_MANY_RECIPS 13 //number of recips exceded upper limit
-
-#define RULE_ERR_FIRST RULE_ERR_UNKNOWN
-#define RULE_ERR_LAST RULE_ERR_TOO_MANY_RECIPS
+#define RULE_ERR_UNKNOWN 1 // general catchall error
+#define RULE_ERR_LOAD 2 // unable to load folder rules
+#define RULE_ERR_DELIVERY 3 // unable to deliver message temporarily
+#define RULE_ERR_PARSING 4 // error while parsing
+#define RULE_ERR_CREATE_DAE 5 // error creating DAE message
+#define RULE_ERR_NO_FOLDER 6 // folder to move/copy doesn't exist
+#define RULE_ERR_NO_RIGHTS 7 // no rights to move/copy into folder
+#define RULE_ERR_CREATE_DAM 8 // error creating DAM
+#define RULE_ERR_NO_SENDAS 9 // can not send as another user
+#define RULE_ERR_NO_TEMPLATE 10 // reply template is missing
+#define RULE_ERR_EXECUTION 11 // error in rule execution
+#define RULE_ERR_QUOTA_EXCEEDED 12 // mailbox quota size exceeded
+#define RULE_ERR_TOO_MANY_RECIPS 13 // number of recips exceded upper limit
+
+#define RULE_ERR_FIRST RULE_ERR_UNKNOWN
+#define RULE_ERR_LAST RULE_ERR_TOO_MANY_RECIPS
/*------------------------------------------------------------------------
*
@@ -1444,22 +1409,17 @@ HrDeserializeActions(IMAPIProp * pprop, BYTE * pbActions, ULONG cbActions, ACTIO
*
*-----------------------------------------------------------------------*/
-#define EXCHANGE_IEXCHANGERULEACTION_METHODS(IPURE) \
- MAPIMETHOD(ActionCount) \
- (THIS_ ULONG FAR * lpcActions) IPURE; \
- MAPIMETHOD(GetAction) \
- (THIS_ ULONG ulActionNumber, \
- LARGE_INTEGER * lpruleid, \
- LPACTION FAR * lppAction) IPURE;
-
-#undef INTERFACE
-#define INTERFACE IExchangeRuleAction
-DECLARE_MAPI_INTERFACE_(IExchangeRuleAction, IUnknown)
-{
- MAPI_IUNKNOWN_METHODS(PURE)
- EXCHANGE_IEXCHANGERULEACTION_METHODS(PURE)
-};
-#undef IMPL
+#define EXCHANGE_IEXCHANGERULEACTION_METHODS(IPURE) \
+ MAPIMETHOD(ActionCount) \
+ (THIS_ ULONG FAR * lpcActions) IPURE; \
+ MAPIMETHOD(GetAction) \
+ (THIS_ ULONG ulActionNumber, LARGE_INTEGER * lpruleid, LPACTION FAR * lppAction) IPURE;
+
+#undef INTERFACE
+#define INTERFACE IExchangeRuleAction
+DECLARE_MAPI_INTERFACE_(IExchangeRuleAction,
+ IUnknown){MAPI_IUNKNOWN_METHODS(PURE) EXCHANGE_IEXCHANGERULEACTION_METHODS(PURE)};
+#undef IMPL
#define IMPL
DECLARE_MAPI_INTERFACE_PTR(IExchangeRuleAction, LPEXCHANGERULEACTION);
@@ -1472,43 +1432,26 @@ DECLARE_MAPI_INTERFACE_PTR(IExchangeRuleAction, LPEXCHANGERULEACTION);
*
*-----------------------------------------------------------------------*/
-#define EXCHANGE_IEXCHANGEMANAGESTORE_METHODS(IPURE) \
- MAPIMETHOD(CreateStoreEntryID) \
- (THIS_ LPSTR lpszMsgStoreDN, \
- LPSTR lpszMailboxDN, \
- ULONG ulFlags, \
- ULONG FAR * lpcbEntryID, \
- LPENTRYID FAR * lppEntryID) IPURE; \
- MAPIMETHOD(EntryIDFromSourceKey) \
- (THIS_ ULONG cFolderKeySize, \
- BYTE FAR * lpFolderSourceKey, \
- ULONG cMessageKeySize, \
- BYTE FAR * lpMessageSourceKey, \
- ULONG FAR * lpcbEntryID, \
- LPENTRYID FAR * lppEntryID) IPURE; \
- MAPIMETHOD(GetRights) \
- (THIS_ ULONG cbUserEntryID, \
- LPENTRYID lpUserEntryID, \
- ULONG cbEntryID, \
- LPENTRYID lpEntryID, \
- ULONG FAR * lpulRights) IPURE; \
- MAPIMETHOD(GetMailboxTable) \
- (THIS_ LPSTR lpszServerName, \
- LPMAPITABLE FAR * lppTable, \
- ULONG ulFlags) IPURE; \
- MAPIMETHOD(GetPublicFolderTable) \
- (THIS_ LPSTR lpszServerName, \
- LPMAPITABLE FAR * lppTable, \
- ULONG ulFlags) IPURE;
-
-#undef INTERFACE
-#define INTERFACE IExchangeManageStore
-DECLARE_MAPI_INTERFACE_(IExchangeManageStore, IUnknown)
-{
- MAPI_IUNKNOWN_METHODS(PURE)
- EXCHANGE_IEXCHANGEMANAGESTORE_METHODS(PURE)
-};
-#undef IMPL
+#define EXCHANGE_IEXCHANGEMANAGESTORE_METHODS(IPURE) \
+ MAPIMETHOD(CreateStoreEntryID) \
+ (THIS_ LPSTR lpszMsgStoreDN, LPSTR lpszMailboxDN, ULONG ulFlags, ULONG FAR * lpcbEntryID, \
+ LPENTRYID FAR * lppEntryID) IPURE; \
+ MAPIMETHOD(EntryIDFromSourceKey) \
+ (THIS_ ULONG cFolderKeySize, BYTE FAR * lpFolderSourceKey, ULONG cMessageKeySize, BYTE FAR * lpMessageSourceKey, \
+ ULONG FAR * lpcbEntryID, LPENTRYID FAR * lppEntryID) IPURE; \
+ MAPIMETHOD(GetRights) \
+ (THIS_ ULONG cbUserEntryID, LPENTRYID lpUserEntryID, ULONG cbEntryID, LPENTRYID lpEntryID, ULONG FAR * lpulRights) \
+ IPURE; \
+ MAPIMETHOD(GetMailboxTable) \
+ (THIS_ LPSTR lpszServerName, LPMAPITABLE FAR * lppTable, ULONG ulFlags) IPURE; \
+ MAPIMETHOD(GetPublicFolderTable) \
+ (THIS_ LPSTR lpszServerName, LPMAPITABLE FAR * lppTable, ULONG ulFlags) IPURE;
+
+#undef INTERFACE
+#define INTERFACE IExchangeManageStore
+DECLARE_MAPI_INTERFACE_(IExchangeManageStore,
+ IUnknown){MAPI_IUNKNOWN_METHODS(PURE) EXCHANGE_IEXCHANGEMANAGESTORE_METHODS(PURE)};
+#undef IMPL
#define IMPL
DECLARE_MAPI_INTERFACE_PTR(IExchangeManageStore, LPEXCHANGEMANAGESTORE);
@@ -1521,26 +1464,20 @@ DECLARE_MAPI_INTERFACE_PTR(IExchangeManageStore, LPEXCHANGEMANAGESTORE);
*
*-----------------------------------------------------------------------*/
-#define EXCHANGE_IEXCHANGEMANAGESTORE2_METHODS(IPURE) \
- MAPIMETHOD(CreateNewsgroupNameEntryID) \
- (THIS_ LPSTR lpszNewsgroupName, \
- ULONG FAR * lpcbEntryID, \
- LPENTRYID FAR * lppEntryID) IPURE;
-
-#undef INTERFACE
-#define INTERFACE IExchangeManageStore2
-DECLARE_MAPI_INTERFACE_(IExchangeManageStore2, IUnknown)
-{
- MAPI_IUNKNOWN_METHODS(PURE)
- EXCHANGE_IEXCHANGEMANAGESTORE_METHODS(PURE)
- EXCHANGE_IEXCHANGEMANAGESTORE2_METHODS(PURE)
-};
-#undef IMPL
+#define EXCHANGE_IEXCHANGEMANAGESTORE2_METHODS(IPURE) \
+ MAPIMETHOD(CreateNewsgroupNameEntryID) \
+ (THIS_ LPSTR lpszNewsgroupName, ULONG FAR * lpcbEntryID, LPENTRYID FAR * lppEntryID) IPURE;
+
+#undef INTERFACE
+#define INTERFACE IExchangeManageStore2
+DECLARE_MAPI_INTERFACE_(IExchangeManageStore2, IUnknown){MAPI_IUNKNOWN_METHODS(PURE)
+ EXCHANGE_IEXCHANGEMANAGESTORE_METHODS(PURE)
+ EXCHANGE_IEXCHANGEMANAGESTORE2_METHODS(PURE)};
+#undef IMPL
#define IMPL
DECLARE_MAPI_INTERFACE_PTR(IExchangeManageStore2, LPEXCHANGEMANAGESTORE2);
-
/*------------------------------------------------------------------------
*
* "IExchangeManageStore3" Interface Declaration
@@ -1549,28 +1486,20 @@ DECLARE_MAPI_INTERFACE_PTR(IExchangeManageStore2, LPEXCHANGEMANAGESTORE2);
*
*-----------------------------------------------------------------------*/
-#define EXCHANGE_IEXCHANGEMANAGESTORE3_METHODS(IPURE) \
- MAPIMETHOD(GetMailboxTableOffset) \
- (THIS_ LPSTR lpszServerName, \
- LPMAPITABLE FAR * lppTable, \
- ULONG ulFlags, \
- UINT uOffset) IPURE;
-
-#undef INTERFACE
-#define INTERFACE IExchangeManageStore3
-DECLARE_MAPI_INTERFACE_(IExchangeManageStore3, IUnknown)
-{
- MAPI_IUNKNOWN_METHODS(PURE)
- EXCHANGE_IEXCHANGEMANAGESTORE_METHODS(PURE)
- EXCHANGE_IEXCHANGEMANAGESTORE2_METHODS(PURE)
- EXCHANGE_IEXCHANGEMANAGESTORE3_METHODS(PURE)
-};
-#undef IMPL
+#define EXCHANGE_IEXCHANGEMANAGESTORE3_METHODS(IPURE) \
+ MAPIMETHOD(GetMailboxTableOffset) \
+ (THIS_ LPSTR lpszServerName, LPMAPITABLE FAR * lppTable, ULONG ulFlags, UINT uOffset) IPURE;
+
+#undef INTERFACE
+#define INTERFACE IExchangeManageStore3
+DECLARE_MAPI_INTERFACE_(IExchangeManageStore3, IUnknown){
+ MAPI_IUNKNOWN_METHODS(PURE) EXCHANGE_IEXCHANGEMANAGESTORE_METHODS(PURE) EXCHANGE_IEXCHANGEMANAGESTORE2_METHODS(PURE)
+ EXCHANGE_IEXCHANGEMANAGESTORE3_METHODS(PURE)};
+#undef IMPL
#define IMPL
DECLARE_MAPI_INTERFACE_PTR(IExchangeManageStore3, LPEXCHANGEMANAGESTORE3);
-
/*------------------------------------------------------------------------
*
* "IExchangeManageStore4" Interface Declaration
@@ -1579,29 +1508,20 @@ DECLARE_MAPI_INTERFACE_PTR(IExchangeManageStore3, LPEXCHANGEMANAGESTORE3);
*
*-----------------------------------------------------------------------*/
-#define EXCHANGE_IEXCHANGEMANAGESTORE4_METHODS(IPURE) \
- MAPIMETHOD(GetPublicFolderTableOffset) \
- (THIS_ LPSTR lpszServerName, \
- LPMAPITABLE FAR * lppTable, \
- ULONG ulFlags, \
- UINT uOffset) IPURE;
-
-#undef INTERFACE
-#define INTERFACE IExchangeManageStore4
-DECLARE_MAPI_INTERFACE_(IExchangeManageStore4, IUnknown)
-{
- MAPI_IUNKNOWN_METHODS(PURE)
- EXCHANGE_IEXCHANGEMANAGESTORE_METHODS(PURE)
- EXCHANGE_IEXCHANGEMANAGESTORE2_METHODS(PURE)
- EXCHANGE_IEXCHANGEMANAGESTORE3_METHODS(PURE)
- EXCHANGE_IEXCHANGEMANAGESTORE4_METHODS(PURE)
-};
-#undef IMPL
+#define EXCHANGE_IEXCHANGEMANAGESTORE4_METHODS(IPURE) \
+ MAPIMETHOD(GetPublicFolderTableOffset) \
+ (THIS_ LPSTR lpszServerName, LPMAPITABLE FAR * lppTable, ULONG ulFlags, UINT uOffset) IPURE;
+
+#undef INTERFACE
+#define INTERFACE IExchangeManageStore4
+DECLARE_MAPI_INTERFACE_(IExchangeManageStore4, IUnknown){
+ MAPI_IUNKNOWN_METHODS(PURE) EXCHANGE_IEXCHANGEMANAGESTORE_METHODS(PURE) EXCHANGE_IEXCHANGEMANAGESTORE2_METHODS(PURE)
+ EXCHANGE_IEXCHANGEMANAGESTORE3_METHODS(PURE) EXCHANGE_IEXCHANGEMANAGESTORE4_METHODS(PURE)};
+#undef IMPL
#define IMPL
DECLARE_MAPI_INTERFACE_PTR(IExchangeManageStore4, LPEXCHANGEMANAGESTORE4);
-
/*------------------------------------------------------------------------
*
* "IExchangeNntpNewsfeed" Interface Declaration
@@ -1610,110 +1530,101 @@ DECLARE_MAPI_INTERFACE_PTR(IExchangeManageStore4, LPEXCHANGEMANAGESTORE4);
*
*-----------------------------------------------------------------------*/
-#define EXCHANGE_IEXCHANGENNTPNEWSFEED_METHODS(IPURE) \
- MAPIMETHOD(Configure) \
- (THIS_ LPSTR lpszNewsfeedDN, \
- ULONG cValues, \
- LPSPropValue lpIMailPropArray) IPURE; \
- MAPIMETHOD(CheckMsgIds) \
- (THIS_ LPSTR lpszMsgIds, \
- ULONG FAR * lpcfWanted, \
- BYTE FAR ** lppfWanted) IPURE; \
- MAPIMETHOD(OpenArticleStream) \
- (THIS_ LPSTREAM FAR * lppStream) IPURE; \
-
-
-#undef INTERFACE
-#define INTERFACE IExchangeNntpNewsfeed
-DECLARE_MAPI_INTERFACE_(IExchangeNntpNewsfeed, IUnknown)
-{
- MAPI_IUNKNOWN_METHODS(PURE)
- EXCHANGE_IEXCHANGENNTPNEWSFEED_METHODS(PURE)
-};
-#undef IMPL
+#define EXCHANGE_IEXCHANGENNTPNEWSFEED_METHODS(IPURE) \
+ MAPIMETHOD(Configure) \
+ (THIS_ LPSTR lpszNewsfeedDN, ULONG cValues, LPSPropValue lpIMailPropArray) IPURE; \
+ MAPIMETHOD(CheckMsgIds) \
+ (THIS_ LPSTR lpszMsgIds, ULONG FAR * lpcfWanted, BYTE FAR * *lppfWanted) IPURE; \
+ MAPIMETHOD(OpenArticleStream) \
+ (THIS_ LPSTREAM FAR * lppStream) IPURE;
+
+#undef INTERFACE
+#define INTERFACE IExchangeNntpNewsfeed
+DECLARE_MAPI_INTERFACE_(IExchangeNntpNewsfeed,
+ IUnknown){MAPI_IUNKNOWN_METHODS(PURE) EXCHANGE_IEXCHANGENNTPNEWSFEED_METHODS(PURE)};
+#undef IMPL
#define IMPL
DECLARE_MAPI_INTERFACE_PTR(IExchangeNntpNewsfeed, LPEXCHANGENNTPNEWSFEED);
// Properties for GetMailboxTable
-#define PR_NT_USER_NAME PROP_TAG(PT_TSTRING, pidAdminMin+0x10)
+#define PR_NT_USER_NAME PROP_TAG(PT_TSTRING, pidAdminMin + 0x10)
//
// PR_LOCALE_ID definition has been moved down and combined with other
// locale-specific properties. It is still being returned through the
// mailbox table.
//
-//#define PR_LOCALE_ID PROP_TAG( PT_LONG, pidAdminMin+0x11 )
-#define PR_LAST_LOGON_TIME PROP_TAG(PT_SYSTIME, pidAdminMin+0x12 )
-#define PR_LAST_LOGOFF_TIME PROP_TAG(PT_SYSTIME, pidAdminMin+0x13 )
-#define PR_STORAGE_LIMIT_INFORMATION PROP_TAG(PT_LONG, pidAdminMin+0x14 )
+// #define PR_LOCALE_ID PROP_TAG( PT_LONG, pidAdminMin+0x11 )
+#define PR_LAST_LOGON_TIME PROP_TAG(PT_SYSTIME, pidAdminMin + 0x12)
+#define PR_LAST_LOGOFF_TIME PROP_TAG(PT_SYSTIME, pidAdminMin + 0x13)
+#define PR_STORAGE_LIMIT_INFORMATION PROP_TAG(PT_LONG, pidAdminMin + 0x14)
// property on disabling message read (unread) receipt
// reusing Folders table property (pidAdminMin+0x15)
-#define PR_INTERNET_MDNS PROP_TAG(PT_BOOLEAN, PROP_ID(PR_NEWSGROUP_COMPONENT))
+#define PR_INTERNET_MDNS PROP_TAG(PT_BOOLEAN, PROP_ID(PR_NEWSGROUP_COMPONENT))
// properties for mailbox quota info - reusing properties from folder table -
// folder pathname, owner, and contacts re-used.
-#define PR_QUOTA_WARNING_THRESHOLD PROP_TAG(PT_LONG, pidAdminMin+0x91)
-#define PR_QUOTA_SEND_THRESHOLD PROP_TAG(PT_LONG, pidAdminMin+0x92)
-#define PR_QUOTA_RECEIVE_THRESHOLD PROP_TAG(PT_LONG, pidAdminMin+0x93)
-
+#define PR_QUOTA_WARNING_THRESHOLD PROP_TAG(PT_LONG, pidAdminMin + 0x91)
+#define PR_QUOTA_SEND_THRESHOLD PROP_TAG(PT_LONG, pidAdminMin + 0x92)
+#define PR_QUOTA_RECEIVE_THRESHOLD PROP_TAG(PT_LONG, pidAdminMin + 0x93)
// Properties for GetPublicFolderTable
-#define PR_FOLDER_FLAGS PROP_TAG(PT_LONG, pidAdminMin+0x18)
-#define PR_LAST_ACCESS_TIME PROP_TAG(PT_SYSTIME, pidAdminMin+0x19)
-#define PR_RESTRICTION_COUNT PROP_TAG(PT_LONG, pidAdminMin+0x1A)
-#define PR_CATEG_COUNT PROP_TAG(PT_LONG, pidAdminMin+0x1B)
-#define PR_CACHED_COLUMN_COUNT PROP_TAG(PT_LONG, pidAdminMin+0x1C)
-#define PR_NORMAL_MSG_W_ATTACH_COUNT PROP_TAG(PT_LONG, pidAdminMin+0x1D)
-#define PR_ASSOC_MSG_W_ATTACH_COUNT PROP_TAG(PT_LONG, pidAdminMin+0x1E)
-#define PR_RECIPIENT_ON_NORMAL_MSG_COUNT PROP_TAG(PT_LONG, pidAdminMin+0x1F)
-#define PR_RECIPIENT_ON_ASSOC_MSG_COUNT PROP_TAG(PT_LONG, pidAdminMin+0x20)
-#define PR_ATTACH_ON_NORMAL_MSG_COUNT PROP_TAG(PT_LONG, pidAdminMin+0x21)
-#define PR_ATTACH_ON_ASSOC_MSG_COUNT PROP_TAG(PT_LONG, pidAdminMin+0x22)
-#define PR_NORMAL_MESSAGE_SIZE PROP_TAG(PT_LONG, pidAdminMin+0x23)
-#define PR_NORMAL_MESSAGE_SIZE_EXTENDED PROP_TAG(PT_I8, pidAdminMin+0x23)
-#define PR_ASSOC_MESSAGE_SIZE PROP_TAG(PT_LONG, pidAdminMin+0x24)
-#define PR_ASSOC_MESSAGE_SIZE_EXTENDED PROP_TAG(PT_I8, pidAdminMin+0x24)
-#define PR_FOLDER_PATHNAME PROP_TAG(PT_TSTRING, pidAdminMin+0x25)
-#define PR_OWNER_COUNT PROP_TAG(PT_LONG, pidAdminMin+0x26)
-#define PR_CONTACT_COUNT PROP_TAG(PT_LONG, pidAdminMin+0x27)
+#define PR_FOLDER_FLAGS PROP_TAG(PT_LONG, pidAdminMin + 0x18)
+#define PR_LAST_ACCESS_TIME PROP_TAG(PT_SYSTIME, pidAdminMin + 0x19)
+#define PR_RESTRICTION_COUNT PROP_TAG(PT_LONG, pidAdminMin + 0x1A)
+#define PR_CATEG_COUNT PROP_TAG(PT_LONG, pidAdminMin + 0x1B)
+#define PR_CACHED_COLUMN_COUNT PROP_TAG(PT_LONG, pidAdminMin + 0x1C)
+#define PR_NORMAL_MSG_W_ATTACH_COUNT PROP_TAG(PT_LONG, pidAdminMin + 0x1D)
+#define PR_ASSOC_MSG_W_ATTACH_COUNT PROP_TAG(PT_LONG, pidAdminMin + 0x1E)
+#define PR_RECIPIENT_ON_NORMAL_MSG_COUNT PROP_TAG(PT_LONG, pidAdminMin + 0x1F)
+#define PR_RECIPIENT_ON_ASSOC_MSG_COUNT PROP_TAG(PT_LONG, pidAdminMin + 0x20)
+#define PR_ATTACH_ON_NORMAL_MSG_COUNT PROP_TAG(PT_LONG, pidAdminMin + 0x21)
+#define PR_ATTACH_ON_ASSOC_MSG_COUNT PROP_TAG(PT_LONG, pidAdminMin + 0x22)
+#define PR_NORMAL_MESSAGE_SIZE PROP_TAG(PT_LONG, pidAdminMin + 0x23)
+#define PR_NORMAL_MESSAGE_SIZE_EXTENDED PROP_TAG(PT_I8, pidAdminMin + 0x23)
+#define PR_ASSOC_MESSAGE_SIZE PROP_TAG(PT_LONG, pidAdminMin + 0x24)
+#define PR_ASSOC_MESSAGE_SIZE_EXTENDED PROP_TAG(PT_I8, pidAdminMin + 0x24)
+#define PR_FOLDER_PATHNAME PROP_TAG(PT_TSTRING, pidAdminMin + 0x25)
+#define PR_OWNER_COUNT PROP_TAG(PT_LONG, pidAdminMin + 0x26)
+#define PR_CONTACT_COUNT PROP_TAG(PT_LONG, pidAdminMin + 0x27)
/* the absolute size limitation of a public folder */
-#define PR_PF_OVER_HARD_QUOTA_LIMIT PROP_TAG(PT_LONG, pidAdminMin+0x91)
+#define PR_PF_OVER_HARD_QUOTA_LIMIT PROP_TAG(PT_LONG, pidAdminMin + 0x91)
/* the size limit of a message in a public folder */
-#define PR_PF_MSG_SIZE_LIMIT PROP_TAG(PT_LONG, pidAdminMin+0x92)
+#define PR_PF_MSG_SIZE_LIMIT PROP_TAG(PT_LONG, pidAdminMin + 0x92)
// Do not inherit expiry settings from the MDB wide settings and instead use folder specific ones
// (if folder specific is not set, it will still not get from MDB and remain with no expiry at all)
-#define PR_PF_DISALLOW_MDB_WIDE_EXPIRY PROP_TAG(PT_BOOLEAN, pidAdminMin+0x93)
+#define PR_PF_DISALLOW_MDB_WIDE_EXPIRY PROP_TAG(PT_BOOLEAN, pidAdminMin + 0x93)
// Locale-specific properties
-#define PR_LOCALE_ID PROP_TAG(PT_LONG, pidAdminMin+0x11)
-#define PR_CODE_PAGE_ID PROP_TAG(PT_LONG, pidAdminMin+0x33)
-#define PR_SORT_LOCALE_ID PROP_TAG(PT_LONG, pidAdminMin+0x75)
+#define PR_LOCALE_ID PROP_TAG(PT_LONG, pidAdminMin + 0x11)
+#define PR_CODE_PAGE_ID PROP_TAG(PT_LONG, pidAdminMin + 0x33)
+#define PR_SORT_LOCALE_ID PROP_TAG(PT_LONG, pidAdminMin + 0x75)
// PT_I8 version of PR_MESSAGE_SIZE defined in mapitags.h
-#define PR_MESSAGE_SIZE_EXTENDED PROP_TAG(PT_I8, PROP_ID(PR_MESSAGE_SIZE))
+#define PR_MESSAGE_SIZE_EXTENDED PROP_TAG(PT_I8, PROP_ID(PR_MESSAGE_SIZE))
/* Bits in PR_FOLDER_FLAGS */
-#define MDB_FOLDER_IPM 0x1
-#define MDB_FOLDER_SEARCH 0x2
-#define MDB_FOLDER_NORMAL 0x4
-#define MDB_FOLDER_RULES 0x8
+#define MDB_FOLDER_IPM 0x1
+#define MDB_FOLDER_SEARCH 0x2
+#define MDB_FOLDER_NORMAL 0x4
+#define MDB_FOLDER_RULES 0x8
/* Bits used in ulFlags in GetPublicFolderTable() */
-#define MDB_NON_IPM 0x10
-#define MDB_IPM 0x20
+#define MDB_NON_IPM 0x10
+#define MDB_IPM 0x20
/* Bits in PR_STORAGE_LIMIT_INFORMATION */
-#define MDB_LIMIT_BELOW 0x1
-#define MDB_LIMIT_ISSUE_WARNING 0x2
-#define MDB_LIMIT_PROHIBIT_SEND 0x4
-#define MDB_LIMIT_NO_CHECK 0x8
-#define MDB_LIMIT_DISABLED 0x10
+#define MDB_LIMIT_BELOW 0x1
+#define MDB_LIMIT_ISSUE_WARNING 0x2
+#define MDB_LIMIT_PROHIBIT_SEND 0x4
+#define MDB_LIMIT_NO_CHECK 0x8
+#define MDB_LIMIT_DISABLED 0x10
/* A define for "no quota infomation" when retrieving the quota information */
-#define MDB_QUOTA_NOQUOTA 0xFFFFFFFF
+#define MDB_QUOTA_NOQUOTA 0xFFFFFFFF
/*------------------------------------------------------------------------
*
@@ -1729,40 +1640,28 @@ DECLARE_MAPI_INTERFACE_PTR(IExchangeNntpNewsfeed, LPEXCHANGENNTPNEWSFEED);
// Use MAPI_MOVE for move option
// Transfer methods
-#define TRANSFER_COPYTO 1
-#define TRANSFER_COPYPROPS 2
-#define TRANSFER_COPYMESSAGES 3
-#define TRANSFER_COPYFOLDER 4
-
-
-#define EXCHANGE_IEXCHANGEFASTTRANSFER_METHODS(IPURE) \
- MAPIMETHOD(Config) \
- (THIS_ ULONG ulFlags, \
- ULONG ulTransferMethod) IPURE; \
- MAPIMETHOD(TransferBuffer) \
- (THIS_ ULONG cb, \
- LPBYTE lpb, \
- ULONG *lpcbProcessed) IPURE; \
- STDMETHOD_(BOOL, IsInterfaceOk) \
- (THIS_ ULONG ulTransferMethod, \
- REFIID refiid, \
- LPSPropTagArray lpptagList, \
- ULONG ulFlags) IPURE;
-
-#undef INTERFACE
-#define INTERFACE IExchangeFastTransfer
-DECLARE_MAPI_INTERFACE_(IExchangeFastTransfer, IUnknown)
-{
- MAPI_IUNKNOWN_METHODS(PURE)
- EXCHANGE_IEXCHANGEFASTTRANSFER_METHODS(PURE)
-};
-#undef IMPL
+#define TRANSFER_COPYTO 1
+#define TRANSFER_COPYPROPS 2
+#define TRANSFER_COPYMESSAGES 3
+#define TRANSFER_COPYFOLDER 4
+
+#define EXCHANGE_IEXCHANGEFASTTRANSFER_METHODS(IPURE) \
+ MAPIMETHOD(Config) \
+ (THIS_ ULONG ulFlags, ULONG ulTransferMethod) IPURE; \
+ MAPIMETHOD(TransferBuffer) \
+ (THIS_ ULONG cb, LPBYTE lpb, ULONG * lpcbProcessed) IPURE; \
+ STDMETHOD_(BOOL, IsInterfaceOk) \
+ (THIS_ ULONG ulTransferMethod, REFIID refiid, LPSPropTagArray lpptagList, ULONG ulFlags) IPURE;
+
+#undef INTERFACE
+#define INTERFACE IExchangeFastTransfer
+DECLARE_MAPI_INTERFACE_(IExchangeFastTransfer,
+ IUnknown){MAPI_IUNKNOWN_METHODS(PURE) EXCHANGE_IEXCHANGEFASTTRANSFER_METHODS(PURE)};
+#undef IMPL
#define IMPL
DECLARE_MAPI_INTERFACE_PTR(IExchangeFastTransfer, LPEXCHANGEFASTTRANSFER);
-
-
/*------------------------------------------------------------------------
*
* "IExchangeExportChanges" Interface Declaration
@@ -1771,33 +1670,22 @@ DECLARE_MAPI_INTERFACE_PTR(IExchangeFastTransfer, LPEXCHANGEFASTTRANSFER);
*
*-----------------------------------------------------------------------*/
-#define EXCHANGE_IEXCHANGEEXPORTCHANGES_METHODS(IPURE) \
- MAPIMETHOD(GetLastError) \
- (THIS_ HRESULT hResult, \
- ULONG ulFlags, \
- LPMAPIERROR FAR * lppMAPIError) IPURE; \
- MAPIMETHOD(Config) \
- (THIS_ LPSTREAM lpStream, \
- ULONG ulFlags, \
- LPUNKNOWN lpUnk, \
- LPSRestriction lpRestriction, \
- LPSPropTagArray lpIncludeProps, \
- LPSPropTagArray lpExcludeProps, \
- ULONG ulBufferSize) IPURE; \
- MAPIMETHOD(Synchronize) \
- (THIS_ ULONG FAR * lpulSteps, \
- ULONG FAR * lpulProgress) IPURE; \
- MAPIMETHOD(UpdateState) \
- (THIS_ LPSTREAM lpStream) IPURE;
-
-#undef INTERFACE
-#define INTERFACE IExchangeExportChanges
-DECLARE_MAPI_INTERFACE_(IExchangeExportChanges, IUnknown)
-{
- MAPI_IUNKNOWN_METHODS(PURE)
- EXCHANGE_IEXCHANGEEXPORTCHANGES_METHODS(PURE)
-};
-#undef IMPL
+#define EXCHANGE_IEXCHANGEEXPORTCHANGES_METHODS(IPURE) \
+ MAPIMETHOD(GetLastError) \
+ (THIS_ HRESULT hResult, ULONG ulFlags, LPMAPIERROR FAR * lppMAPIError) IPURE; \
+ MAPIMETHOD(Config) \
+ (THIS_ LPSTREAM lpStream, ULONG ulFlags, LPUNKNOWN lpUnk, LPSRestriction lpRestriction, \
+ LPSPropTagArray lpIncludeProps, LPSPropTagArray lpExcludeProps, ULONG ulBufferSize) IPURE; \
+ MAPIMETHOD(Synchronize) \
+ (THIS_ ULONG FAR * lpulSteps, ULONG FAR * lpulProgress) IPURE; \
+ MAPIMETHOD(UpdateState) \
+ (THIS_ LPSTREAM lpStream) IPURE;
+
+#undef INTERFACE
+#define INTERFACE IExchangeExportChanges
+DECLARE_MAPI_INTERFACE_(IExchangeExportChanges,
+ IUnknown){MAPI_IUNKNOWN_METHODS(PURE) EXCHANGE_IEXCHANGEEXPORTCHANGES_METHODS(PURE)};
+#undef IMPL
#define IMPL
DECLARE_MAPI_INTERFACE_PTR(IExchangeExportChanges, LPEXCHANGEEXPORTCHANGES);
@@ -1811,25 +1699,17 @@ DECLARE_MAPI_INTERFACE_PTR(IExchangeExportChanges, LPEXCHANGEEXPORTCHANGES);
*
*-----------------------------------------------------------------------*/
-#define EXCHANGE_IEXCHANGEEXPORTCHANGES2_METHODS(IPURE) \
- MAPIMETHOD(ConfigForConversionStream) \
- (THIS_ LPSTREAM lpStream, \
- ULONG ulFlags, \
- LPUNKNOWN lpUnk, \
- LPSRestriction lpRestriction, \
- ULONG cValuesConversion, \
- LPSPropValue lpPropArrayConversion, \
- ULONG ulBufferSize) IPURE;
-
-#undef INTERFACE
-#define INTERFACE IExchangeExportChanges2
-DECLARE_MAPI_INTERFACE_(IExchangeExportChanges2, IExchangeExportChanges)
-{
- MAPI_IUNKNOWN_METHODS(PURE)
- EXCHANGE_IEXCHANGEEXPORTCHANGES_METHODS(PURE)
- EXCHANGE_IEXCHANGEEXPORTCHANGES2_METHODS(PURE)
-};
-#undef IMPL
+#define EXCHANGE_IEXCHANGEEXPORTCHANGES2_METHODS(IPURE) \
+ MAPIMETHOD(ConfigForConversionStream) \
+ (THIS_ LPSTREAM lpStream, ULONG ulFlags, LPUNKNOWN lpUnk, LPSRestriction lpRestriction, ULONG cValuesConversion, \
+ LPSPropValue lpPropArrayConversion, ULONG ulBufferSize) IPURE;
+
+#undef INTERFACE
+#define INTERFACE IExchangeExportChanges2
+DECLARE_MAPI_INTERFACE_(IExchangeExportChanges2, IExchangeExportChanges){
+ MAPI_IUNKNOWN_METHODS(PURE) EXCHANGE_IEXCHANGEEXPORTCHANGES_METHODS(PURE)
+ EXCHANGE_IEXCHANGEEXPORTCHANGES2_METHODS(PURE)};
+#undef IMPL
#define IMPL
DECLARE_MAPI_INTERFACE_PTR(IExchangeExportChanges2, LPEXCHANGEEXPORTCHANGES2);
@@ -1843,36 +1723,25 @@ DECLARE_MAPI_INTERFACE_PTR(IExchangeExportChanges2, LPEXCHANGEEXPORTCHANGES2);
*
*-----------------------------------------------------------------------*/
-#define EXCHANGE_IEXCHANGEEXPORTCHANGES3_METHODS(IPURE) \
- MAPIMETHOD(ConfigForSelectiveSync) \
- (THIS_ LPSTREAM lpStream, \
- ULONG ulFlags, \
- LPUNKNOWN lpUnk, \
- LPENTRYLIST lpMsgList, \
- LPSRestriction lpRestriction, \
- LPSPropTagArray lpIncludeProps, \
- LPSPropTagArray lpExcludeProps, \
- ULONG ulBufferSize) IPURE;
-
-#undef INTERFACE
-#define INTERFACE IExchangeExportChanges3
-DECLARE_MAPI_INTERFACE_(IExchangeExportChanges3, IExchangeExportChanges2)
-{
- MAPI_IUNKNOWN_METHODS(PURE)
- EXCHANGE_IEXCHANGEEXPORTCHANGES_METHODS(PURE)
- EXCHANGE_IEXCHANGEEXPORTCHANGES2_METHODS(PURE)
- EXCHANGE_IEXCHANGEEXPORTCHANGES3_METHODS(PURE)
-};
-#undef IMPL
+#define EXCHANGE_IEXCHANGEEXPORTCHANGES3_METHODS(IPURE) \
+ MAPIMETHOD(ConfigForSelectiveSync) \
+ (THIS_ LPSTREAM lpStream, ULONG ulFlags, LPUNKNOWN lpUnk, LPENTRYLIST lpMsgList, LPSRestriction lpRestriction, \
+ LPSPropTagArray lpIncludeProps, LPSPropTagArray lpExcludeProps, ULONG ulBufferSize) IPURE;
+
+#undef INTERFACE
+#define INTERFACE IExchangeExportChanges3
+DECLARE_MAPI_INTERFACE_(IExchangeExportChanges3, IExchangeExportChanges2){
+ MAPI_IUNKNOWN_METHODS(PURE) EXCHANGE_IEXCHANGEEXPORTCHANGES_METHODS(PURE)
+ EXCHANGE_IEXCHANGEEXPORTCHANGES2_METHODS(PURE) EXCHANGE_IEXCHANGEEXPORTCHANGES3_METHODS(PURE)};
+#undef IMPL
#define IMPL
DECLARE_MAPI_INTERFACE_PTR(IExchangeExportChanges3, LPEXCHANGEEXPORTCHANGES3);
-typedef struct _ReadState
-{
- ULONG cbSourceKey;
- BYTE * pbSourceKey;
- ULONG ulFlags;
+typedef struct _ReadState {
+ ULONG cbSourceKey;
+ BYTE *pbSourceKey;
+ ULONG ulFlags;
} READSTATE, *LPREADSTATE;
/*------------------------------------------------------------------------
@@ -1883,53 +1752,32 @@ typedef struct _ReadState
*
*-----------------------------------------------------------------------*/
-
-#define EXCHANGE_IEXCHANGEIMPORTCONTENTSCHANGES_METHODS(IPURE) \
- MAPIMETHOD(GetLastError) \
- (THIS_ HRESULT hResult, \
- ULONG ulFlags, \
- LPMAPIERROR FAR * lppMAPIError) IPURE; \
- MAPIMETHOD(Config) \
- (THIS_ LPSTREAM lpStream, \
- ULONG ulFlags) IPURE; \
- MAPIMETHOD(UpdateState) \
- (THIS_ LPSTREAM lpStream) IPURE; \
- MAPIMETHOD(ImportMessageChange) \
- (THIS_ ULONG cpvalChanges, \
- LPSPropValue ppvalChanges, \
- ULONG ulFlags, \
- LPMESSAGE *lppmessage) IPURE; \
- MAPIMETHOD(ImportMessageDeletion) \
- (THIS_ ULONG ulFlags, \
- LPENTRYLIST lpSrcEntryList) IPURE; \
- MAPIMETHOD(ImportPerUserReadStateChange) \
- (THIS_ ULONG cElements, \
- LPREADSTATE lpReadState) IPURE; \
- MAPIMETHOD(ImportMessageMove) \
- (THIS_ ULONG cbSourceKeySrcFolder, \
- BYTE FAR * pbSourceKeySrcFolder, \
- ULONG cbSourceKeySrcMessage, \
- BYTE FAR * pbSourceKeySrcMessage, \
- ULONG cbPCLMessage, \
- BYTE FAR * pbPCLMessage, \
- ULONG cbSourceKeyDestMessage, \
- BYTE FAR * pbSourceKeyDestMessage, \
- ULONG cbChangeNumDestMessage, \
- BYTE FAR * pbChangeNumDestMessage) IPURE;
-
-
-#undef INTERFACE
-#define INTERFACE IExchangeImportContentsChanges
-DECLARE_MAPI_INTERFACE_(IExchangeImportContentsChanges, IUnknown)
-{
- MAPI_IUNKNOWN_METHODS(PURE)
- EXCHANGE_IEXCHANGEIMPORTCONTENTSCHANGES_METHODS(PURE)
-};
-#undef IMPL
+#define EXCHANGE_IEXCHANGEIMPORTCONTENTSCHANGES_METHODS(IPURE) \
+ MAPIMETHOD(GetLastError) \
+ (THIS_ HRESULT hResult, ULONG ulFlags, LPMAPIERROR FAR * lppMAPIError) IPURE; \
+ MAPIMETHOD(Config) \
+ (THIS_ LPSTREAM lpStream, ULONG ulFlags) IPURE; \
+ MAPIMETHOD(UpdateState) \
+ (THIS_ LPSTREAM lpStream) IPURE; \
+ MAPIMETHOD(ImportMessageChange) \
+ (THIS_ ULONG cpvalChanges, LPSPropValue ppvalChanges, ULONG ulFlags, LPMESSAGE * lppmessage) IPURE; \
+ MAPIMETHOD(ImportMessageDeletion) \
+ (THIS_ ULONG ulFlags, LPENTRYLIST lpSrcEntryList) IPURE; \
+ MAPIMETHOD(ImportPerUserReadStateChange) \
+ (THIS_ ULONG cElements, LPREADSTATE lpReadState) IPURE; \
+ MAPIMETHOD(ImportMessageMove) \
+ (THIS_ ULONG cbSourceKeySrcFolder, BYTE FAR * pbSourceKeySrcFolder, ULONG cbSourceKeySrcMessage, \
+ BYTE FAR * pbSourceKeySrcMessage, ULONG cbPCLMessage, BYTE FAR * pbPCLMessage, ULONG cbSourceKeyDestMessage, \
+ BYTE FAR * pbSourceKeyDestMessage, ULONG cbChangeNumDestMessage, BYTE FAR * pbChangeNumDestMessage) IPURE;
+
+#undef INTERFACE
+#define INTERFACE IExchangeImportContentsChanges
+DECLARE_MAPI_INTERFACE_(IExchangeImportContentsChanges,
+ IUnknown){MAPI_IUNKNOWN_METHODS(PURE) EXCHANGE_IEXCHANGEIMPORTCONTENTSCHANGES_METHODS(PURE)};
+#undef IMPL
#define IMPL
-DECLARE_MAPI_INTERFACE_PTR(IExchangeImportContentsChanges,
- LPEXCHANGEIMPORTCONTENTSCHANGES);
+DECLARE_MAPI_INTERFACE_PTR(IExchangeImportContentsChanges, LPEXCHANGEIMPORTCONTENTSCHANGES);
/*------------------------------------------------------------------------
*
@@ -1941,33 +1789,21 @@ DECLARE_MAPI_INTERFACE_PTR(IExchangeImportContentsChanges,
*
*-----------------------------------------------------------------------*/
-
-#define EXCHANGE_IEXCHANGEIMPORTCONTENTSCHANGES2_METHODS(IPURE) \
- MAPIMETHOD(ConfigForConversionStream) \
- (THIS_ LPSTREAM lpStream, \
- ULONG ulFlags, \
- ULONG cValuesConversion, \
- LPSPropValue lpPropArrayConversion) IPURE; \
- MAPIMETHOD(ImportMessageChangeAsAStream) \
- (THIS_ ULONG cpvalChanges, \
- LPSPropValue ppvalChanges, \
- ULONG ulFlags, \
- LPSTREAM *lppstream) IPURE; \
-
-
-#undef INTERFACE
-#define INTERFACE IExchangeImportContentsChanges2
-DECLARE_MAPI_INTERFACE_(IExchangeImportContentsChanges2, IExchangeImportContentsChanges)
-{
- MAPI_IUNKNOWN_METHODS(PURE)
- EXCHANGE_IEXCHANGEIMPORTCONTENTSCHANGES_METHODS(PURE)
- EXCHANGE_IEXCHANGEIMPORTCONTENTSCHANGES2_METHODS(PURE)
-};
-#undef IMPL
+#define EXCHANGE_IEXCHANGEIMPORTCONTENTSCHANGES2_METHODS(IPURE) \
+ MAPIMETHOD(ConfigForConversionStream) \
+ (THIS_ LPSTREAM lpStream, ULONG ulFlags, ULONG cValuesConversion, LPSPropValue lpPropArrayConversion) IPURE; \
+ MAPIMETHOD(ImportMessageChangeAsAStream) \
+ (THIS_ ULONG cpvalChanges, LPSPropValue ppvalChanges, ULONG ulFlags, LPSTREAM * lppstream) IPURE;
+
+#undef INTERFACE
+#define INTERFACE IExchangeImportContentsChanges2
+DECLARE_MAPI_INTERFACE_(IExchangeImportContentsChanges2, IExchangeImportContentsChanges){
+ MAPI_IUNKNOWN_METHODS(PURE) EXCHANGE_IEXCHANGEIMPORTCONTENTSCHANGES_METHODS(PURE)
+ EXCHANGE_IEXCHANGEIMPORTCONTENTSCHANGES2_METHODS(PURE)};
+#undef IMPL
#define IMPL
-DECLARE_MAPI_INTERFACE_PTR(IExchangeImportContentsChanges2,
- LPEXCHANGEIMPORTCONTENTSCHANGES2);
+DECLARE_MAPI_INTERFACE_PTR(IExchangeImportContentsChanges2, LPEXCHANGEIMPORTCONTENTSCHANGES2);
/*------------------------------------------------------------------------
*
@@ -1977,86 +1813,62 @@ DECLARE_MAPI_INTERFACE_PTR(IExchangeImportContentsChanges2,
*
*-----------------------------------------------------------------------*/
-#define EXCHANGE_IEXCHANGEIMPORTHIERARCHYCHANGES_METHODS(IPURE) \
- MAPIMETHOD(GetLastError) \
- (THIS_ HRESULT hResult, \
- ULONG ulFlags, \
- LPMAPIERROR FAR * lppMAPIError) IPURE; \
- MAPIMETHOD(Config) \
- (THIS_ LPSTREAM lpStream, \
- ULONG ulFlags) IPURE; \
- MAPIMETHOD(UpdateState) \
- (THIS_ LPSTREAM lpStream) IPURE; \
- MAPIMETHOD(ImportFolderChange) \
- (THIS_ ULONG cpvalChanges, \
- LPSPropValue ppvalChanges) IPURE; \
- MAPIMETHOD(ImportFolderDeletion) \
- (THIS_ ULONG ulFlags, \
- LPENTRYLIST lpSrcEntryList) IPURE;
-
-#undef INTERFACE
-#define INTERFACE IExchangeImportHierarchyChanges
-DECLARE_MAPI_INTERFACE_(IExchangeImportHierarchyChanges, IUnknown)
-{
- MAPI_IUNKNOWN_METHODS(PURE)
- EXCHANGE_IEXCHANGEIMPORTHIERARCHYCHANGES_METHODS(PURE)
-};
-#undef IMPL
+#define EXCHANGE_IEXCHANGEIMPORTHIERARCHYCHANGES_METHODS(IPURE) \
+ MAPIMETHOD(GetLastError) \
+ (THIS_ HRESULT hResult, ULONG ulFlags, LPMAPIERROR FAR * lppMAPIError) IPURE; \
+ MAPIMETHOD(Config) \
+ (THIS_ LPSTREAM lpStream, ULONG ulFlags) IPURE; \
+ MAPIMETHOD(UpdateState) \
+ (THIS_ LPSTREAM lpStream) IPURE; \
+ MAPIMETHOD(ImportFolderChange) \
+ (THIS_ ULONG cpvalChanges, LPSPropValue ppvalChanges) IPURE; \
+ MAPIMETHOD(ImportFolderDeletion) \
+ (THIS_ ULONG ulFlags, LPENTRYLIST lpSrcEntryList) IPURE;
+
+#undef INTERFACE
+#define INTERFACE IExchangeImportHierarchyChanges
+DECLARE_MAPI_INTERFACE_(IExchangeImportHierarchyChanges,
+ IUnknown){MAPI_IUNKNOWN_METHODS(PURE) EXCHANGE_IEXCHANGEIMPORTHIERARCHYCHANGES_METHODS(PURE)};
+#undef IMPL
#define IMPL
-DECLARE_MAPI_INTERFACE_PTR(IExchangeImportHierarchyChanges,
- LPEXCHANGEIMPORTHIERARCHYCHANGES);
-
-#define ulHierChanged (0x01)
-
-#define EXCHANGE_IEXCHANGECHANGEADVISESINK_METHODS(IPURE) \
- MAPIMETHOD_(ULONG, OnNotify) \
- (THIS_ ULONG ulFlags, \
- LPENTRYLIST lpEntryList) IPURE; \
-
-#undef INTERFACE
-#define INTERFACE IExchangeChangeAdviseSink
-DECLARE_MAPI_INTERFACE_(IExchangeChangeAdviseSink, IUnknown)
-{
- BEGIN_INTERFACE
- MAPI_IUNKNOWN_METHODS(PURE)
- EXCHANGE_IEXCHANGECHANGEADVISESINK_METHODS(PURE)
-};
-#undef IMPL
+DECLARE_MAPI_INTERFACE_PTR(IExchangeImportHierarchyChanges, LPEXCHANGEIMPORTHIERARCHYCHANGES);
+
+#define ulHierChanged (0x01)
+
+#define EXCHANGE_IEXCHANGECHANGEADVISESINK_METHODS(IPURE) \
+ MAPIMETHOD_(ULONG, OnNotify) \
+ (THIS_ ULONG ulFlags, LPENTRYLIST lpEntryList) IPURE;
+
+#undef INTERFACE
+#define INTERFACE IExchangeChangeAdviseSink
+DECLARE_MAPI_INTERFACE_(IExchangeChangeAdviseSink, IUnknown){BEGIN_INTERFACE MAPI_IUNKNOWN_METHODS(PURE)
+ EXCHANGE_IEXCHANGECHANGEADVISESINK_METHODS(PURE)};
+#undef IMPL
#define IMPL
-DECLARE_MAPI_INTERFACE_PTR(IExchangeChangeAdviseSink,
- LPEXCHANGECHANGEADVISESINK);
-
-#define EXCHANGE_IEXCHANGECHANGEADVISOR_METHODS(IPURE) \
- MAPIMETHOD(GetLastError) \
- (THIS_ HRESULT hResult, \
- ULONG ulFlags, \
- LPMAPIERROR FAR * lppMAPIError) IPURE; \
- MAPIMETHOD(Config) \
- (THIS_ LPSTREAM lpStream, \
- LPGUID lpGUID, \
- LPEXCHANGECHANGEADVISESINK lpAdviseSink, \
- ULONG ulFlags) IPURE; \
- MAPIMETHOD(UpdateState) \
- (THIS_ LPSTREAM lpStream) IPURE; \
- MAPIMETHOD(AddKeys) \
- (THIS_ LPENTRYLIST lpEntryList) IPURE; \
- MAPIMETHOD(RemoveKeys) \
- (THIS_ LPENTRYLIST lpEntryList) IPURE;
-
-#undef INTERFACE
-#define INTERFACE IExchangeChangeAdvisor
-DECLARE_MAPI_INTERFACE_(IExchangeChangeAdvisor, IUnknown)
-{
- MAPI_IUNKNOWN_METHODS(PURE)
- EXCHANGE_IEXCHANGECHANGEADVISOR_METHODS(PURE)
-};
-#undef IMPL
+DECLARE_MAPI_INTERFACE_PTR(IExchangeChangeAdviseSink, LPEXCHANGECHANGEADVISESINK);
+
+#define EXCHANGE_IEXCHANGECHANGEADVISOR_METHODS(IPURE) \
+ MAPIMETHOD(GetLastError) \
+ (THIS_ HRESULT hResult, ULONG ulFlags, LPMAPIERROR FAR * lppMAPIError) IPURE; \
+ MAPIMETHOD(Config) \
+ (THIS_ LPSTREAM lpStream, LPGUID lpGUID, LPEXCHANGECHANGEADVISESINK lpAdviseSink, ULONG ulFlags) IPURE; \
+ MAPIMETHOD(UpdateState) \
+ (THIS_ LPSTREAM lpStream) IPURE; \
+ MAPIMETHOD(AddKeys) \
+ (THIS_ LPENTRYLIST lpEntryList) IPURE; \
+ MAPIMETHOD(RemoveKeys) \
+ (THIS_ LPENTRYLIST lpEntryList) IPURE;
+
+#undef INTERFACE
+#define INTERFACE IExchangeChangeAdvisor
+DECLARE_MAPI_INTERFACE_(IExchangeChangeAdvisor,
+ IUnknown){MAPI_IUNKNOWN_METHODS(PURE) EXCHANGE_IEXCHANGECHANGEADVISOR_METHODS(PURE)};
+#undef IMPL
#define IMPL
-DECLARE_MAPI_INTERFACE_PTR(IExchangeChangeAdvisor,
- LPEXCHANGECHANGEADVISOR);
+DECLARE_MAPI_INTERFACE_PTR(IExchangeChangeAdvisor, LPEXCHANGECHANGEADVISOR);
/*--------------------------------------------------------------------
*
@@ -2066,27 +1878,19 @@ DECLARE_MAPI_INTERFACE_PTR(IExchangeChangeAdvisor,
*
*--------------------------------------------------------------------*/
-#define EXCHANGE_IEXCHANGEBADITEMCALLBACK_METHODS(IPURE) \
- MAPIMETHOD(BadItem) \
- (THIS_ HRESULT hResult, \
- ULONG ulFlags, \
- LPWSTR lpwszFolderName, \
- LPSBinary lpsbFolderEid, \
- ULONG cValues, \
- LPSPropValue lpPropArray) IPURE;
-
-#undef INTERFACE
-#define INTERFACE IExchangeBadItemCallback
-DECLARE_MAPI_INTERFACE_(IExchangeBadItemCallback, IUnknown)
-{
- MAPI_IUNKNOWN_METHODS(PURE)
- EXCHANGE_IEXCHANGEBADITEMCALLBACK_METHODS(PURE)
-};
-#undef IMPL
+#define EXCHANGE_IEXCHANGEBADITEMCALLBACK_METHODS(IPURE) \
+ MAPIMETHOD(BadItem) \
+ (THIS_ HRESULT hResult, ULONG ulFlags, LPWSTR lpwszFolderName, LPSBinary lpsbFolderEid, ULONG cValues, \
+ LPSPropValue lpPropArray) IPURE;
+
+#undef INTERFACE
+#define INTERFACE IExchangeBadItemCallback
+DECLARE_MAPI_INTERFACE_(IExchangeBadItemCallback,
+ IUnknown){MAPI_IUNKNOWN_METHODS(PURE) EXCHANGE_IEXCHANGEBADITEMCALLBACK_METHODS(PURE)};
+#undef IMPL
#define IMPL
-DECLARE_MAPI_INTERFACE_PTR(IExchangeBadItemCallback,
- LPEXCHANGEBADITEMCALLBACK);
+DECLARE_MAPI_INTERFACE_PTR(IExchangeBadItemCallback, LPEXCHANGEBADITEMCALLBACK);
/*--------------------------------------------------------------------
*
@@ -2096,35 +1900,27 @@ DECLARE_MAPI_INTERFACE_PTR(IExchangeBadItemCallback,
*
*--------------------------------------------------------------------*/
-#define EXCHANGE_IEXCHANGEMOVEUSERPROGRESS_METHODS(IPURE) \
- MAPIMETHOD(NextFolder) \
- (THIS_ ULONG ulFlags, \
- LPWSTR lpwszFolderName) IPURE; \
- MAPIMETHOD(Progress) \
- (THIS_ ULONG ulFlags, \
- ULONG ulCount, \
- ULONG ulTotal) IPURE; \
- MAPIMETHOD(Restart) \
- (THIS_ ULONG ulFlags) IPURE; \
-
-#undef INTERFACE
-#define INTERFACE IExchangeMoveUserProgress
-DECLARE_MAPI_INTERFACE_(IExchangeMoveUserProgress, IUnknown)
-{
- MAPI_IUNKNOWN_METHODS(PURE)
- EXCHANGE_IEXCHANGEMOVEUSERPROGRESS_METHODS(PURE)
-};
-#undef IMPL
+#define EXCHANGE_IEXCHANGEMOVEUSERPROGRESS_METHODS(IPURE) \
+ MAPIMETHOD(NextFolder) \
+ (THIS_ ULONG ulFlags, LPWSTR lpwszFolderName) IPURE; \
+ MAPIMETHOD(Progress) \
+ (THIS_ ULONG ulFlags, ULONG ulCount, ULONG ulTotal) IPURE; \
+ MAPIMETHOD(Restart) \
+ (THIS_ ULONG ulFlags) IPURE;
+
+#undef INTERFACE
+#define INTERFACE IExchangeMoveUserProgress
+DECLARE_MAPI_INTERFACE_(IExchangeMoveUserProgress,
+ IUnknown){MAPI_IUNKNOWN_METHODS(PURE) EXCHANGE_IEXCHANGEMOVEUSERPROGRESS_METHODS(PURE)};
+#undef IMPL
#define IMPL
-DECLARE_MAPI_INTERFACE_PTR(IExchangeMoveUserProgress,
- LPEXCHANGEMOVEUSERPROGRESS);
+DECLARE_MAPI_INTERFACE_PTR(IExchangeMoveUserProgress, LPEXCHANGEMOVEUSERPROGRESS);
// Internal flag for IMsgStore::CopyTo which tells the move user processing
// that there are potential extended callback objects hanhing off of the
// IMAPIProgress object.
-#define MAPI_EXTENDEDCALLBACKS ((ULONG) 0x00000400)
-
+#define MAPI_EXTENDEDCALLBACKS ((ULONG)0x00000400)
/*------------------------------------------------------------------------
*
@@ -2132,21 +1928,21 @@ DECLARE_MAPI_INTERFACE_PTR(IExchangeMoveUserProgress,
*
*-----------------------------------------------------------------------*/
-#define MAKE_SYNC_E(err) (MAKE_SCODE(SEVERITY_ERROR, FACILITY_ITF, err))
-#define MAKE_SYNC_W(warn) (MAKE_SCODE(SEVERITY_SUCCESS, FACILITY_ITF, warn))
+#define MAKE_SYNC_E(err) (MAKE_SCODE(SEVERITY_ERROR, FACILITY_ITF, err))
+#define MAKE_SYNC_W(warn) (MAKE_SCODE(SEVERITY_SUCCESS, FACILITY_ITF, warn))
-#define SYNC_E_UNKNOWN_FLAGS MAPI_E_UNKNOWN_FLAGS
-#define SYNC_E_INVALID_PARAMETER E_INVALIDARG
-#define SYNC_E_ERROR E_FAIL
-#define SYNC_E_OBJECT_DELETED MAKE_SYNC_E(0x800)
-#define SYNC_E_IGNORE MAKE_SYNC_E(0x801)
-#define SYNC_E_CONFLICT MAKE_SYNC_E(0x802)
-#define SYNC_E_NO_PARENT MAKE_SYNC_E(0x803)
-#define SYNC_E_CYCLE MAKE_SYNC_E(0x804)
-#define SYNC_E_UNSYNCHRONIZED MAKE_SYNC_E(0x805)
+#define SYNC_E_UNKNOWN_FLAGS MAPI_E_UNKNOWN_FLAGS
+#define SYNC_E_INVALID_PARAMETER E_INVALIDARG
+#define SYNC_E_ERROR E_FAIL
+#define SYNC_E_OBJECT_DELETED MAKE_SYNC_E(0x800)
+#define SYNC_E_IGNORE MAKE_SYNC_E(0x801)
+#define SYNC_E_CONFLICT MAKE_SYNC_E(0x802)
+#define SYNC_E_NO_PARENT MAKE_SYNC_E(0x803)
+#define SYNC_E_CYCLE MAKE_SYNC_E(0x804)
+#define SYNC_E_UNSYNCHRONIZED MAKE_SYNC_E(0x805)
-#define SYNC_W_PROGRESS MAKE_SYNC_W(0x820)
-#define SYNC_W_CLIENT_CHANGE_NEWER MAKE_SYNC_W(0x821)
+#define SYNC_W_PROGRESS MAKE_SYNC_W(0x820)
+#define SYNC_W_CLIENT_CHANGE_NEWER MAKE_SYNC_W(0x821)
/*------------------------------------------------------------------------
*
@@ -2154,25 +1950,25 @@ DECLARE_MAPI_INTERFACE_PTR(IExchangeMoveUserProgress,
*
*-----------------------------------------------------------------------*/
-#define SYNC_UNICODE 0x01
-#define SYNC_NO_DELETIONS 0x02
-#define SYNC_NO_SOFT_DELETIONS 0x04
-#define SYNC_READ_STATE 0x08
-#define SYNC_ASSOCIATED 0x10
-#define SYNC_NORMAL 0x20
-#define SYNC_NO_CONFLICTS 0x40
-#define SYNC_ONLY_SPECIFIED_PROPS 0x80
-#define SYNC_NO_FOREIGN_KEYS 0x100
-#define SYNC_LIMITED_IMESSAGE 0x200
-#define SYNC_CATCHUP 0x400
-#define SYNC_NEW_MESSAGE 0x800 // only applicable to ImportMessageChange()
-#define SYNC_MSG_SELECTIVE 0x1000 // Used internally. Will reject if used by clients.
-#define SYNC_BEST_BODY 0x2000
+#define SYNC_UNICODE 0x01
+#define SYNC_NO_DELETIONS 0x02
+#define SYNC_NO_SOFT_DELETIONS 0x04
+#define SYNC_READ_STATE 0x08
+#define SYNC_ASSOCIATED 0x10
+#define SYNC_NORMAL 0x20
+#define SYNC_NO_CONFLICTS 0x40
+#define SYNC_ONLY_SPECIFIED_PROPS 0x80
+#define SYNC_NO_FOREIGN_KEYS 0x100
+#define SYNC_LIMITED_IMESSAGE 0x200
+#define SYNC_CATCHUP 0x400
+#define SYNC_NEW_MESSAGE 0x800 // only applicable to ImportMessageChange()
+#define SYNC_MSG_SELECTIVE 0x1000 // Used internally. Will reject if used by clients.
+#define SYNC_BEST_BODY 0x2000
#define SYNC_IGNORE_SPECIFIED_ON_ASSOCIATED 0x4000
-#define SYNC_PROGRESS_MODE 0x8000 // AirMapi progress mode
-#define SYNC_FXRECOVERMODE 0x10000
-#define SYNC_DEFER_CONFIG 0x20000
-#define SYNC_FORCE_UNICODE 0x40000 // Forces server to return Unicode properties
+#define SYNC_PROGRESS_MODE 0x8000 // AirMapi progress mode
+#define SYNC_FXRECOVERMODE 0x10000
+#define SYNC_DEFER_CONFIG 0x20000
+#define SYNC_FORCE_UNICODE 0x40000 // Forces server to return Unicode properties
/*------------------------------------------------------------------------
*
@@ -2180,8 +1976,8 @@ DECLARE_MAPI_INTERFACE_PTR(IExchangeMoveUserProgress,
*
*-----------------------------------------------------------------------*/
-#define SYNC_SOFT_DELETE 0x01
-#define SYNC_EXPIRY 0x02
+#define SYNC_SOFT_DELETE 0x01
+#define SYNC_EXPIRY 0x02
/*------------------------------------------------------------------------
*
@@ -2189,7 +1985,7 @@ DECLARE_MAPI_INTERFACE_PTR(IExchangeMoveUserProgress,
*
*-----------------------------------------------------------------------*/
-#define SYNC_READ 0x01
+#define SYNC_READ 0x01
/*------------------------------------------------------------------------
*
@@ -2197,8 +1993,8 @@ DECLARE_MAPI_INTERFACE_PTR(IExchangeMoveUserProgress,
*
*-----------------------------------------------------------------------*/
-#define MESSAGE_BEST_BODY 0x10
-#define MESSAGE_SEND_ENTRYID 0x20
+#define MESSAGE_BEST_BODY 0x10
+#define MESSAGE_SEND_ENTRYID 0x20
/*------------------------------------------------------------------------
*
@@ -2208,7 +2004,6 @@ DECLARE_MAPI_INTERFACE_PTR(IExchangeMoveUserProgress,
#define SUPRESS_NOTIFICATIONS_ON_MY_ACTIONS 0x01000
-
/*------------------------------------------------------------------------
*
* "IExchangeFavorites" Interface Declaration
@@ -2220,26 +2015,20 @@ DECLARE_MAPI_INTERFACE_PTR(IExchangeMoveUserProgress,
*
*-----------------------------------------------------------------------*/
-#define EXCHANGE_IEXCHANGEFAVORITES_METHODS(IPURE) \
- MAPIMETHOD(GetLastError) \
- (THIS_ HRESULT hResult, \
- ULONG ulFlags, \
- LPMAPIERROR FAR * lppMAPIError) IPURE; \
- MAPIMETHOD(AddFavorites) \
- (THIS_ LPENTRYLIST lpEntryList) IPURE; \
- MAPIMETHOD(DelFavorites) \
- (THIS_ LPENTRYLIST lpEntryList) IPURE; \
-
-#undef INTERFACE
-#define INTERFACE IExchangeFavorites
-DECLARE_MAPI_INTERFACE_(IExchangeFavorites, IUnknown)
-{
- MAPI_IUNKNOWN_METHODS(PURE)
- EXCHANGE_IEXCHANGEFAVORITES_METHODS(PURE)
-};
+#define EXCHANGE_IEXCHANGEFAVORITES_METHODS(IPURE) \
+ MAPIMETHOD(GetLastError) \
+ (THIS_ HRESULT hResult, ULONG ulFlags, LPMAPIERROR FAR * lppMAPIError) IPURE; \
+ MAPIMETHOD(AddFavorites) \
+ (THIS_ LPENTRYLIST lpEntryList) IPURE; \
+ MAPIMETHOD(DelFavorites) \
+ (THIS_ LPENTRYLIST lpEntryList) IPURE;
-DECLARE_MAPI_INTERFACE_PTR(IExchangeFavorites, LPEXCHANGEFAVORITES);
+#undef INTERFACE
+#define INTERFACE IExchangeFavorites
+DECLARE_MAPI_INTERFACE_(IExchangeFavorites,
+ IUnknown){MAPI_IUNKNOWN_METHODS(PURE) EXCHANGE_IEXCHANGEFAVORITES_METHODS(PURE)};
+DECLARE_MAPI_INTERFACE_PTR(IExchangeFavorites, LPEXCHANGEFAVORITES);
/*------------------------------------------------------------------------
*
@@ -2247,17 +2036,16 @@ DECLARE_MAPI_INTERFACE_PTR(IExchangeFavorites, LPEXCHANGEFAVORITES);
*
*-----------------------------------------------------------------------*/
-#define PR_AUTO_ADD_NEW_SUBS PROP_TAG(PT_BOOLEAN, pidExchangeNonXmitReservedMin+0x5)
-#define PR_NEW_SUBS_GET_AUTO_ADD PROP_TAG(PT_BOOLEAN, pidExchangeNonXmitReservedMin+0x6)
+#define PR_AUTO_ADD_NEW_SUBS PROP_TAG(PT_BOOLEAN, pidExchangeNonXmitReservedMin + 0x5)
+#define PR_NEW_SUBS_GET_AUTO_ADD PROP_TAG(PT_BOOLEAN, pidExchangeNonXmitReservedMin + 0x6)
/*------------------------------------------------------------------------
*
* Properties used by the Offline Folders API
*
*-----------------------------------------------------------------------*/
-#define PR_OFFLINE_FLAGS PROP_TAG(PT_LONG, pidFolderMin+0x5)
-#define PR_SYNCHRONIZE_FLAGS PROP_TAG(PT_LONG, pidExchangeNonXmitReservedMin+0x4)
-
+#define PR_OFFLINE_FLAGS PROP_TAG(PT_LONG, pidFolderMin + 0x5)
+#define PR_SYNCHRONIZE_FLAGS PROP_TAG(PT_LONG, pidExchangeNonXmitReservedMin + 0x4)
/*------------------------------------------------------------------------
*
@@ -2265,10 +2053,10 @@ DECLARE_MAPI_INTERFACE_PTR(IExchangeFavorites, LPEXCHANGEFAVORITES);
*
*-----------------------------------------------------------------------*/
-#define OF_AVAILABLE_OFFLINE ((ULONG) 0x00000001)
-#define OF_FORCE ((ULONG) 0x80000000)
+#define OF_AVAILABLE_OFFLINE ((ULONG)0x00000001)
+#define OF_FORCE ((ULONG)0x80000000)
-#define SF_DISABLE_STARTUP_SYNC ((ULONG) 0x00000001)
+#define SF_DISABLE_STARTUP_SYNC ((ULONG)0x00000001)
/*------------------------------------------------------------------------
*
@@ -2278,39 +2066,33 @@ DECLARE_MAPI_INTERFACE_PTR(IExchangeFavorites, LPEXCHANGEFAVORITES);
*
*-----------------------------------------------------------------------*/
-#define EXCHANGE_IEXCHANGEMESSAGECONVERSION_METHODS(IPURE) \
- MAPIMETHOD(OpenStream) \
- (THIS_ ULONG cValues, \
- LPSPropValue lpPropArray, \
- LPSTREAM FAR * lppStream) IPURE;
-#undef INTERFACE
-#define INTERFACE IExchangeMessageConversion
-DECLARE_MAPI_INTERFACE_(IExchangeMessageConversion, IUnknown)
-{
- MAPI_IUNKNOWN_METHODS(PURE)
- EXCHANGE_IEXCHANGEMESSAGECONVERSION_METHODS(PURE)
-};
-#undef IMPL
+#define EXCHANGE_IEXCHANGEMESSAGECONVERSION_METHODS(IPURE) \
+ MAPIMETHOD(OpenStream) \
+ (THIS_ ULONG cValues, LPSPropValue lpPropArray, LPSTREAM FAR * lppStream) IPURE;
+#undef INTERFACE
+#define INTERFACE IExchangeMessageConversion
+DECLARE_MAPI_INTERFACE_(IExchangeMessageConversion,
+ IUnknown){MAPI_IUNKNOWN_METHODS(PURE) EXCHANGE_IEXCHANGEMESSAGECONVERSION_METHODS(PURE)};
+#undef IMPL
#define IMPL
DECLARE_MAPI_INTERFACE_PTR(IExchangeMessageConversion, LPEXCHANGEMESSAGECONVERSION);
-#define PR_MESSAGE_SITE_NAME PROP_TAG(PT_TSTRING, pidExchangeNonXmitReservedMin+0x7)
-#define PR_MESSAGE_SITE_NAME_A PROP_TAG(PT_STRING8, pidExchangeNonXmitReservedMin+0x7)
-#define PR_MESSAGE_SITE_NAME_W PROP_TAG(PT_UNICODE, pidExchangeNonXmitReservedMin+0x7)
-
-#define PR_MESSAGE_PROCESSED PROP_TAG(PT_BOOLEAN, pidExchangeNonXmitReservedMin+0x8)
+#define PR_MESSAGE_SITE_NAME PROP_TAG(PT_TSTRING, pidExchangeNonXmitReservedMin + 0x7)
+#define PR_MESSAGE_SITE_NAME_A PROP_TAG(PT_STRING8, pidExchangeNonXmitReservedMin + 0x7)
+#define PR_MESSAGE_SITE_NAME_W PROP_TAG(PT_UNICODE, pidExchangeNonXmitReservedMin + 0x7)
-#define PR_MSG_BODY_ID PROP_TAG(PT_LONG, pidExchangeXmitReservedMin-0x03)
+#define PR_MESSAGE_PROCESSED PROP_TAG(PT_BOOLEAN, pidExchangeNonXmitReservedMin + 0x8)
+#define PR_MSG_BODY_ID PROP_TAG(PT_LONG, pidExchangeXmitReservedMin - 0x03)
-#define PR_BILATERAL_INFO PROP_TAG(PT_BINARY, pidExchangeXmitReservedMin-0x04)
-#define PR_DL_REPORT_FLAGS PROP_TAG(PT_LONG, pidExchangeXmitReservedMin-0x05)
+#define PR_BILATERAL_INFO PROP_TAG(PT_BINARY, pidExchangeXmitReservedMin - 0x04)
+#define PR_DL_REPORT_FLAGS PROP_TAG(PT_LONG, pidExchangeXmitReservedMin - 0x05)
-#define PRIV_DL_HIDE_MEMBERS 0x00000001
-#define PRIV_DL_REPORT_TO_ORIG 0x00000002
+#define PRIV_DL_HIDE_MEMBERS 0x00000001
+#define PRIV_DL_REPORT_TO_ORIG 0x00000002
#define PRIV_DL_REPORT_TO_OWNER 0x00000004
-#define PRIV_DL_ALLOW_OOF 0x00000008
+#define PRIV_DL_ALLOW_OOF 0x00000008
/*---------------------------------------------------------------------------------
*
@@ -2320,95 +2102,92 @@ DECLARE_MAPI_INTERFACE_PTR(IExchangeMessageConversion, LPEXCHANGEMESSAGECONVERSI
* if the message is not read, or NULL if it is read.
*
*---------------------------------------------------------------------------------*/
-#define PR_ABSTRACT PROP_TAG(PT_TSTRING, pidExchangeXmitReservedMin-0x06)
-#define PR_ABSTRACT_A PROP_TAG(PT_STRING8, pidExchangeXmitReservedMin-0x06)
-#define PR_ABSTRACT_W PROP_TAG(PT_UNICODE, pidExchangeXmitReservedMin-0x06)
+#define PR_ABSTRACT PROP_TAG(PT_TSTRING, pidExchangeXmitReservedMin - 0x06)
+#define PR_ABSTRACT_A PROP_TAG(PT_STRING8, pidExchangeXmitReservedMin - 0x06)
+#define PR_ABSTRACT_W PROP_TAG(PT_UNICODE, pidExchangeXmitReservedMin - 0x06)
-#define PR_PREVIEW PROP_TAG(PT_TSTRING, pidExchangeXmitReservedMin-0x07)
-#define PR_PREVIEW_A PROP_TAG(PT_STRING8, pidExchangeXmitReservedMin-0x07)
-#define PR_PREVIEW_W PROP_TAG(PT_UNICODE, pidExchangeXmitReservedMin-0x07)
+#define PR_PREVIEW PROP_TAG(PT_TSTRING, pidExchangeXmitReservedMin - 0x07)
+#define PR_PREVIEW_A PROP_TAG(PT_STRING8, pidExchangeXmitReservedMin - 0x07)
+#define PR_PREVIEW_W PROP_TAG(PT_UNICODE, pidExchangeXmitReservedMin - 0x07)
-#define PR_PREVIEW_UNREAD PROP_TAG(PT_TSTRING, pidExchangeXmitReservedMin-0x08)
-#define PR_PREVIEW_UNREAD_A PROP_TAG(PT_STRING8, pidExchangeXmitReservedMin-0x08)
-#define PR_PREVIEW_UNREAD_W PROP_TAG(PT_UNICODE, pidExchangeXmitReservedMin-0x08)
+#define PR_PREVIEW_UNREAD PROP_TAG(PT_TSTRING, pidExchangeXmitReservedMin - 0x08)
+#define PR_PREVIEW_UNREAD_A PROP_TAG(PT_STRING8, pidExchangeXmitReservedMin - 0x08)
+#define PR_PREVIEW_UNREAD_W PROP_TAG(PT_UNICODE, pidExchangeXmitReservedMin - 0x08)
//
// Informs IMAIL that full fidelity should be discarded for this message.
//
-#define PR_DISABLE_FULL_FIDELITY PROP_TAG(PT_BOOLEAN, pidRenMsgFldMin+0x72)
+#define PR_DISABLE_FULL_FIDELITY PROP_TAG(PT_BOOLEAN, pidRenMsgFldMin + 0x72)
// file attributes for messages / folders
// need to be in REN property range in order to replicate
-#define PR_ATTR_HIDDEN PROP_TAG(PT_BOOLEAN, pidRenMsgFldMin+0x74)
-#define PR_ATTR_SYSTEM PROP_TAG(PT_BOOLEAN, pidRenMsgFldMin+0x75)
-#define PR_ATTR_READONLY PROP_TAG(PT_BOOLEAN, pidRenMsgFldMin+0x76)
+#define PR_ATTR_HIDDEN PROP_TAG(PT_BOOLEAN, pidRenMsgFldMin + 0x74)
+#define PR_ATTR_SYSTEM PROP_TAG(PT_BOOLEAN, pidRenMsgFldMin + 0x75)
+#define PR_ATTR_READONLY PROP_TAG(PT_BOOLEAN, pidRenMsgFldMin + 0x76)
// Flag indicating whether msg has been read or not (read-only prop for now - not replicated).
-#define PR_READ PROP_TAG(PT_BOOLEAN, pidStoreNonTransMin+0x29)
+#define PR_READ PROP_TAG(PT_BOOLEAN, pidStoreNonTransMin + 0x29)
// Administrative security descriptor for a folder, if present.
//
-#define PR_ADMIN_SECURITY_DESCRIPTOR PROP_TAG(PT_BINARY, 0x3d21)
+#define PR_ADMIN_SECURITY_DESCRIPTOR PROP_TAG(PT_BINARY, 0x3d21)
//
// Win32 compatible representation of folder/message security descriptor
//
-#define PR_WIN32_SECURITY_DESCRIPTOR PROP_TAG(PT_BINARY, 0x3d22)
+#define PR_WIN32_SECURITY_DESCRIPTOR PROP_TAG(PT_BINARY, 0x3d22)
//
// TRUE if PR_NT_SECURITY_DESCRIPTOR describes non Win32 ACL semantics.
// If this is set, components that use PR_WIN32_SECURITY_DESCRIPTOR cannot
// allow modification of PR_NT_SECURITY_DESCRIPTOR (or PR_DEFAULT_MESSAGE_SD).
//
-#define PR_NON_WIN32_ACL PROP_TAG(PT_BOOLEAN, 0x3d23)
+#define PR_NON_WIN32_ACL PROP_TAG(PT_BOOLEAN, 0x3d23)
//
// TRUE if any items in the folder contain item level ACLs
//
-#define PR_ITEM_LEVEL_ACL PROP_TAG(PT_BOOLEAN, 0x3d24)
+#define PR_ITEM_LEVEL_ACL PROP_TAG(PT_BOOLEAN, 0x3d24)
-#define PR_DAV_TRANSFER_SECURITY_DESCRIPTOR PROP_TAG(PT_BINARY, 0x0E84)
+#define PR_DAV_TRANSFER_SECURITY_DESCRIPTOR PROP_TAG(PT_BINARY, 0x0E84)
//
// XML formatted versions of the NT SECURITY DESCRIPTOR properties
-#define PR_NT_SECURITY_DESCRIPTOR_AS_XML PROP_TAG(PT_TSTRING, pidStoreNonTransMin+0x2A)
-#define PR_NT_SECURITY_DESCRIPTOR_AS_XML_A PROP_TAG(PT_STRING8, pidStoreNonTransMin+0x2A)
-#define PR_NT_SECURITY_DESCRIPTOR_AS_XML_W PROP_TAG(PT_UNICODE, pidStoreNonTransMin+0x2A)
-#define PR_ADMIN_SECURITY_DESCRIPTOR_AS_XML PROP_TAG(PT_TSTRING, pidStoreNonTransMin+0x2B)
-#define PR_ADMIN_SECURITY_DESCRIPTOR_AS_XML_A PROP_TAG(PT_STRING8, pidStoreNonTransMin+0x2B)
-#define PR_ADMIN_SECURITY_DESCRIPTOR_AS_XML_W PROP_TAG(PT_UNICODE, pidStoreNonTransMin+0x2B)
-
+#define PR_NT_SECURITY_DESCRIPTOR_AS_XML PROP_TAG(PT_TSTRING, pidStoreNonTransMin + 0x2A)
+#define PR_NT_SECURITY_DESCRIPTOR_AS_XML_A PROP_TAG(PT_STRING8, pidStoreNonTransMin + 0x2A)
+#define PR_NT_SECURITY_DESCRIPTOR_AS_XML_W PROP_TAG(PT_UNICODE, pidStoreNonTransMin + 0x2A)
+#define PR_ADMIN_SECURITY_DESCRIPTOR_AS_XML PROP_TAG(PT_TSTRING, pidStoreNonTransMin + 0x2B)
+#define PR_ADMIN_SECURITY_DESCRIPTOR_AS_XML_A PROP_TAG(PT_STRING8, pidStoreNonTransMin + 0x2B)
+#define PR_ADMIN_SECURITY_DESCRIPTOR_AS_XML_W PROP_TAG(PT_UNICODE, pidStoreNonTransMin + 0x2B)
/*------------------------------------------------------------------------------------
-*
-* OWA Info Property
-*
-*------------------------------------------------------------------------------------*/
-#define PR_OWA_URL PROP_TAG (PT_STRING8, pidRenMsgFldMin+0x71)
-
+ *
+ * OWA Info Property
+ *
+ *------------------------------------------------------------------------------------*/
+#define PR_OWA_URL PROP_TAG(PT_STRING8, pidRenMsgFldMin + 0x71)
//$ The value of this property ID will change in the future. Do not rely on
//$ its current value. Rely on the define only.
-#define PR_STORE_SLOWLINK PROP_TAG(PT_BOOLEAN, 0x7c0a)
-
+#define PR_STORE_SLOWLINK PROP_TAG(PT_BOOLEAN, 0x7c0a)
/*
* Registry locations of settings
*/
#if defined(WIN32) && !defined(MAC)
-#define SZ_HPC_V2 "Software\\Microsoft\\Windows CE Services"
-#define SZ_HPC_V2_MAJOR "MajorVersion" // = 2
-#define SZ_HPC_V2_MINOR "MinorVersion" // = 0 or 1
+#define SZ_HPC_V2 "Software\\Microsoft\\Windows CE Services"
+#define SZ_HPC_V2_MAJOR "MajorVersion" // = 2
+#define SZ_HPC_V2_MINOR "MinorVersion" // = 0 or 1
-#define SZ_HPC_V1 "Software\\Microsoft\\Pegasus"
-#define SZ_HPC_V1_MAJOR "MajorVersion" // = 1 Major and Minor numbers didn't appear
-#define SZ_HPC_V1_MINOR "MinorVersion" // = 1 until after v1.0 was released
-#define SZ_HPC_V1_0 "InstalledDir" // present for v1.0
+#define SZ_HPC_V1 "Software\\Microsoft\\Pegasus"
+#define SZ_HPC_V1_MAJOR "MajorVersion" // = 1 Major and Minor numbers didn't appear
+#define SZ_HPC_V1_MINOR "MinorVersion" // = 1 until after v1.0 was released
+#define SZ_HPC_V1_0 "InstalledDir" // present for v1.0
#define SZ_OUTL_OST_OPTIONS "Software\\Microsoft\\Office\\8.0\\Outlook\\OST"
#define SZ_NO_OST "NoOST"
-#define NO_OST_FLAG_ALLOWED 0 // OST's are allowed on the machine
-#define NO_OST_FLAG_CACHE_ONLY 1 // OST can only be used as a cache
-#define NO_OST_FLAG_NOT_ALLOWED 2 // OST's are not allowed on the machine
-#define NO_OST_FLAG_NO_CACHE 3 // OST's are not allowed as a cache
-#define NO_OST_DEFAULT NO_OST_FLAG_ALLOWED
+#define NO_OST_FLAG_ALLOWED 0 // OST's are allowed on the machine
+#define NO_OST_FLAG_CACHE_ONLY 1 // OST can only be used as a cache
+#define NO_OST_FLAG_NOT_ALLOWED 2 // OST's are not allowed on the machine
+#define NO_OST_FLAG_NO_CACHE 3 // OST's are not allowed as a cache
+#define NO_OST_DEFAULT NO_OST_FLAG_ALLOWED
#endif
/*
@@ -2418,7 +2197,7 @@ DECLARE_MAPI_INTERFACE_PTR(IExchangeMessageConversion, LPEXCHANGEMESSAGECONVERSI
* sync events for that folder by specifying the corresponding GUID in
* the NEWLOGON object.
*/
-#define PR_SYNCEVENT_SUPPRESS_GUID PROP_TAG( PT_BINARY, 0x3880 )
+#define PR_SYNCEVENT_SUPPRESS_GUID PROP_TAG(PT_BINARY, 0x3880)
/*
* The following are the well-known GUIDS for the different special folders.
@@ -2427,7 +2206,7 @@ DECLARE_MAPI_INTERFACE_PTR(IExchangeMessageConversion, LPEXCHANGEMESSAGECONVERSI
* each folder.
*/
// {B2DC5B57-AF2D-4915-BAE3-90E5BDFB0070}
-//static const GUID guidOutboxSyncEvents =
+// static const GUID guidOutboxSyncEvents =
//{
// 0xb2dc5b57, 0xaf2d, 0x4915,
// {
@@ -2436,7 +2215,7 @@ DECLARE_MAPI_INTERFACE_PTR(IExchangeMessageConversion, LPEXCHANGEMESSAGECONVERSI
//};
//
// {2185EE91-28CD-4d9b-BFB4-BC49BB1DD8C0}
-//static const GUID guidMTSInSyncEvents =
+// static const GUID guidMTSInSyncEvents =
//{
// 0x2185ee91, 0x28cd, 0x4d9b,
// {
@@ -2445,7 +2224,7 @@ DECLARE_MAPI_INTERFACE_PTR(IExchangeMessageConversion, LPEXCHANGEMESSAGECONVERSI
//};
//
// {1BDBAFD3-1384-449b-A200-DE4745B07839}
-//static const GUID guidMTSOutSyncEvents =
+// static const GUID guidMTSOutSyncEvents =
//{
// 0x1bdbafd3, 0x1384, 0x449b,
// {
@@ -2454,7 +2233,7 @@ DECLARE_MAPI_INTERFACE_PTR(IExchangeMessageConversion, LPEXCHANGEMESSAGECONVERSI
//};
//
// {221ED74D-0B5C-4c0e-8807-23AFDD8AC2FF}
-//static const GUID guidTransportTempFolderSyncEvents =
+// static const GUID guidTransportTempFolderSyncEvents =
//{
// 0x221ed74d, 0xb5c, 0x4c0e,
// {
@@ -2462,63 +2241,62 @@ DECLARE_MAPI_INTERFACE_PTR(IExchangeMessageConversion, LPEXCHANGEMESSAGECONVERSI
// }
//};
-
/*
* Lock properties
*/
- //REVIEW:: some of these definitions appear both in MAPITAGS.H and EDKMDB.H
- //one set of definitions should be removed
-#define PR_LOCK_BRANCH_ID PROP_TAG( PT_I8, 0x3800 )
-#define PR_LOCK_RESOURCE_FID PROP_TAG( PT_I8, 0x3801 )
-#define PR_LOCK_RESOURCE_DID PROP_TAG( PT_I8, 0x3802 )
-#define PR_LOCK_RESOURCE_VID PROP_TAG( PT_I8, 0x3803 )
-#define PR_LOCK_ENLISTMENT_CONTEXT PROP_TAG( PT_BINARY, 0x3804 )
-#define PR_LOCK_TYPE PROP_TAG( PT_SHORT, 0x3805 )
-#define PR_LOCK_SCOPE PROP_TAG( PT_SHORT, 0x3806 )
-#define PR_LOCK_TRANSIENT_ID PROP_TAG( PT_BINARY, 0x3807 )
-#define PR_LOCK_DEPTH PROP_TAG( PT_LONG, 0x3808 )
-#define PR_LOCK_TIMEOUT PROP_TAG( PT_LONG, 0x3809 )
-#define PR_LOCK_EXPIRY_TIME PROP_TAG( PT_SYSTIME, 0x380a )
-#define PR_LOCK_GLID PROP_TAG( PT_BINARY, 0x380b )
-#define PR_LOCK_NULL_URL_W PROP_TAG( PT_UNICODE, 0x380c )
+// REVIEW:: some of these definitions appear both in MAPITAGS.H and EDKMDB.H
+// one set of definitions should be removed
+#define PR_LOCK_BRANCH_ID PROP_TAG(PT_I8, 0x3800)
+#define PR_LOCK_RESOURCE_FID PROP_TAG(PT_I8, 0x3801)
+#define PR_LOCK_RESOURCE_DID PROP_TAG(PT_I8, 0x3802)
+#define PR_LOCK_RESOURCE_VID PROP_TAG(PT_I8, 0x3803)
+#define PR_LOCK_ENLISTMENT_CONTEXT PROP_TAG(PT_BINARY, 0x3804)
+#define PR_LOCK_TYPE PROP_TAG(PT_SHORT, 0x3805)
+#define PR_LOCK_SCOPE PROP_TAG(PT_SHORT, 0x3806)
+#define PR_LOCK_TRANSIENT_ID PROP_TAG(PT_BINARY, 0x3807)
+#define PR_LOCK_DEPTH PROP_TAG(PT_LONG, 0x3808)
+#define PR_LOCK_TIMEOUT PROP_TAG(PT_LONG, 0x3809)
+#define PR_LOCK_EXPIRY_TIME PROP_TAG(PT_SYSTIME, 0x380a)
+#define PR_LOCK_GLID PROP_TAG(PT_BINARY, 0x380b)
+#define PR_LOCK_NULL_URL_W PROP_TAG(PT_UNICODE, 0x380c)
/*
* Lock flags
*/
-#define LOCK_NON_PERSISTENT 0x00000001
-#define LOCK_BLOCKING_MID_LOCK 0x00000002
-#define LOCK_NULL_RESOURCE 0x00000004
-#define LOCK_READ_ACCESS_CHECK_ONLY 0x00000008
-#define LOCK_WRITE_THROUGH_GOP 0x00010000
+#define LOCK_NON_PERSISTENT 0x00000001
+#define LOCK_BLOCKING_MID_LOCK 0x00000002
+#define LOCK_NULL_RESOURCE 0x00000004
+#define LOCK_READ_ACCESS_CHECK_ONLY 0x00000008
+#define LOCK_WRITE_THROUGH_GOP 0x00010000
// This bit is reserved and must not be set!
-#define LOCK_RESERVED 0x80000000
+#define LOCK_RESERVED 0x80000000
/*
* Unlock flags
*/
-#define UNLOCK_CHECKIN_ABORT 0x00000001
-#define UNLOCK_CHECKIN_KEEP_LOCKED 0x00000002
-#define UNLOCK_BLOCKING_MID_LOCK_ALL 0x00000004
-#define UNLOCK_BLOCKING_MID_LOCK_LOGON_ONLY 0x00000008
-#define UNLOCK_NULL_RESOURCE 0x00000010
-#define UNLOCK_WRITE_THROUGH_GOP 0x00010000
+#define UNLOCK_CHECKIN_ABORT 0x00000001
+#define UNLOCK_CHECKIN_KEEP_LOCKED 0x00000002
+#define UNLOCK_BLOCKING_MID_LOCK_ALL 0x00000004
+#define UNLOCK_BLOCKING_MID_LOCK_LOGON_ONLY 0x00000008
+#define UNLOCK_NULL_RESOURCE 0x00000010
+#define UNLOCK_WRITE_THROUGH_GOP 0x00010000
/*
* Versioning flags for folder
*/
-#define wNonVersionedFolder ((WORD)0x0000)
-#define wVersionedFolderSimple ((WORD)0x0001)
-#define wVersionedFolderAuto ((WORD)0x0002) //When you auto version it is simple versioned as well.
+#define wNonVersionedFolder ((WORD)0x0000)
+#define wVersionedFolderSimple ((WORD)0x0001)
+#define wVersionedFolderAuto ((WORD)0x0002) // When you auto version it is simple versioned as well.
/*
* Versioning operation codes for version rows in ptagVersionedOperation
*/
-#define fVersionedDelete ((ULONG)0x01)
-#define fVersionedUnDelete ((ULONG)0x02)
-#define fVersionedPin ((ULONG)0x04)
-#define fVersionedUnPin ((ULONG)0x08)
-#define fVersionedMoveIn ((ULONG)0x10)
-#define fVersionedMoveOut ((ULONG)0x20)
+#define fVersionedDelete ((ULONG)0x01)
+#define fVersionedUnDelete ((ULONG)0x02)
+#define fVersionedPin ((ULONG)0x04)
+#define fVersionedUnPin ((ULONG)0x08)
+#define fVersionedMoveIn ((ULONG)0x10)
+#define fVersionedMoveOut ((ULONG)0x20)
/*------------------------------------------------------------------------
*
@@ -2527,28 +2305,28 @@ DECLARE_MAPI_INTERFACE_PTR(IExchangeMessageConversion, LPEXCHANGEMESSAGECONVERSI
* These are properties that will be used internally by local store.
* Properties that are listed here are used in components other than the local store
*-----------------------------------------------------------------------*/
-#define pidLISMsgFolderPropMin pidLocalStoreInternalMin+0xa0 // 0x65a0
-#define pidLISMsgFolderPropMax pidLocalStoreInternalMin+0xc0 // 0x65c0
+#define pidLISMsgFolderPropMin pidLocalStoreInternalMin + 0xa0 // 0x65a0
+#define pidLISMsgFolderPropMax pidLocalStoreInternalMin + 0xc0 // 0x65c0
-#define pidLISErrorCodeMin pidLISMsgFolderPropMin+0xa // 0x65aa
-#define pidLISErrorCodeMax pidLISMsgFolderPropMin+0x10 // 0x65b0
+#define pidLISErrorCodeMin pidLISMsgFolderPropMin + 0xa // 0x65aa
+#define pidLISErrorCodeMax pidLISMsgFolderPropMin + 0x10 // 0x65b0
-#define pidLISInterfacePropMin pidLocalStoreInternalMin+0xd0 // 0x65d0
-#define pidLISInterfacePropMax pidLocalStoreInternalMin+0xe0 // 0x65e0
+#define pidLISInterfacePropMin pidLocalStoreInternalMin + 0xd0 // 0x65d0
+#define pidLISInterfacePropMax pidLocalStoreInternalMin + 0xe0 // 0x65e0
-#define ptagLISSubfolders PROP_TAG( PT_BOOLEAN, pidLocalStoreInternalMin+0x0)
-#define ptagLISUnreadCount PROP_TAG( PT_LONG, pidLocalStoreInternalMin+0x1)
+#define ptagLISSubfolders PROP_TAG(PT_BOOLEAN, pidLocalStoreInternalMin + 0x0)
+#define ptagLISUnreadCount PROP_TAG(PT_LONG, pidLocalStoreInternalMin + 0x1)
-#define ptagLISErrorCode PROP_TAG( PT_LONG, pidLISErrorCodeMin+0x0) // PROP_TAG(PT_LONG, 0x65aa)
-#define ptagLISErrorItemType PROP_TAG( PT_LONG, pidLISErrorCodeMin+0x1) // PROP_TAG(PT_LONG, 0x65ab)
-#define ptagLISErrorOperation PROP_TAG( PT_LONG, pidLISErrorCodeMin+0x2) // PROP_TAG(PT_LONG, 0x65ac)
-#define ptagLISErrorItemUrl PROP_TAG( PT_UNICODE, pidLISErrorCodeMin+0x3) // PROP_TAG(PT_UNICODE, 0x65ad)
-#define ptagLISErrorSourceUrl PROP_TAG( PT_UNICODE, pidLISErrorCodeMin+0x4) // PROP_TAG(PT_UNICODE, 0x65ae)
-#define ptagLISModifiedPropertyList PROP_TAG( PT_UNICODE, pidLISErrorCodeMin+0x5) // PROP_TAG(PT_UNICODE, 0x65af)
-#define ptagLISExtendedErrorinfo PROP_TAG( PT_LONG, pidLISErrorCodeMin+0x6) // PROP_TAG(PT_LONG, 0x65b0)
+#define ptagLISErrorCode PROP_TAG(PT_LONG, pidLISErrorCodeMin + 0x0) // PROP_TAG(PT_LONG, 0x65aa)
+#define ptagLISErrorItemType PROP_TAG(PT_LONG, pidLISErrorCodeMin + 0x1) // PROP_TAG(PT_LONG, 0x65ab)
+#define ptagLISErrorOperation PROP_TAG(PT_LONG, pidLISErrorCodeMin + 0x2) // PROP_TAG(PT_LONG, 0x65ac)
+#define ptagLISErrorItemUrl PROP_TAG(PT_UNICODE, pidLISErrorCodeMin + 0x3) // PROP_TAG(PT_UNICODE, 0x65ad)
+#define ptagLISErrorSourceUrl PROP_TAG(PT_UNICODE, pidLISErrorCodeMin + 0x4) // PROP_TAG(PT_UNICODE, 0x65ae)
+#define ptagLISModifiedPropertyList PROP_TAG(PT_UNICODE, pidLISErrorCodeMin + 0x5) // PROP_TAG(PT_UNICODE, 0x65af)
+#define ptagLISExtendedErrorinfo PROP_TAG(PT_LONG, pidLISErrorCodeMin + 0x6) // PROP_TAG(PT_LONG, 0x65b0)
// Not in msgfolder prop range
-#define ptagLISErrorLogUrl PROP_TAG( PT_UNICODE, pidLocalStoreInternalMin+0x70) // PROP_TAG(PT_UNICODE, 0x6570)
+#define ptagLISErrorLogUrl PROP_TAG(PT_UNICODE, pidLocalStoreInternalMin + 0x70) // PROP_TAG(PT_UNICODE, 0x6570)
// Ptags used between EXOLEDB and LSCache on client machine to pass
// along the actual client SQL query from EXOLEDB to LSCache in the RES_COMMENT
@@ -2557,18 +2335,18 @@ DECLARE_MAPI_INTERFACE_PTR(IExchangeMessageConversion, LPEXCHANGEMESSAGECONVERSI
//
// ptagSql = The identifying property for the SQL restriction.
// The value will be the original complete clause.
-#define ptagSql PROP_TAG(PT_UNICODE, pidLISInterfacePropMin+0x0)
-#define ptagSqlSelect PROP_TAG(PT_UNICODE, pidLISInterfacePropMin+0x1)
-#define ptagSqlFrom PROP_TAG(PT_UNICODE, pidLISInterfacePropMin+0x2)
-#define ptagSqlWhere PROP_TAG(PT_UNICODE, pidLISInterfacePropMin+0x3)
-#define ptagSqlOrder PROP_TAG(PT_UNICODE, pidLISInterfacePropMin+0x4)
-#define ptagSqlGroup PROP_TAG(PT_UNICODE, pidLISInterfacePropMin+0x5)
+#define ptagSql PROP_TAG(PT_UNICODE, pidLISInterfacePropMin + 0x0)
+#define ptagSqlSelect PROP_TAG(PT_UNICODE, pidLISInterfacePropMin + 0x1)
+#define ptagSqlFrom PROP_TAG(PT_UNICODE, pidLISInterfacePropMin + 0x2)
+#define ptagSqlWhere PROP_TAG(PT_UNICODE, pidLISInterfacePropMin + 0x3)
+#define ptagSqlOrder PROP_TAG(PT_UNICODE, pidLISInterfacePropMin + 0x4)
+#define ptagSqlGroup PROP_TAG(PT_UNICODE, pidLISInterfacePropMin + 0x5)
-#define PR_RULE_SERVER_RULE_ID PROP_TAG(PT_I8, pidLISMsgFolderPropMin+0x0) // Corresponding server RUID for LIS
+#define PR_RULE_SERVER_RULE_ID PROP_TAG(PT_I8, pidLISMsgFolderPropMin + 0x0) // Corresponding server RUID for LIS
// this is a hackish property to be used by sync event code to say that changes
// need client refresh. The only valid value is TRUE. See #168797 for more info
-#define PR_FORCE_CLIENT_REFRESH PROP_TAG(PT_BOOLEAN, pidLISMsgFolderPropMin+0x1)
+#define PR_FORCE_CLIENT_REFRESH PROP_TAG(PT_BOOLEAN, pidLISMsgFolderPropMin + 0x1)
/*------------------------------------------------------------------------
*
@@ -2578,46 +2356,45 @@ DECLARE_MAPI_INTERFACE_PTR(IExchangeMessageConversion, LPEXCHANGEMESSAGECONVERSI
*-----------------------------------------------------------------------*/
// Name and version of anti-virus product that performed the last scan of an item.
-#define PR_ANTIVIRUS_VENDOR PROP_TAG(PT_STRING8, pidStoreNonTransMin+0x45) // 0x0E85001E
-#define PR_ANTIVIRUS_VERSION PROP_TAG(PT_LONG, pidStoreNonTransMin+0x46) // 0x0E860003
+#define PR_ANTIVIRUS_VENDOR PROP_TAG(PT_STRING8, pidStoreNonTransMin + 0x45) // 0x0E85001E
+#define PR_ANTIVIRUS_VERSION PROP_TAG(PT_LONG, pidStoreNonTransMin + 0x46) // 0x0E860003
// Results ot the last scan of an item.
-#define PR_ANTIVIRUS_SCAN_STATUS PROP_TAG(PT_LONG, pidStoreNonTransMin+0x47) // 0x0E870003
+#define PR_ANTIVIRUS_SCAN_STATUS PROP_TAG(PT_LONG, pidStoreNonTransMin + 0x47) // 0x0E870003
// List of virus identification strings of all viruses found by the last scan, if virus has been cleaned
// or detected, separated by commans. Empty string if no virus has been found.
-#define PR_ANTIVIRUS_SCAN_INFO PROP_TAG(PT_STRING8, pidStoreNonTransMin+0x48) // 0x0E88001F
+#define PR_ANTIVIRUS_SCAN_INFO PROP_TAG(PT_STRING8, pidStoreNonTransMin + 0x48) // 0x0E88001F
/*
* Possible values of PR_ANTIVIRUS_SCAN_STATUS
*/
// Anti-virus product has completed scanning of an item, and found no virus.
-#define ANTIVIRUS_SCAN_NO_VIRUS 0
+#define ANTIVIRUS_SCAN_NO_VIRUS 0
// Anti-virus product has detected a virus in an item, or assumed the item may contain a virus
// based on item's properties, like filename or content type.
-#define ANTIVIRUS_SCAN_VIRUS_PRESENT 1
+#define ANTIVIRUS_SCAN_VIRUS_PRESENT 1
// Anti-virus product has detected a virus in an item, and applied changes to remove the virus.
// The item should be safe to use after modifications.
-#define ANTIVIRUS_SCAN_VIRUS_CLEANED 2
+#define ANTIVIRUS_SCAN_VIRUS_CLEANED 2
// Anti-virus product has detected a virus in an item, and has requested that the message be
// deleted. This item shouldn't be allowed to be opened.
-#define ANTIVIRUS_SCAN_VIRUS_DELETED 3
+#define ANTIVIRUS_SCAN_VIRUS_DELETED 3
// Presents the same list as PR_DISPLAY_TO except uses the format "[addrtype1:addr1]; [addrtype2:addr2]"
-#define PR_ADDR_TO PROP_TAG(PT_TSTRING, pidStoreNonTransMin+0x57) // 0x0E97
-#define PR_ADDR_TO_A PROP_TAG(PT_STRING8, pidStoreNonTransMin+0x57)
-#define PR_ADDR_TO_W PROP_TAG(PT_UNICODE, pidStoreNonTransMin+0x57)
+#define PR_ADDR_TO PROP_TAG(PT_TSTRING, pidStoreNonTransMin + 0x57) // 0x0E97
+#define PR_ADDR_TO_A PROP_TAG(PT_STRING8, pidStoreNonTransMin + 0x57)
+#define PR_ADDR_TO_W PROP_TAG(PT_UNICODE, pidStoreNonTransMin + 0x57)
// Presents the same list as PR_DISPLAY_CC except uses the format "[addrtype1:addr1]; [addrtype2:addr2]"
-#define PR_ADDR_CC PROP_TAG(PT_TSTRING, pidStoreNonTransMin+0x58) // 0x0E98
-#define PR_ADDR_CC_A PROP_TAG(PT_STRING8, pidStoreNonTransMin+0x58)
-#define PR_ADDR_CC_W PROP_TAG(PT_UNICODE, pidStoreNonTransMin+0x58)
-
+#define PR_ADDR_CC PROP_TAG(PT_TSTRING, pidStoreNonTransMin + 0x58) // 0x0E98
+#define PR_ADDR_CC_A PROP_TAG(PT_STRING8, pidStoreNonTransMin + 0x58)
+#define PR_ADDR_CC_W PROP_TAG(PT_UNICODE, pidStoreNonTransMin + 0x58)
// This property IS NO LONGER USED. I've left it here to avoid possible build break.
-#define ptagLISNewMail PROP_TAG(PT_BOOLEAN, 0x65c5)
+#define ptagLISNewMail PROP_TAG(PT_BOOLEAN, 0x65c5)
-#endif //EDKMDB_INCLUDED
+#endif // EDKMDB_INCLUDED
diff --git a/com/win32comext/mapi/src/mapi_stub_library/StubUtils.cpp b/com/win32comext/mapi/src/mapi_stub_library/StubUtils.cpp
index 707bd2a9d8..898a73fedb 100644
--- a/com/win32comext/mapi/src/mapi_stub_library/StubUtils.cpp
+++ b/com/win32comext/mapi/src/mapi_stub_library/StubUtils.cpp
@@ -234,24 +234,21 @@ HMODULE LoadRegisteredMapiClient(LPCWSTR pwzProviderOverride)
if (!pwzProvider) {
// Get Outlook application path registry value
DWORD dwSize = sizeof(rgchMailClient);
- if
- SUCCEEDED(RegQueryValueExW(hkey, nullptr, 0, &dwType, (LPBYTE)&rgchMailClient, &dwSize))
+ if SUCCEEDED (RegQueryValueExW(hkey, nullptr, 0, &dwType, (LPBYTE)&rgchMailClient, &dwSize))
- if (dwType != REG_SZ)
- goto Error;
+ if (dwType != REG_SZ)
+ goto Error;
pwzProvider = rgchMailClient;
}
if (pwzProvider) {
- if
- SUCCEEDED(RegOpenKeyExW(hkey, pwzProvider, 0, KEY_READ, &hkeyMapiClient))
- {
- hinstMapi = LoadMailClientFromMSIData(hkeyMapiClient);
-
- if (!hinstMapi)
- hinstMapi = LoadMailClientFromDllPath(hkeyMapiClient);
- }
+ if SUCCEEDED (RegOpenKeyExW(hkey, pwzProvider, 0, KEY_READ, &hkeyMapiClient)) {
+ hinstMapi = LoadMailClientFromMSIData(hkeyMapiClient);
+
+ if (!hinstMapi)
+ hinstMapi = LoadMailClientFromDllPath(hkeyMapiClient);
+ }
}
}
diff --git a/com/win32comext/mapi/src/mapiutil.cpp b/com/win32comext/mapi/src/mapiutil.cpp
index e09e03c1da..b704c77f6e 100644
--- a/com/win32comext/mapi/src/mapiutil.cpp
+++ b/com/win32comext/mapi/src/mapiutil.cpp
@@ -512,7 +512,7 @@ PyObject *PyMAPIObject_FromSPropValue(SPropValue *pv)
default:
printf("File %s: Unsupported MAPI property type 0x%X", __FILE__, PROP_TYPE(pv->ulPropTag));
- /* Dont set exception, as this prevents otherwise valid props from
+ /* Don't set exception, as this prevents otherwise valid props from
being returned
*/
val = Py_None;
diff --git a/com/win32comext/propsys/src/propsys.cpp b/com/win32comext/propsys/src/propsys.cpp
index 613f540fba..f92f5a0aab 100644
--- a/com/win32comext/propsys/src/propsys.cpp
+++ b/com/win32comext/propsys/src/propsys.cpp
@@ -309,7 +309,7 @@ static PyObject *PyStgDeserializePropVariant(PyObject *self, PyObject *args)
if (!pybuf.ok())
return NULL;
PY_INTERFACE_PRECALL;
- hr = StgDeserializePropVariant((SERIALIZEDPROPERTYVALUE*)pybuf.ptr(), pybuf.len(), &pv);
+ hr = StgDeserializePropVariant((SERIALIZEDPROPERTYVALUE *)pybuf.ptr(), pybuf.len(), &pv);
PY_INTERFACE_POSTCALL;
if (FAILED(hr))
return PyCom_BuildPyException(hr);
diff --git a/com/win32comext/shell/demos/IFileOperationProgressSink.py b/com/win32comext/shell/demos/IFileOperationProgressSink.py
index b327707404..9c73f544aa 100644
--- a/com/win32comext/shell/demos/IFileOperationProgressSink.py
+++ b/com/win32comext/shell/demos/IFileOperationProgressSink.py
@@ -15,7 +15,7 @@ def decode_flags(flags):
for k, v in tsf_flags:
if flags & v:
if flag_txt:
- flag_txt = flag_txt + "|" + k
+ flag_txt += "|" + k
else:
flag_txt = k
return flag_txt
diff --git a/com/win32comext/shell/demos/ITransferAdviseSink.py b/com/win32comext/shell/demos/ITransferAdviseSink.py
index ae4a7dea71..a0a696e2f1 100644
--- a/com/win32comext/shell/demos/ITransferAdviseSink.py
+++ b/com/win32comext/shell/demos/ITransferAdviseSink.py
@@ -19,7 +19,7 @@ def decode_flags(flags):
for k, v in tsf_flags:
if flags & v:
if flag_txt:
- flag_txt = flag_txt + "|" + k
+ flag_txt += "|" + k
else:
flag_txt = k
return flag_txt
diff --git a/com/win32comext/shell/demos/explorer_browser.py b/com/win32comext/shell/demos/explorer_browser.py
index 14dc2fa91d..faef813184 100644
--- a/com/win32comext/shell/demos/explorer_browser.py
+++ b/com/win32comext/shell/demos/explorer_browser.py
@@ -35,7 +35,7 @@ def OnViewCreated(self, view):
# be that view!
try:
pyview = unwrap(view)
- print("and look - its a Python implemented view!", pyview)
+ print("and look - it's a Python implemented view!", pyview)
except ValueError:
pass
diff --git a/com/win32comext/shell/demos/servers/empty_volume_cache.py b/com/win32comext/shell/demos/servers/empty_volume_cache.py
index 6d5a90198c..084e97c4f6 100644
--- a/com/win32comext/shell/demos/servers/empty_volume_cache.py
+++ b/com/win32comext/shell/demos/servers/empty_volume_cache.py
@@ -87,14 +87,14 @@ def _GetDirectories(self):
]
def _WalkCallback(self, arg, directory, files):
- # callback function for os.path.walk - no need to be member, but its
+ # callback function for os.path.walk - no need to be member, but it's
# close to the callers :)
callback, total_list = arg
for file in files:
fqn = os.path.join(directory, file).lower()
if file.endswith(".pyc") or file.endswith(".pyo"):
# See below - total_list is None means delete files,
- # otherwise it is a list where the result is stored. Its a
+ # otherwise it is a list where the result is stored. It's a
# list simply due to the way os.walk works - only [0] is
# referenced
if total_list is None:
diff --git a/com/win32comext/shell/demos/servers/folder_view.py b/com/win32comext/shell/demos/servers/folder_view.py
index 7651f1503d..a26ac840ef 100644
--- a/com/win32comext/shell/demos/servers/folder_view.py
+++ b/com/win32comext/shell/demos/servers/folder_view.py
@@ -58,7 +58,7 @@ def _make_ids(s):
# These strings are what the user sees and would be localized.
-# XXX - its possible that the shell might persist these values, so
+# XXX - it's possible that the shell might persist these values, so
# this scheme wouldn't really be suitable in a real ap.
IDS_UNSPECIFIED = _make_ids("unspecified")
IDS_SMALL = _make_ids("small")
@@ -529,7 +529,7 @@ def QueryContextMenu(self, hMenu, indexMenu, idCmdFirst, idCmdLast, uFlags):
def InvokeCommand(self, ci):
mask, hwnd, verb, params, dir, nShow, hotkey, hicon = ci
- # this seems very convuluted, but its what the sample does :)
+ # this seems very convuluted, but it's what the sample does :)
for verb_name, verb_id, flag in folderViewImplContextMenuIDs:
if isinstance(verb, int):
matches = verb == verb_id
@@ -538,12 +538,12 @@ def InvokeCommand(self, ci):
if matches:
break
else:
- assert False, ci # failed to find our ID
+ raise AssertionError(ci, "failed to find our ID")
if verb_id == MENUVERB_DISPLAY:
sia = shell.SHCreateShellItemArrayFromDataObject(self.dataobj)
DisplayItem(hwnd, sia)
else:
- assert False, ci # Got some verb we weren't expecting?
+ raise AssertionError(ci, "Got some verb we weren't expecting?")
def GetCommandString(self, cmd, typ):
raise COMException(hresult=winerror.E_NOTIMPL)
@@ -642,7 +642,7 @@ def GetAttributesOf(self, pidls, attrFlags):
# Retrieves an OLE interface that can be used to carry out
# actions on the specified file objects or folders.
def GetUIObjectOf(self, hwndOwner, pidls, iid, inout):
- assert len(pidls) == 1, "oops - arent expecting more than one!"
+ assert len(pidls) == 1, "oops - aren't expecting more than one!"
assert len(pidls[0]) == 1, "assuming relative pidls!"
item = pidl_to_item(pidls[0])
if iid == shell.IID_IContextMenu:
@@ -780,7 +780,7 @@ def MapColumnToSCID(self, iCol):
# IPersistFolder2 methods
# Retrieves the PIDLIST_ABSOLUTE for the folder object.
def GetCurFolder(self):
- # The docs say this is OK, but I suspect its a problem in this case :)
+ # The docs say this is OK, but I suspect it's a problem in this case :)
# assert self.pidl, "haven't been initialized?"
return self.pidl
diff --git a/com/win32comext/shell/demos/servers/shell_view.py b/com/win32comext/shell/demos/servers/shell_view.py
index f50977933f..a42e9484e9 100644
--- a/com/win32comext/shell/demos/servers/shell_view.py
+++ b/com/win32comext/shell/demos/servers/shell_view.py
@@ -175,7 +175,7 @@ def CompareIDs(self, param, id1, id2):
def GetUIObjectOf(self, hwndOwner, pidls, iid, inout):
# delegate to the shell.
- assert len(pidls) == 1, "oops - arent expecting more than one!"
+ assert len(pidls) == 1, "oops - aren't expecting more than one!"
pidl = pidls[0]
folder, child_pidl = self._GetFolderAndPIDLForPIDL(pidl)
try:
diff --git a/com/win32comext/shell/shellcon.py b/com/win32comext/shell/shellcon.py
index 37841a9710..90a5073ebb 100644
--- a/com/win32comext/shell/shellcon.py
+++ b/com/win32comext/shell/shellcon.py
@@ -856,12 +856,12 @@ def EIRESID(x):
ASSOCF_OPEN_BYEXENAME = 0x00000002 # executable is being passed in
ASSOCF_INIT_DEFAULTTOSTAR = 0x00000004 # treat "*" as the BaseClass
ASSOCF_INIT_DEFAULTTOFOLDER = 0x00000008 # treat "Folder" as the BaseClass
-ASSOCF_NOUSERSETTINGS = 0x00000010 # dont use HKCU
-ASSOCF_NOTRUNCATE = 0x00000020 # dont truncate the return string
+ASSOCF_NOUSERSETTINGS = 0x00000010 # don't use HKCU
+ASSOCF_NOTRUNCATE = 0x00000020 # don't truncate the return string
ASSOCF_VERIFY = 0x00000040 # verify data is accurate (DISK HITS)
ASSOCF_REMAPRUNDLL = 0x00000080 # actually gets info about rundlls target if applicable
ASSOCF_NOFIXUPS = 0x00000100 # attempt to fix errors if found
-ASSOCF_IGNOREBASECLASS = 0x00000200 # dont recurse into the baseclass
+ASSOCF_IGNOREBASECLASS = 0x00000200 # don't recurse into the baseclass
ASSOCSTR_COMMAND = 1 # shell\verb\command string
ASSOCSTR_EXECUTABLE = 2 # the executable part of command string
diff --git a/com/win32comext/shell/src/PyIQueryAssociations.h b/com/win32comext/shell/src/PyIQueryAssociations.h
index 416b6273e8..5eaba23acb 100644
--- a/com/win32comext/shell/src/PyIQueryAssociations.h
+++ b/com/win32comext/shell/src/PyIQueryAssociations.h
@@ -18,12 +18,12 @@ enum {
ASSOCF_OPEN_BYEXENAME = 0x00000002, // executable is being passed in
ASSOCF_INIT_DEFAULTTOSTAR = 0x00000004, // treat "*" as the BaseClass
ASSOCF_INIT_DEFAULTTOFOLDER = 0x00000008, // treat "Folder" as the BaseClass
- ASSOCF_NOUSERSETTINGS = 0x00000010, // dont use HKCU
- ASSOCF_NOTRUNCATE = 0x00000020, // dont truncate the return string
+ ASSOCF_NOUSERSETTINGS = 0x00000010, // don't use HKCU
+ ASSOCF_NOTRUNCATE = 0x00000020, // don't truncate the return string
ASSOCF_VERIFY = 0x00000040, // verify data is accurate (DISK HITS)
ASSOCF_REMAPRUNDLL = 0x00000080, // actually gets info about rundlls target if applicable
ASSOCF_NOFIXUPS = 0x00000100, // attempt to fix errors if found
- ASSOCF_IGNOREBASECLASS = 0x00000200, // dont recurse into the baseclass
+ ASSOCF_IGNOREBASECLASS = 0x00000200, // don't recurse into the baseclass
};
typedef DWORD ASSOCF;
#define LWSTDAPI STDAPI
diff --git a/com/win32comext/shell/src/PyIShellFolder.cpp b/com/win32comext/shell/src/PyIShellFolder.cpp
index 2a4341224b..65cc210d02 100644
--- a/com/win32comext/shell/src/PyIShellFolder.cpp
+++ b/com/win32comext/shell/src/PyIShellFolder.cpp
@@ -217,14 +217,14 @@ PyObject *PyIShellFolder::CompareIDs(PyObject *self, PyObject *args)
PyCom_BuildPyException(hr, pISF, IID_IShellFolder);
else // special handling of hresult
if ((short)HRESULT_CODE(hr) < 0)
- /* pidl1 comes first */
- ret = PyLong_FromLong(-1);
- else if ((short)HRESULT_CODE(hr) > 0)
- /* pidl2 comes first */
- ret = PyLong_FromLong(1);
- else
- /* the two pidls are equal */
- ret = PyLong_FromLong(0);
+ /* pidl1 comes first */
+ ret = PyLong_FromLong(-1);
+ else if ((short)HRESULT_CODE(hr) > 0)
+ /* pidl2 comes first */
+ ret = PyLong_FromLong(1);
+ else
+ /* the two pidls are equal */
+ ret = PyLong_FromLong(0);
}
PyObject_FreePIDL(pidl1);
PyObject_FreePIDL(pidl2);
diff --git a/com/win32comext/shell/src/PyITransferAdviseSink.cpp b/com/win32comext/shell/src/PyITransferAdviseSink.cpp
index 5e8d8db165..697ba69e8c 100644
--- a/com/win32comext/shell/src/PyITransferAdviseSink.cpp
+++ b/com/win32comext/shell/src/PyITransferAdviseSink.cpp
@@ -385,11 +385,9 @@ STDMETHODIMP PyGTransferAdviseSink::SubStreamFailure(
HRESULT hr = InvokeViaPolicy("SubStreamFailure", &result, "OOl", obpsi, obpszStreamName, hrError);
Py_XDECREF(obpsi);
Py_XDECREF(obpszStreamName);
- if
- FAILED(hr)
- hr = MAKE_PYCOM_GATEWAY_FAILURE_CODE("SubStreamFailure");
- else
- {
+ if FAILED (hr)
+ hr = MAKE_PYCOM_GATEWAY_FAILURE_CODE("SubStreamFailure");
+ else {
hr = PyLong_AsLong(result);
if (hr == -1 && PyErr_Occurred())
hr = MAKE_PYCOM_GATEWAY_FAILURE_CODE("SubStreamFailure");
@@ -418,11 +416,9 @@ STDMETHODIMP PyGTransferAdviseSink::PropertyFailure(
HRESULT hr = InvokeViaPolicy("PropertyFailure", &result, "OOl", obpsi, obkey, hrError);
Py_XDECREF(obpsi);
Py_DECREF(obkey);
- if
- FAILED(hr)
- hr = MAKE_PYCOM_GATEWAY_FAILURE_CODE("PropertyFailure");
- else
- {
+ if FAILED (hr)
+ hr = MAKE_PYCOM_GATEWAY_FAILURE_CODE("PropertyFailure");
+ else {
hr = PyLong_AsLong(result);
if (hr == -1 && PyErr_Occurred())
hr = MAKE_PYCOM_GATEWAY_FAILURE_CODE("PropertyFailure");
diff --git a/com/win32comext/shell/src/shell.cpp b/com/win32comext/shell/src/shell.cpp
index 757647b672..27d51f8d6f 100644
--- a/com/win32comext/shell/src/shell.cpp
+++ b/com/win32comext/shell/src/shell.cpp
@@ -241,7 +241,7 @@ PyObject *PyObject_FromPIDL(LPCITEMIDLIST pidl, BOOL bFreeSystemPIDL)
}
// The length may be too large to read (and causing an
// exception deep inside Python doesn't always leave
- // things in a good state! Its also inconvenient to
+ // things in a good state! It's also inconvenient to
// always pass the size of the object - so explicitly
// check we can read the memory.
UINT cbdata = pidl->mkid.cb - sizeof(pidl->mkid.cb);
@@ -2802,7 +2802,7 @@ static PyObject *PySHCreateShellFolderView(PyObject *self, PyObject *args)
else
ret = PyCom_PyObjectFromIUnknown(view, IID_IShellView, FALSE);
// ref on view consumed by ret object.
-done : {
+done: {
PY_INTERFACE_PRECALL;
if (create.pshf)
create.pshf->Release();
diff --git a/com/win32comext/taskscheduler/src/PyIScheduledWorkItem.cpp b/com/win32comext/taskscheduler/src/PyIScheduledWorkItem.cpp
index 261c532d07..84baabeab9 100644
--- a/com/win32comext/taskscheduler/src/PyIScheduledWorkItem.cpp
+++ b/com/win32comext/taskscheduler/src/PyIScheduledWorkItem.cpp
@@ -488,7 +488,7 @@ PyObject *PyIScheduledWorkItem::SetWorkItemData(PyObject *self, PyObject *args)
else
// Task Scheduler won't take an empty string for data anymore ??????
if (data_len == 0)
- workitem_data = NULL;
+ workitem_data = NULL;
}
HRESULT hr;
diff --git a/com/win32comext/taskscheduler/test/test_addtask_1.py b/com/win32comext/taskscheduler/test/test_addtask_1.py
index 284e3511e0..5f1356af17 100644
--- a/com/win32comext/taskscheduler/test/test_addtask_1.py
+++ b/com/win32comext/taskscheduler/test/test_addtask_1.py
@@ -36,7 +36,7 @@
new_task.SetApplicationName("py.exe")
new_task.SetPriority(taskscheduler.REALTIME_PRIORITY_CLASS)
new_task.SetParameters(
- "-c\"import win32ui,time;win32ui.MessageBox('why aint you doing no work ?');\""
+ "-c\"import win32ui,time;win32ui.MessageBox('why ain't you doing no work ?');\""
)
new_task.SetCreator("test_addtask_1.py")
new_task.SetAccountInformation(win32api.GetUserName(), None)
diff --git a/isapi/install.py b/isapi/install.py
index 55235e8791..157d2735a2 100644
--- a/isapi/install.py
+++ b/isapi/install.py
@@ -364,7 +364,7 @@ def _AssignScriptMapsReplace(target, script_maps):
def _AssignScriptMapsEnd(target, script_maps):
unique_new_maps = get_unique_items(script_maps, target.ScriptMaps)
- target.ScriptMaps = target.ScriptMaps + unique_new_maps
+ target.ScriptMaps += unique_new_maps
def _AssignScriptMapsStart(target, script_maps):
diff --git a/isapi/src/PyExtensionObjects.cpp b/isapi/src/PyExtensionObjects.cpp
index 3351979dcc..19208c19f4 100644
--- a/isapi/src/PyExtensionObjects.cpp
+++ b/isapi/src/PyExtensionObjects.cpp
@@ -23,14 +23,13 @@
======================================================================
*/
-//#define PY_SSIZE_T_CLEAN // defined by isapi\src\StdAfx.h
+// #define PY_SSIZE_T_CLEAN // defined by isapi\src\StdAfx.h
#include "stdafx.h"
#include "pywintypes.h"
#include "Utils.h"
#include "PyExtensionObjects.h"
#include "PythonEng.h"
-
// Asynch IO callbacks are a little tricky, as we never know how many
// callbacks a single connection might make (often each callback will trigger
// another IO request.) So we keep the Python objects used by the callback
@@ -122,7 +121,7 @@ extern "C" void WINAPI DoIOCallback(EXTENSION_CONTROL_BLOCK *ecb, PVOID pContext
Py_DECREF(result);
worked = TRUE;
done:
- // If the callback failed, then its likely this request will end
+ // If the callback failed, then it's likely this request will end
// up hanging. So on error we nuke ourselves from the map then
// call DoneWithSession. We still hold the GIL, so we should be
// safe from races...
@@ -176,7 +175,9 @@ PyObject *PyVERSION_INFO::getattro(PyObject *self, PyObject *obname)
PyVERSION_INFO *me = (PyVERSION_INFO *)self;
if (!me->m_pvi)
return PyErr_Format(PyExc_RuntimeError, "VERSION_INFO structure no longer exists");
- TmpWCHAR name = obname; if (!name) return NULL;
+ TmpWCHAR name = obname;
+ if (!name)
+ return NULL;
if (_tcscmp(name, _T("ExtensionDesc")) == 0) {
return PyBytes_FromString(me->m_pvi->lpszExtensionDesc);
}
@@ -186,7 +187,9 @@ PyObject *PyVERSION_INFO::getattro(PyObject *self, PyObject *obname)
int PyVERSION_INFO::setattro(PyObject *self, PyObject *obname, PyObject *v)
{
PyVERSION_INFO *me = (PyVERSION_INFO *)self;
- TmpWCHAR name = obname; if (!name) return -1;
+ TmpWCHAR name = obname;
+ if (!name)
+ return -1;
if (!me->m_pvi) {
PyErr_Format(PyExc_RuntimeError, "VERSION_INFO structure no longer exists");
return -1;
@@ -345,7 +348,9 @@ PyECB::~PyECB()
PyObject *PyECB::getattro(PyObject *self, PyObject *obname)
{
- TmpWCHAR name = obname; if (!name) return NULL;
+ TmpWCHAR name = obname;
+ if (!name)
+ return NULL;
if (_tcscmp(name, _T("softspace")) == 0) // help 'print' semantics.
return PyLong_FromLong(1);
@@ -385,7 +390,9 @@ int PyECB::setattro(PyObject *self, PyObject *obname, PyObject *v)
PyErr_SetString(PyExc_AttributeError, "can't delete ECB attributes");
return -1;
}
- TmpWCHAR name = obname; if (!name) return -1;
+ TmpWCHAR name = obname;
+ if (!name)
+ return -1;
if (_tcscmp(name, _T("HttpStatusCode")) == 0) {
PyECB *pecb = (PyECB *)self;
@@ -683,9 +690,11 @@ PyObject *PyECB::GetAnonymousToken(PyObject *self, PyObject *args)
Py_END_ALLOW_THREADS
}
else if (PyUnicode_Check(obStr)) {
- TmpWCHAR tmpw = obStr; if (!tmpw) return NULL;
- Py_BEGIN_ALLOW_THREADS bRes = ecb->ServerSupportFunction(ecb->ConnID, HSE_REQ_GET_UNICODE_ANONYMOUS_TOKEN,
- tmpw, (DWORD *)&handle, NULL);
+ TmpWCHAR tmpw = obStr;
+ if (!tmpw)
+ return NULL;
+ Py_BEGIN_ALLOW_THREADS bRes =
+ ecb->ServerSupportFunction(ecb->ConnID, HSE_REQ_GET_UNICODE_ANONYMOUS_TOKEN, tmpw, (DWORD *)&handle, NULL);
Py_END_ALLOW_THREADS
}
else
diff --git a/isapi/src/PyFilterObjects.cpp b/isapi/src/PyFilterObjects.cpp
index 312d69de8e..0239313f0c 100644
--- a/isapi/src/PyFilterObjects.cpp
+++ b/isapi/src/PyFilterObjects.cpp
@@ -23,7 +23,7 @@
======================================================================
*/
-//#define PY_SSIZE_T_CLEAN // defined by isapi\src\StdAfx.h
+// #define PY_SSIZE_T_CLEAN // defined by isapi\src\StdAfx.h
#include "stdafx.h"
#include "pywintypes.h"
#include "Utils.h"
@@ -69,7 +69,9 @@ PyObject *PyFILTER_VERSION::getattro(PyObject *self, PyObject *obname)
PyFILTER_VERSION *me = (PyFILTER_VERSION *)self;
if (!me->m_pfv)
return PyErr_Format(PyExc_RuntimeError, "FILTER_VERSION structure no longer exists");
- TmpWCHAR name = obname; if (!name) return NULL;
+ TmpWCHAR name = obname;
+ if (!name)
+ return NULL;
// @prop int|ServerFilterVersion|(read-only)
if (_tcscmp(name, _T("ServerFilterVersion")) == 0) {
return PyLong_FromLong(me->m_pfv->dwServerFilterVersion);
@@ -100,7 +102,9 @@ int PyFILTER_VERSION::setattro(PyObject *self, PyObject *obname, PyObject *v)
PyErr_SetString(PyExc_AttributeError, "can't delete FILTER_VERSION attributes");
return -1;
}
- TmpWCHAR name = obname; if (!name) return -1;
+ TmpWCHAR name = obname;
+ if (!name)
+ return -1;
if (_tcscmp(name, _T("FilterVersion")) == 0) {
if (!PyLong_Check(v)) {
PyErr_Format(PyExc_ValueError, "FilterVersion must be an int (got %s)", v->ob_type->tp_name);
@@ -416,7 +420,9 @@ PyHFC::~PyHFC()
PyObject *PyHFC::getattro(PyObject *self, PyObject *obname)
{
- TmpWCHAR name = obname; if (!name) return NULL;
+ TmpWCHAR name = obname;
+ if (!name)
+ return NULL;
// other manual attributes.
if (_tcscmp(name, _T("FilterContext")) == 0) {
@@ -435,7 +441,9 @@ PyObject *PyHFC::getattro(PyObject *self, PyObject *obname)
int PyHFC::setattro(PyObject *self, PyObject *obname, PyObject *v)
{
- TmpWCHAR name = obname; if (!name) return -1;
+ TmpWCHAR name = obname;
+ if (!name)
+ return -1;
if (v == NULL) {
PyErr_SetString(PyExc_AttributeError, "can't delete ECB attributes");
return -1;
@@ -537,7 +545,9 @@ PyObject *PyURL_MAP::getattro(PyObject *self, PyObject *obname)
if (!pMap)
return NULL;
// @prop string|URL|
- TmpWCHAR name = obname; if (!name) return NULL;
+ TmpWCHAR name = obname;
+ if (!name)
+ return NULL;
if (_tcscmp(name, _T("URL")) == 0) {
return PyBytes_FromString(pMap->pszURL);
}
@@ -553,7 +563,9 @@ int PyURL_MAP::setattro(PyObject *self, PyObject *obname, PyObject *v)
HTTP_FILTER_URL_MAP *pMap = ((PyURL_MAP *)self)->GetURLMap();
if (!pMap)
return NULL;
- TmpWCHAR name = obname; if (!name) return -1;
+ TmpWCHAR name = obname;
+ if (!name)
+ return -1;
if (_tcscmp(name, _T("PhysicalPath")) == 0) {
if (!PyBytes_Check(v)) {
PyErr_Format(PyExc_TypeError, "PhysicalPath must be a string");
@@ -780,7 +792,9 @@ PyObject *PyRAW_DATA::getattro(PyObject *self, PyObject *obname)
if (!pRD)
return NULL;
// @prop string|InData|
- TmpWCHAR name = obname; if (!name) return NULL;
+ TmpWCHAR name = obname;
+ if (!name)
+ return NULL;
if (_tcscmp(name, _T("InData")) == 0) {
if (pRD->pvInData == NULL) {
Py_INCREF(Py_None);
@@ -800,7 +814,9 @@ int PyRAW_DATA::setattro(PyObject *self, PyObject *obname, PyObject *v)
if (!pRD || !pFC)
return NULL;
- TmpWCHAR name = obname; if (!name) return -1;
+ TmpWCHAR name = obname;
+ if (!name)
+ return -1;
if (_tcscmp(name, _T("InData")) == 0) {
if (!PyBytes_Check(v)) {
PyErr_Format(PyExc_TypeError, "InData must be a string (got %s)", v->ob_type->tp_name);
@@ -886,7 +902,9 @@ PyObject *PyAUTHENT::getattro(PyObject *self, PyObject *obname)
HTTP_FILTER_AUTHENT *pAE = ((PyAUTHENT *)self)->GetAUTHENT();
if (!pAE)
return NULL;
- TmpWCHAR name = obname; if (!name) return NULL;
+ TmpWCHAR name = obname;
+ if (!name)
+ return NULL;
// @prop string|User|
if (_tcscmp(name, _T("User")) == 0) {
if (pAE->pszUser == NULL) {
@@ -914,7 +932,9 @@ int PyAUTHENT::setattro(PyObject *self, PyObject *obname, PyObject *v)
if (!pAE || !pFC)
return NULL;
- TmpWCHAR name = obname; if (!name) return -1;
+ TmpWCHAR name = obname;
+ if (!name)
+ return -1;
if (_tcscmp(name, _T("User")) == 0) {
if (!PyBytes_Check(v)) {
PyErr_Format(PyExc_TypeError, "User must be a string (got %s)", v->ob_type->tp_name);
@@ -999,7 +1019,9 @@ PyObject *PyFILTER_LOG::getattro(PyObject *self, PyObject *obname)
HTTP_FILTER_LOG *pLog = ((PyFILTER_LOG *)self)->GetFilterLog();
if (!pLog)
return NULL;
- TmpWCHAR name = obname; if (!name) return NULL;
+ TmpWCHAR name = obname;
+ if (!name)
+ return NULL;
// @prop string|ClientHostName|
if (_tcscmp(name, _T("ClientHostName")) == 0)
return PyBytes_FromString(pLog->pszClientHostName);
@@ -1032,28 +1054,28 @@ PyObject *PyFILTER_LOG::getattro(PyObject *self, PyObject *obname)
#define CHECK_SET_FILTER_LOG_STRING(struct_elem) \
if (_tcscmp(name, _T(#struct_elem)) == 0) { \
- if (!PyBytes_Check(v)) { \
+ if (!PyBytes_Check(v)) { \
PyErr_Format(PyExc_TypeError, #struct_elem " must be a string"); \
return -1; \
} \
- int cc = PyBytes_Size(v) + sizeof(CHAR); \
+ int cc = PyBytes_Size(v) + sizeof(CHAR); \
char *buf = (char *)pFC->AllocMem(pFC, cc, 0); \
if (!buf) { \
PyErr_NoMemory(); \
return -1; \
} \
- strncpy(buf, PyBytes_AS_STRING(v), cc); \
+ strncpy(buf, PyBytes_AS_STRING(v), cc); \
pLog->psz##struct_elem = buf; \
return 0; \
}
#define CHECK_SET_FILTER_LOG_LONG(struct_elem) \
if (_tcscmp(name, _T(#struct_elem)) == 0) { \
- if (!PyLong_Check(v)) { \
+ if (!PyLong_Check(v)) { \
PyErr_Format(PyExc_TypeError, #struct_elem " must be an integer"); \
return -1; \
} \
- pLog->dw##struct_elem = PyLong_AsLong(v); \
+ pLog->dw##struct_elem = PyLong_AsLong(v); \
return 0; \
}
@@ -1064,7 +1086,9 @@ int PyFILTER_LOG::setattro(PyObject *self, PyObject *obname, PyObject *v)
HTTP_FILTER_LOG *pLog = ((PyFILTER_LOG *)self)->GetFilterLog();
if (!pLog || !pFC)
return NULL;
- TmpWCHAR name = obname; if (!name) return -1;
+ TmpWCHAR name = obname;
+ if (!name)
+ return -1;
CHECK_SET_FILTER_LOG_STRING(ClientHostName)
CHECK_SET_FILTER_LOG_STRING(ClientUserName)
CHECK_SET_FILTER_LOG_STRING(ServerName)
diff --git a/isapi/threaded_extension.py b/isapi/threaded_extension.py
index ecf24c8460..310bbb84be 100644
--- a/isapi/threaded_extension.py
+++ b/isapi/threaded_extension.py
@@ -176,7 +176,7 @@ def HandleDispatchError(self, ecb):
)
except ExtensionError:
# The client disconnected without reading the error body -
- # its probably not a real browser at the other end, ignore it.
+ # it's probably not a real browser at the other end, ignore it.
pass
except:
print("FAILED to render the error message!")
diff --git a/mypy.ini b/mypy.ini
index 34ac87ef01..eb8e23ae9e 100644
--- a/mypy.ini
+++ b/mypy.ini
@@ -35,16 +35,16 @@ disable_error_code =
; Cannot assign to a method (we do lots of monkey patching)
method-assign,
exclude = (?x)(
- ^build/
- ; Vendored
- | ^Pythonwin/Scintilla/
- ; Forked IDLE extensions predating Python 2.3. They now live in idlelib in https://github.com/python/cpython/tree/main/Lib/idlelib
- | ^Pythonwin/pywin/idle/
- ; TODO: adodbapi should be updated and fixed separately
- | ^adodbapi/
- ; TODO: Ignoring non-public APIs until all public API is typed
- | ([Tt]est|[Dd]emos?)/
- )
+ ^build/
+ ; Vendored
+ | ^Pythonwin/Scintilla/
+ ; Forked IDLE extensions predating Python 2.3. They now live in idlelib in https://github.com/python/cpython/tree/main/Lib/idlelib
+ | ^Pythonwin/pywin/idle/
+ ; TODO: adodbapi should be updated and fixed separately
+ | ^adodbapi/
+ ; TODO: Ignoring non-public APIs until all public API is typed
+ | ([Tt]est|[Dd]emos?)/
+ )
; C-modules that will need type-stubs
[mypy-adsi.*,dde,exchange,exchdapi,mapi,perfmon,servicemanager,win32api,win32console,win32clipboard,win32comext.adsi.adsi,win32event,win32evtlog,win32file,win32gui,win32help,win32pdh,win32process,win32ras,win32security,win32service,win32trace,win32ui,win32uiole,win32wnet,_win32sysloader,_winxptheme]
diff --git a/pywin32_testall.py b/pywin32_testall.py
index 9071549174..2aa92098cb 100644
--- a/pywin32_testall.py
+++ b/pywin32_testall.py
@@ -76,7 +76,7 @@ def main():
extras = []
if args.user_interaction:
- extras += ["-user-interaction"]
+ extras.append("-user-interaction")
extras.extend(remains)
scripts = [
"win32/test/testall.py",
diff --git a/ruff.toml b/ruff.toml
index 704ef1d1ba..8c5daa2a9d 100644
--- a/ruff.toml
+++ b/ruff.toml
@@ -1,5 +1,4 @@
-# Target the oldest supported version
-target-version = "py37"
+target-version = "py37" # Target the oldest supported version
[lint]
select = [
@@ -13,10 +12,10 @@ select = [
"YTT", # flake8-2020
# String formatting, concatenating, interpolation, ...
- "ISC001", # single-line-implicit-string-concatenation
- "ISC002", # multi-line-implicit-string-concatenation
"FLY", # static-join-to-f-string
"G", # flake8-logging-format
+ # Note, we still want to allow multiline ISC
+ "ISC001", # single-line-implicit-string-concatenation
"UP025", # Remove unicode literals from strings
"UP030", # Use implicit references for positional format fields
# TODO: Still lots of manual fixes needed
@@ -38,7 +37,7 @@ select = [
# Explicit re-exports is fine in __init__.py, still a code smell elsewhere.
"__init__.py" = ["PLC0414"]
# TODO: Make adodbapi changes in their own PRs
-"adodbapi/*" = ["C4", "YTT301", "UP031", "UP032", "ISC002"]
+"adodbapi/*" = ["C4", "YTT301", "UP031", "UP032"]
[lint.isort]
combine-as-imports = true
@@ -53,6 +52,3 @@ known-third-party = [
"distutils",
]
extra-standard-library = ["setuptools"]
-
-[lint.flake8-implicit-str-concat]
-allow-multiline = false # Enables ISC002, ignore ISC003 with this option disabled
diff --git a/setup.py b/setup.py
index 19f87fbfe2..1e777c007c 100644
--- a/setup.py
+++ b/setup.py
@@ -54,7 +54,7 @@
build_id_patch = build_id
if not "." in build_id_patch:
- build_id_patch = build_id_patch + ".0"
+ build_id_patch += ".0"
pywin32_version = "%d.%d.%s" % (
sys.version_info.major,
sys.version_info.minor,
@@ -174,7 +174,7 @@ def finalize_options(self, build_ext):
# like Python, always use debug info, even in release builds
# (note the compiler doesn't include debug info, so you only get
- # basic info - but its better than nothing!)
+ # basic info - but it's better than nothing!)
# For now use the temp dir - later we may package them, so should
# maybe move them next to the output file.
pch_dir = os.path.join(build_ext.build_temp)
@@ -1039,7 +1039,7 @@ def spawn(self, cmd):
# We want mt.exe run with the original manifest
for i in range(len(cmd)):
if cmd[i] == "-manifest":
- cmd[i + 1] = cmd[i + 1] + ".orig"
+ cmd[i + 1] += ".orig"
break
super().spawn(cmd)
if is_link:
diff --git a/win32/Demos/FileSecurityTest.py b/win32/Demos/FileSecurityTest.py
index 3b8940b644..4cb1aea2d7 100644
--- a/win32/Demos/FileSecurityTest.py
+++ b/win32/Demos/FileSecurityTest.py
@@ -131,7 +131,7 @@
calc_mask = 0 # calculate the mask so we can see if we are printing all of the permissions
for i in permissions:
if getattr(ntsecuritycon, i) & ace[1] == getattr(ntsecuritycon, i):
- calc_mask = calc_mask | getattr(ntsecuritycon, i)
+ calc_mask |= getattr(ntsecuritycon, i)
print(" ", i)
print(" ", "Calculated Check Mask=", hex(calc_mask))
print(" -SID\n ", win32security.LookupAccountSid(None, ace[2]))
diff --git a/win32/Demos/desktopmanager.py b/win32/Demos/desktopmanager.py
index 6ffaf2a94b..ff2441e06a 100644
--- a/win32/Demos/desktopmanager.py
+++ b/win32/Demos/desktopmanager.py
@@ -81,7 +81,7 @@ def get_new_desktop_name(parent_hwnd):
def new_icon(hdesk, desktop_name):
"""Runs as a thread on each desktop to create a new tray icon and handle its messages"""
global id
- id = id + 1
+ id += 1
hdesk.SetThreadDesktop()
## apparently the threads can't use same hinst, so each needs its own window class
windowclassname = "PythonDesktopManager" + desktop_name
@@ -185,9 +185,9 @@ def icon_wndproc(hwnd, msg, wp, lp):
mf_flags = win32con.MF_STRING
## if you switch to winlogon yourself, there's nothing there and you're stuck
if desktops[d - 1].lower() in ("winlogon", "disconnect"):
- mf_flags = mf_flags | win32con.MF_GRAYED | win32con.MF_DISABLED
+ mf_flags |= win32con.MF_GRAYED | win32con.MF_DISABLED
if desktops[d - 1] == curr_desktop_name:
- mf_flags = mf_flags | win32con.MF_CHECKED
+ mf_flags |= win32con.MF_CHECKED
win32gui.AppendMenu(m, mf_flags, d, desktops[d - 1])
win32gui.AppendMenu(m, win32con.MF_STRING, desktop_cnt + 1, "Create new ...")
win32gui.AppendMenu(m, win32con.MF_STRING, desktop_cnt + 2, "Exit")
diff --git a/win32/Demos/eventLogDemo.py b/win32/Demos/eventLogDemo.py
index b87f462288..1e327a80e0 100644
--- a/win32/Demos/eventLogDemo.py
+++ b/win32/Demos/eventLogDemo.py
@@ -21,7 +21,7 @@ def ReadLog(computer, logType="Application", dumpEachRecord=0):
if not objects:
break
for object in objects:
- # get it for testing purposes, but dont print it.
+ # get it for testing purposes, but don't print it.
msg = win32evtlogutil.SafeFormatMessage(object, logType)
if object.Sid is not None:
try:
@@ -46,7 +46,7 @@ def ReadLog(computer, logType="Application", dumpEachRecord=0):
print("(unicode error printing message: repr() follows...)")
print(repr(msg))
- num = num + len(objects)
+ num += len(objects)
if numRecords == num:
print("Successfully read all", numRecords, "records")
@@ -62,8 +62,8 @@ def ReadLog(computer, logType="Application", dumpEachRecord=0):
def usage():
print("Writes an event to the event log.")
- print("-w : Dont write any test records.")
- print("-r : Dont read the event log")
+ print("-w : Don't write any test records.")
+ print("-r : Don't read the event log")
print("-c : computerName : Process the log on the specified computer")
print("-v : Verbose")
print("-t : LogType - Use the specified log - default = 'Application'")
@@ -102,7 +102,7 @@ def test():
if opt == "-w":
do_write = 0
if opt == "-v":
- verbose = verbose + 1
+ verbose += 1
if do_write:
ph = win32api.GetCurrentProcess()
th = win32security.OpenProcessToken(ph, win32con.TOKEN_READ)
diff --git a/win32/Demos/security/security_enums.py b/win32/Demos/security/security_enums.py
index ab3cc6d361..8850b442c0 100644
--- a/win32/Demos/security/security_enums.py
+++ b/win32/Demos/security/security_enums.py
@@ -37,7 +37,7 @@ def lookup_flags(self, flags):
for k, v in self.__dict__.items():
if flags & v == v:
flag_names.append(k)
- unknown_flags = unknown_flags & ~v
+ unknown_flags &= ~v
return flag_names, unknown_flags
diff --git a/win32/Demos/service/pipeTestService.py b/win32/Demos/service/pipeTestService.py
index 27aec92555..f062fcd2c9 100644
--- a/win32/Demos/service/pipeTestService.py
+++ b/win32/Demos/service/pipeTestService.py
@@ -77,7 +77,7 @@ def DoProcessClient(self, pipeHandle, tid):
hr = winerror.ERROR_MORE_DATA
while hr == winerror.ERROR_MORE_DATA:
hr, thisd = ReadFile(pipeHandle, 256)
- d = d + thisd
+ d += thisd
print("Read", d)
ok = 1
except error:
@@ -85,7 +85,7 @@ def DoProcessClient(self, pipeHandle, tid):
ok = 0
# A secure service would handle (and ignore!) errors writing to the
- # pipe, but for the sake of this demo we dont (if only to see what errors
+ # pipe, but for the sake of this demo we don't (if only to see what errors
# we can get when our clients break at strange times :-)
if ok:
msg = (
@@ -162,7 +162,7 @@ def SvcDoRun(self):
else:
# Pipe event - spawn thread to deal with it.
_thread.start_new_thread(self.ProcessClient, (pipeHandle,))
- num_connections = num_connections + 1
+ num_connections += 1
# Sleep to ensure that any new threads are in the list, and then
# wait for all current threads to finish.
diff --git a/win32/Demos/service/pipeTestServiceClient.py b/win32/Demos/service/pipeTestServiceClient.py
index cc12dc66a3..507219c09e 100644
--- a/win32/Demos/service/pipeTestServiceClient.py
+++ b/win32/Demos/service/pipeTestServiceClient.py
@@ -38,7 +38,7 @@ def CallPipe(fn, args):
ret = None
retryCount = 0
while retryCount < 8: # Keep looping until user cancels.
- retryCount = retryCount + 1
+ retryCount += 1
try:
return fn(*args)
except win32api.error as exc:
diff --git a/win32/Demos/timer_demo.py b/win32/Demos/timer_demo.py
index 61115f0655..0ce1d0210b 100644
--- a/win32/Demos/timer_demo.py
+++ b/win32/Demos/timer_demo.py
@@ -26,7 +26,7 @@ def __init__(self, delay=1000, max=10):
def increment(self, id, time):
print("x = %d" % self.x)
- self.x = self.x + 1
+ self.x += 1
# if we've reached the max count,
# kill off the timer.
if self.x > self.max:
diff --git a/win32/Demos/win32clipboardDemo.py b/win32/Demos/win32clipboardDemo.py
index 1c1c9f5d0f..094c0c8520 100644
--- a/win32/Demos/win32clipboardDemo.py
+++ b/win32/Demos/win32clipboardDemo.py
@@ -34,7 +34,7 @@ def TestText():
SetClipboardText(text)
got = GetClipboardData(win32con.CF_TEXT)
# CF_TEXT always gives us 'bytes' back .
- assert got == text_bytes, f"Didnt get the correct result back - '{got!r}'."
+ assert got == text_bytes, f"Didn't get the correct result back - '{got!r}'."
finally:
CloseClipboard()
@@ -42,12 +42,12 @@ def TestText():
try:
# CF_UNICODE text always gives unicode objects back.
got = GetClipboardData(win32con.CF_UNICODETEXT)
- assert got == text, f"Didnt get the correct result back - '{got!r}'."
- assert isinstance(got, str), f"Didnt get the correct result back - '{got!r}'."
+ assert got == text, f"Didn't get the correct result back - '{got!r}'."
+ assert isinstance(got, str), f"Didn't get the correct result back - '{got!r}'."
# CF_OEMTEXT is a bytes-based format.
got = GetClipboardData(win32con.CF_OEMTEXT)
- assert got == text_bytes, f"Didnt get the correct result back - '{got!r}'."
+ assert got == text_bytes, f"Didn't get the correct result back - '{got!r}'."
# Unicode tests
EmptyClipboard()
@@ -57,8 +57,8 @@ def TestText():
SetClipboardData(win32con.CF_UNICODETEXT, text)
# Get it in Unicode.
got = GetClipboardData(win32con.CF_UNICODETEXT)
- assert got == text, f"Didnt get the correct result back - '{got!r}'."
- assert isinstance(got, str), f"Didnt get the correct result back - '{got!r}'."
+ assert got == text, f"Didn't get the correct result back - '{got!r}'."
+ assert isinstance(got, str), f"Didn't get the correct result back - '{got!r}'."
# Close and open the clipboard to ensure auto-conversions take place.
finally:
@@ -68,12 +68,12 @@ def TestText():
try:
# Make sure I can still get the text as bytes
got = GetClipboardData(win32con.CF_TEXT)
- assert got == text_bytes, f"Didnt get the correct result back - '{got!r}'."
+ assert got == text_bytes, f"Didn't get the correct result back - '{got!r}'."
# Make sure we get back the correct types.
got = GetClipboardData(win32con.CF_UNICODETEXT)
- assert isinstance(got, str), f"Didnt get the correct result back - '{got!r}'."
+ assert isinstance(got, str), f"Didn't get the correct result back - '{got!r}'."
got = GetClipboardData(win32con.CF_OEMTEXT)
- assert got == text_bytes, f"Didnt get the correct result back - '{got!r}'."
+ assert got == text_bytes, f"Didn't get the correct result back - '{got!r}'."
print("Clipboard text tests worked correctly")
finally:
CloseClipboard()
@@ -127,7 +127,7 @@ def TestCustomFormat():
# Now read it back.
data = GetClipboardData(fmt)
loaded_object = pickle.loads(data)
- assert pickle.loads(data) == pickled_object, "Didnt get the correct data!"
+ assert pickle.loads(data) == pickled_object, "Didn't get the correct data!"
print("Clipboard custom format tests worked correctly")
finally:
diff --git a/win32/Demos/win32comport_demo.py b/win32/Demos/win32comport_demo.py
index 2ee4c3c154..1596e41395 100644
--- a/win32/Demos/win32comport_demo.py
+++ b/win32/Demos/win32comport_demo.py
@@ -11,7 +11,7 @@
# This demo uses userlapped IO, so that none of the read or write operations actually block (however,
# in this sample, the very next thing we do _is_ block - so it shows off the concepts even though it
-# doesnt exploit them.
+# doesn't exploit them.
import msvcrt # For the getch() function.
import sys
diff --git a/win32/Demos/win32gui_dialog.py b/win32/Demos/win32gui_dialog.py
index 40ff8bbbe7..956265a25e 100644
--- a/win32/Demos/win32gui_dialog.py
+++ b/win32/Demos/win32gui_dialog.py
@@ -69,7 +69,7 @@ def toparam(self):
# alternate strategy would be to use unicode natively
# and use the 'W' version of the messages - eg,
# LVM_SETITEMW etc.
- val = val + "\0"
+ val += "\x00"
if isinstance(val, str):
val = val.encode("mbcs")
str_buf = array.array("b", val)
diff --git a/win32/Demos/win32netdemo.py b/win32/Demos/win32netdemo.py
index 35aecda2e5..ac5f305db5 100644
--- a/win32/Demos/win32netdemo.py
+++ b/win32/Demos/win32netdemo.py
@@ -59,7 +59,7 @@ def UserEnum():
)
for user in data:
verbose("Found user %s" % user["name"])
- nuser = nuser + 1
+ nuser += 1
if not resume:
break
assert nuser, "Could not find any users!"
@@ -82,12 +82,12 @@ def GroupEnum():
)
for member in memberdata:
verbose(" Member {name}".format(**member))
- nmembers = nmembers + 1
+ nmembers += 1
if memberresume == 0:
break
if not resume:
break
- assert nmembers, "Couldnt find a single member in a single group!"
+ assert nmembers, "Couldn't find a single member in a single group!"
print("Enumerated all the groups")
@@ -109,13 +109,13 @@ def LocalGroupEnum():
username, domain, type = win32security.LookupAccountSid(
server, member["sid"]
)
- nmembers = nmembers + 1
+ nmembers += 1
verbose(" Member {} ({})".format(username, member["domainandname"]))
if memberresume == 0:
break
if not resume:
break
- assert nmembers, "Couldnt find a single member in a single group!"
+ assert nmembers, "Couldn't find a single member in a single group!"
print("Enumerated all the local groups")
@@ -206,7 +206,7 @@ def SetInfo(userName=None):
def SetComputerInfo():
- "Doesnt actually change anything, just make sure we could ;-)"
+ "Doesn't actually change anything, just make sure we could ;-)"
info = win32net.NetWkstaGetInfo(None, 502)
# *sob* - but we can't! Why not!!!
# win32net.NetWkstaSetInfo(None, 502, info)
@@ -242,7 +242,7 @@ def main():
usage(tests)
if opt == "-v":
global verbose_level
- verbose_level = verbose_level + 1
+ verbose_level += 1
if opt == "-c":
create_user = True
diff --git a/win32/Demos/win32wnet/testwnet.py b/win32/Demos/win32wnet/testwnet.py
index ea18e4808c..d13917cf2f 100644
--- a/win32/Demos/win32wnet/testwnet.py
+++ b/win32/Demos/win32wnet/testwnet.py
@@ -113,7 +113,7 @@ def TestGetUser():
u = win32wnet.WNetGetUser()
print("Current global user is", repr(u))
if u != win32wnet.WNetGetUser(None):
- raise RuntimeError("Default value didnt seem to work!")
+ raise RuntimeError("Default value didn't seem to work!")
TestGetUser()
diff --git a/win32/Lib/pywin32_testutil.py b/win32/Lib/pywin32_testutil.py
index 4dc33d1ae8..d9e5179136 100644
--- a/win32/Lib/pywin32_testutil.py
+++ b/win32/Lib/pywin32_testutil.py
@@ -31,7 +31,7 @@ def __init__(self, real_test):
self.num_test_cases = 1
self.num_leak_iters = 2 # seems to be enough!
if hasattr(sys, "gettotalrefcount"):
- self.num_test_cases = self.num_test_cases + self.num_leak_iters
+ self.num_test_cases += self.num_leak_iters
def countTestCases(self):
return self.num_test_cases
@@ -61,7 +61,7 @@ def __call__(self, result=None):
result.addFailure(self.real_test, (exc.__class__, exc, None))
def runTest(self):
- assert 0, "not used"
+ raise NotImplementedError("not used")
def _do_leak_tests(self, result=None):
try:
diff --git a/win32/Lib/regcheck.py b/win32/Lib/regcheck.py
index 4bb2419aae..27aab3e5d6 100644
--- a/win32/Lib/regcheck.py
+++ b/win32/Lib/regcheck.py
@@ -77,7 +77,7 @@ def CheckPythonPaths(verbose):
else:
if verbose:
print("(empty)")
- keyNo = keyNo + 1
+ keyNo += 1
except win32api.error:
break
finally:
@@ -116,7 +116,7 @@ def CheckHelpFiles(verbose):
print(helpFile)
except OSError:
print("** Help file %s does not exist" % helpFile)
- keyNo = keyNo + 1
+ keyNo += 1
except win32api.error as exc:
import winerror
diff --git a/win32/Lib/regutil.py b/win32/Lib/regutil.py
index 9837637327..f85b06b224 100644
--- a/win32/Lib/regutil.py
+++ b/win32/Lib/regutil.py
@@ -76,7 +76,7 @@ def RegisterPythonExe(exeFullPath, exeAlias=None, exeAppPath=None):
of the filename is used.
exeAppPath -- Not supported.
"""
- # Note - Dont work on win32s (but we dont care anymore!)
+ # Note - Don't work on win32s (but we don't care anymore!)
if exeAppPath:
raise error("Do not support exeAppPath argument currently")
if exeAlias is None:
@@ -107,7 +107,7 @@ def RegisterNamedPath(name, path):
"""Register a named path - ie, a named PythonPath entry."""
keyStr = BuildDefaultPythonKey() + "\\PythonPath"
if name:
- keyStr = keyStr + "\\" + name
+ keyStr += "\\" + name
win32api.RegSetValue(GetRootKey(), keyStr, win32con.REG_SZ, path)
@@ -125,10 +125,10 @@ def UnregisterNamedPath(name):
def GetRegisteredNamedPath(name):
- """Get a registered named path, or None if it doesnt exist."""
+ """Get a registered named path, or None if it doesn't exist."""
keyStr = BuildDefaultPythonKey() + "\\PythonPath"
if name:
- keyStr = keyStr + "\\" + name
+ keyStr += "\\" + name
try:
return win32api.RegQueryValue(GetRootKey(), keyStr)
except win32api.error as exc:
diff --git a/win32/Lib/sspi.py b/win32/Lib/sspi.py
index 79afa58393..803559fba9 100644
--- a/win32/Lib/sspi.py
+++ b/win32/Lib/sspi.py
@@ -39,7 +39,7 @@ def _get_next_seq_num(self):
implementation is to increment a counter
"""
ret = self.next_seq_num
- self.next_seq_num = self.next_seq_num + 1
+ self.next_seq_num += 1
return ret
def encrypt(self, data):
diff --git a/win32/Lib/win32gui_struct.py b/win32/Lib/win32gui_struct.py
index 2725de0023..e87a55364f 100644
--- a/win32/Lib/win32gui_struct.py
+++ b/win32/Lib/win32gui_struct.py
@@ -80,9 +80,9 @@ def UnpackNMITEMACTIVATE(lparam):
if is64bit:
# the struct module doesn't handle this correctly as some of the items
# are actually structs in structs, which get individually aligned.
- format = format + "iiiiiiixxxxP"
+ format += "iiiiiiixxxxP"
else:
- format = format + "iiiiiiiP"
+ format += "iiiiiiiP"
buf = win32gui.PyMakeBuffer(struct.calcsize(format), lparam)
return _MakeResult(
"NMITEMACTIVATE hwndFrom idFrom code iItem iSubItem uNewState uOldState uChanged actionx actiony lParam",
@@ -522,10 +522,10 @@ def UnpackTVNOTIFY(lparam):
item_size = struct.calcsize(_tvitem_fmt)
format = _nmhdr_fmt + _nmhdr_align_padding
if is64bit:
- format = format + "ixxxx"
+ format += "ixxxx"
else:
- format = format + "i"
- format = format + "%ds%ds" % (item_size, item_size)
+ format += "i"
+ format += "%ds%ds" % (item_size, item_size)
buf = win32gui.PyGetMemory(lparam, struct.calcsize(format))
hwndFrom, id, code, action, buf_old, buf_new = struct.unpack(format, buf)
item_old = UnpackTVITEM(buf_old)
@@ -670,8 +670,8 @@ def UnpackLVDISPINFO(lparam):
def UnpackLVNOTIFY(lparam):
format = _nmhdr_fmt + _nmhdr_align_padding + "7i"
if is64bit:
- format = format + "xxxx" # point needs padding.
- format = format + "P"
+ format += "xxxx" # point needs padding.
+ format += "P"
buf = win32gui.PyGetMemory(lparam, struct.calcsize(format))
(
hwndFrom,
diff --git a/win32/Lib/win32pdhquery.py b/win32/Lib/win32pdhquery.py
index 71d77e03aa..3f458e0a88 100644
--- a/win32/Lib/win32pdhquery.py
+++ b/win32/Lib/win32pdhquery.py
@@ -443,7 +443,7 @@ def getinstpaths(
try:
while instances[cur + 1] == object:
temp.append(object)
- cur = cur + 1
+ cur += 1
except IndexError: # if we went over the end
pass
paths = []
diff --git a/win32/Lib/win32pdhutil.py b/win32/Lib/win32pdhutil.py
index 850e0ab89d..4b733ac3fb 100644
--- a/win32/Lib/win32pdhutil.py
+++ b/win32/Lib/win32pdhutil.py
@@ -103,7 +103,7 @@ def FindPerformanceAttributesByName(
instance_dict = {}
for instance in instances:
try:
- instance_dict[instance] = instance_dict[instance] + 1
+ instance_dict[instance] += 1
except KeyError:
instance_dict[instance] = 0
@@ -128,7 +128,7 @@ def ShowAllProcesses():
instance_dict = {}
for instance in instances:
try:
- instance_dict[instance] = instance_dict[instance] + 1
+ instance_dict[instance] += 1
except KeyError:
instance_dict[instance] = 0
diff --git a/win32/Lib/win32serviceutil.py b/win32/Lib/win32serviceutil.py
index 0552e5fc3f..2284536c3a 100644
--- a/win32/Lib/win32serviceutil.py
+++ b/win32/Lib/win32serviceutil.py
@@ -218,7 +218,7 @@ def InstallService(
startType = win32service.SERVICE_DEMAND_START
serviceType = win32service.SERVICE_WIN32_OWN_PROCESS
if bRunInteractive:
- serviceType = serviceType | win32service.SERVICE_INTERACTIVE_PROCESS
+ serviceType |= win32service.SERVICE_INTERACTIVE_PROCESS
if errorControl is None:
errorControl = win32service.SERVICE_ERROR_NORMAL
@@ -304,7 +304,7 @@ def ChangeServiceConfig(
hscm = win32service.OpenSCManager(None, None, win32service.SC_MANAGER_ALL_ACCESS)
serviceType = win32service.SERVICE_WIN32_OWN_PROCESS
if bRunInteractive:
- serviceType = serviceType | win32service.SERVICE_INTERACTIVE_PROCESS
+ serviceType |= win32service.SERVICE_INTERACTIVE_PROCESS
commandLine = _GetCommandLine(exeName, exeArgs)
try:
hs = SmartOpenService(hscm, serviceName, win32service.SERVICE_ALL_ACCESS)
@@ -452,7 +452,7 @@ def __FindSvcDeps(findName):
svc = win32api.RegEnumKey(k, num)
except win32api.error:
break
- num = num + 1
+ num += 1
sk = win32api.RegOpenKey(k, svc)
try:
deps, typ = win32api.RegQueryValueEx(sk, "DependOnService")
@@ -835,7 +835,7 @@ def HandleCommandLine(
# Note that we install the service before calling the custom option
# handler, so if the custom handler fails, we have an installed service (from NT's POV)
# but is unlikely to work, as the Python code controlling it failed. Therefore
- # we remove the service if the first bit works, but the second doesnt!
+ # we remove the service if the first bit works, but the second doesn't!
try:
InstallService(
serviceClassString,
@@ -981,11 +981,11 @@ def GetAcceptedControls(self):
# override this.
accepted = 0
if hasattr(self, "SvcStop"):
- accepted = accepted | win32service.SERVICE_ACCEPT_STOP
+ accepted |= win32service.SERVICE_ACCEPT_STOP
if hasattr(self, "SvcPause") and hasattr(self, "SvcContinue"):
- accepted = accepted | win32service.SERVICE_ACCEPT_PAUSE_CONTINUE
+ accepted |= win32service.SERVICE_ACCEPT_PAUSE_CONTINUE
if hasattr(self, "SvcShutdown"):
- accepted = accepted | win32service.SERVICE_ACCEPT_SHUTDOWN
+ accepted |= win32service.SERVICE_ACCEPT_SHUTDOWN
return accepted
def ReportServiceStatus(
@@ -1004,7 +1004,7 @@ def ReportServiceStatus(
]:
checkPoint = 0
else:
- self.checkPoint = self.checkPoint + 1
+ self.checkPoint += 1
checkPoint = self.checkPoint
# Now report the status to the control manager
diff --git a/win32/Lib/win32verstamp.py b/win32/Lib/win32verstamp.py
index a705c967fd..e9f8c5e45d 100644
--- a/win32/Lib/win32verstamp.py
+++ b/win32/Lib/win32verstamp.py
@@ -71,7 +71,7 @@ def String(key, value):
key = nullterm(key)
value = nullterm(value)
result = struct.pack("hh", len(value) // 2, 1) # wValueLength, wType
- result = result + key
+ result += key
result = pad32(result) + value
return addlen(result)
@@ -79,16 +79,16 @@ def String(key, value):
def StringTable(key, data):
key = nullterm(key)
result = struct.pack("hh", 0, 1) # wValueLength, wType
- result = result + key
+ result += key
for k, v in data.items():
- result = result + String(k, v)
+ result += String(k, v)
result = pad32(result)
return addlen(result)
def StringFileInfo(data):
result = struct.pack("hh", 0, 1) # wValueLength, wType
- result = result + nullterm("StringFileInfo")
+ result += nullterm("StringFileInfo")
# result = pad32(result) + StringTable('040904b0', data)
result = pad32(result) + StringTable("040904E4", data)
return addlen(result)
@@ -96,24 +96,24 @@ def StringFileInfo(data):
def Var(key, value):
result = struct.pack("hh", len(value), 0) # wValueLength, wType
- result = result + nullterm(key)
+ result += nullterm(key)
result = pad32(result) + value
return addlen(result)
def VarFileInfo(data):
result = struct.pack("hh", 0, 1) # wValueLength, wType
- result = result + nullterm("VarFileInfo")
+ result += nullterm("VarFileInfo")
result = pad32(result)
for k, v in data.items():
- result = result + Var(k, v)
+ result += Var(k, v)
return addlen(result)
def VS_VERSION_INFO(maj, min, sub, build, sdata, vdata, debug=0, is_dll=1):
ffi = VS_FIXEDFILEINFO(maj, min, sub, build, debug, is_dll)
result = struct.pack("hh", len(ffi), 0) # wValueLength, wType
- result = result + nullterm("VS_VERSION_INFO")
+ result += nullterm("VS_VERSION_INFO")
result = pad32(result) + ffi
result = pad32(result) + StringFileInfo(sdata) + VarFileInfo(vdata)
return addlen(result)
@@ -121,7 +121,7 @@ def VS_VERSION_INFO(maj, min, sub, build, sdata, vdata, debug=0, is_dll=1):
def stamp(pathname, options):
# For some reason, the API functions report success if the file is open
- # but doesnt work! Try and open the file for writing, just to see if it is
+ # but doesn't work! Try and open the file for writing, just to see if it is
# likely the stamp will work!
try:
f = open(pathname, "a+b")
diff --git a/win32/help/win32net.html b/win32/help/win32net.html
index 36e351b1f6..6d4d62e188 100644
--- a/win32/help/win32net.html
+++ b/win32/help/win32net.html
@@ -217,7 +217,7 @@
Selecting that link will show a number of different PySHARE_INFO
-structures; lets assume we want to use the PySHARE_INFO_2 structure.
+structures; let's assume we want to use the PySHARE_INFO_2 structure.
So do you create this PySHARE_INFO_2 Object? It is really quite simple:
diff --git a/win32/scripts/ControlService.py b/win32/scripts/ControlService.py
index d2281add2b..b4d35685ce 100644
--- a/win32/scripts/ControlService.py
+++ b/win32/scripts/ControlService.py
@@ -315,7 +315,7 @@ def ReloadData(self):
svc[0],
)
)
- i = i + 1
+ i += 1
if service and service[1] == svc[0]:
self.listCtrl.SetCurSel(pos)
diff --git a/win32/scripts/VersionStamp/bulkstamp.py b/win32/scripts/VersionStamp/bulkstamp.py
index 81f7cbcd53..3a039ebb81 100644
--- a/win32/scripts/VersionStamp/bulkstamp.py
+++ b/win32/scripts/VersionStamp/bulkstamp.py
@@ -63,7 +63,7 @@ def walk(arg, dirname, names):
desc = descriptions[os.path.normcase(name)]
try:
verstamp.stamp(vars, pathname, desc, is_dll=is_dll)
- numStamped = numStamped + 1
+ numStamped += 1
except win32api.error as exc:
print(
"Could not stamp",
diff --git a/win32/scripts/VersionStamp/vssutil.py b/win32/scripts/VersionStamp/vssutil.py
index ae9259c1a7..ca9d9e344b 100644
--- a/win32/scripts/VersionStamp/vssutil.py
+++ b/win32/scripts/VersionStamp/vssutil.py
@@ -74,14 +74,14 @@ def VssLog(project, linePrefix="", noLabels=5, maxItems=150):
num = 0
labelNum = 0
for i in project.GetVersions(constants.VSSFLAG_RECURSYES):
- num = num + 1
+ num += 1
if num > maxItems:
break
commentDesc = itemDesc = ""
if i.Action[:5] == "Added":
continue
if len(i.Label):
- labelNum = labelNum + 1
+ labelNum += 1
itemDesc = i.Action
else:
itemDesc = i.VSSItem.Name
@@ -110,7 +110,7 @@ def SubstituteVSSInFile(projectName, inName, outName):
if version.Label:
break
else:
- print("Couldnt find a label in the sourcesafe project!")
+ print("Couldn't find a label in the sourcesafe project!")
return
# Setup some local helpers for the conversion strings.
vss_label = version.Label
@@ -123,10 +123,10 @@ def CountCheckouts(item):
num = 0
if item.Type == constants.VSSITEM_PROJECT:
for sub in item.Items:
- num = num + CountCheckouts(sub)
+ num += CountCheckouts(sub)
else:
if item.IsCheckedOut:
- num = num + 1
+ num += 1
return num
@@ -165,7 +165,7 @@ def MakeNewBuildNo(project, buildDesc=None, auto=0, bRebrand=0):
try:
buildNo = int(buildNo)
if not bRebrand:
- buildNo = buildNo + 1
+ buildNo += 1
buildNo = str(buildNo)
except ValueError:
raise error("The previous label could not be incremented: %s" % (oldBuild))
diff --git a/win32/scripts/backupEventLog.py b/win32/scripts/backupEventLog.py
index 325da9da5f..2a4ea5024e 100644
--- a/win32/scripts/backupEventLog.py
+++ b/win32/scripts/backupEventLog.py
@@ -23,7 +23,7 @@ def BackupClearLog(logType):
os.stat(fname)
except OSError:
fileExists = 0
- retry = retry + 1
+ retry += 1
# OK - have unique file name.
try:
hlog = win32evtlog.OpenEventLog(None, logType)
diff --git a/win32/scripts/rasutil.py b/win32/scripts/rasutil.py
index 75426341f0..6eaa318875 100644
--- a/win32/scripts/rasutil.py
+++ b/win32/scripts/rasutil.py
@@ -42,7 +42,7 @@ def Connect(rasEntryName, numRetries=5):
break
print("Retrying...")
win32api.Sleep(5000)
- retryCount = retryCount - 1
+ retryCount -= 1
if errCode:
raise ConnectionError(errCode, win32ras.GetErrorString(errCode))
diff --git a/win32/src/PerfMon/PerfObjectType.cpp b/win32/src/PerfMon/PerfObjectType.cpp
index f6feb1732d..b496b99412 100644
--- a/win32/src/PerfMon/PerfObjectType.cpp
+++ b/win32/src/PerfMon/PerfObjectType.cpp
@@ -129,7 +129,7 @@ void PyPERF_OBJECT_TYPE::Term()
m_obPerfMonManager = NULL;
}
-// Get the counter objects that Im gunna use.
+// Get the counter objects that I'm gunna use.
BOOL PyPERF_OBJECT_TYPE::InitPythonObjects(PyObject *obCounters)
{
m_obCounters = obCounters;
@@ -138,8 +138,8 @@ BOOL PyPERF_OBJECT_TYPE::InitPythonObjects(PyObject *obCounters)
}
// Init the memory layout of the win32 perfmon structures from the mapping manager.
-// Doesnt keep a reference to the mapping manager, but assumes it will stay alive
-// until Im term'd!
+// Doesn't keep a reference to the mapping manager, but assumes it will stay alive
+// until I'm term'd!
// Also _removes_ the reference to the counters' and _adds_ a reference to
// the PyPerMonManager object
BOOL PyPERF_OBJECT_TYPE::InitMemoryLayout(MappingManager *pmm, PyPerfMonManager *obPerfMonManager)
diff --git a/win32/src/PerfMon/PyPerfMonControl.h b/win32/src/PerfMon/PyPerfMonControl.h
index e3b0a358ce..8a450683ea 100644
--- a/win32/src/PerfMon/PyPerfMonControl.h
+++ b/win32/src/PerfMon/PyPerfMonControl.h
@@ -5,7 +5,7 @@
// A PERF_OBJECT_TYPE
// A number of PERF_COUNTER_DEFINITIONs
-// dont manage these size better cos I cant be bothered!
+// don't manage these size better cos I can't be bothered!
const int MMCD_SERVICE_SIZE = 25;
const int MMCD_EVENTSOURCE_SIZE = 25;
diff --git a/win32/src/PerfMon/perfmondata.cpp b/win32/src/PerfMon/perfmondata.cpp
index 995b856bc4..0533879961 100644
--- a/win32/src/PerfMon/perfmondata.cpp
+++ b/win32/src/PerfMon/perfmondata.cpp
@@ -24,7 +24,7 @@
// LOG_DEBUG = Minimum Debugging
// LOG_VERBOSE = Maximum Debugging
-//#define LOG_NONE 0
+// #define LOG_NONE 0
#define LOG_USER 1
#define LOG_DEBUG 2
#define LOG_VERBOSE 3
@@ -171,7 +171,7 @@ DWORD APIENTRY OpenPerformanceData(LPWSTR lpDeviceNames)
if (!dwOpenCount) { // open Eventlog interface
// The memmapped file name is derived from the DLL name.
// Later we may offer to look up a string resource, but not now!
- // NOTE - We dont open the event log yet, as we may wish to open it with a custom name
+ // NOTE - We don't open the event log yet, as we may wish to open it with a custom name
// open shared memory used by application to pass performance values
hSharedMemory = OpenFileMapping(FILE_MAP_READ, FALSE, szFileMapping);
diff --git a/win32/src/PyACL.cpp b/win32/src/PyACL.cpp
index 304b2083c1..fb2ec35308 100644
--- a/win32/src/PyACL.cpp
+++ b/win32/src/PyACL.cpp
@@ -727,7 +727,7 @@ PyObject *PyACL::AddAuditAccessAce(PyObject *self, PyObject *args)
unsigned int required_size = psacl->AclSize + sizeof(SYSTEM_AUDIT_ACE) + GetLengthSid(psid);
// max ACL size is USHRT_MAX
if (required_size > USHRT_MAX)
- return PyErr_Format(PyExc_OverflowError, "%s: adding ACE would put ACL over size limit", __FUNCTION__ );
+ return PyErr_Format(PyExc_OverflowError, "%s: adding ACE would put ACL over size limit", __FUNCTION__);
psacl_padded = (ACL *)malloc(required_size);
if (psacl_padded == NULL)
return PyErr_Format(PyExc_MemoryError, "AddAuditAccessAce: unable to allocated %d bytes", required_size);
@@ -789,7 +789,7 @@ PyObject *PyACL::AddAuditAccessAceEx(PyObject *self, PyObject *args)
unsigned int required_size = psacl->AclSize + sizeof(SYSTEM_AUDIT_ACE) + GetLengthSid(psid);
// max ACL size is USHRT_MAX
if (required_size > USHRT_MAX)
- return PyErr_Format(PyExc_OverflowError, "%s: adding ACE would put ACL over size limit", __FUNCTION__ );
+ return PyErr_Format(PyExc_OverflowError, "%s: adding ACE would put ACL over size limit", __FUNCTION__);
psacl_padded = (ACL *)malloc(required_size);
if (psacl_padded == NULL)
return PyErr_Format(PyExc_MemoryError, "AddAuditAccessAceEx: unable to allocated %d bytes", required_size);
@@ -867,10 +867,10 @@ PyObject *PyACL::AddAuditAccessObjectAce(PyObject *self, PyObject *args)
if (err != ERROR_ALLOTTED_SPACE_EXCEEDED)
return PyWin_SetAPIError("AddAuditAccessObjectAce", err);
// resize if acl too small
- unsigned int required_size = psacl->AclSize + sizeof(SYSTEM_AUDIT_OBJECT_ACE) + GetLengthSid(psid);
+ unsigned int required_size = psacl->AclSize + sizeof(SYSTEM_AUDIT_OBJECT_ACE) + GetLengthSid(psid);
// max ACL size is USHRT_MAX
if (required_size > USHRT_MAX)
- return PyErr_Format(PyExc_OverflowError, "%s: adding ACE would put ACL over size limit", __FUNCTION__ );
+ return PyErr_Format(PyExc_OverflowError, "%s: adding ACE would put ACL over size limit", __FUNCTION__);
psacl_padded = (ACL *)malloc(required_size);
if (psacl_padded == NULL)
return PyErr_Format(PyExc_MemoryError, "AddAuditAccessObjectAce: unable to allocated %d bytes",
diff --git a/win32/src/PyHANDLE.cpp b/win32/src/PyHANDLE.cpp
index 4fdad48f06..c1baf754f6 100644
--- a/win32/src/PyHANDLE.cpp
+++ b/win32/src/PyHANDLE.cpp
@@ -111,9 +111,9 @@ struct PyMethodDef PyHANDLE::methods[] = {
{NULL}};
static PyNumberMethods PyHANDLE_NumberMethods = {
- PyHANDLE::binaryFailureFunc, /* nb_add */
- PyHANDLE::binaryFailureFunc, /* nb_subtract */
- PyHANDLE::binaryFailureFunc, /* nb_multiply */
+ PyHANDLE::binaryFailureFunc, /* nb_add */
+ PyHANDLE::binaryFailureFunc, /* nb_subtract */
+ PyHANDLE::binaryFailureFunc, /* nb_multiply */
PyHANDLE::binaryFailureFunc, /* nb_remainder */
PyHANDLE::binaryFailureFunc, /* nb_divmod */
PyHANDLE::ternaryFailureFunc, /* nb_power */
@@ -128,23 +128,22 @@ static PyNumberMethods PyHANDLE_NumberMethods = {
PyHANDLE::binaryFailureFunc, /* nb_and */
PyHANDLE::binaryFailureFunc, /* nb_xor */
PyHANDLE::binaryFailureFunc, /* nb_or */
- PyHANDLE::intFunc, /* nb_int */
- PyHANDLE::longFunc, /* nb_long */
- PyHANDLE::unaryFailureFunc, /* nb_float */
- // These removed in 3.0
+ PyHANDLE::intFunc, /* nb_int */
+ PyHANDLE::longFunc, /* nb_long */
+ PyHANDLE::unaryFailureFunc, /* nb_float */
+ // These removed in 3.0
};
// @pymeth __int__|Used when an integer representation of the handle object is required.
PYWINTYPES_EXPORT PyTypeObject PyHANDLEType = {
PYWIN_OBJECT_HEAD "PyHANDLE", sizeof(PyHANDLE), 0, PyHANDLE::deallocFunc, /* tp_dealloc */
- 0,
- 0, /* tp_getattr */
- 0, /* tp_setattr */
- 0, /* tp_compare */
- PyHANDLE::strFunc, /* tp_repr */
- &PyHANDLE_NumberMethods, /* tp_as_number */
- 0, /* tp_as_sequence */
- 0, /* tp_as_mapping */
+ 0, 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_compare */
+ PyHANDLE::strFunc, /* tp_repr */
+ &PyHANDLE_NumberMethods, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
// @pymeth __hash__|Used when the hash value of an object is required
PyHANDLE::hashFunc, /* tp_hash */
0, /* tp_call */
@@ -301,7 +300,7 @@ int PyHANDLE::print(FILE *fp, int flags)
// ### runtime library) Hack it by getting Python to do the print!
//
// ### - Double Ack - Always use the hack!
- //#ifdef _DEBUG
+ // #ifdef _DEBUG
PyObject *ob = PyWinCoreString_FromString(resBuf);
PyObject_Print(ob, fp, flags | Py_PRINT_RAW);
Py_DECREF(ob);
diff --git a/win32/src/PySID.cpp b/win32/src/PySID.cpp
index fcb5215e22..e7d8da1463 100644
--- a/win32/src/PySID.cpp
+++ b/win32/src/PySID.cpp
@@ -53,7 +53,7 @@ PyObject *PyWinMethod_NewSID(PyObject *self, PyObject *args)
return new PySID(pNew);
}
}
- if (bufSize > INT_MAX) {
+ if (bufSize > INT_MAX) {
PyErr_SetString(PyExc_ValueError, "SID buffer size beyond INT_MAX");
return NULL;
}
diff --git a/win32/src/PyTime.cpp b/win32/src/PyTime.cpp
index de0c32cda4..502ed8787a 100644
--- a/win32/src/PyTime.cpp
+++ b/win32/src/PyTime.cpp
@@ -18,11 +18,7 @@ const double ONETHOUSANDMILLISECONDS = 0.00001157407407407407407407407407;
PyObject *PyWin_NewTime(PyObject *timeOb);
-BOOL PyWinTime_Check(PyObject *ob)
-{
- return PyDateTime_Check(ob) ||
- PyObject_HasAttrString(ob, "timetuple");
-}
+BOOL PyWinTime_Check(PyObject *ob) { return PyDateTime_Check(ob) || PyObject_HasAttrString(ob, "timetuple"); }
// Timezone helpers...
// Returns a timezone object representing UTC. Implementation currently
@@ -155,7 +151,7 @@ PyTypeObject PyWinDateTimeType = {
PyWinDateTimeType_methods, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
- // we fill tp_base in at runtime; its not available statically.
+ // we fill tp_base in at runtime; it's not available statically.
0, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
@@ -264,190 +260,190 @@ static WORD SequenceIndexAsWORD(PyObject *seq, int index)
PyObject *PyWin_NewTime(PyObject *timeOb)
{
// If it already a datetime object, just return it as-is.
- if (PyDateTime_Check(timeOb)) {
- Py_INCREF(timeOb);
- return timeOb;
- }
-
- PyObject *result = NULL;
- PyObject *cleanupOb = NULL; // must be xdefref'd.
+ if (PyDateTime_Check(timeOb)) {
+ Py_INCREF(timeOb);
+ return timeOb;
+ }
- // Support other objects with a "timetuple" method.
- PyObject *method = PyObject_GetAttrString(timeOb, "timetuple");
- if (method == NULL)
- PyErr_Clear();
- else {
- timeOb = PyEval_CallObject(method, NULL);
- Py_DECREF(method);
- if (!timeOb)
- return NULL;
- cleanupOb = timeOb; // new reference that must be nuked.
- // now we should fall into the sequence check!
- }
- if (PyNumber_Check(timeOb)) {
- PyObject *longob = PyNumber_Long(timeOb);
- if (longob) {
- long t = PyLong_AsLong(longob);
- if (t == -1) {
- if (!PyErr_Occurred())
- PyErr_BadArgument();
- }
- else
- result = PyWinTimeObject_Fromtime_t(t);
- Py_DECREF(longob);
- }
- }
- else if (PySequence_Check(timeOb)) {
- assert(!PyErr_Occurred()); // should be no stale errors!
- // convert a timetuple, with optional millisecond extension,
- // into a datetime object. ie:
- // >>> datetime.datetime.fromtimestamp(time.mktime(timetuple))
- // but we 'inline' the time.mktime step...
- struct tm buf;
- time_t tt;
- int millisec = 0;
- // must use a tuple as we use ParseTuple with an optional arg.
- PyObject *tuple_args = PySequence_Tuple(timeOb);
- if (!tuple_args)
- return NULL;
- BOOL ok = gettmarg(tuple_args, &buf, &millisec);
- Py_DECREF(tuple_args);
- if (!ok)
- return NULL;
- tt = mktime(&buf);
- if (tt == (time_t)(-1)) {
- PyErr_SetString(PyExc_OverflowError, "mktime argument out of range");
- return NULL;
+ PyObject *result = NULL;
+ PyObject *cleanupOb = NULL; // must be xdefref'd.
+
+ // Support other objects with a "timetuple" method.
+ PyObject *method = PyObject_GetAttrString(timeOb, "timetuple");
+ if (method == NULL)
+ PyErr_Clear();
+ else {
+ timeOb = PyEval_CallObject(method, NULL);
+ Py_DECREF(method);
+ if (!timeOb)
+ return NULL;
+ cleanupOb = timeOb; // new reference that must be nuked.
+ // now we should fall into the sequence check!
+ }
+ if (PyNumber_Check(timeOb)) {
+ PyObject *longob = PyNumber_Long(timeOb);
+ if (longob) {
+ long t = PyLong_AsLong(longob);
+ if (t == -1) {
+ if (!PyErr_Occurred())
+ PyErr_BadArgument();
}
- double dval = (double)tt + (millisec / 1000.0);
- PyObject *args = Py_BuildValue("(d)", dval);
- if (!args)
- return NULL;
- result = PyDateTimeAPI->DateTime_FromTimestamp((PyObject *)(&PyWinDateTimeType), args, NULL);
- Py_DECREF(args);
+ else
+ result = PyWinTimeObject_Fromtime_t(t);
+ Py_DECREF(longob);
}
- else
- // result stays NULL.
- PyErr_Format(PyExc_TypeError, "Objects of type '%s' can not be used as a time object",
- timeOb->ob_type->tp_name);
- Py_XDECREF(cleanupOb);
- return result;
}
-
- PyObject *PyWinObject_FromSYSTEMTIME(const SYSTEMTIME &t)
- {
- // SYSTEMTIME structures explicitly use UTC.
- PyObject *obtz = GetTZUTC();
- if (!obtz)
+ else if (PySequence_Check(timeOb)) {
+ assert(!PyErr_Occurred()); // should be no stale errors!
+ // convert a timetuple, with optional millisecond extension,
+ // into a datetime object. ie:
+ // >>> datetime.datetime.fromtimestamp(time.mktime(timetuple))
+ // but we 'inline' the time.mktime step...
+ struct tm buf;
+ time_t tt;
+ int millisec = 0;
+ // must use a tuple as we use ParseTuple with an optional arg.
+ PyObject *tuple_args = PySequence_Tuple(timeOb);
+ if (!tuple_args)
+ return NULL;
+ BOOL ok = gettmarg(tuple_args, &buf, &millisec);
+ Py_DECREF(tuple_args);
+ if (!ok)
+ return NULL;
+ tt = mktime(&buf);
+ if (tt == (time_t)(-1)) {
+ PyErr_SetString(PyExc_OverflowError, "mktime argument out of range");
return NULL;
- // If the value is larger than the datetime module can handle, we return
- // the max datetime value.
- PyObject *ret;
- if (t.wYear > 9999) { // sadly this constant isn't exposed.
- ret = PyObject_GetAttrString((PyObject *)PyDateTimeAPI->DateTimeType, "max");
- }
- else {
- ret = PyDateTimeAPI->DateTime_FromDateAndTime(t.wYear, t.wMonth, t.wDay, t.wHour, t.wMinute, t.wSecond,
- t.wMilliseconds * 1000, obtz, &PyWinDateTimeType);
}
- Py_DECREF(obtz);
- return ret;
+ double dval = (double)tt + (millisec / 1000.0);
+ PyObject *args = Py_BuildValue("(d)", dval);
+ if (!args)
+ return NULL;
+ result = PyDateTimeAPI->DateTime_FromTimestamp((PyObject *)(&PyWinDateTimeType), args, NULL);
+ Py_DECREF(args);
}
+ else
+ // result stays NULL.
+ PyErr_Format(PyExc_TypeError, "Objects of type '%s' can not be used as a time object",
+ timeOb->ob_type->tp_name);
+ Py_XDECREF(cleanupOb);
+ return result;
+}
- PyObject *PyWinObject_FromFILETIME(const FILETIME &t)
- {
- // XXX - We should create a datetime object using the localtz here,
- // but for now we only have a utc tz available, so convert to a
- // systemtime and go from there.
- SYSTEMTIME st;
- if (!FileTimeToSystemTime(&t, &st))
- return PyWin_SetAPIError("FileTimeToSystemTime");
- return PyWinObject_FromSYSTEMTIME(st);
+PyObject *PyWinObject_FromSYSTEMTIME(const SYSTEMTIME &t)
+{
+ // SYSTEMTIME structures explicitly use UTC.
+ PyObject *obtz = GetTZUTC();
+ if (!obtz)
+ return NULL;
+ // If the value is larger than the datetime module can handle, we return
+ // the max datetime value.
+ PyObject *ret;
+ if (t.wYear > 9999) { // sadly this constant isn't exposed.
+ ret = PyObject_GetAttrString((PyObject *)PyDateTimeAPI->DateTimeType, "max");
}
-
- static double round(double Value, int Digits)
- {
- assert(Digits >= -4 && Digits <= 4);
- int Idx = Digits + 4;
- double v[] = {1e-4, 1e-3, 1e-2, 1e-1, 1, 10, 1e2, 1e3, 1e4};
- return floor(Value * v[Idx] + 0.5) / (v[Idx]);
+ else {
+ ret = PyDateTimeAPI->DateTime_FromDateAndTime(t.wYear, t.wMonth, t.wDay, t.wHour, t.wMinute, t.wSecond,
+ t.wMilliseconds * 1000, obtz, &PyWinDateTimeType);
}
+ Py_DECREF(obtz);
+ return ret;
+}
- PyObject *PyWinObject_FromDATE(DATE t)
- {
- // via https://www.codeproject.com/Articles/17576/SystemTime-to-VariantTime-with-Milliseconds
- // (in particular, see the comments)
- double fraction = t - (int)t; // extracts the fraction part
- double hours = (fraction - (int)fraction) * 24.0;
- double minutes = (hours - (int)hours) * 60.0;
- double seconds = round((minutes - (int)minutes) * 60.0, 4);
- double milliseconds = round((seconds - (int)seconds) * 1000.0, 0);
- // Strip off the msec part of time
- double TimeWithoutMsecs = t - (ONETHOUSANDMILLISECONDS / 1000.0 * milliseconds);
-
- // We might have rounded ms to 1000 which blows up datetime. Round up
- // to the next second.
- if (milliseconds >= 1000) {
- TimeWithoutMsecs += ONETHOUSANDMILLISECONDS;
- milliseconds = 0;
- }
+PyObject *PyWinObject_FromFILETIME(const FILETIME &t)
+{
+ // XXX - We should create a datetime object using the localtz here,
+ // but for now we only have a utc tz available, so convert to a
+ // systemtime and go from there.
+ SYSTEMTIME st;
+ if (!FileTimeToSystemTime(&t, &st))
+ return PyWin_SetAPIError("FileTimeToSystemTime");
+ return PyWinObject_FromSYSTEMTIME(st);
+}
- // Let the OS translate the variant date/time
- SYSTEMTIME st;
- if (!VariantTimeToSystemTime(TimeWithoutMsecs, &st)) {
- return PyWin_SetAPIError("VariantTimeToSystemTime");
- }
- if (milliseconds > 0.0) {
- // add the msec part to the systemtime object
- st.wMilliseconds = (WORD)milliseconds;
- }
- return PyWinObject_FromSYSTEMTIME(st);
- }
+static double round(double Value, int Digits)
+{
+ assert(Digits >= -4 && Digits <= 4);
+ int Idx = Digits + 4;
+ double v[] = {1e-4, 1e-3, 1e-2, 1e-1, 1, 10, 1e2, 1e3, 1e4};
+ return floor(Value * v[Idx] + 0.5) / (v[Idx]);
+}
- PyObject *PyWinTimeObject_Fromtime_t(time_t t)
- {
- PyObject *args = Py_BuildValue("(i)", (int)t);
- if (!args)
- return NULL;
- PyObject *ret = PyDateTimeAPI->DateTime_FromTimestamp((PyObject *)(&PyWinDateTimeType), args, NULL);
- if (ret == NULL) {
- // datetime throws an OSError on failure, but for compatibility with
- // Python 2, we turn that into a ValueError.
- PyErr_Clear();
- PyErr_SetString(PyExc_ValueError, "invalid timestamp");
- }
- Py_DECREF(args);
- return ret;
+PyObject *PyWinObject_FromDATE(DATE t)
+{
+ // via https://www.codeproject.com/Articles/17576/SystemTime-to-VariantTime-with-Milliseconds
+ // (in particular, see the comments)
+ double fraction = t - (int)t; // extracts the fraction part
+ double hours = (fraction - (int)fraction) * 24.0;
+ double minutes = (hours - (int)hours) * 60.0;
+ double seconds = round((minutes - (int)minutes) * 60.0, 4);
+ double milliseconds = round((seconds - (int)seconds) * 1000.0, 0);
+ // Strip off the msec part of time
+ double TimeWithoutMsecs = t - (ONETHOUSANDMILLISECONDS / 1000.0 * milliseconds);
+
+ // We might have rounded ms to 1000 which blows up datetime. Round up
+ // to the next second.
+ if (milliseconds >= 1000) {
+ TimeWithoutMsecs += ONETHOUSANDMILLISECONDS;
+ milliseconds = 0;
}
- // Converts a TimeStamp, which is in 100 nanosecond units like a FILETIME
- // See comments in pywintypes.h re LARGE_INTEGER vs TimeStamp
- PyObject *PyWinObject_FromTimeStamp(const LARGE_INTEGER &ts)
- {
- FILETIME ft;
- ft.dwHighDateTime = ts.HighPart;
- ft.dwLowDateTime = ts.LowPart;
- return PyWinObject_FromFILETIME(ft);
+ // Let the OS translate the variant date/time
+ SYSTEMTIME st;
+ if (!VariantTimeToSystemTime(TimeWithoutMsecs, &st)) {
+ return PyWin_SetAPIError("VariantTimeToSystemTime");
}
-
- // A couple of public functions used by the module init
- BOOL _PyWinDateTime_Init()
- {
- PyDateTime_IMPORT;
- if (!PyDateTimeAPI)
- return NULL;
- PyWinDateTimeType.tp_base = PyDateTimeAPI->DateTimeType;
- PyWinDateTimeType.tp_basicsize = PyDateTimeAPI->DateTimeType->tp_basicsize;
- PyWinDateTimeType.tp_new = PyDateTimeAPI->DateTimeType->tp_new;
- PyWinDateTimeType.tp_dealloc = PyDateTimeAPI->DateTimeType->tp_dealloc;
- if (PyType_Ready(&PyWinDateTimeType) == -1)
- return FALSE;
- return TRUE;
+ if (milliseconds > 0.0) {
+ // add the msec part to the systemtime object
+ st.wMilliseconds = (WORD)milliseconds;
}
+ return PyWinObject_FromSYSTEMTIME(st);
+}
- BOOL _PyWinDateTime_PrepareModuleDict(PyObject * dict)
- {
- if (PyDict_SetItemString(dict, "TimeType", (PyObject *)&PyWinDateTimeType) == -1)
- return FALSE;
- return TRUE;
+PyObject *PyWinTimeObject_Fromtime_t(time_t t)
+{
+ PyObject *args = Py_BuildValue("(i)", (int)t);
+ if (!args)
+ return NULL;
+ PyObject *ret = PyDateTimeAPI->DateTime_FromTimestamp((PyObject *)(&PyWinDateTimeType), args, NULL);
+ if (ret == NULL) {
+ // datetime throws an OSError on failure, but for compatibility with
+ // Python 2, we turn that into a ValueError.
+ PyErr_Clear();
+ PyErr_SetString(PyExc_ValueError, "invalid timestamp");
}
+ Py_DECREF(args);
+ return ret;
+}
+
+// Converts a TimeStamp, which is in 100 nanosecond units like a FILETIME
+// See comments in pywintypes.h re LARGE_INTEGER vs TimeStamp
+PyObject *PyWinObject_FromTimeStamp(const LARGE_INTEGER &ts)
+{
+ FILETIME ft;
+ ft.dwHighDateTime = ts.HighPart;
+ ft.dwLowDateTime = ts.LowPart;
+ return PyWinObject_FromFILETIME(ft);
+}
+
+// A couple of public functions used by the module init
+BOOL _PyWinDateTime_Init()
+{
+ PyDateTime_IMPORT;
+ if (!PyDateTimeAPI)
+ return NULL;
+ PyWinDateTimeType.tp_base = PyDateTimeAPI->DateTimeType;
+ PyWinDateTimeType.tp_basicsize = PyDateTimeAPI->DateTimeType->tp_basicsize;
+ PyWinDateTimeType.tp_new = PyDateTimeAPI->DateTimeType->tp_new;
+ PyWinDateTimeType.tp_dealloc = PyDateTimeAPI->DateTimeType->tp_dealloc;
+ if (PyType_Ready(&PyWinDateTimeType) == -1)
+ return FALSE;
+ return TRUE;
+}
+
+BOOL _PyWinDateTime_PrepareModuleDict(PyObject *dict)
+{
+ if (PyDict_SetItemString(dict, "TimeType", (PyObject *)&PyWinDateTimeType) == -1)
+ return FALSE;
+ return TRUE;
+}
diff --git a/win32/src/PyUnicode.cpp b/win32/src/PyUnicode.cpp
index 5bb7b084dc..b7382401ed 100644
--- a/win32/src/PyUnicode.cpp
+++ b/win32/src/PyUnicode.cpp
@@ -21,12 +21,12 @@ BOOL PyWinObject_AsPfnAllocatedWCHAR(PyObject *stringObject, void *(*pfnAllocato
if (buf == NULL)
return FALSE;
- /* We assume that we dont need more 'wide characters' for the result
+ /* We assume that we don't need more 'wide characters' for the result
then the number of bytes in the input. Often we
will need less, as the input may contain multi-byte chars, but we
should never need more
*/
- PYWIN_CHECK_SSIZE_DWORD(cch+1, FALSE);
+ PYWIN_CHECK_SSIZE_DWORD(cch + 1, FALSE);
*ppResult = (LPWSTR)(*pfnAllocator)((cch + 1) * sizeof(WCHAR));
if (*ppResult)
/* convert and get the final character size */
@@ -34,7 +34,9 @@ BOOL PyWinObject_AsPfnAllocatedWCHAR(PyObject *stringObject, void *(*pfnAllocato
}
else if (PyUnicode_Check(stringObject)) {
// copy the value, including embedded NULLs
- TmpWCHAR v = stringObject; if (!v) return FALSE;
+ TmpWCHAR v = stringObject;
+ if (!v)
+ return FALSE;
Py_ssize_t cch = v.length;
*ppResult = (WCHAR *)pfnAllocator((cch + 1) * sizeof(WCHAR));
if (*ppResult)
@@ -182,7 +184,9 @@ BOOL PyWinObject_AsBstr(PyObject *stringObject, BSTR *pResult, BOOL bNoneOK /*=
// copy the value, including embedded NULLs
// Py3.12+: only conversion yields the correct number of wide chars (incl. surrogate pairs).
// For simplicity we use a temp buffer.
- TmpWCHAR tw = stringObject; if (!tw) return FALSE;
+ TmpWCHAR tw = stringObject;
+ if (!tw)
+ return FALSE;
PYWIN_CHECK_SSIZE_DWORD(tw.length, NULL);
// SysAllocStringLen allocates length+1 wchars (and puts a \0 at end); like PyUnicode_AsWideCharString
*pResult = SysAllocStringLen(tw, (UINT)tw.length);
diff --git a/win32/src/PyWinTypes.h b/win32/src/PyWinTypes.h
index b45184cf2e..620aada9c1 100644
--- a/win32/src/PyWinTypes.h
+++ b/win32/src/PyWinTypes.h
@@ -127,14 +127,12 @@ PYWINTYPES_EXPORT PyObject *PyWin_SetBasicCOMError(HRESULT hr);
// (We also use this for UINT and ULONG, all of which are 32bit unsigned ints.)
// Sometimes we need to downcast from a ssize_t to a DWORD
-inline bool PyWin_is_ssize_dword(Py_ssize_t val) {
- return val <= MAXDWORD;
-}
+inline bool PyWin_is_ssize_dword(Py_ssize_t val) { return val <= MAXDWORD; }
-#define PYWIN_CHECK_SSIZE_DWORD(val, failResult) \
- if (!PyWin_is_ssize_dword(val)) { \
+#define PYWIN_CHECK_SSIZE_DWORD(val, failResult) \
+ if (!PyWin_is_ssize_dword(val)) { \
PyErr_SetString(PyExc_ValueError, "value is larger than a DWORD"); \
- return failResult; \
+ return failResult; \
}
// Almost all of these are roughly identical! But start with BSTR
@@ -171,7 +169,7 @@ PYWINTYPES_EXPORT void PyWinObject_FreeChars(char *pResult);
// Automatically freed WCHAR that can be used anywhere WCHAR * is required
class TmpWCHAR {
public:
- WCHAR *tmp; // (NULL after conversion error)
+ WCHAR *tmp; // (NULL after conversion error)
Py_ssize_t length; // only set after successful auto-conversion; w/o trailing \0
PyObject *u; // auxiliary slot for u2w()
@@ -179,7 +177,8 @@ class TmpWCHAR {
TmpWCHAR(WCHAR *t) { tmp = t; }
TmpWCHAR(PyObject *ob) : tmp(NULL) { *this = ob; }
WCHAR *u2w() { return *this = u; }
- WCHAR *operator=(PyObject *ob) {
+ WCHAR *operator=(PyObject *ob)
+ {
if (tmp)
PyMem_Free(tmp);
if (ob == NULL)
@@ -198,11 +197,16 @@ class TmpWCHAR {
WCHAR **operator&() { return &tmp; }
boolean operator==(WCHAR *t) { return tmp == t; }
operator WCHAR *() { return tmp; }
- ~TmpWCHAR() { if (tmp) PyMem_Free(tmp); }
+ ~TmpWCHAR()
+ {
+ if (tmp)
+ PyMem_Free(tmp);
+ }
+
private:
// Block unwanted copy construction
- TmpWCHAR(const TmpWCHAR& o); // = delete;
- const TmpWCHAR& operator=(const TmpWCHAR& o); // = delete;
+ TmpWCHAR(const TmpWCHAR &o); // = delete;
+ const TmpWCHAR &operator=(const TmpWCHAR &o); // = delete;
};
// More string helpers - how many do we need?
@@ -251,35 +255,35 @@ PYWINTYPES_EXPORT BOOL PyWinObject_AsCharArray(PyObject *str_seq, char ***pchars
// Bytes/Buffer helpers.
// replacement for PyWinObject_AsReadBuffer and PyWinObject_AsWriteBuffer
-class PYWINTYPES_EXPORT PyWinBufferView
-{
-public:
+class PYWINTYPES_EXPORT PyWinBufferView {
+ public:
PyWinBufferView() { m_view.obj = NULL; }
- PyWinBufferView(PyObject *ob, bool bWrite = false, bool bNoneOk = false) {
+ PyWinBufferView(PyObject *ob, bool bWrite = false, bool bNoneOk = false)
+ {
m_view.obj = NULL;
init(ob, bWrite, bNoneOk);
}
~PyWinBufferView() { release(); }
bool init(PyObject *ob, bool bWrite = false, bool bNoneOk = false);
- void release() {
+ void release()
+ {
if (m_view.obj != NULL && m_view.obj != Py_None) {
PyBuffer_Release(&m_view); // sets view->obj = NULL
}
}
bool ok() { return m_view.obj != NULL; }
- void* ptr() { return m_view.buf; }
+ void *ptr() { return m_view.buf; }
DWORD len() { return static_cast(m_view.len); }
-private:
+ private:
Py_buffer m_view;
// don't copy objects and don't use C++ >= 11 -> not implemented private
// copy ctor and assignment operator
- PyWinBufferView(const PyWinBufferView& src);
- PyWinBufferView& operator=(PyWinBufferView const &);
+ PyWinBufferView(const PyWinBufferView &src);
+ PyWinBufferView &operator=(PyWinBufferView const &);
};
-
// For 64-bit python compatibility, convert sequence to tuple and check length fits in a DWORD
PYWINTYPES_EXPORT PyObject *PyWinSequence_Tuple(PyObject *obseq, DWORD *len);
@@ -399,34 +403,36 @@ PYWINTYPES_EXPORT void PyWinObject_FreeResourceId(WCHAR *resource_id);
// Auto-freed WPARAM / LPARAM which ensure any memory referenced remains valid when a String or
// Buffer object is used. Make sure the destructor is called with the GIL held.
class PyWin_PARAMHolder {
- protected:
+ protected:
WPARAM _pa;
// Holds *either* a PyWinBufferView (which will auto-free) *or* a "void *" that we
// will auto-free.
void *_pymem;
- void _free() {
+ void _free()
+ {
if (_pymem) {
PyMem_Free(_pymem);
_pymem = NULL;
}
}
- public:
+
+ public:
PyWinBufferView bufferView;
- PyWin_PARAMHolder(WPARAM t=0):_pa(t),_pymem(NULL) {}
- ~PyWin_PARAMHolder() {
- _free();
- }
- WCHAR *set_allocated(WCHAR *t) {
- assert(!bufferView.ok()); // should be one or the other.
+ PyWin_PARAMHolder(WPARAM t = 0) : _pa(t), _pymem(NULL) {}
+ ~PyWin_PARAMHolder() { _free(); }
+ WCHAR *set_allocated(WCHAR *t)
+ {
+ assert(!bufferView.ok()); // should be one or the other.
_free();
_pymem = t;
_pa = (WPARAM)t;
return t;
}
// When init_buffer() fails, an appropriate Python error has been set too
- bool init_buffer(PyObject *ob) {
- assert(!_pymem); // should be one or the other!
+ bool init_buffer(PyObject *ob)
+ {
+ assert(!_pymem); // should be one or the other!
_free();
if (!bufferView.init(ob)) {
return false;
@@ -435,9 +441,7 @@ class PyWin_PARAMHolder {
return true;
}
- WPARAM operator=(WPARAM t) {
- return _pa = t;
- }
+ WPARAM operator=(WPARAM t) { return _pa = t; }
operator WPARAM() { return _pa; }
operator LPARAM() { return (LPARAM)_pa; }
};
@@ -447,7 +451,10 @@ inline PyObject *PyWinObject_FromPARAM(WPARAM param) { return PyWinObject_FromUL
inline PyObject *PyWinObject_FromPARAM(LPARAM param) { return PyWinObject_FromULONG_PTR(param); }
PYWINTYPES_EXPORT BOOL PyWinObject_AsSimplePARAM(PyObject *ob, WPARAM *pparam);
-inline BOOL PyWinObject_AsSimplePARAM(PyObject *ob, LPARAM *pparam) { return PyWinObject_AsSimplePARAM(ob, (WPARAM *)pparam); }
+inline BOOL PyWinObject_AsSimplePARAM(PyObject *ob, LPARAM *pparam)
+{
+ return PyWinObject_AsSimplePARAM(ob, (WPARAM *)pparam);
+}
// RECT conversions
// @object PyRECT|Tuple of 4 ints defining a rectangle: (left, top, right, bottom)
@@ -530,7 +537,7 @@ PYWINTYPES_EXPORT PyObject *PyWinMethod_NewHANDLE(PyObject *self, PyObject *args
// A global function that does the right thing wrt closing a "handle".
// The object can be either a PyHANDLE or an integer.
-// If result is FALSE, a Python error is all setup (cf PyHANDLE::Close(), which doesnt set the Python error)
+// If result is FALSE, a Python error is all setup (cf PyHANDLE::Close(), which doesn't set the Python error)
PYWINTYPES_EXPORT BOOL PyWinObject_CloseHANDLE(PyObject *obHandle);
PYWINTYPES_EXPORT BOOL PyWinObject_AsHKEY(PyObject *ob, HKEY *pRes);
diff --git a/win32/src/PyWinTypesmodule.cpp b/win32/src/PyWinTypesmodule.cpp
index 313dfeb1a3..1564f84d52 100644
--- a/win32/src/PyWinTypesmodule.cpp
+++ b/win32/src/PyWinTypesmodule.cpp
@@ -601,7 +601,8 @@ void PyWinObject_FreeResourceId(WCHAR *resource_id)
// Conversion for WPARAM and LPARAM from a simple integer value. Used when we
// can't guarantee memory pointed at will remain valid as long as necessary.
// In that scenario, the caller is responsible for arranging memory safety.
-BOOL PyWinObject_AsSimplePARAM(PyObject *ob, WPARAM *wparam) {
+BOOL PyWinObject_AsSimplePARAM(PyObject *ob, WPARAM *wparam)
+{
// convert simple integers directly
void *simple = PyLong_AsVoidPtr(ob);
if (simple || !PyErr_Occurred()) {
@@ -615,8 +616,7 @@ BOOL PyWinObject_AsSimplePARAM(PyObject *ob, WPARAM *wparam) {
return TRUE;
}
- PyErr_Format(PyExc_TypeError, "WPARAM is simple, so must be an int object (got %s)",
- ob->ob_type->tp_name);
+ PyErr_Format(PyExc_TypeError, "WPARAM is simple, so must be an int object (got %s)", ob->ob_type->tp_name);
return FALSE;
}
@@ -691,9 +691,11 @@ bool PyWinBufferView::init(PyObject *ob, bool bWrite, bool bNoneOk)
m_view.obj = Py_None;
m_view.buf = NULL;
m_view.len = 0;
- } else
+ }
+ else
PyErr_SetString(PyExc_TypeError, "Buffer cannot be None");
- } else if (ob != NULL) {
+ }
+ else if (ob != NULL) {
PyObject_GetBuffer(ob, &m_view, bWrite ? PyBUF_WRITABLE : PyBUF_SIMPLE);
#ifdef _WIN64
@@ -702,7 +704,8 @@ bool PyWinBufferView::init(PyObject *ob, bool bWrite, bool bNoneOk)
PyErr_Format(PyExc_ValueError, "Buffer length can be at most %d characters", MAXDWORD);
}
#endif
- } else // ob == NULL handled as not ok
+ }
+ else // ob == NULL handled as not ok
m_view.obj = NULL;
return ok();
}
@@ -764,9 +767,9 @@ static struct PyMethodDef pywintypes_functions[] = {
#endif
{"Time", PyWinMethod_NewTime, 1}, // @pymeth Time|Makes a object from the argument.
{"TimeStamp", PyWinMethod_NewTimeStamp, 1}, // @pymeth Time|Makes a object from the argument.
- {"CreateGuid", PyWin_CreateGuid, 1}, // @pymeth CreateGuid|Creates a new, unique GUIID.
- {"ACL", PyWinMethod_NewACL, 1}, // @pymeth ACL|Creates a new object.
- {"SID", PyWinMethod_NewSID, 1}, // @pymeth SID|Creates a new object.
+ {"CreateGuid", PyWin_CreateGuid, 1}, // @pymeth CreateGuid|Creates a new, unique GUIID.
+ {"ACL", PyWinMethod_NewACL, 1}, // @pymeth ACL|Creates a new object.
+ {"SID", PyWinMethod_NewSID, 1}, // @pymeth SID|Creates a new object.
{"SECURITY_ATTRIBUTES", PyWinMethod_NewSECURITY_ATTRIBUTES,
1}, // @pymeth SECURITY_ATTRIBUTES|Creates a new object.
{"SECURITY_DESCRIPTOR", PyWinMethod_NewSECURITY_DESCRIPTOR,
@@ -798,8 +801,7 @@ int PyWinGlobals_Ensure()
PyDict_SetItemString(d, "Exception", PyExc_Exception);
PyDict_SetItemString(d, "__name__", name);
Py_DECREF(name);
- PyObject *bimod = PyImport_ImportModule(
- "builtins");
+ PyObject *bimod = PyImport_ImportModule("builtins");
if ((bimod == NULL) || PyDict_SetItemString(d, "__builtins__", bimod) == -1) {
Py_XDECREF(bimod);
return -1;
@@ -875,14 +877,12 @@ int PyWinGlobals_Ensure()
??? All extension modules that call this need to be changed to check the exit code ???
*/
if (PyType_Ready(&PyHANDLEType) == -1 || PyType_Ready(&PyOVERLAPPEDType) == -1 ||
- PyType_Ready(&PyDEVMODEWType) == -1 ||
- PyType_Ready(&PyWAVEFORMATEXType) == -1
+ PyType_Ready(&PyDEVMODEWType) == -1 || PyType_Ready(&PyWAVEFORMATEXType) == -1
#ifndef NO_PYWINTYPES_IID
|| PyType_Ready(&PyIIDType) == -1
#endif // NO_PYWINTYPES_IID
|| PyType_Ready(&PySECURITY_DESCRIPTORType) == -1 || PyType_Ready(&PySECURITY_ATTRIBUTESType) == -1 ||
- PyType_Ready(&PySIDType) == -1 || PyType_Ready(&PyACLType) == -1
- )
+ PyType_Ready(&PySIDType) == -1 || PyType_Ready(&PyACLType) == -1)
return -1;
if (!_PyWinDateTime_Init())
@@ -966,8 +966,7 @@ PYWIN_MODULE_INIT_FUNC(pywintypes)
PYWIN_MODULE_INIT_RETURN_SUCCESS;
}
-extern "C" __declspec(dllexport)
- BOOL WINAPI DllMain(HANDLE hInstance, DWORD dwReason, LPVOID lpReserved)
+extern "C" __declspec(dllexport) BOOL WINAPI DllMain(HANDLE hInstance, DWORD dwReason, LPVOID lpReserved)
{
FARPROC fp;
// dll usually will already be loaded
@@ -1063,10 +1062,10 @@ extern "C" __declspec(dllexport)
}
// Function to format a python traceback into a character string.
-#define GPEM_ERROR(what) \
- { \
+#define GPEM_ERROR(what) \
+ { \
errorMsg = L""; \
- goto done; \
+ goto done; \
}
PYWINTYPES_EXPORT WCHAR *GetPythonTraceback(PyObject *exc_type, PyObject *exc_value, PyObject *exc_tb)
{
@@ -1085,15 +1084,15 @@ PYWINTYPES_EXPORT WCHAR *GetPythonTraceback(PyObject *exc_type, PyObject *exc_va
modStringIO = PyImport_ImportModule("io");
if (modStringIO == NULL)
- GPEM_ERROR("cant import cStringIO");
+ GPEM_ERROR("can't import cStringIO");
modTB = PyImport_ImportModule("traceback");
if (modTB == NULL)
- GPEM_ERROR("cant import traceback");
+ GPEM_ERROR("can't import traceback");
/* Construct a cStringIO object */
obFuncStringIO = PyObject_GetAttrString(modStringIO, "StringIO");
if (obFuncStringIO == NULL)
- GPEM_ERROR("cant find cStringIO.StringIO");
+ GPEM_ERROR("can't find cStringIO.StringIO");
obStringIO = PyObject_CallObject(obFuncStringIO, NULL);
if (obStringIO == NULL)
GPEM_ERROR("cStringIO.StringIO() failed");
@@ -1101,21 +1100,18 @@ PYWINTYPES_EXPORT WCHAR *GetPythonTraceback(PyObject *exc_type, PyObject *exc_va
/* Get the traceback.print_exception function, and call it. */
obFuncTB = PyObject_GetAttrString(modTB, "print_exception");
if (obFuncTB == NULL)
- GPEM_ERROR("cant find traceback.print_exception");
+ GPEM_ERROR("can't find traceback.print_exception");
// Py3k has added an undocumented 'chain' argument which defaults to True
// and causes all kinds of exceptions while trying to print a traceback!
// This *could* be useful thought if we can tame it - later!
int chain = 0;
- argsTB = Py_BuildValue(
- "OOOOOi",
- exc_type ? exc_type : Py_None, exc_value ? exc_value : Py_None, exc_tb ? exc_tb : Py_None,
- Py_None, // limit
- obStringIO,
- chain
- );
+ argsTB = Py_BuildValue("OOOOOi", exc_type ? exc_type : Py_None, exc_value ? exc_value : Py_None,
+ exc_tb ? exc_tb : Py_None,
+ Py_None, // limit
+ obStringIO, chain);
if (argsTB == NULL)
- GPEM_ERROR("cant make print_exception arguments");
+ GPEM_ERROR("can't make print_exception arguments");
obResult = PyObject_CallObject(obFuncTB, argsTB);
if (obResult == NULL) {
@@ -1131,7 +1127,7 @@ PYWINTYPES_EXPORT WCHAR *GetPythonTraceback(PyObject *exc_type, PyObject *exc_va
Py_DECREF(obFuncStringIO);
obFuncStringIO = PyObject_GetAttrString(obStringIO, "getvalue");
if (obFuncStringIO == NULL)
- GPEM_ERROR("cant find getvalue function");
+ GPEM_ERROR("can't find getvalue function");
Py_DECREF(obResult);
obResult = PyObject_CallObject(obFuncStringIO, NULL);
if (obResult == NULL)
diff --git a/win32/src/PythonService.cpp b/win32/src/PythonService.cpp
index 7f02a30e5e..181c97b50c 100644
--- a/win32/src/PythonService.cpp
+++ b/win32/src/PythonService.cpp
@@ -146,10 +146,10 @@ SERVICE_STATUS stoppedStatus = {SERVICE_WIN32_OWN_PROCESS,
SERVICE_STATUS stoppedErrorStatus = {SERVICE_WIN32_OWN_PROCESS,
SERVICE_STOPPED,
- 0, // dwControlsAccepted
- ERROR_SERVICE_SPECIFIC_ERROR, // dwWin32ExitCode
- 0x20000001, // dwServiceSpecificExitCode
- 0, // dwCheckPoint
+ 0, // dwControlsAccepted
+ ERROR_SERVICE_SPECIFIC_ERROR, // dwWin32ExitCode
+ 0x20000001, // dwServiceSpecificExitCode
+ 0, // dwCheckPoint
0};
// The Service Control Manager/Event Log seems to interpret dwServiceSpecificExitCode as a Win32 Error code
// (https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes)
@@ -599,7 +599,7 @@ static void PyService_InitPython()
have_init = TRUE;
// Often for a service, __argv[0] will be just "ExeName", rather
// than "c:\path\to\ExeName.exe"
- // This, however, shouldnt be a problem, as Python itself
+ // This, however, shouldn't be a problem, as Python itself
// knows how to get the .EXE name when it needs.
int pyargc;
WCHAR **pyargv = CommandLineToArgvW(GetCommandLineW(), &pyargc);
@@ -844,7 +844,7 @@ void WINAPI service_main(DWORD dwArgc, LPTSTR *lpszArgv)
instance = LoadPythonServiceInstance(pe->klass, dwArgc, lpszArgv);
// If Python has not yet registered the service control handler, then
// we are in serious trouble - it is likely the service will enter a
- // zombie state, where it wont do anything, but you can not start
+ // zombie state, where it won't do anything, but you can not start
// another. Therefore, we still create register the handler, thereby
// getting a handle, so we can immediately tell Windows the service
// is rooted (that is a technical term!)
@@ -899,7 +899,7 @@ void WINAPI service_main(DWORD dwArgc, LPTSTR *lpszArgv)
// try to report the stopped status to the service control manager.
Py_XDECREF(start);
Py_XDECREF(instance);
- if (pe && pe->sshStatusHandle) { // Wont be true if debugging.
+ if (pe && pe->sshStatusHandle) { // Won't be true if debugging.
if (!SetServiceStatus(pe->sshStatusHandle, (stopWithError ? &stoppedErrorStatus : &stoppedStatus)))
ReportAPIError(PYS_E_API_CANT_SET_STOPPED);
}
@@ -1461,9 +1461,10 @@ int _tmain(int argc, TCHAR **argv)
// now get the handle to the DLL, and call the main function.
if (PyBytes_Check(f))
hmod = GetModuleHandleA(PyBytes_AsString(f));
- else if (TmpWCHAR tw=f) {
+ else if (TmpWCHAR tw = f) {
hmod = GetModuleHandleW(tw);
- } else {
+ }
+ else {
PyErr_SetString(PyExc_TypeError, "servicemanager.__file__ is not a string or unicode !");
goto failed;
}
diff --git a/win32/src/_win32sysloader.cpp b/win32/src/_win32sysloader.cpp
index 2a5db22ce4..0a9e4dcac7 100644
--- a/win32/src/_win32sysloader.cpp
+++ b/win32/src/_win32sysloader.cpp
@@ -52,15 +52,12 @@ static PyObject *PyLoadModule(PyObject *self, PyObject *args)
if (!modName)
return NULL;
- // Python 3.7 vs 3.8 use different flags for LoadLibraryEx and we match them.
- // See github issue 1787.
+ // Python 3.7 vs 3.8 use different flags for LoadLibraryEx and we match them.
+ // See github issue 1787.
#if (PY_VERSION_HEX < 0x03080000)
- HINSTANCE hinst = LoadLibraryEx(modName, NULL,
- LOAD_WITH_ALTERED_SEARCH_PATH);
+ HINSTANCE hinst = LoadLibraryEx(modName, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
#else
- HINSTANCE hinst = LoadLibraryEx(modName, NULL,
- LOAD_LIBRARY_SEARCH_DEFAULT_DIRS |
- LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR);
+ HINSTANCE hinst = LoadLibraryEx(modName, NULL, LOAD_LIBRARY_SEARCH_DEFAULT_DIRS | LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR);
#endif
PyMem_Free(modName);
if (hinst == NULL) {
diff --git a/win32/src/_winxptheme.i b/win32/src/_winxptheme.i
index 7b2b72bfaf..3ef07bbb9c 100644
--- a/win32/src/_winxptheme.i
+++ b/win32/src/_winxptheme.i
@@ -168,7 +168,7 @@ typedef long FLAGS;
// class name) to provide the class an opportunity
// to get the "best" match between the class and
// the current theme. For example, a button might
-// pass L"OkButton, Button" if its ID=ID_OK. If
+// pass L"OkButton, Button" if it's ID=ID_OK. If
// the current theme has an entry for OkButton,
// that will be used. Otherwise, we fall back on
// the normal Button entry.
diff --git a/win32/src/odbc.cpp b/win32/src/odbc.cpp
index dfbe4c4fe1..6190ce53c1 100644
--- a/win32/src/odbc.cpp
+++ b/win32/src/odbc.cpp
@@ -716,13 +716,14 @@ static int ibindDate(cursorObject *cur, int column, PyObject *item)
// Last 3 items are ignored.
PyObject *obwday, *obyday, *obdst;
if (!PyArg_ParseTuple(timeseq, "hhh|hhhOOO:TIMESTAMP_STRUCT", &dt->year, &dt->month, &dt->day, &dt->hour,
- &dt->minute, &dt->second, &obwday, &obyday, &obdst))
+ &dt->minute, &dt->second, &obwday, &obyday, &obdst))
return 0;
TmpPyObject usec = PyObject_GetAttrString(item, "microsecond");
if (usec == NULL) {
PyErr_Clear();
- } else {
+ }
+ else {
dt->fraction = PyLong_AsUnsignedLong(usec);
if (dt->fraction == -1 && PyErr_Occurred())
return 0;
@@ -817,7 +818,9 @@ static int ibindString(cursorObject *cur, int column, PyObject *item)
static int ibindUnicode(cursorObject *cur, int column, PyObject *item)
{
- TmpWCHAR wval = item; if (!wval) return 0;
+ TmpWCHAR wval = item;
+ if (!wval)
+ return 0;
Py_ssize_t nchars = wval.length + 1;
Py_ssize_t nbytes = nchars * sizeof(WCHAR);
@@ -853,8 +856,7 @@ static int rewriteQuery(TCHAR *out, const TCHAR *in)
parseContext ctx;
initParseContext(&ctx, in);
- while (*out++ = doParse(&ctx))
- ;
+ while (*out++ = doParse(&ctx));
return ctx.parmCount;
}
@@ -893,8 +895,7 @@ static int bindInput(cursorObject *cur, PyObject *vars, int columns)
else if (PyWinTime_Check(item)) {
rv = ibindDate(cur, iCol, item);
}
- else if (PyObject_CheckBuffer(item))
- {
+ else if (PyObject_CheckBuffer(item)) {
rv = ibindRaw(cur, iCol, item);
}
else {
@@ -1016,7 +1017,8 @@ static BOOL bindOutput(cursorObject *cur)
break;
case SQL_VARCHAR:
case SQL_WVARCHAR:
- if (!bindOutputVar(cur, wcharCopy, SQL_C_WCHAR, (((vsize == 0) ? cur->max_width : vsize) + 1) * sizeof(WCHAR), pos, false))
+ if (!bindOutputVar(cur, wcharCopy, SQL_C_WCHAR,
+ (((vsize == 0) ? cur->max_width : vsize) + 1) * sizeof(WCHAR), pos, false))
return FALSE;
typeOf = DbiString;
break;
diff --git a/win32/src/stddde.h b/win32/src/stddde.h
index 2e36398e26..85688c1f92 100644
--- a/win32/src/stddde.h
+++ b/win32/src/stddde.h
@@ -56,8 +56,8 @@ class CDDEAllocator {
LPBYTE p = (LPBYTE)(const TCHAR *)cs;
DWORD cb = (cs.GetLength() + 1) * sizeof(TCHAR);
- if(m_wFmt == CF_TEXT) {
- p = (LPBYTE)(const char*)CT2CA(cs);
+ if (m_wFmt == CF_TEXT) {
+ p = (LPBYTE)(const char *)CT2CA(cs);
cb = (cs.GetLength() + 1) * sizeof(const char);
}
diff --git a/win32/src/timermodule.cpp b/win32/src/timermodule.cpp
index 826cb19432..cc47889188 100644
--- a/win32/src/timermodule.cpp
+++ b/win32/src/timermodule.cpp
@@ -9,7 +9,7 @@
// @doc - Contains autoduck comments for documentation
#include "pywintypes.h"
-//#include "abstract.h"
+// #include "abstract.h"
static PyObject *timer_id_callback_map = NULL;
diff --git a/win32/src/win32apimodule.cpp b/win32/src/win32apimodule.cpp
index c6a0dad4b4..026816e69d 100644
--- a/win32/src/win32apimodule.cpp
+++ b/win32/src/win32apimodule.cpp
@@ -1180,11 +1180,14 @@ static PyObject *PyLoadCursor(PyObject *self, PyObject *args)
return PyWinLong_FromHANDLE(ret);
}
-// @pymethod [string]|win32api|CommandLineToArgv|Parses a command line string and returns a list of command line arguments, in a way that is similar to sys.argv.
+// @pymethod [string]|win32api|CommandLineToArgv|Parses a command line string and returns a list of command line
+// arguments, in a way that is similar to sys.argv.
static PyObject *PyCommandLineToArgv(PyObject *self, PyObject *args)
{
TmpWCHAR cmd;
- if (!PyArg_ParseTuple(args, "U", &cmd.u) || !cmd.u2w()) // @pyparm string|cmdLine||A string that contains the full command line. If this parameter is an empty string the function returns the path to the current executable file.
+ if (!PyArg_ParseTuple(args, "U", &cmd.u) ||
+ !cmd.u2w()) // @pyparm string|cmdLine||A string that contains the full command line. If this parameter is an
+ // empty string the function returns the path to the current executable file.
return NULL;
int numArgs = 0;
LPWSTR *szArglist = CommandLineToArgvW(cmd, &numArgs);
@@ -1195,7 +1198,7 @@ static PyObject *PyCommandLineToArgv(PyObject *self, PyObject *args)
if (!result)
goto done;
- for (int i=0; i < numArgs; i++) {
+ for (int i = 0; i < numArgs; i++) {
PyObject *ob = PyWinObject_FromWCHAR(szArglist[i]);
if (ob == NULL) {
Py_DECREF(result);
@@ -1400,7 +1403,9 @@ static PyObject *PyVkKeyScan(PyObject *self, PyObject *args)
PyErr_SetString(PyExc_TypeError, "must be a unicode string of length 1");
return NULL;
}
- TmpWCHAR ts(obkey); if (!ts) return NULL;
+ TmpWCHAR ts(obkey);
+ if (!ts)
+ return NULL;
PyW32_BEGIN_ALLOW_THREADS
// @pyseeapi VkKeyScanW
ret = VkKeyScanW(ts[0]);
@@ -1445,7 +1450,9 @@ static PyObject *PyVkKeyScanEx(PyObject *self, PyObject *args)
PyErr_SetString(PyExc_TypeError, "must be a unicode string of length 1");
return NULL;
}
- TmpWCHAR ts(obkey); if (!ts) return NULL;
+ TmpWCHAR ts(obkey);
+ if (!ts)
+ return NULL;
PyW32_BEGIN_ALLOW_THREADS
// @pyseeapi VkKeyScanExW
ret = VkKeyScanExW(ts[0], hkl);
@@ -1920,7 +1927,7 @@ static PyObject *PyGetProfileSection(PyObject *self, PyObject *args)
delete[] szRetBuf;
size *= 2;
}
- szRetBuf = new TCHAR[size]; /* cant fail - may raise exception */
+ szRetBuf = new TCHAR[size]; /* can't fail - may raise exception */
if (szRetBuf == NULL) {
PyErr_SetString(PyExc_MemoryError, "Error allocating space for return buffer");
break;
@@ -2105,9 +2112,7 @@ static PyObject *PyGetLongPathNameW(PyObject *self, PyObject *args)
// The length is the buffer needed, which includes the NULL.
// PyUnicode_FromWideChar adds one.
PyW32_BEGIN_ALLOW_THREADS DWORD length2 = (*pfnGetLongPathNameW)(fileName, buf, length);
- PyW32_END_ALLOW_THREADS
- if (length2)
- obLongPathNameW = PyUnicode_FromWideChar(buf, -1);
+ PyW32_END_ALLOW_THREADS if (length2) obLongPathNameW = PyUnicode_FromWideChar(buf, -1);
// On success, it is the number of chars copied *not* including
// the NULL. Check this is true.
assert(length2 + 1 == length);
@@ -2119,13 +2124,13 @@ static PyObject *PyGetLongPathNameW(PyObject *self, PyObject *args)
return obLongPathNameW;
}
-// @pymethod int|win32api|GetTickCount|Returns the (64bit) number of milliseconds since windows started. Uses Win API GetTickCount64().
+// @pymethod int|win32api|GetTickCount|Returns the (64bit) number of milliseconds since windows started. Uses Win API
+// GetTickCount64().
static PyObject *PyGetTickCount(PyObject *self, PyObject *args)
{
if (!PyArg_ParseTuple(args, ":PyGetTickCount"))
return NULL;
- PyW32_BEGIN_ALLOW_THREADS
- ULONGLONG count = GetTickCount64();
+ PyW32_BEGIN_ALLOW_THREADS ULONGLONG count = GetTickCount64();
PyW32_END_ALLOW_THREADS
return Py_BuildValue("K", count);
@@ -2223,9 +2228,9 @@ static PyObject *PyGetTimeZoneInformation(PyObject *self, PyObject *args)
// example, this member could contain "EST" to indicate Eastern Standard Time. This string is not used by the
// operating system, so anything stored there using the SetTimeZoneInformation function is returned unchanged by the
// GetTimeZoneInformation function. This string can be empty.
- // @tupleitem 2|/tuple|standardTime|Specifies a SYSTEMTIME object that contains a date and local time when
- // the transition from daylight saving time to standard time occurs on this operating system. If this date is not
- // specified, the wMonth member in the SYSTEMTIME structure must be zero. If this date is specified, the
+ // @tupleitem 2|/tuple|standardTime|Specifies a SYSTEMTIME object that contains a date and local time
+ // when the transition from daylight saving time to standard time occurs on this operating system. If this date is
+ // not specified, the wMonth member in the SYSTEMTIME structure must be zero. If this date is specified, the
// DaylightDate value in the TIME_ZONE_INFORMATION structure must also be specified. To select the correct day
// in the month, set the wYear member to zero, the wDayOfWeek member to an appropriate weekday, and the wDay member
// to a value in the range 1 through 5. Using this notation, the first Sunday in April can be specified, as can the
@@ -2517,7 +2522,7 @@ static PyObject *PyGetVersionEx(PyObject *self, PyObject *args)
// system.
ver.dwBuildNumber, // @tupleitem 2|int|buildNumber|Identifies the build number of the operating system in
// the low-order word. (The high-order word contains the major and minor version
- // numbers.)
+ // numbers.)
ver.dwPlatformId, // @tupleitem 3|int|platformId|Identifies the platform supported by the operating system.
// May be one of VER_PLATFORM_WIN32s, VER_PLATFORM_WIN32_WINDOWS or
// VER_PLATFORM_WIN32_NT
@@ -2538,7 +2543,7 @@ static PyObject *PyGetVersionEx(PyObject *self, PyObject *args)
// system.
ver.dwBuildNumber, // @tupleitem 2|int|buildNumber|Identifies the build number of the operating system in
// the low-order word. (The high-order word contains the major and minor version
- // numbers.)
+ // numbers.)
ver.dwPlatformId, // @tupleitem 3|int|platformId|Identifies the platform supported by the operating system.
// May be one of VER_PLATFORM_WIN32s, VER_PLATFORM_WIN32_WINDOWS or
// VER_PLATFORM_WIN32_NT
@@ -2699,7 +2704,8 @@ PyObject *PyPostMessage(PyObject *self, PyObject *args)
PyW32_BEGIN_ALLOW_THREADS;
BOOL ok = ::PostMessage(hwnd, message, wParam, lParam);
PyW32_END_ALLOW_THREADS;
- if (!ok) return ReturnAPIError("PostMessage");
+ if (!ok)
+ return ReturnAPIError("PostMessage");
Py_INCREF(Py_None);
return Py_None;
}
@@ -2727,7 +2733,8 @@ PyObject *PyPostThreadMessage(PyObject *self, PyObject *args)
PyW32_BEGIN_ALLOW_THREADS;
BOOL ok = ::PostThreadMessage(threadId, message, wParam, lParam);
PyW32_END_ALLOW_THREADS;
- if (!ok) return ReturnAPIError("PostThreadMessage");
+ if (!ok)
+ return ReturnAPIError("PostThreadMessage");
Py_INCREF(Py_None);
return Py_None;
}
@@ -3266,17 +3273,16 @@ static BOOL PyWinObject_AsRegistryValue(PyObject *value, DWORD typ, BYTE **retDa
}
return FALSE;
case REG_BINARY:
- // ALSO handle ALL unknown data types here. Even if we cant support
+ // ALSO handle ALL unknown data types here. Even if we can't support
// it natively, we should handle the bits.
- default:
- {
- PyWinBufferView pybuf(value, false, true); // None ok
+ default: {
+ PyWinBufferView pybuf(value, false, true); // None ok
if (!pybuf.ok())
return FALSE;
// note: this might be unsafe, as we give away the buffer pointer to a
// client outside of the scope where our RAII object 'pybuf' resides.
- *retDataBuf = (BYTE*)pybuf.ptr();
+ *retDataBuf = (BYTE *)pybuf.ptr();
*retDataSize = pybuf.len();
return TRUE;
}
@@ -3347,7 +3353,7 @@ static PyObject *PyWinObject_FromRegistryValue(BYTE *retDataBuf, DWORD retDataSi
break;
}
case REG_BINARY:
- // ALSO handle ALL unknown data types here. Even if we cant support
+ // ALSO handle ALL unknown data types here. Even if we can't support
// it natively, we should handle the bits.
default:
if (retDataSize == 0) {
@@ -4772,7 +4778,10 @@ static PyObject *PySetSystemTime(PyObject *self, PyObject *args)
{
return ReturnAPIError("SetSystemTime");
}
- else { return Py_BuildValue("i", result); }
+ else
+ {
+ return Py_BuildValue("i", result);
+ }
}
// @pymethod |win32api|SetThreadLocale|Sets the current thread's locale.
@@ -5176,8 +5185,8 @@ PyObject *PyEnumResourceLanguages(PyObject *self, PyObject *args)
// Win32 Exception Handler.
//
// A recursive routine called by the exception handler!
-// (I hope this doesnt wind too far on a stack overflow :-)
-// Limited testing indicates it doesnt, and this can handle
+// (I hope this doesn't wind too far on a stack overflow :-)
+// Limited testing indicates it doesn't, and this can handle
// a stack overflow fine.
PyObject *MakeExceptionRecord(PEXCEPTION_RECORD pExceptionRecord)
{
@@ -5820,12 +5829,11 @@ PyObject *PyGetPwrCapabilities(PyObject *self, PyObject *args)
"DefaultLowLatencyWake", PyLong_FromLong(spc.DefaultLowLatencyWake));
}
-
// @pymethod dict|win32api|GetSystemPowerStatus|Retrieves the power status of the system
// @pyseeapi GetSystemPowerStatus
// @comm Requires Winxp or later.
// @rdesc Returns a dict representing a SYSTEM_POWER_STATUS struct
-PyObject* PyGetSystemPowerStatus(PyObject *self, PyObject *args)
+PyObject *PyGetSystemPowerStatus(PyObject *self, PyObject *args)
{
SYSTEM_POWER_STATUS sps;
BOOL res = FALSE;
@@ -5835,16 +5843,13 @@ PyObject* PyGetSystemPowerStatus(PyObject *self, PyObject *args)
if (!res)
return PyWin_SetAPIError("GetSystemPowerStatus");
return Py_BuildValue(
- "{s:h, s:h, s:h, s:B, s:L, s:L}",
- "ACLineStatus", (sps.ACLineStatus == (BYTE)-1) ? -1 : sps.ACLineStatus,
- "BatteryFlag", (sps.BatteryFlag == (BYTE)-1) ? -1 : sps.BatteryFlag,
- "BatteryLifePercent", (sps.BatteryLifePercent == (BYTE)-1) ? -1 : sps.BatteryLifePercent,
- "SystemStatusFlag", sps.SystemStatusFlag,
+ "{s:h, s:h, s:h, s:B, s:L, s:L}", "ACLineStatus", (sps.ACLineStatus == (BYTE)-1) ? -1 : sps.ACLineStatus,
+ "BatteryFlag", (sps.BatteryFlag == (BYTE)-1) ? -1 : sps.BatteryFlag, "BatteryLifePercent",
+ (sps.BatteryLifePercent == (BYTE)-1) ? -1 : sps.BatteryLifePercent, "SystemStatusFlag", sps.SystemStatusFlag,
"BatteryLifeTime", (sps.BatteryLifeTime == (DWORD)-1) ? -1 : (long long)sps.BatteryLifeTime,
"BatteryFullLifeTime", (sps.BatteryFullLifeTime == (DWORD)-1) ? -1 : (long long)sps.BatteryFullLifeTime);
}
-
/* List of functions exported by this module */
// @module win32api|A module, encapsulating the Windows Win32 API.
static struct PyMethodDef win32api_functions[] = {
@@ -5865,10 +5870,12 @@ static struct PyMethodDef win32api_functions[] = {
METH_VARARGS | METH_KEYWORDS}, // @pymeth ChangeDisplaySettingsEx|Changes video mode for specified display
{"ClipCursor", PyClipCursor, 1}, // @pymeth ClipCursor|Confines the cursor to a rectangular area on the screen.
{"CloseHandle", PyCloseHandle, 1}, // @pymeth CloseHandle|Closes an open handle.
- {"CommandLineToArgv", PyCommandLineToArgv, 1}, // @pymeth CommandLineToArgv|Parses a Unicode command line string and returns a list of command line arguments, in a way that is similar to sys.argv.
- {"CopyFile", PyCopyFile, 1}, // @pymeth CopyFile|Copy a file.
- {"DebugBreak", PyDebugBreak, 1}, // @pymeth DebugBreak|Breaks into the C debugger.
- {"DeleteFile", PyDeleteFile, 1}, // @pymeth DeleteFile|Deletes the specified file.
+ {"CommandLineToArgv", PyCommandLineToArgv,
+ 1}, // @pymeth CommandLineToArgv|Parses a Unicode command line string and returns a list of command line
+ // arguments, in a way that is similar to sys.argv.
+ {"CopyFile", PyCopyFile, 1}, // @pymeth CopyFile|Copy a file.
+ {"DebugBreak", PyDebugBreak, 1}, // @pymeth DebugBreak|Breaks into the C debugger.
+ {"DeleteFile", PyDeleteFile, 1}, // @pymeth DeleteFile|Deletes the specified file.
{"DragQueryFile", PyDragQueryFile, 1}, // @pymeth DragQueryFile|Retrieve the file names for dropped files.
{"DragFinish", PyDragFinish, 1}, // @pymeth DragFinish|Free memory associated with dropped files.
{"DuplicateHandle", PyDuplicateHandle, 1}, // @pymeth DuplicateHandle|Duplicates a handle.
@@ -6013,9 +6020,9 @@ static struct PyMethodDef win32api_functions[] = {
1}, // @pymeth GetNativeSystemInfo|Retrieves information about the current system for a Wow64 process.
{"GetSystemMetrics", PyGetSystemMetrics, 1}, // @pymeth GetSystemMetrics|Returns the specified system metrics.
{"GetSystemPowerStatus", PyGetSystemPowerStatus,
- METH_NOARGS}, // @pymeth GetSystemPowerStatus|Retrieves the power status of the system
- {"GetSystemTime", PyGetSystemTime, 1}, // @pymeth GetSystemTime|Returns the current system time.
- {"GetTempFileName", PyGetTempFileName, 1}, // @pymeth GetTempFileName|Creates a temporary file.
+ METH_NOARGS}, // @pymeth GetSystemPowerStatus|Retrieves the power status of the system
+ {"GetSystemTime", PyGetSystemTime, 1}, // @pymeth GetSystemTime|Returns the current system time.
+ {"GetTempFileName", PyGetTempFileName, 1}, // @pymeth GetTempFileName|Creates a temporary file.
{"GetTempPath", PyGetTempPath, 1}, // @pymeth GetTempPath|Returns the path designated as holding temporary files.
{"GetThreadLocale", PyGetThreadLocale, 1}, // @pymeth GetThreadLocale|Returns the current thread's locale.
{"GetTickCount", PyGetTickCount, 1}, // @pymeth GetTickCount|Returns the milliseconds since windows started.
@@ -6062,7 +6069,7 @@ static struct PyMethodDef win32api_functions[] = {
{"MoveFile", PyMoveFile, 1}, // @pymeth MoveFile|Moves or renames a file.
{"MoveFileEx", PyMoveFileEx, 1}, // @pymeth MoveFileEx|Moves or renames a file.
{"OpenProcess", PyOpenProcess, 1}, // @pymeth OpenProcess|Retrieves a handle to an existing process.
- {"OpenThread", PyOpenThread, 1}, // @pymeth OpenProcess|Retrieves a handle to an existing thread.
+ {"OpenThread", PyOpenThread, 1}, // @pymeth OpenProcess|Retrieves a handle to an existing thread.
{"OutputDebugString", PyOutputDebugString, 1}, // @pymeth OutputDebugString|Writes output to the Windows debugger.
{"PostMessage", PyPostMessage, 1}, // @pymeth PostMessage|Post a message to a window.
{"PostQuitMessage", PyPostQuitMessage, 1}, // @pymeth PostQuitMessage|Posts a quit message.
@@ -6150,9 +6157,9 @@ static struct PyMethodDef win32api_functions[] = {
// specified offset into the extra class memory for the window.
{"SetClassWord", PySetClassWord, 1}, // @pymeth SetClassWord|Replaces the specified 32-bit (long) value at the
// specified offset into the extra class memory for the window.
- {"SetWindowWord", PySetWindowWord, 1}, // @pymeth SetWindowWord|
+ {"SetWindowWord", PySetWindowWord, 1}, // @pymeth SetWindowWord|
{"SetCursor", PySetCursor, 1}, // @pymeth SetCursor|Set the cursor to the HCURSOR object.
-// @pymeth SetEnvironmentVariable|Creates, deletes, or changes the value of an environment variable.
+ // @pymeth SetEnvironmentVariable|Creates, deletes, or changes the value of an environment variable.
{"SetEnvironmentVariable", PySetEnvironmentVariableW, 1},
{"SetEnvironmentVariableW", PySetEnvironmentVariableW,
1}, // @pymeth SetEnvironmentVariableW|Creates, deletes, or changes the value of an environment variable.
@@ -6288,8 +6295,7 @@ PYWIN_MODULE_INIT_FUNC(win32api)
if (hmodule != NULL) {
pfnEnumDisplayMonitors = (EnumDisplayMonitorsfunc)GetProcAddress(hmodule, "EnumDisplayMonitors");
pfnEnumDisplayDevices = (EnumDisplayDevicesfunc)GetProcAddress(hmodule, "EnumDisplayDevicesW");
- pfnChangeDisplaySettingsEx =
- (ChangeDisplaySettingsExfunc)GetProcAddress(hmodule, "ChangeDisplaySettingsExW");
+ pfnChangeDisplaySettingsEx = (ChangeDisplaySettingsExfunc)GetProcAddress(hmodule, "ChangeDisplaySettingsExW");
pfnMonitorFromWindow = (MonitorFromWindowfunc)GetProcAddress(hmodule, "MonitorFromWindow");
pfnMonitorFromRect = (MonitorFromRectfunc)GetProcAddress(hmodule, "MonitorFromRect");
pfnMonitorFromPoint = (MonitorFromPointfunc)GetProcAddress(hmodule, "MonitorFromPoint");
diff --git a/win32/src/win32clipboardmodule.cpp b/win32/src/win32clipboardmodule.cpp
index 8f552f6917..9ffe4b0760 100644
--- a/win32/src/win32clipboardmodule.cpp
+++ b/win32/src/win32clipboardmodule.cpp
@@ -863,7 +863,7 @@ static PyObject *py_set_clipboard_data(PyObject *self, PyObject *args)
buf = pybuf.ptr();
bufSize = pybuf.len();
if ((PyBytes_Check(obhandle)) && (isTextFormat(format)))
- bufSize++; // size doesnt include nulls!
+ bufSize++; // size doesn't include nulls!
// else assume buffer needs no terminator...
}
handle = GlobalAlloc(GHND, bufSize);
diff --git a/win32/src/win32consolemodule.cpp b/win32/src/win32consolemodule.cpp
index d1ff661b33..daae981cf4 100644
--- a/win32/src/win32consolemodule.cpp
+++ b/win32/src/win32consolemodule.cpp
@@ -1295,7 +1295,8 @@ PyObject *PyConsoleScreenBuffer::PyScrollConsoleScreenBuffer(PyObject *self, PyO
if (!ScrollConsoleScreenBuffer(((PyConsoleScreenBuffer *)self)->m_handle, pscrollrect, pcliprect, *pdestcoord,
&char_info)) {
PyWin_SetAPIError("ScrollConsoleScreenBuffer");
- } else {
+ }
+ else {
Py_INCREF(Py_None);
return Py_None;
}
@@ -1813,7 +1814,8 @@ static PyObject *PyAddConsoleAlias(PyObject *self, PyObject *args, PyObject *kwa
PyWinObject_AsWCHAR(obexename, &exename, FALSE)) {
if (!(*pfnAddConsoleAlias)(source, target, exename)) {
PyWin_SetAPIError("AddConsoleAlias");
- } else {
+ }
+ else {
Py_INCREF(Py_None);
ret = Py_None;
}
diff --git a/win32/src/win32credmodule.cpp b/win32/src/win32credmodule.cpp
index efcddfe99a..2825c2213c 100644
--- a/win32/src/win32credmodule.cpp
+++ b/win32/src/win32credmodule.cpp
@@ -535,13 +535,12 @@ PyObject *PyCredEnumerate(PyObject *self, PyObject *args, PyObject *kwargs)
// @pymethod dict|win32cred|CredGetSessionTypes|Returns maximum persistence supported by the current logon session
// @rdesc Returns an integer list
-PyObject* PyCredGetSessionTypes(PyObject* self, PyObject* args, PyObject* kwargs)
+PyObject *PyCredGetSessionTypes(PyObject *self, PyObject *args, PyObject *kwargs)
{
static char *keywords[] = {"MaximumPersistCount", NULL};
DWORD mpc = CRED_TYPE_MAXIMUM;
- if (!PyArg_ParseTupleAndKeywords(
- args, kwargs, "|k:CredGetSessionTypes", keywords,
- &mpc)) // @pyparm int|MaximumPersistCount|CRED_TYPE_MAXIMUM|Maximum array entries
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|k:CredGetSessionTypes", keywords,
+ &mpc)) // @pyparm int|MaximumPersistCount|CRED_TYPE_MAXIMUM|Maximum array entries
return NULL;
if ((mpc == 0) || (mpc > CRED_TYPE_MAXIMUM)) {
PyErr_SetString(PyExc_ValueError, "Argument must be between 1 and CRED_TYPE_MAXIMUM");
@@ -555,8 +554,7 @@ PyObject* PyCredGetSessionTypes(PyObject* self, PyObject* args, PyObject* kwargs
if (!res)
return PyWin_SetAPIError("CredGetSessionTypes");
PyObject *ret = PyList_New(mpc);
- for (DWORD i = 0; i < mpc; ++i)
- PyList_SET_ITEM(ret, i, PyLong_FromUnsignedLong(arr[i]));
+ for (DWORD i = 0; i < mpc; ++i) PyList_SET_ITEM(ret, i, PyLong_FromUnsignedLong(arr[i]));
return ret;
}
diff --git a/win32/src/win32crypt/PyCERTSTORE.cpp b/win32/src/win32crypt/PyCERTSTORE.cpp
index ca79106725..ace33b4e33 100644
--- a/win32/src/win32crypt/PyCERTSTORE.cpp
+++ b/win32/src/win32crypt/PyCERTSTORE.cpp
@@ -136,16 +136,16 @@ PyObject *PyCERTSTORE::PyCertCloseStore(PyObject *self, PyObject *args, PyObject
{
static char *keywords[] = {"Flags", NULL};
HCERTSTORE hcertstore = ((PyCERTSTORE *)self)->GetHCERTSTORE();
- DWORD dwFlags = (DWORD)-1; // DEPRECATED and not actually used other than to warn if it is specified.
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|k:PyCERTSTORE::CertCloseStore", keywords,
- &dwFlags))
+ DWORD dwFlags = (DWORD)-1; // DEPRECATED and not actually used other than to warn if it is specified.
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|k:PyCERTSTORE::CertCloseStore", keywords, &dwFlags))
return NULL;
if (hcertstore == NULL) {
PyErr_SetString(PyExc_SystemError, "Certificate store is already closed");
return NULL;
}
if (dwFlags != (DWORD)-1) {
- PyErr_Warn(PyExc_PendingDeprecationWarning, "The Flags param to CertCloseStore is deprecated; a non-zero value is likely to crash");
+ PyErr_Warn(PyExc_PendingDeprecationWarning,
+ "The Flags param to CertCloseStore is deprecated; a non-zero value is likely to crash");
}
BOOL bsuccess;
Py_BEGIN_ALLOW_THREADS;
@@ -156,7 +156,8 @@ PyObject *PyCERTSTORE::PyCertCloseStore(PyObject *self, PyObject *args, PyObject
((PyCERTSTORE *)self)->hcertstore = NULL;
Py_XDECREF(((PyCERTSTORE *)self)->obcertstore);
((PyCERTSTORE *)self)->obcertstore = NULL;
- if (!bsuccess) return PyWin_SetAPIError("PyCERTSTORE::CertCloseStore");
+ if (!bsuccess)
+ return PyWin_SetAPIError("PyCERTSTORE::CertCloseStore");
Py_INCREF(Py_None);
return Py_None;
}
@@ -181,7 +182,8 @@ PyObject *PyCERTSTORE::PyCertControlStore(PyObject *self, PyObject *args, PyObje
Py_BEGIN_ALLOW_THREADS;
bsuccess = CertControlStore(hcertstore, dwFlags, dwCtrlType, hevent);
Py_END_ALLOW_THREADS;
- if (!bsuccess) return PyWin_SetAPIError("CertControlStore");
+ if (!bsuccess)
+ return PyWin_SetAPIError("CertControlStore");
Py_INCREF(Py_None);
return Py_None;
}
@@ -201,8 +203,7 @@ PyObject *PyCERTSTORE::PyCertEnumCertificatesInStore(PyObject *self, PyObject *a
Py_BEGIN_ALLOW_THREADS;
pccert_context = CertEnumCertificatesInStore(hcertstore, pccert_context);
Py_END_ALLOW_THREADS;
- if (pccert_context != NULL)
- {
+ if (pccert_context != NULL) {
// increments reference count
py_pccert_context = CertDuplicateCertificateContext(pccert_context);
ret_item = PyWinObject_FromCERT_CONTEXT(py_pccert_context);
@@ -240,8 +241,7 @@ PyObject *PyCERTSTORE::PyCertEnumCTLsInStore(PyObject *self, PyObject *args)
Py_BEGIN_ALLOW_THREADS;
ctl_context = CertEnumCTLsInStore(hcertstore, ctl_context);
Py_END_ALLOW_THREADS;
- if (ctl_context != NULL)
- {
+ if (ctl_context != NULL) {
py_ctl_context = CertDuplicateCTLContext(ctl_context);
ret_item = PyWinObject_FromCTL_CONTEXT(py_ctl_context);
if ((ret_item == NULL) || (PyList_Append(ret, ret_item) == -1)) {
@@ -305,12 +305,11 @@ PyObject *PyCERTSTORE::PyCertSaveStore(PyObject *self, PyObject *args, PyObject
}
BOOL bsuccess;
Py_BEGIN_ALLOW_THREADS;
- bsuccess =
- CertSaveStore(hcertstore, dwMsgAndCertEncodingType, dwSaveAs, dwSaveTo, pvSaveToPara, dwFlags);
+ bsuccess = CertSaveStore(hcertstore, dwMsgAndCertEncodingType, dwSaveAs, dwSaveTo, pvSaveToPara, dwFlags);
Py_END_ALLOW_THREADS;
- if (!bsuccess) PyWin_SetAPIError("PyCERTSTORE::CertSaveStore");
- else
- {
+ if (!bsuccess)
+ PyWin_SetAPIError("PyCERTSTORE::CertSaveStore");
+ else {
Py_INCREF(Py_None);
ret = Py_None;
}
@@ -342,11 +341,11 @@ PyObject *PyCERTSTORE::PyCertAddEncodedCertificateToStore(PyObject *self, PyObje
return NULL;
BOOL bsuccess;
Py_BEGIN_ALLOW_THREADS;
- bsuccess =
- CertAddEncodedCertificateToStore(hcertstore, dwCertEncodingType, (BYTE*)pybuf.ptr(), pybuf.len(),
- dwAddDisposition, (const struct _CERT_CONTEXT **)&newcert_context);
+ bsuccess = CertAddEncodedCertificateToStore(hcertstore, dwCertEncodingType, (BYTE *)pybuf.ptr(), pybuf.len(),
+ dwAddDisposition, (const struct _CERT_CONTEXT **)&newcert_context);
Py_END_ALLOW_THREADS;
- if (!bsuccess) return PyWin_SetAPIError("PyCERTSTORE::CertAddEncodedCertificateToStore");
+ if (!bsuccess)
+ return PyWin_SetAPIError("PyCERTSTORE::CertAddEncodedCertificateToStore");
return PyWinObject_FromCERT_CONTEXT(newcert_context);
}
@@ -368,10 +367,10 @@ PyObject *PyCERTSTORE::PyCertAddCertificateContextToStore(PyObject *self, PyObje
return NULL;
BOOL bsuccess;
Py_BEGIN_ALLOW_THREADS;
- bsuccess =
- CertAddCertificateContextToStore(hcertstore, pcert_context, dwAddDisposition, &newcert_context);
+ bsuccess = CertAddCertificateContextToStore(hcertstore, pcert_context, dwAddDisposition, &newcert_context);
Py_END_ALLOW_THREADS;
- if (!bsuccess) return PyWin_SetAPIError("CertAddCertificateContextToStore");
+ if (!bsuccess)
+ return PyWin_SetAPIError("CertAddCertificateContextToStore");
return PyWinObject_FromCERT_CONTEXT(newcert_context);
}
@@ -393,10 +392,10 @@ PyObject *PyCERTSTORE::PyCertAddCertificateLinkToStore(PyObject *self, PyObject
return NULL;
BOOL bsuccess;
Py_BEGIN_ALLOW_THREADS;
- bsuccess =
- CertAddCertificateLinkToStore(hcertstore, pcert_context, dwAddDisposition, &newcert_context);
+ bsuccess = CertAddCertificateLinkToStore(hcertstore, pcert_context, dwAddDisposition, &newcert_context);
Py_END_ALLOW_THREADS;
- if (!bsuccess) return PyWin_SetAPIError("CertAddCertificateLinkToStore");
+ if (!bsuccess)
+ return PyWin_SetAPIError("CertAddCertificateLinkToStore");
return PyWinObject_FromCERT_CONTEXT(newcert_context);
}
@@ -419,7 +418,8 @@ PyObject *PyCERTSTORE::PyCertAddCTLContextToStore(PyObject *self, PyObject *args
Py_BEGIN_ALLOW_THREADS;
bsuccess = CertAddCTLContextToStore(hcertstore, pctl, dwAddDisposition, &new_pctl);
Py_END_ALLOW_THREADS;
- if (!bsuccess) return PyWin_SetAPIError("CertAddCTLContextToStore");
+ if (!bsuccess)
+ return PyWin_SetAPIError("CertAddCTLContextToStore");
return PyWinObject_FromCTL_CONTEXT(new_pctl);
}
@@ -443,7 +443,8 @@ PyObject *PyCERTSTORE::PyCertAddCTLLinkToStore(PyObject *self, PyObject *args, P
Py_BEGIN_ALLOW_THREADS;
bsuccess = CertAddCTLLinkToStore(hcertstore, pctl, dwAddDisposition, &new_pctl);
Py_END_ALLOW_THREADS;
- if (!bsuccess) return PyWin_SetAPIError("CertAddCTLLinkToStore");
+ if (!bsuccess)
+ return PyWin_SetAPIError("CertAddCTLLinkToStore");
return PyWinObject_FromCTL_CONTEXT(new_pctl);
}
@@ -469,7 +470,8 @@ PyObject *PyCERTSTORE::PyCertAddStoreToCollection(PyObject *self, PyObject *args
Py_BEGIN_ALLOW_THREADS;
bsuccess = CertAddStoreToCollection(hcertstore, sibling, flags, priority);
Py_END_ALLOW_THREADS;
- if (!bsuccess) return PyWin_SetAPIError("CertAddStoreToCollection");
+ if (!bsuccess)
+ return PyWin_SetAPIError("CertAddStoreToCollection");
Py_INCREF(Py_None);
return Py_None;
@@ -520,7 +522,8 @@ PyObject *PyCERTSTORE::PyPFXExportCertStoreEx(PyObject *self, PyObject *args, Py
Py_BEGIN_ALLOW_THREADS;
bsuccess = PFXExportCertStoreEx(hcertstore, &out, password, NULL, flags);
Py_END_ALLOW_THREADS;
- if (!bsuccess) return PyWin_SetAPIError("PFXExportCertStoreEx");
+ if (!bsuccess)
+ return PyWin_SetAPIError("PFXExportCertStoreEx");
out.pbData = (BYTE *)malloc(out.cbData);
if (out.pbData == NULL)
return PyErr_NoMemory();
@@ -529,8 +532,10 @@ PyObject *PyCERTSTORE::PyPFXExportCertStoreEx(PyObject *self, PyObject *args, Py
Py_BEGIN_ALLOW_THREADS;
bsuccess = PFXExportCertStoreEx(hcertstore, &out, password, NULL, flags);
Py_END_ALLOW_THREADS;
- if (!bsuccess) PyWin_SetAPIError("PFXExportCertStoreEx");
- else ret = PyBytes_FromStringAndSize((char *)out.pbData, out.cbData);
+ if (!bsuccess)
+ PyWin_SetAPIError("PFXExportCertStoreEx");
+ else
+ ret = PyBytes_FromStringAndSize((char *)out.pbData, out.cbData);
free(out.pbData);
return ret;
}
diff --git a/win32/src/win32crypt/PyCERT_CONTEXT.cpp b/win32/src/win32crypt/PyCERT_CONTEXT.cpp
index cd2ecf0590..fb1b01f553 100644
--- a/win32/src/win32crypt/PyCERT_CONTEXT.cpp
+++ b/win32/src/win32crypt/PyCERT_CONTEXT.cpp
@@ -129,13 +129,13 @@ PyObject *PyWinObject_FromCERT_EXTENSIONArray(PCERT_EXTENSION pce, DWORD ext_cnt
return ret;
}
-#define CHECK_CERT_CONTEXT(p) \
- if (p == NULL) { \
+#define CHECK_CERT_CONTEXT(p) \
+ if (p == NULL) { \
PyErr_SetString(PyExc_ValueError, "The certificate context has been closed"); \
- return NULL; \
+ return NULL; \
}
-#define GET_CERT_CONTEXT(varname) \
+#define GET_CERT_CONTEXT(varname) \
PCCERT_CONTEXT varname = ((PyCERT_CONTEXT *)self)->GetPCCERT_CONTEXT(); \
CHECK_CERT_CONTEXT(varname);
@@ -205,15 +205,14 @@ PyObject *PyCERT_CONTEXT::getattro(PyObject *self, PyObject *obname)
return PyObject_GenericGetAttr(self, obname);
}
-PyCERT_CONTEXT::~PyCERT_CONTEXT(void) {
+PyCERT_CONTEXT::~PyCERT_CONTEXT(void)
+{
if (pccert_context) {
CertFreeCertificateContext(pccert_context);
}
}
-void PyCERT_CONTEXT::deallocFunc(PyObject *ob) {
- delete (PyCERT_CONTEXT *)ob;
-}
+void PyCERT_CONTEXT::deallocFunc(PyObject *ob) { delete (PyCERT_CONTEXT *)ob; }
PyCERT_CONTEXT::PyCERT_CONTEXT(PCCERT_CONTEXT pccert_context)
{
@@ -261,7 +260,8 @@ PyObject *PyCERT_CONTEXT::PyCertFreeCertificateContext(PyObject *self, PyObject
Py_BEGIN_ALLOW_THREADS;
bsuccess = CertFreeCertificateContext(pcc);
Py_END_ALLOW_THREADS;
- if (!bsuccess) return PyWin_SetAPIError("CertFreeCertificateContext");
+ if (!bsuccess)
+ return PyWin_SetAPIError("CertFreeCertificateContext");
((PyCERT_CONTEXT *)self)->pccert_context = NULL;
Py_INCREF(Py_None);
return Py_None;
@@ -619,7 +619,7 @@ PyObject *PyCERT_CONTEXT::PyCertSetCertificateContextProperty(PyObject *self, Py
case CERT_CTL_USAGE_PROP_ID:
if (!pybuf.init(obData))
goto cleanup;
- cdb.pbData = (BYTE*)pybuf.ptr();
+ cdb.pbData = (BYTE *)pybuf.ptr();
cdb.cbData = pybuf.len();
pvData = &cdb;
break;
diff --git a/win32/src/win32crypt/PyCRYPTHASH.cpp b/win32/src/win32crypt/PyCRYPTHASH.cpp
index 6dfdf272a8..7b5e963d72 100644
--- a/win32/src/win32crypt/PyCRYPTHASH.cpp
+++ b/win32/src/win32crypt/PyCRYPTHASH.cpp
@@ -137,7 +137,7 @@ PyObject *PyCRYPTHASH::PyCryptHashData(PyObject *self, PyObject *args, PyObject
dwDataLen = pybuf.len();
if (dwFlags & CRYPT_USERDATA)
dwDataLen = 0;
- if (CryptHashData(hcrypthash, (BYTE*)pybuf.ptr(), dwDataLen, dwFlags)) {
+ if (CryptHashData(hcrypthash, (BYTE *)pybuf.ptr(), dwDataLen, dwFlags)) {
Py_INCREF(Py_None);
return Py_None;
}
diff --git a/win32/src/win32crypt/PyCRYPTPROV.cpp b/win32/src/win32crypt/PyCRYPTPROV.cpp
index 248e763779..c65b82be19 100644
--- a/win32/src/win32crypt/PyCRYPTPROV.cpp
+++ b/win32/src/win32crypt/PyCRYPTPROV.cpp
@@ -401,7 +401,7 @@ PyObject *PyCRYPTPROV::PyCryptImportKey(PyObject *self, PyObject *args, PyObject
if (!pybuf.ok())
return NULL;
- if (!CryptImportKey(hcryptprov, (BYTE*)pybuf.ptr(), pybuf.len(), pubkey, flags, &retkey))
+ if (!CryptImportKey(hcryptprov, (BYTE *)pybuf.ptr(), pybuf.len(), pubkey, flags, &retkey))
return PyWin_SetAPIError("PyCRYPTPROV::CryptImportKey");
return new PyCRYPTKEY(retkey, self);
}
diff --git a/win32/src/win32crypt/PyCTL_CONTEXT.cpp b/win32/src/win32crypt/PyCTL_CONTEXT.cpp
index aea1a6f8d3..91487a7bb3 100644
--- a/win32/src/win32crypt/PyCTL_CONTEXT.cpp
+++ b/win32/src/win32crypt/PyCTL_CONTEXT.cpp
@@ -84,13 +84,13 @@ PyObject *PyWinObject_FromCTL_CONTEXT(PCCTL_CONTEXT pcc)
return ret;
}
-#define CHECK_CTL_CONTEXT(p) \
- if (p == NULL) { \
+#define CHECK_CTL_CONTEXT(p) \
+ if (p == NULL) { \
PyErr_SetString(PyExc_ValueError, "The certificate trust context has been closed"); \
- return NULL; \
+ return NULL; \
}
-#define GET_CTL_CONTEXT(varname) \
+#define GET_CTL_CONTEXT(varname) \
PCCTL_CONTEXT varname = ((PyCTL_CONTEXT *)self)->GetCTL_CONTEXT(); \
CHECK_CTL_CONTEXT(varname);
diff --git a/win32/src/win32crypt/win32crypt_structs.cpp b/win32/src/win32crypt/win32crypt_structs.cpp
index 668ffbcb8f..d4424c795b 100644
--- a/win32/src/win32crypt/win32crypt_structs.cpp
+++ b/win32/src/win32crypt/win32crypt_structs.cpp
@@ -10,7 +10,7 @@ BOOL PyWinObject_AsDATA_BLOB(PyObject *ob, DATA_BLOB *b)
return FALSE;
// note: this might be unsafe, as we give away the buffer pointer to a
// client outside of the scope where our RAII object 'pybuf' resides.
- b->pbData = (BYTE*)pybuf.ptr();
+ b->pbData = (BYTE *)pybuf.ptr();
b->cbData = PyWin_SAFE_DOWNCAST(pybuf.len(), Py_ssize_t, int);
return TRUE;
}
@@ -228,12 +228,13 @@ BOOL PyWinObject_AsCRYPT_ALGORITHM_IDENTIFIER(PyObject *obcai, PCRYPT_ALGORITHM_
}
ZeroMemory(pcai, sizeof(CRYPT_ALGORITHM_IDENTIFIER));
Py_ssize_t cbData;
- BOOL ok = PyArg_ParseTupleAndKeywords(
- dummy_tuple, obcai, "sz#:CRYPT_ALGORITHM_IDENTIFIER", cai_keys,
- &pcai->pszObjId, // @prop str|ObjId|An szOID_* string identifying the algorithm
- &pcai->Parameters.pbData,
- &cbData); // @prop str|Parameters|Blob of binary data containing encoded parameters
- if (ok) pcai->Parameters.cbData = (DWORD)cbData;
+ BOOL ok =
+ PyArg_ParseTupleAndKeywords(dummy_tuple, obcai, "sz#:CRYPT_ALGORITHM_IDENTIFIER", cai_keys,
+ &pcai->pszObjId, // @prop str|ObjId|An szOID_* string identifying the algorithm
+ &pcai->Parameters.pbData,
+ &cbData); // @prop str|Parameters|Blob of binary data containing encoded parameters
+ if (ok)
+ pcai->Parameters.cbData = (DWORD)cbData;
return ok;
}
@@ -280,11 +281,11 @@ BOOL PyWinObject_AsCRYPT_BIT_BLOB(PyObject *obcbb, PCRYPT_BIT_BLOB pcbb)
dummy_tuple, obcbb, "Ok:CRYPT_BIT_BLOB", cbb_keys,
&obdata, // @prop buffer|Data|Binary data
&pcbb->cUnusedBits) // @prop int|UnusedBits|Nbr of bits of last byte that are unused
- )
+ )
if (pybuf.init(obdata)) {
// note: this might be unsafe, as we give away the buffer pointer to a
// client outside of the scope where our RAII object 'pybuf' resides.
- pcbb->pbData = (BYTE*)pybuf.ptr();
+ pcbb->pbData = (BYTE *)pybuf.ptr();
pcbb->cbData = pybuf.len();
return TRUE;
}
@@ -832,7 +833,7 @@ BOOL PyWinObject_AsPBYTEArray(PyObject *str_seq, PBYTE **pbyte_array, DWORD **by
goto cleanup;
// note: this might be unsafe, as we give away the buffer pointer to a
// client outside of the scope where our RAII object 'pybuf' resides.
- (*pbyte_array)[tuple_index] = (BYTE*)pybuf.ptr();
+ (*pbyte_array)[tuple_index] = (BYTE *)pybuf.ptr();
(*byte_lens)[tuple_index] = pybuf.len();
}
ret = TRUE;
@@ -978,7 +979,7 @@ PyObject *PyWinObject_FromCERT_BASIC_CONSTRAINTS_INFO(PCERT_BASIC_CONSTRAINTS_IN
return NULL;
for (DWORD i = 0; i < pcbci->cSubtreesConstraint; i++) {
PyObject *nb = PyBytes_FromStringAndSize((char *)pcbci->rgSubtreesConstraint[i].pbData,
- pcbci->rgSubtreesConstraint[i].cbData);
+ pcbci->rgSubtreesConstraint[i].cbData);
if (nb == NULL) {
Py_DECREF(sc);
return NULL;
@@ -1013,7 +1014,7 @@ PyObject *PyWinObject_FromCERT_POLICY_INFO(PCERT_POLICY_INFO pcpi)
PyObject *qual = Py_BuildValue(
"{s:s,s:N}", "PolicyQualifierId", pcpi->rgPolicyQualifier[qual_ind].pszPolicyQualifierId, "Qualifier",
PyBytes_FromStringAndSize((char *)pcpi->rgPolicyQualifier[qual_ind].Qualifier.pbData,
- pcpi->rgPolicyQualifier[qual_ind].Qualifier.cbData));
+ pcpi->rgPolicyQualifier[qual_ind].Qualifier.cbData));
if (qual == NULL) {
Py_DECREF(quals);
return NULL;
diff --git a/win32/src/win32crypt/win32cryptmodule.cpp b/win32/src/win32crypt/win32cryptmodule.cpp
index 730fbf551a..3f801fc12b 100644
--- a/win32/src/win32crypt/win32cryptmodule.cpp
+++ b/win32/src/win32crypt/win32cryptmodule.cpp
@@ -486,7 +486,7 @@ static PyObject *PyCertEnumSystemStore(PyObject *self, PyObject *args, PyObject
CertEnumSystemStore(dwFlags, pvSystemStoreLocationPara, ret, CertEnumSystemStoreCallback);
Py_END_ALLOW_THREADS
- if (!bsuccess)
+ if (!bsuccess)
{
Py_DECREF(ret);
ret = NULL;
@@ -494,8 +494,7 @@ static PyObject *PyCertEnumSystemStore(PyObject *self, PyObject *args, PyObject
PyWin_SetAPIError("CertEnumSystemStore");
}
- if (pvSystemStoreLocationPara != NULL)
- {
+ if (pvSystemStoreLocationPara != NULL) {
if (dwFlags & CERT_SYSTEM_STORE_RELOCATE_FLAG)
PyWinObject_FreeWCHAR((WCHAR *)cssrp.pwszSystemStore);
else
@@ -609,7 +608,7 @@ static PyObject *PyCertOpenStore(PyObject *self, PyObject *args, PyObject *kwarg
case CERT_STORE_PROV_PKCS7: {
if (!pybuf.init(obpvPara))
return NULL;
- crypt_data_blob.pbData = (BYTE*)pybuf.ptr();
+ crypt_data_blob.pbData = (BYTE *)pybuf.ptr();
crypt_data_blob.cbData = pybuf.len();
pvPara = (void *)&crypt_data_blob;
break;
@@ -824,7 +823,7 @@ static PyObject *PyCryptGetKeyIdentifierProperty(PyObject *self, PyObject *args,
PyWinBufferView pybuf(obkeyid);
if (!pybuf.ok())
return NULL;
- chb.pbData = (BYTE*)pybuf.ptr();
+ chb.pbData = (BYTE *)pybuf.ptr();
chb.cbData = pybuf.len();
if (!PyWinObject_AsWCHAR(obcomputername, &computername, TRUE))
return NULL;
@@ -931,7 +930,7 @@ static PyObject *PyCryptEnumKeyIdentifierProperties(PyObject *self, PyObject *ar
if (obkeyid != Py_None) {
if (!pybuf.init(obkeyid))
return NULL;
- chb.pbData = (BYTE*)pybuf.ptr();
+ chb.pbData = (BYTE *)pybuf.ptr();
chb.cbData = pybuf.len();
}
if (!PyWinObject_AsWCHAR(obcomputername, &computername, TRUE))
@@ -1024,9 +1023,8 @@ static PyObject *PyCertAddSerializedElementToStore(PyObject *self, PyObject *arg
return NULL;
BOOL bsuccess;
- Py_BEGIN_ALLOW_THREADS bsuccess = CertAddSerializedElementToStore(hcertstore, (BYTE*)pybuf.ptr(), pybuf.len(),
- adddisposition, flags, contexttype,
- &contexttype_out, &context);
+ Py_BEGIN_ALLOW_THREADS bsuccess = CertAddSerializedElementToStore(
+ hcertstore, (BYTE *)pybuf.ptr(), pybuf.len(), adddisposition, flags, contexttype, &contexttype_out, &context);
Py_END_ALLOW_THREADS
if (!bsuccess) return PyWin_SetAPIError("CertAddSerializedElementToStore");
@@ -1077,7 +1075,7 @@ static PyObject *PyCryptQueryObject(PyObject *self, PyObject *args, PyObject *kw
case CERT_QUERY_OBJECT_BLOB:
if (!pybuf.init(obinput))
return NULL;
- blob_input.pbData = (BYTE*)pybuf.ptr();
+ blob_input.pbData = (BYTE *)pybuf.ptr();
blob_input.cbData = pybuf.len();
input = (void *)&blob_input;
break;
@@ -1092,11 +1090,11 @@ static PyObject *PyCryptQueryObject(PyObject *self, PyObject *args, PyObject *kw
BOOL bsuccess;
Py_BEGIN_ALLOW_THREADS;
- bsuccess =
- CryptQueryObject(objecttype, input, contenttype, formattype, flags, &encoding, &contenttypeout, &formattypeout,
- &hcertstore, &hcryptmsg, (const void **)&context);
+ bsuccess = CryptQueryObject(objecttype, input, contenttype, formattype, flags, &encoding, &contenttypeout,
+ &formattypeout, &hcertstore, &hcryptmsg, (const void **)&context);
Py_END_ALLOW_THREADS;
- if (!bsuccess) return PyWin_SetAPIError("CryptQueryObject");
+ if (!bsuccess)
+ return PyWin_SetAPIError("CryptQueryObject");
switch (contenttypeout) {
case CERT_QUERY_CONTENT_CERT:
@@ -1169,7 +1167,7 @@ static PyObject *PyCryptDecodeMessage(PyObject *self, PyObject *args, PyObject *
return NULL;
Py_BEGIN_ALLOW_THREADS bsuccess =
- CryptDecodeMessage(msg_type_flags, &cdmp, &cvmp, signer_ind, (BYTE*)pybuf.ptr(), pybuf.len(), prev_inner_type,
+ CryptDecodeMessage(msg_type_flags, &cdmp, &cvmp, signer_ind, (BYTE *)pybuf.ptr(), pybuf.len(), prev_inner_type,
&msg_type, &inner_type, output_buf, &output_bufsize, &exchange_cert, &signer_cert);
Py_END_ALLOW_THREADS if (!bsuccess)
{
@@ -1190,7 +1188,7 @@ static PyObject *PyCryptDecodeMessage(PyObject *self, PyObject *args, PyObject *
if (output_buf == NULL)
return PyErr_NoMemory();
Py_BEGIN_ALLOW_THREADS bsuccess =
- CryptDecodeMessage(msg_type_flags, &cdmp, &cvmp, signer_ind, (BYTE*)pybuf.ptr(), pybuf.len(), prev_inner_type,
+ CryptDecodeMessage(msg_type_flags, &cdmp, &cvmp, signer_ind, (BYTE *)pybuf.ptr(), pybuf.len(), prev_inner_type,
&msg_type, &inner_type, output_buf, &output_bufsize, NULL, NULL);
Py_END_ALLOW_THREADS if (!bsuccess)
{
@@ -1238,9 +1236,8 @@ static PyObject *PyCryptEncryptMessage(PyObject *self, PyObject *args, PyObject
return NULL;
if (!PyWinObject_AsCERT_CONTEXTArray(obrecipients, &recipients, &recipient_cnt))
return NULL;
- Py_BEGIN_ALLOW_THREADS bsuccess =
- CryptEncryptMessage(&cemp, recipient_cnt, recipients, (BYTE*)pybuf.ptr(), pybuf.len(), outputbuf,
- &output_bufsize);
+ Py_BEGIN_ALLOW_THREADS bsuccess = CryptEncryptMessage(&cemp, recipient_cnt, recipients, (BYTE *)pybuf.ptr(),
+ pybuf.len(), outputbuf, &output_bufsize);
Py_END_ALLOW_THREADS if (!bsuccess) PyWin_SetAPIError("CryptEncryptMessage");
else
{
@@ -1248,9 +1245,8 @@ static PyObject *PyCryptEncryptMessage(PyObject *self, PyObject *args, PyObject
if (outputbuf == NULL)
PyErr_Format(PyExc_MemoryError, "CryptEncryptMessage: Unable to allocate %d bytes", output_bufsize);
else {
- Py_BEGIN_ALLOW_THREADS bsuccess = CryptEncryptMessage(&cemp, recipient_cnt, recipients,
- (BYTE*)pybuf.ptr(), pybuf.len(),
- outputbuf, &output_bufsize);
+ Py_BEGIN_ALLOW_THREADS bsuccess = CryptEncryptMessage(&cemp, recipient_cnt, recipients, (BYTE *)pybuf.ptr(),
+ pybuf.len(), outputbuf, &output_bufsize);
Py_END_ALLOW_THREADS if (!bsuccess) PyWin_SetAPIError("CryptEncryptMessage");
else ret = PyBytes_FromStringAndSize((char *)outputbuf, output_bufsize);
}
@@ -1286,7 +1282,7 @@ static PyObject *PyCryptDecryptMessage(PyObject *self, PyObject *args, PyObject
return NULL;
Py_BEGIN_ALLOW_THREADS bsuccess =
- CryptDecryptMessage(&cdmp, (BYTE*)pybuf.ptr(), pybuf.len(), output_buf, &output_bufsize, NULL);
+ CryptDecryptMessage(&cdmp, (BYTE *)pybuf.ptr(), pybuf.len(), output_buf, &output_bufsize, NULL);
Py_END_ALLOW_THREADS if (!bsuccess) return PyWin_SetAPIError("CryptDecryptMessage");
output_buf = (BYTE *)malloc(output_bufsize);
@@ -1294,7 +1290,7 @@ static PyObject *PyCryptDecryptMessage(PyObject *self, PyObject *args, PyObject
return PyErr_NoMemory();
Py_BEGIN_ALLOW_THREADS bsuccess =
- CryptDecryptMessage(&cdmp, (BYTE*)pybuf.ptr(), pybuf.len(), output_buf, &output_bufsize, &exchange_cert);
+ CryptDecryptMessage(&cdmp, (BYTE *)pybuf.ptr(), pybuf.len(), output_buf, &output_bufsize, &exchange_cert);
Py_END_ALLOW_THREADS if (!bsuccess) PyWin_SetAPIError("CryptDecryptMessage");
else ret = Py_BuildValue("NN", PyBytes_FromStringAndSize((char *)output_buf, output_bufsize),
PyWinObject_FromCERT_CONTEXT(exchange_cert));
@@ -1331,9 +1327,8 @@ static PyObject *PyCryptSignAndEncryptMessage(PyObject *self, PyObject *args, Py
goto cleanup;
BOOL bsuccess;
- Py_BEGIN_ALLOW_THREADS bsuccess = CryptSignAndEncryptMessage(&csmp, &cemp, recipient_cnt, recipients,
- (BYTE*)pybuf.ptr(), pybuf.len(), output_buf,
- &output_bufsize);
+ Py_BEGIN_ALLOW_THREADS bsuccess = CryptSignAndEncryptMessage(
+ &csmp, &cemp, recipient_cnt, recipients, (BYTE *)pybuf.ptr(), pybuf.len(), output_buf, &output_bufsize);
Py_END_ALLOW_THREADS if (!bsuccess)
{
PyWin_SetAPIError("CryptSignAndEncryptMessage");
@@ -1346,9 +1341,8 @@ static PyObject *PyCryptSignAndEncryptMessage(PyObject *self, PyObject *args, Py
goto cleanup;
}
- Py_BEGIN_ALLOW_THREADS bsuccess = CryptSignAndEncryptMessage(&csmp, &cemp, recipient_cnt, recipients,
- (BYTE*)pybuf.ptr(), pybuf.len(), output_buf,
- &output_bufsize);
+ Py_BEGIN_ALLOW_THREADS bsuccess = CryptSignAndEncryptMessage(
+ &csmp, &cemp, recipient_cnt, recipients, (BYTE *)pybuf.ptr(), pybuf.len(), output_buf, &output_bufsize);
Py_END_ALLOW_THREADS if (!bsuccess)
{
PyWin_SetAPIError("CryptSignAndEncryptMessage");
@@ -1391,7 +1385,7 @@ static PyObject *PyCryptVerifyMessageSignature(PyObject *self, PyObject *args, P
if (!PyWinObject_AsCRYPT_VERIFY_MESSAGE_PARA(obcvmp, &cvmp))
return NULL;
- Py_BEGIN_ALLOW_THREADS bsuccess = CryptVerifyMessageSignature(&cvmp, signer_ind, (BYTE*)pybuf.ptr(), pybuf.len(),
+ Py_BEGIN_ALLOW_THREADS bsuccess = CryptVerifyMessageSignature(&cvmp, signer_ind, (BYTE *)pybuf.ptr(), pybuf.len(),
output_buf, &output_bufsize, &signer_cert);
Py_END_ALLOW_THREADS
// Callback may have already set an exception
@@ -1410,9 +1404,8 @@ static PyObject *PyCryptVerifyMessageSignature(PyObject *self, PyObject *args, P
if (output_buf == NULL)
PyErr_NoMemory();
else {
- Py_BEGIN_ALLOW_THREADS bsuccess =
- CryptVerifyMessageSignature(&cvmp, signer_ind, (BYTE*)pybuf.ptr(), pybuf.len(), output_buf,
- &output_bufsize, NULL);
+ Py_BEGIN_ALLOW_THREADS bsuccess = CryptVerifyMessageSignature(&cvmp, signer_ind, (BYTE *)pybuf.ptr(),
+ pybuf.len(), output_buf, &output_bufsize, NULL);
Py_END_ALLOW_THREADS if (!bsuccess)
{
// Callback may have already set an exception
@@ -1452,7 +1445,7 @@ static PyObject *PyCryptGetMessageCertificates(PyObject *self, PyObject *args, P
if (!PyWinObject_AsHCRYPTPROV(obcsp, &csp, TRUE))
return NULL;
Py_BEGIN_ALLOW_THREADS hcertstore =
- CryptGetMessageCertificates(encoding_type, csp, flags, (BYTE*)pybuf.ptr(), pybuf.len());
+ CryptGetMessageCertificates(encoding_type, csp, flags, (BYTE *)pybuf.ptr(), pybuf.len());
Py_END_ALLOW_THREADS if (hcertstore == NULL) return PyWin_SetAPIError("CryptGetMessageCertificates");
return PyWinObject_FromCERTSTORE(hcertstore);
}
@@ -1474,7 +1467,7 @@ static PyObject *PyCryptGetMessageSignerCount(PyObject *self, PyObject *args, Py
PyWinBufferView pybuf(obbuf);
if (!pybuf.ok())
return NULL;
- Py_BEGIN_ALLOW_THREADS signer_cnt = CryptGetMessageSignerCount(encoding_type, (BYTE*)pybuf.ptr(), pybuf.len());
+ Py_BEGIN_ALLOW_THREADS signer_cnt = CryptGetMessageSignerCount(encoding_type, (BYTE *)pybuf.ptr(), pybuf.len());
Py_END_ALLOW_THREADS if (signer_cnt == -1) return PyWin_SetAPIError("CryptGetMessageSignerCount");
return PyLong_FromLong(signer_cnt);
}
@@ -1563,9 +1556,8 @@ static PyObject *PyCryptVerifyDetachedMessageSignature(PyObject *self, PyObject
return NULL;
BOOL bsuccess;
- Py_BEGIN_ALLOW_THREADS bsuccess = CryptVerifyDetachedMessageSignature(&cvmp, signer_ind, (BYTE*)pybuf.ptr(),
- pybuf.len(), msg_cnt, (const BYTE **)msgs,
- msg_sizes, &signer_cert);
+ Py_BEGIN_ALLOW_THREADS bsuccess = CryptVerifyDetachedMessageSignature(
+ &cvmp, signer_ind, (BYTE *)pybuf.ptr(), pybuf.len(), msg_cnt, (const BYTE **)msgs, msg_sizes, &signer_cert);
Py_END_ALLOW_THREADS if (!bsuccess) PyWin_SetAPIError("CryptVerifyDetachedMessageSignature");
else ret = PyWinObject_FromCERT_CONTEXT(signer_cert);
@@ -1608,14 +1600,15 @@ static PyObject *PyCryptDecryptAndVerifyMessageSignature(PyObject *self, PyObjec
BOOL bsuccess;
Py_BEGIN_ALLOW_THREADS bsuccess = CryptDecryptAndVerifyMessageSignature(
- &cdmp, &cvmp, signer_ind, (BYTE*)pybuf.ptr(), pybuf.len(), output_buf, &output_bufsize, NULL, NULL);
+ &cdmp, &cvmp, signer_ind, (BYTE *)pybuf.ptr(), pybuf.len(), output_buf, &output_bufsize, NULL, NULL);
Py_END_ALLOW_THREADS if (!bsuccess) return PyWin_SetAPIError("CryptDecryptAndVerifyMessageSignature");
output_buf = (BYTE *)malloc(output_bufsize);
if (output_buf == NULL)
return PyErr_NoMemory();
- Py_BEGIN_ALLOW_THREADS bsuccess = CryptDecryptAndVerifyMessageSignature(
- &cdmp, &cvmp, signer_ind, (BYTE*)pybuf.ptr(), pybuf.len(), output_buf, &output_bufsize, &exchange_cert, &signer_cert);
+ Py_BEGIN_ALLOW_THREADS bsuccess =
+ CryptDecryptAndVerifyMessageSignature(&cdmp, &cvmp, signer_ind, (BYTE *)pybuf.ptr(), pybuf.len(), output_buf,
+ &output_bufsize, &exchange_cert, &signer_cert);
Py_END_ALLOW_THREADS if (!bsuccess) PyWin_SetAPIError("CryptDecryptAndVerifyMessageSignature");
else ret = Py_BuildValue(
"{s:N,s:N,s:N}", "Decrypted", PyBytes_FromStringAndSize((char *)output_buf, output_bufsize), "XchgCert",
@@ -1755,9 +1748,8 @@ static PyObject *PyCryptDecodeObjectEx(PyObject *self, PyObject *args, PyObject
}
BOOL bsuccess;
- Py_BEGIN_ALLOW_THREADS bsuccess =
- CryptDecodeObjectEx(encoding, structtype, (BYTE*)pybuf.ptr(), pybuf.len(), flags, NULL, &output_buf,
- &output_bufsize);
+ Py_BEGIN_ALLOW_THREADS bsuccess = CryptDecodeObjectEx(encoding, structtype, (BYTE *)pybuf.ptr(), pybuf.len(), flags,
+ NULL, &output_buf, &output_bufsize);
Py_END_ALLOW_THREADS if (!bsuccess)
{
PyWin_SetAPIError("CryptDecodeObjectEx");
@@ -1817,7 +1809,7 @@ static PyObject *PyCryptDecodeObjectEx(PyObject *self, PyObject *args, PyObject
else if (oid_is_str && (strcmp(structtype, szOID_SUBJECT_KEY_IDENTIFIER) ==
0)) // @flag szOID_SUBJECT_KEY_IDENTIFIER|Binary string containing the key identifier
ret = PyBytes_FromStringAndSize((char *)((CRYPT_DATA_BLOB *)output_buf)->pbData,
- ((CRYPT_DATA_BLOB *)output_buf)->cbData);
+ ((CRYPT_DATA_BLOB *)output_buf)->cbData);
else if ((oid_is_str && (strcmp(structtype, szOID_AUTHORITY_KEY_IDENTIFIER) ==
0)) || // @flag szOID_AUTHORITY_KEY_IDENTIFIER|
(structtype == X509_AUTHORITY_KEY_ID)) // @flag X509_AUTHORITY_KEY_ID|
@@ -1886,7 +1878,7 @@ static PyObject *PyCertNameToStr(PyObject *self, PyObject *args, PyObject *kwarg
PyWinBufferView pybuf(obname);
if (!pybuf.ok())
return NULL;
- cnb.pbData = (BYTE*)pybuf.ptr();
+ cnb.pbData = (BYTE *)pybuf.ptr();
cnb.cbData = pybuf.len();
Py_BEGIN_ALLOW_THREADS output_buflen = CertNameToStr(encoding, &cnb, strtype, output_buf, output_buflen);
@@ -1938,16 +1930,14 @@ static PyObject *PyCryptFormatObject(PyObject *self, PyObject *args, PyObject *k
BOOL bsuccess;
Py_BEGIN_ALLOW_THREADS bsuccess = CryptFormatObject(encoding, fmt_type, string_fmt, fmt_struct, oid,
- (BYTE*)pybuf.ptr(), pybuf.len(), output_buf,
- &output_bufsize);
+ (BYTE *)pybuf.ptr(), pybuf.len(), output_buf, &output_bufsize);
Py_END_ALLOW_THREADS if (!bsuccess) return PyWin_SetAPIError("CryptFormatObject");
output_buf = malloc(output_bufsize);
if (output_buf == NULL)
return PyErr_Format(PyExc_MemoryError, "Unable to allocate %d bytes", output_bufsize);
Py_BEGIN_ALLOW_THREADS bsuccess = CryptFormatObject(encoding, fmt_type, string_fmt, fmt_struct, oid,
- (BYTE*)pybuf.ptr(), pybuf.len(), output_buf,
- &output_bufsize);
+ (BYTE *)pybuf.ptr(), pybuf.len(), output_buf, &output_bufsize);
Py_END_ALLOW_THREADS if (!bsuccess) PyWin_SetAPIError("CryptFormatObject");
else ret = PyWinObject_FromWCHAR((WCHAR *)output_buf);
free(output_buf);
@@ -2045,16 +2035,16 @@ static PyObject *PyCryptBinaryToString(PyObject *self, PyObject *args, PyObject
if (!pybuf.ok())
return NULL;
BOOL bsuccess;
- Py_BEGIN_ALLOW_THREADS bsuccess = CryptBinaryToString((BYTE*)pybuf.ptr(), pybuf.len(), flags,
- output_buf, &output_size);
+ Py_BEGIN_ALLOW_THREADS bsuccess =
+ CryptBinaryToString((BYTE *)pybuf.ptr(), pybuf.len(), flags, output_buf, &output_size);
Py_END_ALLOW_THREADS if (!bsuccess) return PyWin_SetAPIError("CryptBinaryToString");
output_buf = (WCHAR *)malloc(output_size * sizeof(WCHAR));
if (output_buf == NULL)
return PyErr_NoMemory();
PyObject *ret = NULL;
- Py_BEGIN_ALLOW_THREADS bsuccess = CryptBinaryToString((BYTE*)pybuf.ptr(), pybuf.len(), flags,
- output_buf, &output_size);
+ Py_BEGIN_ALLOW_THREADS bsuccess =
+ CryptBinaryToString((BYTE *)pybuf.ptr(), pybuf.len(), flags, output_buf, &output_size);
Py_END_ALLOW_THREADS if (!bsuccess) PyWin_SetAPIError("CryptBinaryToString");
else ret = PyWinObject_FromWCHAR(output_buf, output_size);
free(output_buf);
diff --git a/win32/src/win32dynamicdialog.cpp b/win32/src/win32dynamicdialog.cpp
index c5b815c259..bef6473748 100644
--- a/win32/src/win32dynamicdialog.cpp
+++ b/win32/src/win32dynamicdialog.cpp
@@ -599,7 +599,7 @@ static BOOL ParseDlgItemList(CPythonDialogTemplate *dlg, PyObject *tmpl)
if (IS_INTRESOURCE(wclass))
ret = dlg->Add((WORD)wclass, &tpl, caption);
else
- ret = dlg->Add(wclass, &tpl, caption, pybuf.len(), (BYTE*)pybuf.ptr());
+ ret = dlg->Add(wclass, &tpl, caption, pybuf.len(), (BYTE *)pybuf.ptr());
cleanup:
PyWinObject_FreeResourceId(wclass);
diff --git a/win32/src/win32file_comm.cpp b/win32/src/win32file_comm.cpp
index 77121e0668..bcd2d3667f 100644
--- a/win32/src/win32file_comm.cpp
+++ b/win32/src/win32file_comm.cpp
@@ -162,8 +162,11 @@ PyDCB::PyDCB(const DCB &other)
PyDCB::~PyDCB(void) {}
-#define GET_BITFIELD_ENTRY(bitfield_name) \
- else if (strcmp(name, #bitfield_name) == 0) { return PyLong_FromLong(pydcb->m_DCB.##bitfield_name); }
+#define GET_BITFIELD_ENTRY(bitfield_name) \
+ else if (strcmp(name, #bitfield_name) == 0) \
+ { \
+ return PyLong_FromLong(pydcb->m_DCB.##bitfield_name); \
+ }
PyObject *PyDCB::getattro(PyObject *self, PyObject *obname)
{
@@ -194,11 +197,11 @@ PyObject *PyDCB::getattro(PyObject *self, PyObject *obname)
#define SET_BITFIELD_ENTRY(bitfield_name) \
else if (strcmp(name, #bitfield_name) == 0) \
{ \
- if (!PyLong_Check(v)) { \
+ if (!PyLong_Check(v)) { \
PyErr_Format(PyExc_TypeError, szNeedIntAttr, #bitfield_name); \
return -1; \
} \
- pydcb->m_DCB.##bitfield_name = PyLong_AsLong(v); \
+ pydcb->m_DCB.##bitfield_name = PyLong_AsLong(v); \
return 0; \
}
@@ -361,8 +364,11 @@ PyCOMSTAT::PyCOMSTAT(const COMSTAT &other)
PyCOMSTAT::~PyCOMSTAT(void) {}
#undef GET_BITFIELD_ENTRY
-#define GET_BITFIELD_ENTRY(bitfield_name) \
- else if (strcmp(name, #bitfield_name) == 0) { return PyLong_FromLong(pyCOMSTAT->m_COMSTAT.##bitfield_name); }
+#define GET_BITFIELD_ENTRY(bitfield_name) \
+ else if (strcmp(name, #bitfield_name) == 0) \
+ { \
+ return PyLong_FromLong(pyCOMSTAT->m_COMSTAT.##bitfield_name); \
+ }
PyObject *PyCOMSTAT::getattro(PyObject *self, PyObject *obname)
{
@@ -387,11 +393,11 @@ PyObject *PyCOMSTAT::getattro(PyObject *self, PyObject *obname)
#define SET_BITFIELD_ENTRY(bitfield_name) \
else if (strcmp(name, #bitfield_name) == 0) \
{ \
- if (!PyLong_Check(v)) { \
+ if (!PyLong_Check(v)) { \
PyErr_Format(PyExc_TypeError, szNeedIntAttr, #bitfield_name); \
return -1; \
} \
- pyCOMSTAT->m_COMSTAT.##bitfield_name = PyLong_AsLong(v); \
+ pyCOMSTAT->m_COMSTAT.##bitfield_name = PyLong_AsLong(v); \
return 0; \
}
diff --git a/win32/src/win32gui.i b/win32/src/win32gui.i
index d466cc3350..a59ae28232 100644
--- a/win32/src/win32gui.i
+++ b/win32/src/win32gui.i
@@ -1995,121 +1995,159 @@ LRESULT DefWindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
%{
struct PyEnumWindowsCallback {
- PyObject *func;
- PyObject *extra;
+ PyObject *func;
+ PyObject *extra;
};
BOOL CALLBACK PyEnumWindowsProc(
HWND hwnd, // handle to parent window
LPARAM lParam // application-defined value
) {
- BOOL result = TRUE;
- PyEnumWindowsCallback *cb = (PyEnumWindowsCallback *)lParam;
- CEnterLeavePython _celp;
- PyObject *args = Py_BuildValue("(NO)", PyWinLong_FromHANDLE(hwnd), cb->extra);
- if (args == NULL)
- return FALSE;
- PyObject *ret = PyEval_CallObject(cb->func, args);
- Py_DECREF(args);
- if (ret == NULL)
- return FALSE;
- if (ret != Py_None){
- result = PyLong_AsLong(ret);
- if (result == -1 && PyErr_Occurred())
- result = FALSE;
- }
- Py_DECREF(ret);
- return result;
+ BOOL result = TRUE;
+ PyEnumWindowsCallback *cb = (PyEnumWindowsCallback *)lParam;
+ CEnterLeavePython _celp;
+ PyObject *args = Py_BuildValue("(NO)", PyWinLong_FromHANDLE(hwnd), cb->extra);
+ if (args == NULL)
+ return FALSE;
+ PyObject *ret = PyObject_CallObject(cb->func, args);
+ Py_DECREF(args);
+ if (ret == NULL)
+ return FALSE;
+ if (ret != Py_None) {
+ result = PyLong_AsLong(ret);
+ if ((result == -1) && (PyErr_Occurred()))
+ result = FALSE;
+ }
+ Py_DECREF(ret);
+ return result;
}
// @pyswig |EnumWindows|Enumerates all top-level windows on the screen by passing the handle to each window, in turn, to an application-defined callback function.
static PyObject *PyEnumWindows(PyObject *self, PyObject *args)
{
- BOOL rc;
- PyObject *obFunc, *obOther;
- // @pyparm function|callback||A Python function to be used as the callback. Function can return False to stop enumeration, or raise an exception.
- // @pyparm object|extra||Any python object - this is passed to the callback function as the second param (first is the hwnd).
- if (!PyArg_ParseTuple(args, "OO", &obFunc, &obOther))
- return NULL;
- if (!PyCallable_Check(obFunc)) {
- PyErr_SetString(PyExc_TypeError, "First param must be a callable object");
- return NULL;
- }
- PyEnumWindowsCallback cb;
- cb.func = obFunc;
- cb.extra = obOther;
+ BOOL rc;
+ PyObject *obFunc, *obOther;
+ // @pyparm function|callback||A Python function to be used as the callback. Function can return False to stop enumeration, or raise an exception.
+ // @pyparm object|extra||Any python object - this is passed to the callback function as the second param (first is the hwnd).
+ if (!PyArg_ParseTuple(args, "OO", &obFunc, &obOther))
+ return NULL;
+ if (!PyCallable_Check(obFunc)) {
+ PyErr_SetString(PyExc_TypeError, "First param must be a callable object");
+ return NULL;
+ }
+ PyEnumWindowsCallback cb;
+ cb.func = obFunc;
+ cb.extra = obOther;
Py_BEGIN_ALLOW_THREADS
- rc = EnumWindows(PyEnumWindowsProc, (LPARAM)&cb);
+ rc = EnumWindows(PyEnumWindowsProc, (LPARAM)&cb);
Py_END_ALLOW_THREADS
- if (!rc){
- // Callback may have raised an exception already
- if (PyErr_Occurred())
- return NULL;
- return PyWin_SetAPIError("EnumWindows");
- }
- Py_INCREF(Py_None);
- return Py_None;
+ if (!rc) {
+ // Callback may have raised an exception already
+ if (PyErr_Occurred())
+ return NULL;
+ return PyWin_SetAPIErrorOrReturnNone("EnumWindows");
+ }
+ Py_RETURN_NONE;
}
// @pyswig |EnumThreadWindows|Enumerates all top-level windows associated with a thread on the screen by passing the handle to each window, in turn, to an application-defined callback function. EnumThreadWindows continues until the last top-level window associated with the thread is enumerated or the callback function returns FALSE
static PyObject *PyEnumThreadWindows(PyObject *self, PyObject *args)
{
- BOOL rc;
- PyObject *obFunc, *obOther;
- DWORD dwThreadId;
- // @pyparm int|dwThreadId||The id of the thread for which the windows need to be enumerated.
- // @pyparm object|callback||A Python function to be used as the callback.
- // @pyparm object|extra||Any python object - this is passed to the callback function as the second param (first is the hwnd).
- if (!PyArg_ParseTuple(args, "lOO", &dwThreadId, &obFunc, &obOther))
- return NULL;
- if (!PyCallable_Check(obFunc)) {
- PyErr_SetString(PyExc_TypeError, "Second param must be a callable object");
- return NULL;
- }
- PyEnumWindowsCallback cb;
- cb.func = obFunc;
- cb.extra = obOther;
+ BOOL rc;
+ PyObject *obFunc, *obOther;
+ DWORD dwThreadId;
+ // @pyparm int|dwThreadId||The id of the thread for which the windows need to be enumerated.
+ // @pyparm object|callback||A Python function to be used as the callback.
+ // @pyparm object|extra||Any python object - this is passed to the callback function as the second param (first is the hwnd).
+ if (!PyArg_ParseTuple(args, "lOO", &dwThreadId, &obFunc, &obOther))
+ return NULL;
+ if (!PyCallable_Check(obFunc)) {
+ PyErr_SetString(PyExc_TypeError, "Second param must be a callable object");
+ return NULL;
+ }
+ PyEnumWindowsCallback cb;
+ cb.func = obFunc;
+ cb.extra = obOther;
Py_BEGIN_ALLOW_THREADS
- rc = EnumThreadWindows(dwThreadId, PyEnumWindowsProc, (LPARAM)&cb);
+ rc = EnumThreadWindows(dwThreadId, PyEnumWindowsProc, (LPARAM)&cb);
Py_END_ALLOW_THREADS
- if (!rc)
- return PyWin_SetAPIError("EnumThreadWindows");
- Py_INCREF(Py_None);
- return Py_None;
+ if (!rc) {
+ // Callback may have raised an exception already
+ if (PyErr_Occurred())
+ return NULL;
+ return PyWin_SetAPIErrorOrReturnNone("EnumThreadWindows");
+ }
+ Py_RETURN_NONE;
}
// @pyswig |EnumChildWindows|Enumerates the child windows that belong to the specified parent window by passing the handle to each child window, in turn, to an application-defined callback function. EnumChildWindows continues until the last child window is enumerated or the callback function returns FALSE.
static PyObject *PyEnumChildWindows(PyObject *self, PyObject *args)
{
- PyObject *obhwnd, *obFunc, *obOther;
- HWND hwnd;
- // @pyparm |hwnd||The handle to the window to enumerate.
- // @pyparm object|callback||A Python function to be used as the callback.
- // @pyparm object|extra||Any python object - this is passed to the callback function as the second param (first is the hwnd).
- if (!PyArg_ParseTuple(args, "OOO", &obhwnd, &obFunc, &obOther))
- return NULL;
- if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&hwnd))
- return NULL;
- if (!PyCallable_Check(obFunc)) {
- PyErr_SetString(PyExc_TypeError, "First param must be a callable object");
- return NULL;
- }
- PyEnumWindowsCallback cb;
- cb.func = obFunc;
- cb.extra = obOther;
+ PyObject *obhwnd, *obFunc, *obOther;
+ HWND hwnd;
+ // @pyparm |hwnd||The handle to the window to enumerate.
+ // @pyparm object|callback||A Python function to be used as the callback.
+ // @pyparm object|extra||Any python object - this is passed to the callback function as the second param (first is the hwnd).
+ if (!PyArg_ParseTuple(args, "OOO", &obhwnd, &obFunc, &obOther))
+ return NULL;
+ if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&hwnd))
+ return NULL;
+ if (!PyCallable_Check(obFunc)) {
+ PyErr_SetString(PyExc_TypeError, "Second param must be a callable object");
+ return NULL;
+ }
+ PyEnumWindowsCallback cb;
+ cb.func = obFunc;
+ cb.extra = obOther;
Py_BEGIN_ALLOW_THREADS
- // According to MSDN, the return value is not used, and according to
- // #1350, may cause spurious exceptions.
- EnumChildWindows(hwnd, PyEnumWindowsProc, (LPARAM)&cb);
+ // According to MSDN, the return value is not used, and according to
+ // #1350, may cause spurious exceptions.
+ EnumChildWindows(hwnd, PyEnumWindowsProc, (LPARAM)&cb);
Py_END_ALLOW_THREADS
- Py_INCREF(Py_None);
- return Py_None;
+ if (PyErr_Occurred())
+ return NULL;
+ Py_RETURN_NONE;
+}
+
+// @pyswig |EnumDesktopWindows|Enumerates all top-level windows associated with a desktop on the screen by passing the handle to each window, in turn, to an application-defined callback function. EnumThreadWindows continues until the last top-level window associated with the thread is enumerated or the callback function returns FALSE
+static PyObject *PyEnumDesktopWindows(PyObject *self, PyObject *args)
+{
+ BOOL rc;
+ PyObject *obDesktop, *obFunc, *obOther;
+ HDESK hDesktop = NULL;
+ // @pyparm |hDesktop||The id of the desktop for which the windows need to be enumerated.
+ // @pyparm object|callback||A Python function to be used as the callback.
+ // @pyparm object|extra||Any python object - this is passed to the callback function as the second param (first is the hwnd).
+ if (!PyArg_ParseTuple(args, "OOO", &obDesktop, &obFunc, &obOther))
+ return NULL;
+ if (!PyWinObject_AsHANDLE(obDesktop, (HANDLE *)&hDesktop))
+ return NULL;
+ if (!PyCallable_Check(obFunc)) {
+ PyErr_SetString(PyExc_TypeError, "Second param must be a callable object");
+ return NULL;
+ }
+ PyEnumWindowsCallback cb;
+ cb.func = obFunc;
+ cb.extra = obOther;
+ Py_BEGIN_ALLOW_THREADS
+ rc = EnumDesktopWindows(hDesktop, PyEnumWindowsProc, (LPARAM)&cb);
+ Py_END_ALLOW_THREADS
+ if (!rc) {
+ // Callback may have raised an exception already
+ if (PyErr_Occurred())
+ return NULL;
+ return PyWin_SetAPIErrorOrReturnNone("EnumDesktopWindows");
+ }
+ Py_RETURN_NONE;
}
%}
%native (EnumWindows) PyEnumWindows;
%native (EnumThreadWindows) PyEnumThreadWindows;
%native (EnumChildWindows) PyEnumChildWindows;
+%native (EnumDesktopWindows) PyEnumDesktopWindows;
+
+HDESK GetThreadDesktop(DWORD dwThreadId);
// @pyswig int|DialogBox|Creates a modal dialog box.
%{
@@ -5972,7 +6010,7 @@ PyGetClassName(PyObject *self, PyObject *args)
return NULL;
if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&hwnd))
return NULL;
- // dont bother with lock - no callback possible.
+ // don't bother with lock - no callback possible.
int nchars = GetClassName(hwnd, buf, sizeof buf/sizeof buf[0]);
if (nchars==0)
return PyWin_SetAPIError("GetClassName");
diff --git a/win32/src/win32helpmodule.cpp b/win32/src/win32helpmodule.cpp
index f9094b5ed1..9bf9bf7816 100644
--- a/win32/src/win32helpmodule.cpp
+++ b/win32/src/win32helpmodule.cpp
@@ -66,10 +66,8 @@ static PyObject *PyWinHelp(PyObject *self, PyObject *args)
data = (ULONG_PTR)pybuf.ptr();
if (!PyWinObject_AsTCHAR(obhlpFile, &hlpFile, FALSE))
return NULL;
- PyW32_BEGIN_ALLOW_THREADS
- BOOL ok = ::WinHelp(hwnd, hlpFile, cmd, data);
- PyW32_END_ALLOW_THREADS
- PyWinObject_FreeTCHAR(hlpFile);
+ PyW32_BEGIN_ALLOW_THREADS BOOL ok = ::WinHelp(hwnd, hlpFile, cmd, data);
+ PyW32_END_ALLOW_THREADS PyWinObject_FreeTCHAR(hlpFile);
if (!ok)
return ReturnAPIError("WinHelp");
Py_INCREF(Py_None);
@@ -1527,7 +1525,7 @@ PyNMHDR::PyNMHDR(const NMHDR *pNMHDR)
memcpy(&m_NMHDR, pNMHDR, sizeof(m_NMHDR));
}
-PyNMHDR::~PyNMHDR(void){};
+PyNMHDR::~PyNMHDR(void) {};
/*static*/ void PyNMHDR::deallocFunc(PyObject *ob) { delete (PyNMHDR *)ob; }
@@ -2377,7 +2375,8 @@ file must be a string");
}
if (dataOb == Py_None) {
data = 0;
- } else {
+ }
+ else {
if (!PyWinObject_AsTCHAR(dataOb, &dataObAsTCHAR, FALSE, NULL))
return NULL;
data = (DWORD_PTR)dataObAsTCHAR;
@@ -2488,11 +2487,10 @@ data tuple items must be integers");
}
HWND helpWnd;
- PyW32_BEGIN_ALLOW_THREADS
- helpWnd = ::HtmlHelp(hwnd, file, cmd, data);
+ PyW32_BEGIN_ALLOW_THREADS helpWnd = ::HtmlHelp(hwnd, file, cmd, data);
PyW32_END_ALLOW_THREADS
- PyWinObject_FreeTCHAR(dataObAsTCHAR);
+ PyWinObject_FreeTCHAR(dataObAsTCHAR);
PyWinObject_FreeTCHAR(file);
PyObject *ret;
diff --git a/win32/src/win32net/win32netgroup.cpp b/win32/src/win32net/win32netgroup.cpp
index 5fcb0357d4..3e30ff88af 100644
--- a/win32/src/win32net/win32netgroup.cpp
+++ b/win32/src/win32net/win32netgroup.cpp
@@ -8,26 +8,11 @@
#include "win32net.h"
#include "stddef.h"
-#define GI0_ENTRY(name, t, r) \
- { \
-#name, t, offsetof(GROUP_INFO_0, grpi0_##name), r \
- }
-#define GI1_ENTRY(name, t, r) \
- { \
-#name, t, offsetof(GROUP_INFO_1, grpi1_##name), r \
- }
-#define GI2_ENTRY(name, t, r) \
- { \
-#name, t, offsetof(GROUP_INFO_2, grpi2_##name), r \
- }
-#define GI1002_ENTRY(name, t, r) \
- { \
-#name, t, offsetof(GROUP_INFO_1002, grpi1002_##name), r \
- }
-#define GI1005_ENTRY(name, t, r) \
- { \
-#name, t, offsetof(GROUP_INFO_1005, grpi1005_##name), r \
- }
+#define GI0_ENTRY(name, t, r) {#name, t, offsetof(GROUP_INFO_0, grpi0_##name), r}
+#define GI1_ENTRY(name, t, r) {#name, t, offsetof(GROUP_INFO_1, grpi1_##name), r}
+#define GI2_ENTRY(name, t, r) {#name, t, offsetof(GROUP_INFO_2, grpi2_##name), r}
+#define GI1002_ENTRY(name, t, r) {#name, t, offsetof(GROUP_INFO_1002, grpi1002_##name), r}
+#define GI1005_ENTRY(name, t, r) {#name, t, offsetof(GROUP_INFO_1005, grpi1005_##name), r}
// @object PyGROUP_INFO_0|A dictionary holding the information in a Win32 GROUP_INFO_0 structure.
static struct PyNET_STRUCT_ITEM gi0[] = {
@@ -65,18 +50,9 @@ static struct PyNET_STRUCT group_infos[] = { // @flagh Level|Data
{1005, gi1005, sizeof(GROUP_INFO_1005)}, // @flag 1005|
{0, NULL, 0}};
-#define LGI0_ENTRY(name, t, r) \
- { \
-#name, t, offsetof(LOCALGROUP_INFO_0, lgrpi0_##name), r \
- }
-#define LGI1_ENTRY(name, t, r) \
- { \
-#name, t, offsetof(LOCALGROUP_INFO_1, lgrpi1_##name), r \
- }
-#define LGI1002_ENTRY(name, t, r) \
- { \
-#name, t, offsetof(LOCALGROUP_INFO_1002, lgrpi1002_##name), r \
- }
+#define LGI0_ENTRY(name, t, r) {#name, t, offsetof(LOCALGROUP_INFO_0, lgrpi0_##name), r}
+#define LGI1_ENTRY(name, t, r) {#name, t, offsetof(LOCALGROUP_INFO_1, lgrpi1_##name), r}
+#define LGI1002_ENTRY(name, t, r) {#name, t, offsetof(LOCALGROUP_INFO_1002, lgrpi1002_##name), r}
// @object PyLOCALGROUP_INFO_0|A dictionary holding the information in a Win32 LOCALGROUP_INFO_0 structure.
static struct PyNET_STRUCT_ITEM LGI0[] = {
@@ -101,19 +77,13 @@ static struct PyNET_STRUCT localgroup_infos[] = { // @flagh Level|Data
{1002, LGI1002, sizeof(LOCALGROUP_INFO_1002)}, // @flag 1002|
{0, NULL, 0}};
-#define LGMI0_ENTRY(name, t, r) \
- { \
-#name, t, offsetof(LOCALGROUP_MEMBERS_INFO_0, lgrmi0_##name), r \
- }
+#define LGMI0_ENTRY(name, t, r) {#name, t, offsetof(LOCALGROUP_MEMBERS_INFO_0, lgrmi0_##name), r}
// @object PyLOCALGROUP_MEMBERS_INFO_0|A dictionary holding the information in a Win32 LOCALGROUP_MEMBERS_INFO_0
// structure.
static struct PyNET_STRUCT_ITEM lgmi0[] = {LGMI0_ENTRY(sid, NSI_SID, 0), // @prop |sid|
{NULL}};
-#define LGMI1_ENTRY(name, t, r) \
- { \
-#name, t, offsetof(LOCALGROUP_MEMBERS_INFO_1, lgrmi1_##name), r \
- }
+#define LGMI1_ENTRY(name, t, r) {#name, t, offsetof(LOCALGROUP_MEMBERS_INFO_1, lgrmi1_##name), r}
// @object PyLOCALGROUP_MEMBERS_INFO_1|A dictionary holding the information in a Win32 LOCALGROUP_MEMBERS_INFO_1
// structure.
static struct PyNET_STRUCT_ITEM lgmi1[] = {LGMI1_ENTRY(sid, NSI_SID, 0), // @prop |sid|
@@ -121,10 +91,7 @@ static struct PyNET_STRUCT_ITEM lgmi1[] = {LGMI1_ENTRY(sid, NSI_SID, 0),
LGMI1_ENTRY(name, NSI_WSTR, 0), // @prop string/|name|
{NULL}};
-#define LGMI2_ENTRY(name, t, r) \
- { \
-#name, t, offsetof(LOCALGROUP_MEMBERS_INFO_2, lgrmi2_##name), r \
- }
+#define LGMI2_ENTRY(name, t, r) {#name, t, offsetof(LOCALGROUP_MEMBERS_INFO_2, lgrmi2_##name), r}
// @object PyLOCALGROUP_MEMBERS_INFO_2|A dictionary holding the information in a Win32 LOCALGROUP_MEMBERS_INFO_2
// structure.
static struct PyNET_STRUCT_ITEM lgmi2[] = {
@@ -134,10 +101,7 @@ static struct PyNET_STRUCT_ITEM lgmi2[] = {
// the member prefixed by the domain name and the "\" separator character
{NULL}};
-#define LGMI3_ENTRY(name, t, r) \
- { \
-#name, t, offsetof(LOCALGROUP_MEMBERS_INFO_3, lgrmi3_##name), r \
- }
+#define LGMI3_ENTRY(name, t, r) {#name, t, offsetof(LOCALGROUP_MEMBERS_INFO_3, lgrmi3_##name), r}
// @object PyLOCALGROUP_MEMBERS_INFO_3|A dictionary holding the information in a Win32 LOCALGROUP_MEMBERS_INFO_3
// structure.
static struct PyNET_STRUCT_ITEM lgmi3[] = {
@@ -153,14 +117,8 @@ static struct PyNET_STRUCT localgroup_members_infos[] = { // @flagh Level|Data
{3, lgmi3, sizeof(LOCALGROUP_MEMBERS_INFO_3)}, // @flag 3|
{NULL}};
-#define GUI0_ENTRY(name, t, r) \
- { \
-#name, t, offsetof(GROUP_USERS_INFO_0, grui0_##name), r \
- }
-#define GUI1_ENTRY(name, t, r) \
- { \
-#name, t, offsetof(GROUP_USERS_INFO_1, grui1_##name), r \
- }
+#define GUI0_ENTRY(name, t, r) {#name, t, offsetof(GROUP_USERS_INFO_0, grui0_##name), r}
+#define GUI1_ENTRY(name, t, r) {#name, t, offsetof(GROUP_USERS_INFO_1, grui1_##name), r}
// @object PyGROUP_USERS_INFO_0|A dictionary holding the information in a Win32 GROUP_USERS_INFO_0 structure.
static struct PyNET_STRUCT_ITEM gui0[] = {
GUI0_ENTRY(name, NSI_WSTR, 0), // @prop string/|name|Name of the group or user
diff --git a/win32/src/win32net/win32netmisc.cpp b/win32/src/win32net/win32netmisc.cpp
index 4aa0e796f7..025665e36f 100644
--- a/win32/src/win32net/win32netmisc.cpp
+++ b/win32/src/win32net/win32netmisc.cpp
@@ -10,28 +10,19 @@
#include "win32net.h"
#include "stddef.h"
-#define SI0_ENTRY(name, t, r) \
- { \
-#name, t, offsetof(SHARE_INFO_0, shi0_##name), r \
- }
+#define SI0_ENTRY(name, t, r) {#name, t, offsetof(SHARE_INFO_0, shi0_##name), r}
// @object PySHARE_INFO_0|A dictionary holding the infomation in a Win32 SHARE_INFO_0 structure.
static struct PyNET_STRUCT_ITEM si0[] = {SI0_ENTRY(netname, NSI_WSTR, 0), // @prop string/|netname|
{NULL}};
-#define SI1_ENTRY(name, t, r) \
- { \
-#name, t, offsetof(SHARE_INFO_1, shi1_##name), r \
- }
+#define SI1_ENTRY(name, t, r) {#name, t, offsetof(SHARE_INFO_1, shi1_##name), r}
// @object PySHARE_INFO_1|A dictionary holding the infomation in a Win32 SHARE_INFO_1 structure.
static struct PyNET_STRUCT_ITEM si1[] = {SI1_ENTRY(netname, NSI_WSTR, 0), // @prop string/|netname|
SI1_ENTRY(type, NSI_DWORD, 0), // @prop int|type|
SI1_ENTRY(remark, NSI_WSTR, 0), // @prop string/|remark|
{NULL}};
-#define SI2_ENTRY(name, t, r) \
- { \
-#name, t, offsetof(SHARE_INFO_2, shi2_##name), r \
- }
+#define SI2_ENTRY(name, t, r) {#name, t, offsetof(SHARE_INFO_2, shi2_##name), r}
// @object PySHARE_INFO_2|A dictionary holding the infomation in a Win32 SHARE_INFO_2 structure.
static struct PyNET_STRUCT_ITEM si2[] = {SI2_ENTRY(netname, NSI_WSTR, 0), // @prop string/|netname|
SI2_ENTRY(type, NSI_DWORD, 0), // @prop int|type|
@@ -43,10 +34,7 @@ static struct PyNET_STRUCT_ITEM si2[] = {SI2_ENTRY(netname, NSI_WSTR, 0),
SI2_ENTRY(passwd, NSI_WSTR, 0), // @prop string/|passwd|
{NULL}};
-#define SI501_ENTRY(name, t, r) \
- { \
-#name, t, offsetof(SHARE_INFO_501, shi501_##name), r \
- }
+#define SI501_ENTRY(name, t, r) {#name, t, offsetof(SHARE_INFO_501, shi501_##name), r}
// @object PySHARE_INFO_501|A dictionary holding the infomation in a Win32 SHARE_INFO_501 structure.
static struct PyNET_STRUCT_ITEM si501[] = {SI501_ENTRY(netname, NSI_WSTR, 0), // @prop string/|netname|
SI501_ENTRY(type, NSI_DWORD, 0), // @prop int|type|
@@ -54,10 +42,7 @@ static struct PyNET_STRUCT_ITEM si501[] = {SI501_ENTRY(netname, NSI_WSTR, 0), /
SI501_ENTRY(flags, NSI_DWORD, 0), // @prop int|flags|
{NULL}};
-#define SI502_ENTRY(name, t, r) \
- { \
-#name, t, offsetof(SHARE_INFO_502, shi502_##name), r \
- }
+#define SI502_ENTRY(name, t, r) {#name, t, offsetof(SHARE_INFO_502, shi502_##name), r}
// @object PySHARE_INFO_502|A dictionary holding the infomation in a Win32 SHARE_INFO_502 structure.
static struct PyNET_STRUCT_ITEM si502[] = {SI502_ENTRY(netname, NSI_WSTR, 0), // @prop string/|netname|
SI502_ENTRY(type, NSI_DWORD, 0), // @prop int|type|
@@ -81,10 +66,7 @@ static struct PyNET_STRUCT share_infos[] = { // @flagh Level|Data
{502, si502, sizeof(SHARE_INFO_502)}, // @flag 502|
{0, NULL, 0}};
-#define WKI100_ENTRY(name, t, r) \
- { \
-#name, t, offsetof(WKSTA_INFO_100, wki100_##name), r \
- }
+#define WKI100_ENTRY(name, t, r) {#name, t, offsetof(WKSTA_INFO_100, wki100_##name), r}
// @object PyWKSTA_INFO_100|A dictionary holding the infomation in a Win32 WKSTA_INFO_100 structure.
static struct PyNET_STRUCT_ITEM wki100[] = {
WKI100_ENTRY(platform_id, NSI_DWORD,
@@ -98,10 +80,7 @@ static struct PyNET_STRUCT_ITEM wki100[] = {
0), // @prop int|ver_minor|Minor version number of operating system running on the computer
{NULL}};
-#define WKI101_ENTRY(name, t, r) \
- { \
-#name, t, offsetof(WKSTA_INFO_101, wki101_##name), r \
- }
+#define WKI101_ENTRY(name, t, r) {#name, t, offsetof(WKSTA_INFO_101, wki101_##name), r}
// @object PyWKSTA_INFO_101|A dictionary holding the infomation in a Win32 WKSTA_INFO_101 structure.
static struct PyNET_STRUCT_ITEM wki101[] = {
WKI101_ENTRY(platform_id, NSI_DWORD,
@@ -116,10 +95,7 @@ static struct PyNET_STRUCT_ITEM wki101[] = {
WKI101_ENTRY(lanroot, NSI_WSTR, 0), // @prop string/|lanroot|Path to the LANMAN directory
{NULL}};
-#define WKI102_ENTRY(name, t, r) \
- { \
-#name, t, offsetof(WKSTA_INFO_102, wki102_##name), r \
- }
+#define WKI102_ENTRY(name, t, r) {#name, t, offsetof(WKSTA_INFO_102, wki102_##name), r}
// @object PyWKSTA_INFO_102|A dictionary holding the infomation in a Win32 WKSTA_INFO_102 structure.
static struct PyNET_STRUCT_ITEM wki102[] = {
WKI102_ENTRY(platform_id, NSI_DWORD,
@@ -136,10 +112,7 @@ static struct PyNET_STRUCT_ITEM wki102[] = {
0), // @prop int|logged_on_users|Number of users who are logged on to the local computer
{NULL}};
-#define WKI302_ENTRY(name, t, r) \
- { \
-#name, t, offsetof(WKSTA_INFO_302, wki302_##name), r \
- }
+#define WKI302_ENTRY(name, t, r) {#name, t, offsetof(WKSTA_INFO_302, wki302_##name), r}
// @object PyWKSTA_INFO_302|A dictionary holding the infomation in a Win32 WKSTA_INFO_302 structure.
static struct PyNET_STRUCT_ITEM wki302[] = {
WKI302_ENTRY(
@@ -193,10 +166,7 @@ static struct PyNET_STRUCT_ITEM wki302[] = {
0), // @prop int|num_dgram_buf|Specifies the number of buffers to allocate for receiving datagrams.
{NULL}};
-#define WKI402_ENTRY(name, t, r) \
- { \
-#name, t, offsetof(WKSTA_INFO_402, wki402_##name), r \
- }
+#define WKI402_ENTRY(name, t, r) {#name, t, offsetof(WKSTA_INFO_402, wki402_##name), r}
// @object PyWKSTA_INFO_402|A dictionary holding the infomation in a Win32 WKSTA_INFO_402 structure.
static struct PyNET_STRUCT_ITEM wki402[] = {
WKI402_ENTRY(
@@ -235,10 +205,7 @@ static struct PyNET_STRUCT_ITEM wki402[] = {
0), // @prop int|max_threads|Number of threads the computer can dedicate to the network
{NULL}};
-#define WKI502_ENTRY(name, t, r) \
- { \
-#name, t, offsetof(WKSTA_INFO_502, wki502_##name), r \
- }
+#define WKI502_ENTRY(name, t, r) {#name, t, offsetof(WKSTA_INFO_502, wki502_##name), r}
// @object PyWKSTA_INFO_502|A dictionary holding the infomation in a Win32 WKSTA_INFO_502 structure.
static struct PyNET_STRUCT_ITEM wki502[] = {
WKI502_ENTRY(
@@ -309,20 +276,14 @@ static struct PyNET_STRUCT wksta_infos[] = { // @flagh Level|Data
{502, wki502, sizeof(WKSTA_INFO_502)}, // @flag 502,|
{0, NULL, 0}};
-#define WKUI0_ENTRY(name, t, r) \
- { \
-#name, t, offsetof(WKSTA_USER_INFO_0, wkui0_##name), r \
- }
+#define WKUI0_ENTRY(name, t, r) {#name, t, offsetof(WKSTA_USER_INFO_0, wkui0_##name), r}
// @object PyWKSTA_USER_INFO_0|A dictionary holding the infomation in a Win32 WKSTA_USER_INFO_0 structure.
static struct PyNET_STRUCT_ITEM wkui0[] = {
WKUI0_ENTRY(username, NSI_WSTR,
0), // @prop string/|username|Name of user currently logged on to the workstation
{NULL}};
-#define WKUI1_ENTRY(name, t, r) \
- { \
-#name, t, offsetof(WKSTA_USER_INFO_1, wkui1_##name), r \
- }
+#define WKUI1_ENTRY(name, t, r) {#name, t, offsetof(WKSTA_USER_INFO_1, wkui1_##name), r}
// @object PyWKSTA_USER_INFO_1|A dictionary holding the infomation in a Win32 WKSTA_USER_INFO_1 structure.
static struct PyNET_STRUCT_ITEM wkui1[] = {
WKUI1_ENTRY(username, NSI_WSTR,
@@ -343,10 +304,7 @@ static struct PyNET_STRUCT wktau_infos[] = { // @flagh Level|Data
{1, wkui1, sizeof(WKSTA_USER_INFO_1)}, // @flag 1,|
{0, NULL, 0}};
-#define WKTI0_ENTRY(name, t, r) \
- { \
-#name, t, offsetof(WKSTA_TRANSPORT_INFO_0, wkti0_##name), r \
- }
+#define WKTI0_ENTRY(name, t, r) {#name, t, offsetof(WKSTA_TRANSPORT_INFO_0, wkti0_##name), r}
// @object PyWKSTA_TRANSPORT_INFO_0|A dictionary holding the infomation in a Win32 WKSTA_TRANSPORT_INFO_0 structure.
static struct PyNET_STRUCT_ITEM wkti0[] = {
WKTI0_ENTRY(quality_of_service, NSI_DWORD,
@@ -415,11 +373,11 @@ static PyObject *PyNetShareEnum1(WCHAR *szServerName)
return NULL;
}
- p_nr++; // next object (its a ++ because it is a typed pointer)
+ p_nr++; // next object (it's a ++ because it is a typed pointer)
dwCount--;
} while (dwCount);
}; // if dwCount
- } // if Errno == NERR_Sucess
+ } // if Errno == NERR_Sucess
else
{
Py_DECREF(pRetlist);
@@ -576,18 +534,12 @@ PyObject *PyNetShareCheck(PyObject *self, PyObject *args)
// @pyseeapi NetShareCheck
}
-#define SV100_ENTRY(name, t, r) \
- { \
-#name, t, offsetof(SERVER_INFO_100, sv100_##name), r \
- }
+#define SV100_ENTRY(name, t, r) {#name, t, offsetof(SERVER_INFO_100, sv100_##name), r}
// @object PySERVER_INFO_100|A dictionary holding the information in a Win32 SERVER_INFO_100 structure.
static struct PyNET_STRUCT_ITEM sv100[] = {SV100_ENTRY(platform_id, NSI_DWORD, 0), // @prop int|platform_id|
SV100_ENTRY(name, NSI_WSTR, 0), // @prop string/|name|
{NULL}};
-#define SV101_ENTRY(name, t, r) \
- { \
-#name, t, offsetof(SERVER_INFO_101, sv101_##name), r \
- }
+#define SV101_ENTRY(name, t, r) {#name, t, offsetof(SERVER_INFO_101, sv101_##name), r}
// @object PySERVER_INFO_101|A dictionary holding the information in a Win32 SERVER_INFO_101 structure.
static struct PyNET_STRUCT_ITEM sv101[] = {
SV101_ENTRY(platform_id, NSI_DWORD, 0), // @prop int|platform_id|
@@ -598,10 +550,7 @@ static struct PyNET_STRUCT_ITEM sv101[] = {
SV101_ENTRY(comment, NSI_WSTR, 0), // @prop string/|comment|
{NULL}};
-#define SV102_ENTRY(name, t, r) \
- { \
-#name, t, offsetof(SERVER_INFO_102, sv102_##name), r \
- }
+#define SV102_ENTRY(name, t, r) {#name, t, offsetof(SERVER_INFO_102, sv102_##name), r}
// @object PySERVER_INFO_102|A dictionary holding the information in a Win32 SERVER_INFO_102 structure.
static struct PyNET_STRUCT_ITEM sv102[] = {
SV102_ENTRY(platform_id, NSI_DWORD, 0), // @prop int|platform_id|
@@ -618,10 +567,7 @@ static struct PyNET_STRUCT_ITEM sv102[] = {
SV102_ENTRY(userpath, NSI_WSTR, 0), // @prop string/|userpath|
{NULL}};
-#define SV402_ENTRY(name, t, r) \
- { \
-#name, t, offsetof(SERVER_INFO_402, sv402_##name), r \
- }
+#define SV402_ENTRY(name, t, r) {#name, t, offsetof(SERVER_INFO_402, sv402_##name), r}
// @object PySERVER_INFO_402|A dictionary holding the information in a Win32 SERVER_INFO_402 structure.
static struct PyNET_STRUCT_ITEM sv402[] = {
SV402_ENTRY(ulist_mtime, NSI_DWORD, 0), // @prop int|ulist_mtime|
@@ -656,10 +602,7 @@ static struct PyNET_STRUCT_ITEM sv402[] = {
SV402_ENTRY(srvheuristics, NSI_WSTR, 0), // @prop string/|srvheuristics|
{NULL}};
-#define SV403_ENTRY(name, t, r) \
- { \
-#name, t, offsetof(SERVER_INFO_403, sv403_##name), r \
- }
+#define SV403_ENTRY(name, t, r) {#name, t, offsetof(SERVER_INFO_403, sv403_##name), r}
// @object PySERVER_INFO_403|A dictionary holding the information in a Win32 SERVER_INFO_403 structure.
static struct PyNET_STRUCT_ITEM sv403[] = {
SV403_ENTRY(ulist_mtime, NSI_DWORD, 0), // @prop int|ulist_mtime|
@@ -697,10 +640,7 @@ static struct PyNET_STRUCT_ITEM sv403[] = {
SV403_ENTRY(autopath, NSI_WSTR, 0), // @prop string/|autopath|
{NULL}};
-#define SV502_ENTRY(name, t) \
- { \
-#name, t, offsetof(SERVER_INFO_502, sv502_##name), 0 \
- }
+#define SV502_ENTRY(name, t) {#name, t, offsetof(SERVER_INFO_502, sv502_##name), 0}
// @object PySERVER_INFO_502|A dictionary holding the information in a Win32 SERVER_INFO_502 structure.
static struct PyNET_STRUCT_ITEM sv502[] = {
SV502_ENTRY(sessopens, NSI_DWORD), // @prop int|sessopens|
@@ -722,10 +662,7 @@ static struct PyNET_STRUCT_ITEM sv502[] = {
SV502_ENTRY(lmannounce, NSI_BOOL), // @prop bool|lmannounce|
{NULL}};
-#define SV503_ENTRY(name, t) \
- { \
-#name, t, offsetof(SERVER_INFO_503, sv503_##name), 0 \
- }
+#define SV503_ENTRY(name, t) {#name, t, offsetof(SERVER_INFO_503, sv503_##name), 0}
// @object PySERVER_INFO_503|A dictionary holding the information in a Win32 SERVER_INFO_503 structure.
static struct PyNET_STRUCT_ITEM sv503[] = {
SV503_ENTRY(sessopens, NSI_DWORD), // @prop int|sessopens|
@@ -1484,10 +1421,12 @@ static BOOL PyObject_AsAUTH_INPUT(PyObject *ob, NET_VALIDATE_AUTHENTICATION_INPU
kw = ob;
args = PyTuple_New(0);
BOOL decref_args = (args != 0);
- } else if (PyTuple_Check(ob)) {
+ }
+ else if (PyTuple_Check(ob)) {
kw = NULL;
args = ob;
- } else {
+ }
+ else {
PyErr_SetString(PyExc_TypeError, "Must be tuple or dict");
return FALSE;
}
@@ -1536,10 +1475,12 @@ static BOOL PyObject_AsCHANGE_INPUT(PyObject *ob, NET_VALIDATE_PASSWORD_CHANGE_I
kw = ob;
args = PyTuple_New(0);
BOOL decref_args = (args != 0);
- } else if (PyTuple_Check(ob)) {
+ }
+ else if (PyTuple_Check(ob)) {
kw = NULL;
args = ob;
- } else {
+ }
+ else {
PyErr_SetString(PyExc_TypeError, "Must be tuple or dict");
return FALSE;
}
@@ -1554,7 +1495,8 @@ static BOOL PyObject_AsCHANGE_INPUT(PyObject *ob, NET_VALIDATE_PASSWORD_CHANGE_I
&Length,
&p->PasswordMatch); // @pyparm int|PasswordMatch|0|Note MSDN incorrectly documents this member as
// PasswordMatched
- if (rc) p->HashedPassword.Length = Length;
+ if (rc)
+ p->HashedPassword.Length = Length;
if (decref_args)
Py_DECREF(args);
diff --git a/win32/src/win32net/win32netuse.cpp b/win32/src/win32net/win32netuse.cpp
index a3d49e560e..8ddfce2a52 100644
--- a/win32/src/win32net/win32netuse.cpp
+++ b/win32/src/win32net/win32netuse.cpp
@@ -9,19 +9,13 @@
#include "win32net.h"
#include "stddef.h"
-#define UI0_ENTRY(name, t, r) \
- { \
-#name, t, offsetof(USE_INFO_0, ui0_##name), r \
- }
+#define UI0_ENTRY(name, t, r) {#name, t, offsetof(USE_INFO_0, ui0_##name), r}
// @object PyUSE_INFO_0|A dictionary holding the infomation in a Win32 USE_INFO_0 structure.
static struct PyNET_STRUCT_ITEM ui0[] = {UI0_ENTRY(local, NSI_WSTR, 0), // @prop string/|local|
UI0_ENTRY(remote, NSI_WSTR, 0), // @prop string/|remote|
{NULL}};
-#define UI1_ENTRY(name, t, r) \
- { \
-#name, t, offsetof(USE_INFO_1, ui1_##name), r \
- }
+#define UI1_ENTRY(name, t, r) {#name, t, offsetof(USE_INFO_1, ui1_##name), r}
// @object PyUSE_INFO_1|A dictionary holding the infomation in a Win32 USE_INFO_1 structure.
static struct PyNET_STRUCT_ITEM ui1[] = {UI1_ENTRY(local, NSI_WSTR, 0), // @prop string/|local|
UI1_ENTRY(remote, NSI_WSTR, 0), // @prop string/|remote|
@@ -32,10 +26,7 @@ static struct PyNET_STRUCT_ITEM ui1[] = {UI1_ENTRY(local, NSI_WSTR, 0), //
UI1_ENTRY(usecount, NSI_DWORD, 0), // @prop int|usecount|
{NULL}};
-#define UI2_ENTRY(name, t, r) \
- { \
-#name, t, offsetof(USE_INFO_2, ui2_##name), r \
- }
+#define UI2_ENTRY(name, t, r) {#name, t, offsetof(USE_INFO_2, ui2_##name), r}
// @object PyUSE_INFO_2|A dictionary holding the infomation in a Win32 USE_INFO_2 structure.
static struct PyNET_STRUCT_ITEM ui2[] = {UI2_ENTRY(local, NSI_WSTR, 0), // @prop string/|local|
UI2_ENTRY(remote, NSI_WSTR, 0), // @prop string/|remote|
@@ -48,10 +39,7 @@ static struct PyNET_STRUCT_ITEM ui2[] = {UI2_ENTRY(local, NSI_WSTR, 0), //
UI2_ENTRY(domainname, NSI_WSTR, 0), // @prop string/|domainname|
{NULL}};
-#define UI3_ENTRY(name, t, r) \
- { \
-#name, t, offsetof(USE_INFO_3, ui3_##name), r \
- }
+#define UI3_ENTRY(name, t, r) {#name, t, offsetof(USE_INFO_3, ui3_##name), r}
// @object PyUSE_INFO_3|A dictionary holding the infomation in a Win32 USE_INFO_3 structure.
static struct PyNET_STRUCT_ITEM ui3[] = {
UI2_ENTRY(local, NSI_WSTR, 0), // @prop string/|local|
diff --git a/win32/src/win32net/win32netuser.cpp b/win32/src/win32net/win32netuser.cpp
index f7a903bf0b..e3977d4d1c 100644
--- a/win32/src/win32net/win32netuser.cpp
+++ b/win32/src/win32net/win32netuser.cpp
@@ -12,87 +12,27 @@ of the Network API. This is part of the win32net module.
#include "win32net.h"
#include "stddef.h"
-#define UI0_ENTRY(name, t, r) \
- { \
-#name, t, offsetof(USER_INFO_0, usri0_##name), r \
- }
-#define UI1_ENTRY(name, t, r) \
- { \
-#name, t, offsetof(USER_INFO_1, usri1_##name), r \
- }
-#define UI2_ENTRY(name, t, r) \
- { \
-#name, t, offsetof(USER_INFO_2, usri2_##name), r \
- }
-#define UI3_ENTRY(name, t, r) \
- { \
-#name, t, offsetof(USER_INFO_3, usri3_##name), r \
- }
-#define UI4_ENTRY(name, t, r) \
- { \
-#name, t, offsetof(USER_INFO_4, usri4_##name), r \
- }
-#define UI10_ENTRY(name, t, r) \
- { \
-#name, t, offsetof(USER_INFO_10, usri10_##name), r \
- }
-#define UI11_ENTRY(name, t, r) \
- { \
-#name, t, offsetof(USER_INFO_11, usri11_##name), r \
- }
-#define UI20_ENTRY(name, t, r) \
- { \
-#name, t, offsetof(USER_INFO_20, usri20_##name), r \
- }
-#define UI1003_ENTRY(name, t, r) \
- { \
-#name, t, offsetof(USER_INFO_1003, usri1003_##name), r \
- }
-#define UI1005_ENTRY(name, t, r) \
- { \
-#name, t, offsetof(USER_INFO_1005, usri1005_##name), r \
- }
-#define UI1006_ENTRY(name, t, r) \
- { \
-#name, t, offsetof(USER_INFO_1006, usri1006_##name), r \
- }
-#define UI1007_ENTRY(name, t, r) \
- { \
-#name, t, offsetof(USER_INFO_1007, usri1007_##name), r \
- }
-#define UI1008_ENTRY(name, t, r) \
- { \
-#name, t, offsetof(USER_INFO_1008, usri1008_##name), r \
- }
-#define UI1009_ENTRY(name, t, r) \
- { \
-#name, t, offsetof(USER_INFO_1009, usri1009_##name), r \
- }
-#define UI1010_ENTRY(name, t, r) \
- { \
-#name, t, offsetof(USER_INFO_1010, usri1010_##name), r \
- }
-#define UI1011_ENTRY(name, t, r) \
- { \
-#name, t, offsetof(USER_INFO_1011, usri1011_##name), r \
- }
-
-#define UMI0_ENTRY(name, t, r) \
- { \
-#name, t, offsetof(USER_MODALS_INFO_0, usrmod0_##name), r \
- }
-#define UMI1_ENTRY(name, t, r) \
- { \
-#name, t, offsetof(USER_MODALS_INFO_1, usrmod1_##name), r \
- }
-#define UMI2_ENTRY(name, t, r) \
- { \
-#name, t, offsetof(USER_MODALS_INFO_2, usrmod2_##name), r \
- }
-#define UMI3_ENTRY(name, t, r) \
- { \
-#name, t, offsetof(USER_MODALS_INFO_3, usrmod3_##name), r \
- }
+#define UI0_ENTRY(name, t, r) {#name, t, offsetof(USER_INFO_0, usri0_##name), r}
+#define UI1_ENTRY(name, t, r) {#name, t, offsetof(USER_INFO_1, usri1_##name), r}
+#define UI2_ENTRY(name, t, r) {#name, t, offsetof(USER_INFO_2, usri2_##name), r}
+#define UI3_ENTRY(name, t, r) {#name, t, offsetof(USER_INFO_3, usri3_##name), r}
+#define UI4_ENTRY(name, t, r) {#name, t, offsetof(USER_INFO_4, usri4_##name), r}
+#define UI10_ENTRY(name, t, r) {#name, t, offsetof(USER_INFO_10, usri10_##name), r}
+#define UI11_ENTRY(name, t, r) {#name, t, offsetof(USER_INFO_11, usri11_##name), r}
+#define UI20_ENTRY(name, t, r) {#name, t, offsetof(USER_INFO_20, usri20_##name), r}
+#define UI1003_ENTRY(name, t, r) {#name, t, offsetof(USER_INFO_1003, usri1003_##name), r}
+#define UI1005_ENTRY(name, t, r) {#name, t, offsetof(USER_INFO_1005, usri1005_##name), r}
+#define UI1006_ENTRY(name, t, r) {#name, t, offsetof(USER_INFO_1006, usri1006_##name), r}
+#define UI1007_ENTRY(name, t, r) {#name, t, offsetof(USER_INFO_1007, usri1007_##name), r}
+#define UI1008_ENTRY(name, t, r) {#name, t, offsetof(USER_INFO_1008, usri1008_##name), r}
+#define UI1009_ENTRY(name, t, r) {#name, t, offsetof(USER_INFO_1009, usri1009_##name), r}
+#define UI1010_ENTRY(name, t, r) {#name, t, offsetof(USER_INFO_1010, usri1010_##name), r}
+#define UI1011_ENTRY(name, t, r) {#name, t, offsetof(USER_INFO_1011, usri1011_##name), r}
+
+#define UMI0_ENTRY(name, t, r) {#name, t, offsetof(USER_MODALS_INFO_0, usrmod0_##name), r}
+#define UMI1_ENTRY(name, t, r) {#name, t, offsetof(USER_MODALS_INFO_1, usrmod1_##name), r}
+#define UMI2_ENTRY(name, t, r) {#name, t, offsetof(USER_MODALS_INFO_2, usrmod2_##name), r}
+#define UMI3_ENTRY(name, t, r) {#name, t, offsetof(USER_MODALS_INFO_3, usrmod3_##name), r}
// @object PyUSER_INFO_0|A dictionary holding the information in a Win32 USER_INFO_0 structure.
static struct PyNET_STRUCT_ITEM ui0[] = {UI0_ENTRY(name, NSI_WSTR, 0), // @prop string/|name|
@@ -571,7 +511,7 @@ PyObject *PyNetUserGetGroups(PyObject *self, PyObject *args)
return NULL;
}
- p_nr++; // next object (its a ++ because it is a typed pointer!)
+ p_nr++; // next object (it's a ++ because it is a typed pointer!)
dwCount--;
} while (dwCount);
}; // if (dwCount > 0)
@@ -657,7 +597,7 @@ PyObject *PyNetUserGetLocalGroups(PyObject *self, PyObject *args)
return NULL;
}
- p_nr++; // next object (its a ++ because it is a typed pointer!)
+ p_nr++; // next object (it's a ++ because it is a typed pointer!)
dwCount--;
} while (dwCount);
}; // if (dwCount > 0)
diff --git a/win32/src/win32pdhmodule.cpp b/win32/src/win32pdhmodule.cpp
index 26d5df5c23..5631da52a7 100644
--- a/win32/src/win32pdhmodule.cpp
+++ b/win32/src/win32pdhmodule.cpp
@@ -665,7 +665,7 @@ static PyObject *PyGetFormattedCounterValue(PyObject *self, PyObject *args)
else if (format & PDH_FMT_LARGE)
rc = PyLong_FromLongLong(result.largeValue);
else {
- PyErr_SetString(PyExc_ValueError, "Dont know how to convert the result");
+ PyErr_SetString(PyExc_ValueError, "Don't know how to convert the result");
rc = NULL;
}
PyObject *realrc = Py_BuildValue("iO", type, rc);
@@ -697,8 +697,7 @@ static PyObject *PyPdhGetFormattedCounterArray(PyObject *self, PyObject *args)
pdhStatus = (*pPdhGetFormattedCounterArray)(handle, format, &size, &count, pItems);
Py_END_ALLOW_THREADS;
if (pdhStatus != PDH_MORE_DATA) {
- return PyWin_SetAPIError("PdhGetFormattedCounterArray",
- pdhStatus);
+ return PyWin_SetAPIError("PdhGetFormattedCounterArray", pdhStatus);
}
pItems = (PDH_FMT_COUNTERVALUE_ITEM *)malloc(size);
if (pItems == NULL) {
@@ -709,8 +708,7 @@ static PyObject *PyPdhGetFormattedCounterArray(PyObject *self, PyObject *args)
Py_BEGIN_ALLOW_THREADS;
pdhStatus = (*pPdhGetFormattedCounterArray)(handle, format, &size, &count, pItems);
Py_END_ALLOW_THREADS;
- if (pdhStatus != ERROR_SUCCESS)
- {
+ if (pdhStatus != ERROR_SUCCESS) {
free(pItems);
return PyWin_SetAPIError("PdhGetFormattedCounterArray", pdhStatus);
}
@@ -733,7 +731,7 @@ static PyObject *PyPdhGetFormattedCounterArray(PyObject *self, PyObject *args)
else if (format & PDH_FMT_LARGE)
value = PyLong_FromLongLong(pItems[i].FmtValue.largeValue);
else {
- PyErr_SetString(PyExc_ValueError, "Dont know how to convert the result");
+ PyErr_SetString(PyExc_ValueError, "Don't know how to convert the result");
Py_XDECREF(rc);
Py_XDECREF(key);
rc = NULL;
diff --git a/win32/src/win32print/win32print.cpp b/win32/src/win32print/win32print.cpp
index 6962767cf9..9a4ce5829e 100644
--- a/win32/src/win32print/win32print.cpp
+++ b/win32/src/win32print/win32print.cpp
@@ -218,7 +218,7 @@ static PyObject *PyWinObject_FromPRINTER_INFO(LPBYTE printer_info, DWORD level)
pi5->TransmissionRetryTimeout);
case 6:
PRINTER_INFO_6 *pi6;
- pi6 = (PRINTER_INFO_6*)printer_info;
+ pi6 = (PRINTER_INFO_6 *)printer_info;
return Py_BuildValue("{s:k}", "Status", pi6->dwStatus);
case 7:
PRINTER_INFO_7 *pi7;
@@ -335,16 +335,15 @@ void PyWinObject_FreePRINTER_INFO(DWORD level, LPBYTE pbuf)
free(pbuf);
}
-#define AsPRINTER_INFO__INIT_PRINTER_INFO_X(_PRINTER_INFO_X, _PIX_PTR) \
- _PRINTER_INFO_X *_PIX_PTR; \
- bufsize = sizeof(_PRINTER_INFO_X); \
- if ((*pbuf = (LPBYTE)malloc(bufsize)) == NULL) { \
+#define AsPRINTER_INFO__INIT_PRINTER_INFO_X(_PRINTER_INFO_X, _PIX_PTR) \
+ _PRINTER_INFO_X *_PIX_PTR; \
+ bufsize = sizeof(_PRINTER_INFO_X); \
+ if ((*pbuf = (LPBYTE)malloc(bufsize)) == NULL) { \
PyErr_Format(PyExc_MemoryError, "Malloc failed for %d bytes", bufsize); \
- break; \
- } \
- ZeroMemory(*pbuf, bufsize); \
- _PIX_PTR = (_PRINTER_INFO_X*)*pbuf;
-
+ break; \
+ } \
+ ZeroMemory(*pbuf, bufsize); \
+ _PIX_PTR = (_PRINTER_INFO_X *)*pbuf;
BOOL PyWinObject_AsPRINTER_INFO(DWORD level, PyObject *obinfo, LPBYTE *pbuf)
{
@@ -459,9 +458,7 @@ BOOL PyWinObject_AsPRINTER_INFO(DWORD level, PyObject *obinfo, LPBYTE *pbuf)
break;
}
case 6: {
- static char *pi6_keys[] = {
- "Status",
- NULL };
+ static char *pi6_keys[] = {"Status", NULL};
static char *pi6_format = "k:PRINTER_INFO_6";
AsPRINTER_INFO__INIT_PRINTER_INFO_X(PRINTER_INFO_6, pi6);
ret = PyArg_ParseTupleAndKeywords(dummy_tuple, obinfo, pi6_format, pi6_keys, &pi6->dwStatus);
@@ -1139,7 +1136,7 @@ static PyObject *PyGetJob(PyObject *self, PyObject *args)
// Convert a python dictionary to a JOB_INFO_* structure.
// Returned buffer must be freed.
-BOOL PytoJob(DWORD level, PyObject *pyjobinfo, LPBYTE *pbuf, TmpWCHAR* tmpw_shelve)
+BOOL PytoJob(DWORD level, PyObject *pyjobinfo, LPBYTE *pbuf, TmpWCHAR *tmpw_shelve)
{
static char *job1_keys[] = {"JobId", "pPrinterName", "pMachineName", "pUserName", "pDocument",
"pDatatype", "pStatus", "Status", "Priority", "Position",
@@ -1161,7 +1158,7 @@ BOOL PytoJob(DWORD level, PyObject *pyjobinfo, LPBYTE *pbuf, TmpWCHAR* tmpw_shel
// record conversions unicode / None --> WCHAR* / NULL
int i, u2w_count = 0;
TmpWCHAR *ptw = tmpw_shelve;
-#define U2W(target) (ptw->u=(PyObject*)target, ptw++, u2w_count++, target)
+#define U2W(target) (ptw->u = (PyObject *)target, ptw++, u2w_count++, target)
*pbuf = NULL;
switch (level) {
@@ -1185,9 +1182,9 @@ BOOL PytoJob(DWORD level, PyObject *pyjobinfo, LPBYTE *pbuf, TmpWCHAR* tmpw_shel
ZeroMemory(job1, sizeof(JOB_INFO_1));
if (PyArg_ParseTupleAndKeywords(dummy_tuple, pyjobinfo, job1_format, job1_keys, &job1->JobId,
U2W(&job1->pPrinterName), U2W(&job1->pMachineName), U2W(&job1->pUserName),
- U2W(&job1->pDocument), U2W(&job1->pDatatype), U2W(&job1->pStatus), &job1->Status,
- &job1->Priority, &job1->Position, &job1->TotalPages, &job1->PagesPrinted,
- &obsubmitted) &&
+ U2W(&job1->pDocument), U2W(&job1->pDatatype), U2W(&job1->pStatus),
+ &job1->Status, &job1->Priority, &job1->Position, &job1->TotalPages,
+ &job1->PagesPrinted, &obsubmitted) &&
((obsubmitted == Py_None) || PyWinObject_AsSYSTEMTIME(obsubmitted, &job1->Submitted)))
ret = TRUE;
break;
@@ -1205,10 +1202,11 @@ BOOL PytoJob(DWORD level, PyObject *pyjobinfo, LPBYTE *pbuf, TmpWCHAR* tmpw_shel
ZeroMemory(job2, sizeof(JOB_INFO_2));
if (PyArg_ParseTupleAndKeywords(
dummy_tuple, pyjobinfo, job2_format, job2_keys, &job2->JobId, U2W(&job2->pPrinterName),
- U2W(&job2->pMachineName), U2W(&job2->pUserName), U2W(&job2->pDocument), U2W(&job2->pNotifyName), U2W(&job2->pDatatype),
- U2W(&job2->pPrintProcessor), U2W(&job2->pParameters), U2W(&job2->pDriverName), &obdevmode, U2W(&job2->pStatus),
- &obsecurity_descriptor, &job2->Status, &job2->Priority, &job2->Position, &job2->StartTime,
- &job2->UntilTime, &job2->TotalPages, &job2->Size, &obsubmitted, &job2->Time, &job2->PagesPrinted) &&
+ U2W(&job2->pMachineName), U2W(&job2->pUserName), U2W(&job2->pDocument), U2W(&job2->pNotifyName),
+ U2W(&job2->pDatatype), U2W(&job2->pPrintProcessor), U2W(&job2->pParameters),
+ U2W(&job2->pDriverName), &obdevmode, U2W(&job2->pStatus), &obsecurity_descriptor, &job2->Status,
+ &job2->Priority, &job2->Position, &job2->StartTime, &job2->UntilTime, &job2->TotalPages,
+ &job2->Size, &obsubmitted, &job2->Time, &job2->PagesPrinted) &&
PyWinObject_AsDEVMODE(obdevmode, &job2->pDevMode, TRUE) &&
PyWinObject_AsSECURITY_DESCRIPTOR(obsecurity_descriptor, &job2->pSecurityDescriptor, TRUE) &&
((obsubmitted == Py_None) || PyWinObject_AsSYSTEMTIME(obsubmitted, &job2->Submitted)))
@@ -1234,11 +1232,11 @@ BOOL PytoJob(DWORD level, PyObject *pyjobinfo, LPBYTE *pbuf, TmpWCHAR* tmpw_shel
}
// Conversions unicode / None --> WCHAR* / NULL (held by tmpw_shelve)
- for (i=0, ptw = tmpw_shelve; ret && i < u2w_count; i++, ptw++) {
- PyObject *o = *(PyObject**)ptw->u;
+ for (i = 0, ptw = tmpw_shelve; ret && i < u2w_count; i++, ptw++) {
+ PyObject *o = *(PyObject **)ptw->u;
if (o == Py_None)
- *(WCHAR**)ptw->u = NULL;
- else if (!(*(WCHAR**)ptw->u = *ptw = o)) // convert, hold and store in target
+ *(WCHAR **)ptw->u = NULL;
+ else if (!(*(WCHAR **)ptw->u = *ptw = o)) // convert, hold and store in target
ret = FALSE;
}
#undef U2W
@@ -1710,7 +1708,7 @@ BOOL PyWinObject_AsSIZEL(PyObject *obsizel, SIZEL *sizel)
// @prop dict|ImageableArea|A dictionary representing a RECTL structure {'left':int, 'top':int, 'right':int,
// 'bottom':int}
-BOOL PyWinObject_AsFORM_INFO_1(PyObject *obform, FORM_INFO_1W *fi1, TmpWCHAR* ptw)
+BOOL PyWinObject_AsFORM_INFO_1(PyObject *obform, FORM_INFO_1W *fi1, TmpWCHAR *ptw)
{
static char *form_keys[] = {"Flags", "Name", "Size", "ImageableArea", 0};
static char *err_msg =
@@ -1720,8 +1718,8 @@ BOOL PyWinObject_AsFORM_INFO_1(PyObject *obform, FORM_INFO_1W *fi1, TmpWCHAR* pt
return FALSE;
}
return PyArg_ParseTupleAndKeywords(dummy_tuple, obform, "kUO&O&:FORM_INFO_1", form_keys, &fi1->Flags, &ptw->u,
- PyWinObject_AsSIZEL, &fi1->Size, PyWinObject_AsRECTL, &fi1->ImageableArea)
- && (fi1->pName=ptw->u2w());
+ PyWinObject_AsSIZEL, &fi1->Size, PyWinObject_AsRECTL, &fi1->ImageableArea) &&
+ (fi1->pName = ptw->u2w());
}
// @pymethod |win32print|AddForm|Adds a form for a printer
@@ -1736,8 +1734,8 @@ static PyObject *PyAddForm(PyObject *self, PyObject *args)
PyObject *py_form1;
TmpWCHAR tmpw_shelve[1];
- if (!PyArg_ParseTuple(args, "O&O:AddForm", PyWinObject_AsPrinterHANDLE, &hprinter, &py_form1)
- || !PyWinObject_AsFORM_INFO_1(py_form1, &fi1, tmpw_shelve))
+ if (!PyArg_ParseTuple(args, "O&O:AddForm", PyWinObject_AsPrinterHANDLE, &hprinter, &py_form1) ||
+ !PyWinObject_AsFORM_INFO_1(py_form1, &fi1, tmpw_shelve))
return NULL;
if (!(*pfnAddForm)(hprinter, 1, (LPBYTE)&fi1))
return PyWin_SetAPIError("AddForm");
@@ -1755,7 +1753,8 @@ static PyObject *PyDeleteForm(PyObject *self, PyObject *args)
TmpWCHAR formname;
CHECK_PFN(DeleteForm);
- if (!PyArg_ParseTuple(args, "O&U:DeleteForm", PyWinObject_AsPrinterHANDLE, &hprinter, &formname.u) || !formname.u2w())
+ if (!PyArg_ParseTuple(args, "O&U:DeleteForm", PyWinObject_AsPrinterHANDLE, &hprinter, &formname.u) ||
+ !formname.u2w())
return NULL;
if (!(*pfnDeleteForm)(hprinter, formname))
return PyWin_SetAPIError("DeleteForm");
@@ -1809,8 +1808,8 @@ static PyObject *PySetForm(PyObject *self, PyObject *args)
TmpWCHAR tmpw_shelve[1];
CHECK_PFN(SetForm);
- if (!PyArg_ParseTuple(args, "O&UO:SetForm", PyWinObject_AsPrinterHANDLE, &hprinter, &formname.u, &py_form1)
- || !formname.u2w() || !PyWinObject_AsFORM_INFO_1(py_form1, &fi1, tmpw_shelve))
+ if (!PyArg_ParseTuple(args, "O&UO:SetForm", PyWinObject_AsPrinterHANDLE, &hprinter, &formname.u, &py_form1) ||
+ !formname.u2w() || !PyWinObject_AsFORM_INFO_1(py_form1, &fi1, tmpw_shelve))
return NULL;
if (!(*pfnSetForm)(hprinter, formname, 1, (LPBYTE)&fi1))
return PyWin_SetAPIError("SetForm");
@@ -1892,7 +1891,7 @@ static PyObject *PyDeviceCapabilities(PyObject *self, PyObject *args)
static DWORD papernamesize = 64; // same for DC_PAPERNAMES, DC_MEDIATYPENAMES, DC_MEDIAREADY, DC_FILEDEPENDENCIES
static DWORD binnamesize = 24; // DC_BINNAMES
static DWORD personalitysize = 32; // DC_PERSONALITY
- DWORD retsize, actual_ret_size ;
+ DWORD retsize, actual_ret_size;
if (!PyArg_ParseTuple(args, "OOh|O:DeviceCapabilities", &obdevice, &obport, &capability, &obdevmode))
return NULL;
@@ -2459,7 +2458,8 @@ static PyObject *PyDeletePrinterDriver(PyObject *self, PyObject *args)
// @comm Does not delete associated driver files - use if this is required
if (PyArg_ParseTuple(args, "OOO:DeletePrinterDriver", &observername, &obenvironment, &obdrivername) &&
PyWinObject_AsWCHAR(observername, &servername, TRUE) &&
- PyWinObject_AsWCHAR(obenvironment, &environment, TRUE) && PyWinObject_AsWCHAR(obdrivername, &drivername, FALSE)) {
+ PyWinObject_AsWCHAR(obenvironment, &environment, TRUE) &&
+ PyWinObject_AsWCHAR(obdrivername, &drivername, FALSE)) {
if (DeletePrinterDriverW(servername, environment, drivername)) {
Py_INCREF(Py_None);
ret = Py_None;
@@ -2495,7 +2495,8 @@ static PyObject *PyDeletePrinterDriverEx(PyObject *self, PyObject *args)
if (PyArg_ParseTuple(args, "OOOll:DeletePrinterDriverEx", &observername, &obenvironment, &obdrivername, &deleteflag,
&versionflag) &&
PyWinObject_AsWCHAR(observername, &servername, TRUE) &&
- PyWinObject_AsWCHAR(obenvironment, &environment, TRUE) && PyWinObject_AsWCHAR(obdrivername, &drivername, FALSE)) {
+ PyWinObject_AsWCHAR(obenvironment, &environment, TRUE) &&
+ PyWinObject_AsWCHAR(obdrivername, &drivername, FALSE)) {
if ((*pfnDeletePrinterDriverEx)(servername, environment, drivername, deleteflag, versionflag)) {
Py_INCREF(Py_None);
ret = Py_None;
diff --git a/win32/src/win32process.i b/win32/src/win32process.i
index c7e95ddaa0..beeb85981a 100644
--- a/win32/src/win32process.i
+++ b/win32/src/win32process.i
@@ -460,7 +460,7 @@ static PyObject *myCreateRemoteThread(PyObject *self, PyObject *args)
%native (CreateRemoteThread) myCreateRemoteThread;
-// Wont expose ExitThread!!! May leak all sorts of things!
+// Won't expose ExitThread!!! May leak all sorts of things!
%{
diff --git a/win32/src/win32security_sspi.cpp b/win32/src/win32security_sspi.cpp
index 8322769ebf..32960b4299 100644
--- a/win32/src/win32security_sspi.cpp
+++ b/win32/src/win32security_sspi.cpp
@@ -67,7 +67,7 @@ PySequenceMethods PySecBufferDesc_sequencemethods = {
NULL, // objobjproc sq_contains;
NULL, // binaryfunc sq_inplace_concat;
NULL // intargfunc sq_inplace_repeat;
-}; // ??? why isnt append included ???
+}; // ??? why isn't append included ???
// @object PySecBufferDesc|Sequence-like object that contains a group of buffers to be used with SSPI functions.
// @comm This object is created using win32security.PySecBufferDescType(Version), where Version is an int that
@@ -192,11 +192,11 @@ PyObject *PySecBufferDesc::tp_new(PyTypeObject *typ, PyObject *args, PyObject *k
return new PySecBufferDesc(ulVersion);
}
-PyObject * PySecBufferDesc::tp_repr(PyObject * obj)
+PyObject *PySecBufferDesc::tp_repr(PyObject *obj)
{
PSecBufferDesc psecbufferdesc = ((PySecBufferDesc *)obj)->GetSecBufferDesc();
return PyUnicode_FromFormat("PySecBufferDesc(ulVersion: %i | cBuffers: %i | pBuffers: %p)",
- psecbufferdesc->ulVersion, psecbufferdesc->cBuffers, psecbufferdesc->pBuffers);
+ psecbufferdesc->ulVersion, psecbufferdesc->cBuffers, psecbufferdesc->pBuffers);
}
BOOL PyWinObject_AsSecBufferDesc(PyObject *ob, PSecBufferDesc *ppSecBufferDesc, BOOL bNoneOk)
@@ -365,8 +365,7 @@ PySecBuffer::PySecBuffer(ULONG cbBuffer, ULONG BufferType)
secbuffer.BufferType = BufferType;
allocBuffer = NULL;
- if (cbBuffer > 0)
- {
+ if (cbBuffer > 0) {
// Stores our allocated memory in a class property so we don't try and free memory that wasn't allocated by us.
// Windows could change where pvBuffer points to after a function call and we should only be concerned about
// freeing memory that we have allocated ourselves.
@@ -452,11 +451,11 @@ PyObject *PySecBuffer::tp_new(PyTypeObject *typ, PyObject *args, PyObject *kwarg
return new PySecBuffer(cbBuffer, BufferType);
}
-PyObject * PySecBuffer::tp_repr(PyObject * obj)
+PyObject *PySecBuffer::tp_repr(PyObject *obj)
{
PSecBuffer psecbuffer = ((PySecBuffer *)obj)->GetSecBuffer();
return PyUnicode_FromFormat("PySecBuffer(cbBuffer: %i | BufferType: %i | pvBuffer: %p)", psecbuffer->cbBuffer,
- psecbuffer->BufferType, psecbuffer->pvBuffer);
+ psecbuffer->BufferType, psecbuffer->pvBuffer);
}
// @pymethod |PySecBuffer|Clear|Resets the buffer to all NULL's, and set the current size to maximum
@@ -896,7 +895,8 @@ PyObject *PyCtxtHandle::QueryContextAttributes(PyObject *self, PyObject *args)
pe = (PSecPkgContext_PasswordExpiry)&buf;
ret = PyWinObject_FromTimeStamp(pe->tsPasswordExpires);
break;
- // @flag SECPKG_ATTR_LIFESPAN|(,) - returns time period during which context is valid
+ // @flag SECPKG_ATTR_LIFESPAN|(,) - returns time period during which context is
+ // valid
case SECPKG_ATTR_LIFESPAN:
PSecPkgContext_Lifespan ls;
ls = (PSecPkgContext_Lifespan)&buf;
diff --git a/win32/src/win32security_sspi.h b/win32/src/win32security_sspi.h
index e850a372ff..262ed9cb62 100644
--- a/win32/src/win32security_sspi.h
+++ b/win32/src/win32security_sspi.h
@@ -51,7 +51,7 @@ class PySecBuffer : public PyObject {
static PyObject *getattro(PyObject *self, PyObject *name);
static int setattro(PyObject *self, PyObject *obname, PyObject *obvalue);
static PyObject *tp_new(PyTypeObject *, PyObject *, PyObject *);
- static PyObject *tp_repr(PyObject * obj);
+ static PyObject *tp_repr(PyObject *obj);
static PyObject *Clear(PyObject *self, PyObject *args);
PSecBuffer GetSecBuffer(void);
@@ -83,7 +83,7 @@ class PySecBufferDesc : public PyObject {
static PyObject *getattro(PyObject *self, PyObject *name);
static int setattro(PyObject *self, PyObject *obname, PyObject *obvalue);
static PyObject *tp_new(PyTypeObject *, PyObject *, PyObject *);
- static PyObject *tp_repr(PyObject * obj);
+ static PyObject *tp_repr(PyObject *obj);
static PySequenceMethods sequencemethods;
PSecBufferDesc GetSecBufferDesc(void);
PyObject **obBuffers;
diff --git a/win32/src/win32wnet/PyNetresource.cpp b/win32/src/win32wnet/PyNetresource.cpp
index 62be645b32..9d928b326e 100644
--- a/win32/src/win32wnet/PyNetresource.cpp
+++ b/win32/src/win32wnet/PyNetresource.cpp
@@ -65,36 +65,36 @@ __declspec(dllexport) PyTypeObject PyNETRESOURCEType = {
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_as_async */
- 0, /* tp_repr */
- 0, /* tp_as_number */
- 0, /* tp_as_sequence */
- 0, /* tp_as_mapping */
- 0, /* hash? */
- 0, /* tp_call */
- 0, /* tp_str */
- PyNETRESOURCE::getattro, /* tp_getattro */
- PyNETRESOURCE::setattro, /* tp_setattro */
- 0, /* tp_as_buffer */
- Py_TPFLAGS_DEFAULT, /* tp_flags */
- 0, /* tp_doc */
- 0, /* tp_traverse */
- 0, /* tp_clear */
- 0, /* tp_richcompare */
- 0, /* tp_weaklistoffset */
- 0, /* tp_iter */
- 0, /* tp_iternext */
- 0, /* tp_methods */
- PyNETRESOURCE::members, /* tp_members */
- 0, /* tp_getset */
- 0, /* tp_base */
- 0, /* tp_dict */
- 0, /* tp_descr_get */
- 0, /* tp_descr_set */
- 0, /* tp_dictoffset */
- 0, /* tp_init */
- 0, /* tp_alloc */
- NETRESOURCE_new, /* tp_new */
+ 0, /* tp_as_async */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* hash? */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ PyNETRESOURCE::getattro, /* tp_getattro */
+ PyNETRESOURCE::setattro, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT, /* tp_flags */
+ 0, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ PyNETRESOURCE::members, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ NETRESOURCE_new, /* tp_new */
};
#define OFF(e) offsetof(PyNETRESOURCE, e)
diff --git a/win32/src/win32wnet/win32wnet.cpp b/win32/src/win32wnet/win32wnet.cpp
index beb18c8330..fe5c6ccb12 100644
--- a/win32/src/win32wnet/win32wnet.cpp
+++ b/win32/src/win32wnet/win32wnet.cpp
@@ -149,8 +149,7 @@ static PyObject *PyWNetAddConnection2(PyObject *self, PyObject *args, PyObject *
if (!PyWinObject_AsTCHAR(obPassword, &Password, TRUE) || !PyWinObject_AsTCHAR(obUsername, &Username, TRUE))
goto done;
- Py_BEGIN_ALLOW_THREADS
- ErrorNo = WNetAddConnection2(pNetResource, Password, Username, flags);
+ Py_BEGIN_ALLOW_THREADS ErrorNo = WNetAddConnection2(pNetResource, Password, Username, flags);
Py_END_ALLOW_THREADS if (ErrorNo != NO_ERROR) ReturnNetError("WNetAddConnection2", ErrorNo);
else
{
@@ -315,7 +314,7 @@ static PyObject *PyWNetEnumResource(PyObject *self, PyObject *args)
// nothing hard & fast here, just a rough sizing..have to figure out something better later
if (dwMaxCount == 0) // using 0 to mean a default
- dwMaxCount = dwCount = 64; // lets default at 64 items
+ dwMaxCount = dwCount = 64; // let's default at 64 items
else
dwCount = dwMaxCount; // yes virginia, 0xffffffff is a LOT of items
@@ -365,7 +364,7 @@ static PyObject *PyWNetEnumResource(PyObject *self, PyObject *args)
return (ReturnError("Unable to create return list", "WNetEnumResource"));
}
- p_nr++; // next NETRESOURCE object (its a ++ because it is a typed pointer)
+ p_nr++; // next NETRESOURCE object (it's a ++ because it is a typed pointer)
dwCount--;
} while (dwCount);
}; // if
@@ -458,7 +457,7 @@ static PyObject *PyWNetGetUniversalName(PyObject *self, PyObject *args)
// First get the buffer size.
{
- Py_BEGIN_ALLOW_THREADS char temp_buf[] = ""; // doesnt appear to like NULL!!
+ Py_BEGIN_ALLOW_THREADS char temp_buf[] = ""; // doesn't appear to like NULL!!
errcode = WNetGetUniversalName(szLocalPath, level, &temp_buf, &length);
Py_END_ALLOW_THREADS
}
diff --git a/win32/test/handles.py b/win32/test/handles.py
index eb71524952..01b7f17ef9 100644
--- a/win32/test/handles.py
+++ b/win32/test/handles.py
@@ -93,7 +93,7 @@ def testOtherHandle(self):
# but the above doesn't really test everything - we want a way to
# pass the handle directly into PyWinLong_AsVoidPtr. One way to
# to that is to abuse win32api.GetProcAddress() - the 2nd param
- # is passed to PyWinLong_AsVoidPtr() if its not a string.
+ # is passed to PyWinLong_AsVoidPtr() if it's not a string.
# passing a handle value of '1' should work - there is something
# at that ordinal
win32api.GetProcAddress(sys.dllhandle, h)
diff --git a/win32/test/test_exceptions.py b/win32/test/test_exceptions.py
index 984d7271ba..c222f0adeb 100644
--- a/win32/test/test_exceptions.py
+++ b/win32/test/test_exceptions.py
@@ -5,7 +5,6 @@
import pythoncom
import pywintypes
import win32api
-import win32file
import winerror
@@ -100,7 +99,7 @@ def testStrangeArgsNotEnough(self):
raise pywintypes.error("foo")
self.fail("Expected exception")
except pywintypes.error as exc:
- assert exc.args[0] == "foo"
+ self.assertEqual(exc.args[0], "foo")
# 'winerror' always args[0]
self.assertEqual(exc.winerror, "foo")
self.assertEqual(exc.funcname, None)
diff --git a/win32/test/test_pywintypes.py b/win32/test/test_pywintypes.py
index 67c4a5afe5..cf679b7566 100644
--- a/win32/test/test_pywintypes.py
+++ b/win32/test/test_pywintypes.py
@@ -22,7 +22,7 @@ def testPyTimeFormat(self):
def testPyTimePrint(self):
# This used to crash with an invalid, or too early time.
# We don't really want to check that it does cause a ValueError
- # (as hopefully this wont be true forever). So either working, or
+ # (as hopefully this won't be true forever). So either working, or
# ValueError is OK.
try:
t = pywintypes.Time(-2)
diff --git a/win32/test/test_sspi.py b/win32/test/test_sspi.py
index 17256b75b1..6b113aeb0e 100644
--- a/win32/test/test_sspi.py
+++ b/win32/test/test_sspi.py
@@ -1,7 +1,6 @@
# Some tests of the win32security sspi functions.
# Stolen from Roger's original test_sspi.c, a version of which is in "Demos"
# See also the other SSPI demos.
-import re
import unittest
import sspi
@@ -196,33 +195,33 @@ def testSequenceEncrypt(self):
def testSecBufferRepr(self):
desc = win32security.PySecBufferDescType()
- assert re.match(
- r"PySecBufferDesc\(ulVersion: 0 \| cBuffers: 0 \| pBuffers: 0x[\da-fA-F]{8,16}\)",
+ self.assertRegex(
repr(desc),
+ r"PySecBufferDesc\(ulVersion: 0 \| cBuffers: 0 \| pBuffers: 0x[\da-fA-F]{8,16}\)",
)
buffer1 = win32security.PySecBufferType(0, sspicon.SECBUFFER_TOKEN)
- assert re.match(
- r"PySecBuffer\(cbBuffer: 0 \| BufferType: 2 \| pvBuffer: 0x[\da-fA-F]{8,16}\)",
+ self.assertRegex(
repr(buffer1),
+ r"PySecBuffer\(cbBuffer: 0 \| BufferType: 2 \| pvBuffer: 0x[\da-fA-F]{8,16}\)",
)
desc.append(buffer1)
- assert re.match(
- r"PySecBufferDesc\(ulVersion: 0 \| cBuffers: 1 \| pBuffers: 0x[\da-fA-F]{8,16}\)",
+ self.assertRegex(
repr(desc),
+ r"PySecBufferDesc\(ulVersion: 0 \| cBuffers: 1 \| pBuffers: 0x[\da-fA-F]{8,16}\)",
)
buffer2 = win32security.PySecBufferType(4, sspicon.SECBUFFER_DATA)
- assert re.match(
- r"PySecBuffer\(cbBuffer: 4 \| BufferType: 1 \| pvBuffer: 0x[\da-fA-F]{8,16}\)",
+ self.assertRegex(
repr(buffer2),
+ r"PySecBuffer\(cbBuffer: 4 \| BufferType: 1 \| pvBuffer: 0x[\da-fA-F]{8,16}\)",
)
desc.append(buffer2)
- assert re.match(
- r"PySecBufferDesc\(ulVersion: 0 \| cBuffers: 2 \| pBuffers: 0x[\da-fA-F]{8,16}\)",
+ self.assertRegex(
repr(desc),
+ r"PySecBufferDesc\(ulVersion: 0 \| cBuffers: 2 \| pBuffers: 0x[\da-fA-F]{8,16}\)",
)
diff --git a/win32/test/test_win32file.py b/win32/test/test_win32file.py
index 159c45e678..fd72c614d7 100644
--- a/win32/test/test_win32file.py
+++ b/win32/test/test_win32file.py
@@ -313,7 +313,7 @@ def testSimpleOverlapped(self):
for i in range(num_loops):
win32file.WriteFile(h, chunk_data, overlapped)
win32event.WaitForSingleObject(overlapped.hEvent, win32event.INFINITE)
- overlapped.Offset = overlapped.Offset + len(chunk_data)
+ overlapped.Offset += len(chunk_data)
h.Close()
# Now read the data back overlapped
overlapped = pywintypes.OVERLAPPED()
@@ -328,7 +328,7 @@ def testSimpleOverlapped(self):
try:
hr, data = win32file.ReadFile(h, buffer, overlapped)
win32event.WaitForSingleObject(overlapped.hEvent, win32event.INFINITE)
- overlapped.Offset = overlapped.Offset + len(data)
+ overlapped.Offset += len(data)
if not data is buffer:
self.fail(
"Unexpected result from ReadFile - should be the same buffer we passed it"
@@ -351,7 +351,7 @@ def testCompletionPortsMultiple(self):
sock.listen(1)
socks.append(sock)
new = win32file.CreateIoCompletionPort(sock.fileno(), ioport, PORT, 0)
- assert new is ioport
+ self.assertIs(new, ioport)
for s in socks:
s.close()
hv = int(ioport)
@@ -552,11 +552,11 @@ def testIter(self):
set2 = set()
for file in win32file.FindFilesIterator(dir):
set2.add(file)
- assert len(set2) > 5, "This directory has less than 5 files!?"
+ self.assertGreater(len(set2), 5, "This directory has less than 5 files!?")
self.assertEqual(set1, set2)
def testBadDir(self):
- dir = os.path.join(os.getcwd(), "a dir that doesnt exist", "*")
+ dir = os.path.join(os.getcwd(), "a dir that doesn't exist", "*")
self.assertRaises(win32file.error, win32file.FindFilesIterator, dir)
def testEmptySpec(self):
@@ -724,7 +724,7 @@ def testEncrypt(self):
except win32file.error as details:
if details.winerror != winerror.ERROR_ACCESS_DENIED:
raise
- print("It appears this is not NTFS - cant encrypt/decrypt")
+ print("It appears this is not NTFS - can't encrypt/decrypt")
win32file.DecryptFile(fname)
finally:
if f is not None:
diff --git a/win32/test/test_win32gui.py b/win32/test/test_win32gui.py
index ad96bd4352..c5754722c3 100644
--- a/win32/test/test_win32gui.py
+++ b/win32/test/test_win32gui.py
@@ -1,9 +1,12 @@
# tests for win32gui
import array
import operator
+import sys
import unittest
import pywin32_testutil
+import pywintypes
+import win32api
import win32gui
@@ -61,5 +64,150 @@ def test_memory_not_writable(self):
self.assertRaises(TypeError, operator.setitem, got, 0, 1)
+class TestEnumWindowsFamily(unittest.TestCase):
+ @classmethod
+ def enum_callback_sle(cls, handle, data):
+ win32api.SetLastError(1)
+ return data
+
+ @classmethod
+ def enum_callback_exc(cls, handle, data):
+ raise ValueError
+
+ @classmethod
+ def enum_callback(cls, handle, data):
+ return data
+
+ def setUp(self):
+ self.default_data_set = (None, -1, 0, 1, True, False)
+ self.type_data_set = ("", (), {})
+
+ def test_enumwindows(self):
+ win32api.SetLastError(0)
+ for data in (0, False):
+ self.assertRaises(
+ pywintypes.error, win32gui.EnumWindows, self.enum_callback_sle, data
+ )
+ for data in (None, 1, True):
+ self.assertIsNone(win32gui.EnumWindows(self.enum_callback_sle, data))
+ win32api.SetLastError(0)
+ for data in self.default_data_set:
+ self.assertIsNone(win32gui.EnumWindows(self.enum_callback, data))
+ for data in self.default_data_set:
+ self.assertRaises(
+ ValueError, win32gui.EnumWindows, self.enum_callback_exc, data
+ )
+ for func in (
+ self.enum_callback,
+ self.enum_callback_sle,
+ ):
+ for data in self.type_data_set:
+ self.assertRaises(TypeError, win32gui.EnumWindows, func, data)
+ if sys.version_info >= (3, 10):
+ for func in (
+ self.enum_callback,
+ self.enum_callback_sle,
+ ):
+ self.assertRaises(
+ TypeError, win32gui.EnumWindows, func, self.enum_callback, 2.718282
+ )
+
+ def test_enumchildwindows(self):
+ win32api.SetLastError(0)
+ for data in self.default_data_set:
+ self.assertIsNone(win32gui.EnumChildWindows(None, self.enum_callback, data))
+ for data in self.default_data_set:
+ self.assertIsNone(
+ win32gui.EnumChildWindows(None, self.enum_callback_sle, data)
+ )
+ win32api.SetLastError(0)
+ for data in self.default_data_set:
+ self.assertRaises(
+ ValueError,
+ win32gui.EnumChildWindows,
+ None,
+ self.enum_callback_exc,
+ data,
+ )
+ for data in self.type_data_set:
+ for func in (
+ self.enum_callback,
+ self.enum_callback_sle,
+ ):
+ self.assertRaises(
+ TypeError, win32gui.EnumChildWindows, None, func, data
+ )
+ if sys.version_info >= (3, 10):
+ for func in (
+ self.enum_callback,
+ self.enum_callback_sle,
+ ):
+ self.assertRaises(
+ TypeError,
+ win32gui.EnumChildWindows,
+ None,
+ func,
+ self.enum_callback,
+ 2.718282,
+ )
+
+ def test_enumdesktopwindows(self):
+ win32api.SetLastError(0)
+ desktop = None
+ for data in (0, False):
+ self.assertRaises(
+ pywintypes.error,
+ win32gui.EnumDesktopWindows,
+ desktop,
+ self.enum_callback_sle,
+ data,
+ )
+ for data in (None, 1, True):
+ self.assertIsNone(
+ win32gui.EnumDesktopWindows(desktop, self.enum_callback_sle, data)
+ )
+ win32api.SetLastError(0)
+ for data in self.default_data_set:
+ self.assertIsNone(
+ win32gui.EnumDesktopWindows(desktop, self.enum_callback, data)
+ )
+ for data in self.default_data_set:
+ self.assertRaises(
+ ValueError,
+ win32gui.EnumDesktopWindows,
+ desktop,
+ self.enum_callback_exc,
+ data,
+ )
+ desktops = (0, None)
+ for desktop in desktops:
+ for data in self.default_data_set:
+ self.assertRaises(
+ ValueError,
+ win32gui.EnumDesktopWindows,
+ desktop,
+ self.enum_callback_exc,
+ data,
+ )
+ for func in (
+ self.enum_callback,
+ self.enum_callback_sle,
+ ):
+ for desktop in desktops:
+ for data in self.type_data_set:
+ self.assertRaises(
+ TypeError, win32gui.EnumDesktopWindows, 0, func, data
+ )
+ if sys.version_info >= (3, 10):
+ for func in (
+ self.enum_callback,
+ self.enum_callback_sle,
+ ):
+ for desktop in desktops:
+ self.assertRaises(
+ TypeError, win32gui.EnumDesktopWindows, 0, func, 2.718282
+ )
+
+
if __name__ == "__main__":
unittest.main()
diff --git a/win32/test/test_win32inet.py b/win32/test/test_win32inet.py
index bf4a9af3cc..fe7de185c0 100644
--- a/win32/test/test_win32inet.py
+++ b/win32/test/test_win32inet.py
@@ -53,9 +53,8 @@ def testPythonDotOrg(self):
break
chunks.append(chunk)
data = b"".join(chunks)
- assert data.find(b"Python") > 0, repr(
- data
- ) # This must appear somewhere on the main page!
+ # This must appear somewhere on the main page!
+ self.assertGreater(data.find(b"Python"), 0, repr(data))
def testFtpCommand(self):
# ftp.python.org doesn't exist. ftp.gnu.org is what Python's urllib
diff --git a/win32/test/test_win32profile.py b/win32/test/test_win32profile.py
index 71432363fd..4ddc8d3826 100644
--- a/win32/test/test_win32profile.py
+++ b/win32/test/test_win32profile.py
@@ -10,9 +10,9 @@ class Tester(unittest.TestCase):
def test_environment(self):
os.environ["FOO"] = "bar=baz"
env = win32profile.GetEnvironmentStrings()
- assert "FOO" in env
- assert env["FOO"] == "bar=baz"
- assert os.environ["FOO"] == "bar=baz"
+ self.assertIn("FOO", env)
+ self.assertEqual(env["FOO"], "bar=baz")
+ self.assertEqual(os.environ["FOO"], "bar=baz")
if __name__ == "__main__":
diff --git a/win32/test/test_win32trace.py b/win32/test/test_win32trace.py
index 48ef0141c2..d1b64d5720 100644
--- a/win32/test/test_win32trace.py
+++ b/win32/test/test_win32trace.py
@@ -152,7 +152,7 @@ def testFlush(self):
def testIsatty(self):
tracer = win32trace.GetTracer()
- assert tracer.isatty() == False
+ self.assertFalse(tracer.isatty())
def testRoundTrip(self):
traceObject = win32trace.GetTracer()
@@ -195,7 +195,7 @@ def tearDown(self):
def areBucketsFull(self):
bucketsAreFull = True
for each in self.buckets:
- assert each <= self.FullBucket, each
+ self.assertLessEqual(each, self.FullBucket)
if each != self.FullBucket:
bucketsAreFull = False
break
@@ -207,7 +207,7 @@ def read(self):
for ch in readString:
integer = int(ch)
count = self.buckets[integer]
- assert count != -1
+ self.assertNotEqual(count, -1)
self.buckets[integer] = count + 1
if self.buckets[integer] == self.FullBucket:
if self.areBucketsFull():
@@ -220,8 +220,8 @@ def testThreads(self):
for each in self.threads:
each.join()
for each in self.threads:
- assert each.verifyWritten()
- assert self.areBucketsFull()
+ self.assertTrue(each.verifyWritten())
+ self.assertTrue(self.areBucketsFull())
class TestHugeChunks(unittest.TestCase):
@@ -238,7 +238,7 @@ def testHugeChunks(self):
data = "*" * 1023 + "\n"
while len(data) <= self.BiggestChunk:
win32trace.write(data)
- data = data + data
+ data += data
# If we made it here, we passed.
def tearDown(self):
@@ -305,7 +305,7 @@ def setUpWriters(self):
def areBucketsFull(self):
bucketsAreFull = True
for each in self.buckets:
- assert each <= self.FullBucket, each
+ self.assertLessEqual(each, self.FullBucket)
if each != self.FullBucket:
bucketsAreFull = False
break
@@ -317,7 +317,7 @@ def read(self):
for ch in readString:
integer = int(ch)
count = self.buckets[integer]
- assert count != -1
+ self.assertNotEqual(count, -1)
self.buckets[integer] = count + 1
if self.buckets[integer] == self.FullBucket:
if self.areBucketsFull():
@@ -330,8 +330,8 @@ def testProcesses(self):
for each in self.processes:
each.join()
for each in self.processes:
- assert each.verifyWritten()
- assert self.areBucketsFull()
+ self.assertTrue(each.verifyWritten())
+ self.assertTrue(self.areBucketsFull())
def _RunAsTestProcess():