diff --git a/CHANGES.md b/CHANGES.md index 924a331965..83914a3bd3 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -19,6 +19,8 @@ Coming in build 312, as yet unreleased -------------------------------------- * Fixed missing version stamp on built `.dll` and `.exe` files (mhammond#2647, [@Avasam][Avasam]) +* Removed considerations for Windows 2000 and Windows Vista (mhammond#2667, [@Avasam][Avasam]) + * This mostly updates obsolete documentation and tests * Removed considerations for Windows 95/98/ME (mhammond#2400, [@Avasam][Avasam]) This removes the following constants: * `win32con.FILE_ATTRIBUTE_ATOMIC_WRITE` diff --git a/com/help/active_directory.html b/com/help/active_directory.html index 4acd51726b..14b1def372 100644 --- a/com/help/active_directory.html +++ b/com/help/active_directory.html @@ -83,9 +83,11 @@

Getting Active Directory Objects

Discovery

-A tool that can be of a great help is ADSIedit which is in the Windows -2000 support tools on the Windows 2000 server cdrom. It gives you the - raw ldap view of active directory.

+A tool that can be of a great help is the ADSI Edit MMC snap-in, aka ADSIEdit.msc. See +Remote Server Administration Tools for Windows 10 for installation instructions. +It gives you the raw ldap view of active directory. +Note that it is not available for the Home edition of Windows.

def discover(): Here is a function that helps you determine the active directory ldap strings that you can actually use. diff --git a/com/win32com/server/register.py b/com/win32com/server/register.py index 817f3a28a2..8b3ae84c21 100644 --- a/com/win32com/server/register.py +++ b/com/win32com/server/register.py @@ -9,6 +9,7 @@ import os import sys +import tempfile import pythoncom import win32api @@ -541,8 +542,6 @@ def UnregisterInfoClasses(*classes, **flags): # Attempt to 're-execute' our current process with elevation. def ReExecuteElevated(flags): - import tempfile - import win32console import win32event # we've already checked we are running XP above import win32process @@ -646,14 +645,9 @@ def UseCommandLine(*classes, **flags): else: RegisterClasses(*classes, **flags) except win32api.error as exc: - # If we are on xp+ and have "access denied", retry using - # ShellExecuteEx with 'runas' verb to force elevation (vista) and/or - # admin login dialog (vista/xp) - if ( - flags["unattended"] - or exc.winerror != winerror.ERROR_ACCESS_DENIED - or sys.getwindowsversion()[0] < 5 - ): + # If we have "access denied", retry using + # ShellExecuteEx with 'runas' verb to force elevation + if flags["unattended"] or exc.winerror != winerror.ERROR_ACCESS_DENIED: raise ReExecuteElevated(flags) diff --git a/com/win32com/src/PythonCOM.cpp b/com/win32com/src/PythonCOM.cpp index 6002beab45..f8a99063bf 100644 --- a/com/win32com/src/PythonCOM.cpp +++ b/com/win32com/src/PythonCOM.cpp @@ -92,7 +92,6 @@ extern LONG _PyCom_GetGatewayCount(void); typedef HRESULT(STDAPICALLTYPE *CreateURLMonikerExfunc)(LPMONIKER, LPCWSTR, LPMONIKER *, DWORD); static CreateURLMonikerExfunc pfnCreateURLMonikerEx = NULL; -// Win2k or later typedef HRESULT(STDAPICALLTYPE *CoWaitForMultipleHandlesfunc)(DWORD dwFlags, DWORD dwTimeout, ULONG cHandles, LPHANDLE pHandles, LPDWORD lpdwindex); static CoWaitForMultipleHandlesfunc pfnCoWaitForMultipleHandles = NULL; @@ -104,7 +103,6 @@ typedef HRESULT(STDAPICALLTYPE *CoSetCancelObjectfunc)(IUnknown *); static CoSetCancelObjectfunc pfnCoSetCancelObject = NULL; // typedefs for the function pointers are in OleAcc.h -// WinXP or later LPFNOBJECTFROMLRESULT pfnObjectFromLresult = NULL; typedef HRESULT(STDAPICALLTYPE *CoCreateInstanceExfunc)(REFCLSID, IUnknown *, DWORD, COSERVERINFO *, ULONG, MULTI_QI *); diff --git a/com/win32comext/propsys/src/propsys.cpp b/com/win32comext/propsys/src/propsys.cpp index f92f5a0aab..28d6afe577 100644 --- a/com/win32comext/propsys/src/propsys.cpp +++ b/com/win32comext/propsys/src/propsys.cpp @@ -2,10 +2,6 @@ // $Id$ // Implements wrappers for the Property System functions and interfaces. -// These interfaces are present on Windows Vista and later, but can also -// be installed on XP with Desktop Search 3. -// However, this module doeen't dynamically load any libraries or functions, -// so it will fail to import if the components are not installed. // This source file contains autoduck documentation. // @doc @@ -38,13 +34,6 @@ #include "propvarutil.h" #include "Shobjidl.h" -#define CHECK_PFN(fname) \ - if (pfn##fname == NULL) \ - return PyErr_Format(PyExc_NotImplementedError, "%s is not available on this platform", #fname); -// Not available on Vista or earlier -typedef HRESULT(WINAPI *PFNSHGetPropertyStoreForWindow)(HWND, REFIID, void **); -static PFNSHGetPropertyStoreForWindow pfnSHGetPropertyStoreForWindow = NULL; - // @object PyPROPERTYKEY|A tuple of a fmtid and property id (IID, int) that uniquely identifies a property BOOL PyWinObject_AsPROPERTYKEY(PyObject *obkey, PROPERTYKEY *pkey) { @@ -390,12 +379,10 @@ static PyObject *PyPSLookupPropertyHandlerCLSID(PyObject *self, PyObject *args) }; // @pymethod |propsys|SHGetPropertyStoreForWindow|Retrieves a collection of a window's properties -// @comm Requires Windows 7 or later. // @rdesc The returned store can be used to set the System.AppUserModel.ID property that determines how windows // are grouped on the taskbar static PyObject *PySHGetPropertyStoreForWindow(PyObject *self, PyObject *args) { - CHECK_PFN(SHGetPropertyStoreForWindow); HWND hwnd; IID riid = IID_IPropertyStore; void *ret; @@ -407,7 +394,7 @@ static PyObject *PySHGetPropertyStoreForWindow(PyObject *self, PyObject *args) HRESULT hr; PY_INTERFACE_PRECALL; - hr = (*pfnSHGetPropertyStoreForWindow)(hwnd, riid, &ret); + hr = SHGetPropertyStoreForWindow(hwnd, riid, &ret); PY_INTERFACE_POSTCALL; if (FAILED(hr)) return PyCom_BuildPyException(hr); @@ -546,7 +533,7 @@ static PyObject *PySHSetDefaultProperties(PyObject *self, PyObject *args) } /* List of module functions */ -// @module propsys|A module, encapsulating the Vista Property System interfaces +// @module propsys|A module, encapsulating the Property System interfaces static struct PyMethodDef propsys_methods[] = { // { "SHGetPropertyStoreFromIDList", PySHGetPropertyStoreFromIDList, 1 }, // @pymeth // SHGetPropertyStoreFromIDList|Retrieves the property store from an absolute ID list @@ -618,10 +605,7 @@ static const PyCom_InterfaceSupportInfo g_interfaceSupportData[] = { /* Module initialisation */ PYWIN_MODULE_INIT_FUNC(propsys) { - PYWIN_MODULE_INIT_PREPARE(propsys, propsys_methods, - "A module, encapsulating the Property System interfaces." - "Available on Windows Vista and later, but can also be used" - "on XP if Desktop Search 3 is installed."); + PYWIN_MODULE_INIT_PREPARE(propsys, propsys_methods, "A module, encapsulating the Property System interfaces."); if (PyDict_SetItemString(dict, "error", PyWinExc_COMError) == -1) PYWIN_MODULE_INIT_RETURN_ERROR; @@ -636,10 +620,5 @@ PYWIN_MODULE_INIT_FUNC(propsys) sizeof(g_interfaceSupportData) / sizeof(PyCom_InterfaceSupportInfo)) != 0) PYWIN_MODULE_INIT_RETURN_ERROR; - HMODULE hmod = GetModuleHandle(L"shell32.dll"); - if (hmod) - pfnSHGetPropertyStoreForWindow = - (PFNSHGetPropertyStoreForWindow)GetProcAddress(hmod, "SHGetPropertyStoreForWindow"); - PYWIN_MODULE_INIT_RETURN_SUCCESS; } diff --git a/com/win32comext/shell/demos/explorer_browser.py b/com/win32comext/shell/demos/explorer_browser.py index 7aec82d99e..2862be6db3 100644 --- a/com/win32comext/shell/demos/explorer_browser.py +++ b/com/win32comext/shell/demos/explorer_browser.py @@ -1,4 +1,4 @@ -# A sample of using Vista's IExplorerBrowser interfaces... +# A sample of using IExplorerBrowser interfaces... # Currently doesn't quite work: # * CPU sits at 100% while running. diff --git a/com/win32comext/shell/demos/servers/context_menu.py b/com/win32comext/shell/demos/servers/context_menu.py index a0d664f696..ba25be467a 100644 --- a/com/win32comext/shell/demos/servers/context_menu.py +++ b/com/win32comext/shell/demos/servers/context_menu.py @@ -78,12 +78,11 @@ def InvokeCommand(self, ci): mask, hwnd, verb, params, dir, nShow, hotkey, hicon = ci win32gui.MessageBox(hwnd, "Hello", "Wow", win32con.MB_OK) - def GetCommandString(self, cmd, typ): + def GetCommandString(self, cmd: int, typ): # If GetCommandString returns the same string for all items then - # the shell seems to ignore all but one. This is even true in - # Win7 etc where there is no status bar (and hence this string seems - # ignored) - return "Hello from Python (cmd=%d)!!" % (cmd,) + # the shell seems to ignore all but one. This is even true if the + # status bar is turned off (and hence this string seems ignored). + return f"Hello from Python ({cmd=})!!" def DllRegisterServer(): diff --git a/com/win32comext/shell/demos/servers/folder_view.py b/com/win32comext/shell/demos/servers/folder_view.py index bfca23cf7a..ad11fea385 100644 --- a/com/win32comext/shell/demos/servers/folder_view.py +++ b/com/win32comext/shell/demos/servers/folder_view.py @@ -8,7 +8,8 @@ import os import pickle import random -import sys +import struct +import winreg import commctrl import pythoncom @@ -796,12 +797,6 @@ def get_schema_fname(): def DllRegisterServer(): - import winreg - - if sys.getwindowsversion()[0] < 6: - print("This sample only works on Vista") - sys.exit(1) - key = winreg.CreateKey( winreg.HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\" @@ -816,7 +811,6 @@ def DllRegisterServer(): attr = ( shellcon.SFGAO_FOLDER | shellcon.SFGAO_HASSUBFOLDER | shellcon.SFGAO_BROWSABLE ) - import struct s = struct.pack("i", attr) winreg.SetValueEx(key, "Attributes", 0, winreg.REG_BINARY, s) @@ -832,8 +826,6 @@ def DllRegisterServer(): def DllUnregisterServer(): - import winreg - paths = [ "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Desktop\\Namespace\\" + ShellFolder._reg_clsid_, diff --git a/com/win32comext/shell/src/PyIFileOperation.cpp b/com/win32comext/shell/src/PyIFileOperation.cpp index 7e574e83e8..8eab79e673 100644 --- a/com/win32comext/shell/src/PyIFileOperation.cpp +++ b/com/win32comext/shell/src/PyIFileOperation.cpp @@ -629,7 +629,6 @@ PyObject *PyIFileOperation::GetAnyOperationsAborted(PyObject *self, PyObject *ar // performed by the shell as a unit. Serves as a replacement for . // No changes are actually made until PerformOperations is called. // Progress can be monitored by implementing . -// Requires Vista or later. static struct PyMethodDef PyIFileOperation_methods[] = { {"Advise", PyIFileOperation::Advise, 1}, // @pymeth Advise|Connects an event sink to receive updates {"Unadvise", PyIFileOperation::Unadvise, 1}, // @pymeth Unadvise|Disconnects a progress sink diff --git a/com/win32comext/shell/src/PyIKnownFolder.cpp b/com/win32comext/shell/src/PyIKnownFolder.cpp index 41f81d5540..a30ad5ccdc 100644 --- a/com/win32comext/shell/src/PyIKnownFolder.cpp +++ b/com/win32comext/shell/src/PyIKnownFolder.cpp @@ -211,7 +211,6 @@ PyObject *PyIKnownFolder::GetFolderDefinition(PyObject *self, PyObject *args) // @object PyIKnownFolder|Interface representing a known folder that serves // as a replacement for the numeric CSIDL definitions and API functions. -// Requires Vista or later. static struct PyMethodDef PyIKnownFolder_methods[] = { {"GetId", PyIKnownFolder::GetId, 1}, // @pymeth GetId|Returns the id of the folder {"GetCategory", PyIKnownFolder::GetCategory, diff --git a/com/win32comext/shell/src/PyIShellFolder2.cpp b/com/win32comext/shell/src/PyIShellFolder2.cpp index 0146abdb06..3246c09a71 100644 --- a/com/win32comext/shell/src/PyIShellFolder2.cpp +++ b/com/win32comext/shell/src/PyIShellFolder2.cpp @@ -165,8 +165,7 @@ PyObject *PyIShellFolder2::GetDetailsOf(PyObject *self, PyObject *args) } // @pymethod |PyIShellFolder2|MapColumnToSCID|Returns the unique identifier (FMTID, pid) of a column -// @rdesc On XP and earlier, this is the Column Id as provided by . -// For Vista and later, this is the Property Key used with the property system interfaces. +// @rdesc This is the Property Key used with the property system interfaces. PyObject *PyIShellFolder2::MapColumnToSCID(PyObject *self, PyObject *args) { IShellFolder2 *pISF2 = GetI(self); diff --git a/com/win32comext/shell/src/shell.cpp b/com/win32comext/shell/src/shell.cpp index ecc4535ffd..acad7a78e7 100644 --- a/com/win32comext/shell/src/shell.cpp +++ b/com/win32comext/shell/src/shell.cpp @@ -129,62 +129,15 @@ static PFNSHILCreateFromPath pfnSHILCreateFromPath = NULL; typedef HRESULT(WINAPI *PFNAssocCreate)(CLSID, REFIID, LPVOID); static PFNAssocCreate pfnAssocCreate = NULL; -typedef HRESULT(WINAPI *PFNAssocCreateForClasses)(const ASSOCIATIONELEMENT *, ULONG cClasses, REFIID riid, void **ppv); -static PFNAssocCreateForClasses pfnAssocCreateForClasses = NULL; - typedef LRESULT(WINAPI *PFNSHShellFolderView_Message)(HWND, UINT, LPARAM); static PFNSHShellFolderView_Message pfnSHShellFolderView_Message = NULL; typedef BOOL(WINAPI *PFNIsUserAnAdmin)(); static PFNIsUserAnAdmin pfnIsUserAnAdmin = NULL; -typedef BOOL(WINAPI *PFNSHGetNameFromIDList)(PCIDLIST_ABSOLUTE, SIGDN, PWSTR *); -static PFNSHGetNameFromIDList pfnSHGetNameFromIDList = NULL; - typedef BOOL(WINAPI *PFNSHCreateShellFolderView)(const SFV_CREATE *, IShellView **ppsv); static PFNSHCreateShellFolderView pfnSHCreateShellFolderView = NULL; -typedef BOOL(WINAPI *PFNSHCreateDefaultExtractIcon)(REFIID riid, void **ppv); -static PFNSHCreateDefaultExtractIcon pfnSHCreateDefaultExtractIcon = NULL; - -typedef BOOL(WINAPI *PFNSHCreateDataObject)(PCIDLIST_ABSOLUTE, UINT, PCUITEMID_CHILD_ARRAY, IDataObject *, REFIID, - void **); -static PFNSHCreateDataObject pfnSHCreateDataObject = NULL; - -typedef BOOL(WINAPI *PFNSHCreateShellItemArray)(PCIDLIST_ABSOLUTE, IShellFolder *, UINT, PCUITEMID_CHILD_ARRAY, - IShellItemArray **); -static PFNSHCreateShellItemArray pfnSHCreateShellItemArray = NULL; - -typedef BOOL(WINAPI *PFNSHCreateShellItemArrayFromDataObject)(IDataObject *pdo, REFIID, void **); -static PFNSHCreateShellItemArrayFromDataObject pfnSHCreateShellItemArrayFromDataObject = NULL; - -typedef BOOL(WINAPI *PFNSHCreateShellItemArrayFromIDLists)(UINT, PCIDLIST_ABSOLUTE_ARRAY, IShellItemArray **); -static PFNSHCreateShellItemArrayFromIDLists pfnSHCreateShellItemArrayFromIDLists = NULL; - -typedef BOOL(WINAPI *PFNSHCreateShellItemArrayFromShellItem)(IShellItem *, REFIID riid, void **); -static PFNSHCreateShellItemArrayFromShellItem pfnSHCreateShellItemArrayFromShellItem = NULL; - -typedef BOOL(WINAPI *PFNSHCreateDefaultContextMenu)(const DEFCONTEXTMENU *, REFIID, void **); -static PFNSHCreateDefaultContextMenu pfnSHCreateDefaultContextMenu = NULL; - -typedef HRESULT(WINAPI *PFNSHCreateItemFromIDList)(PCIDLIST_ABSOLUTE, REFIID, void **); -static PFNSHCreateItemFromIDList pfnSHCreateItemFromIDList = NULL; - -typedef HRESULT(WINAPI *PFNSHCreateItemFromParsingName)(PCWSTR, IBindCtx *, REFIID, void **); -static PFNSHCreateItemFromParsingName pfnSHCreateItemFromParsingName = NULL; - -typedef HRESULT(WINAPI *PFNSHCreateItemFromRelativeName)(IShellItem *, PCWSTR, IBindCtx *, REFIID, void **); -static PFNSHCreateItemFromRelativeName pfnSHCreateItemFromRelativeName = NULL; - -typedef HRESULT(WINAPI *PFNSHCreateItemInKnownFolder)(REFKNOWNFOLDERID, DWORD, PCWSTR, REFIID, void **); -static PFNSHCreateItemInKnownFolder pfnSHCreateItemInKnownFolder = NULL; - -typedef HRESULT(WINAPI *PFNSHCreateItemWithParent)(PCIDLIST_ABSOLUTE, IShellFolder *, PCUITEMID_CHILD, REFIID, void **); -static PFNSHCreateItemWithParent pfnSHCreateItemWithParent = NULL; - -typedef HRESULT(WINAPI *PFNSHGetIDListFromObject)(IUnknown *, PIDLIST_ABSOLUTE *); -static PFNSHGetIDListFromObject pfnSHGetIDListFromObject = NULL; - typedef HRESULT(WINAPI *PFNSHCreateShellItem)(PCIDLIST_ABSOLUTE, IShellFolder *, PCUITEMID_CHILD, IShellItem **); static PFNSHCreateShellItem pfnSHCreateShellItem = NULL; @@ -1422,7 +1375,6 @@ static PyObject *PySHGetFolderPath(PyObject *self, PyObject *args) } // @pymethod |shell|SHSetFolderPath|Sets the location of one of the special folders -// @comm This function is only available on Windows 2000 or later static PyObject *PySHSetFolderPath(PyObject *self, PyObject *args) { int csidl; @@ -2631,11 +2583,6 @@ static PyObject *PyAssocCreate(PyObject *self, PyObject *args) // interface. static PyObject *PyAssocCreateForClasses(PyObject *self, PyObject *args) { - // @comm This function is only available on Vista and later; a - // COM exception with E_NOTIMPL will be thrown if the function can't be located. - if (pfnAssocCreateForClasses == NULL) - return PyCom_BuildPyException(E_NOTIMPL); - PyObject *ret = NULL; PyObject *obClasses, *obiid; if (!PyArg_ParseTuple(args, "OO:AssocCreateForClasses", &obClasses, &obiid)) @@ -2651,7 +2598,7 @@ static PyObject *PyAssocCreateForClasses(PyObject *self, PyObject *args) void *v; { PY_INTERFACE_PRECALL; - hr = (*pfnAssocCreateForClasses)(elts, nclasses, iid, &v); + hr = AssocCreateForClasses(elts, nclasses, iid, &v); PY_INTERFACE_POSTCALL; } if (FAILED(hr)) { @@ -2803,18 +2750,13 @@ done: { // defaults can be further configured via the IDefaultExtractIconInit interface. static PyObject *PySHCreateDefaultExtractIcon(PyObject *self, PyObject *args) { - // @comm This function is only available on Vista and later; a - // COM exception with E_NOTIMPL will be thrown if the function can't be located. - if (pfnSHCreateDefaultExtractIcon == NULL) - return PyCom_BuildPyException(E_NOTIMPL); - // be lazy - don't take IID as a param! if (!PyArg_ParseTuple(args, ":SHCreateDefaultExtractIcon")) return NULL; IDefaultExtractIconInit *ret = NULL; HRESULT hr; PY_INTERFACE_PRECALL; - hr = (*pfnSHCreateDefaultExtractIcon)(IID_IDefaultExtractIconInit, (void **)&ret); + hr = SHCreateDefaultExtractIcon(IID_IDefaultExtractIconInit, (void **)&ret); PY_INTERFACE_POSTCALL; if (FAILED(hr)) return PyCom_BuildPyException(hr); @@ -2825,11 +2767,6 @@ static PyObject *PySHCreateDefaultExtractIcon(PyObject *self, PyObject *args) // @pymethod |shell|SHCreateDataObject| static PyObject *PySHCreateDataObject(PyObject *self, PyObject *args) { - // @comm This function is only available on Vista and later; a - // COM exception with E_NOTIMPL will be thrown if the function can't be located. - if (pfnSHCreateDataObject == NULL) - return PyCom_BuildPyException(E_NOTIMPL); - PyObject *ret = NULL; PyObject *obParent; PyObject *obChildren; @@ -2858,7 +2795,7 @@ static PyObject *PySHCreateDataObject(PyObject *self, PyObject *args) HRESULT hr; { PY_INTERFACE_PRECALL; - hr = (*pfnSHCreateDataObject)(parent, nchildren, children, do_inner, iid, &do_ret); + hr = SHCreateDataObject(parent, nchildren, children, do_inner, iid, &do_ret); PY_INTERFACE_POSTCALL; } if (FAILED(hr)) { @@ -2879,11 +2816,6 @@ static PyObject *PySHCreateDataObject(PyObject *self, PyObject *args) // @pymethod |shell|SHCreateDefaultContextMenu| static PyObject *PySHCreateDefaultContextMenu(PyObject *self, PyObject *args) { - // @comm This function is only available on Vista and later; a - // COM exception with E_NOTIMPL will be thrown if the function can't be located. - if (pfnSHCreateDefaultContextMenu == NULL) - return PyCom_BuildPyException(E_NOTIMPL); - PyObject *ret = NULL; PyObject *obdcm, *obiid; IID iid = IID_IContextMenu; @@ -2900,7 +2832,7 @@ static PyObject *PySHCreateDefaultContextMenu(PyObject *self, PyObject *args) HRESULT hr; { PY_INTERFACE_PRECALL; - hr = (*pfnSHCreateDefaultContextMenu)(&dcm, iid, &iret); + hr = SHCreateDefaultContextMenu(&dcm, iid, &iret); PY_INTERFACE_POSTCALL; } if (FAILED(hr)) { @@ -2917,10 +2849,6 @@ static PyObject *PySHCreateDefaultContextMenu(PyObject *self, PyObject *args) // @pymethod str|shell|SHGetNameFromIDList|Retrieves the display name of an item from an ID list. static PyObject *PySHGetNameFromIDList(PyObject *self, PyObject *args) { - // @comm This function is only available on Vista and later; a - // COM exception with E_NOTIMPL will be thrown if the function can't be located. - if (pfnSHGetNameFromIDList == NULL) - return PyCom_BuildPyException(E_NOTIMPL); PyObject *ret = NULL; PyObject *obpidl; SIGDN flags; @@ -2935,7 +2863,7 @@ static PyObject *PySHGetNameFromIDList(PyObject *self, PyObject *args) HRESULT hr; { PY_INTERFACE_PRECALL; - hr = (*pfnSHGetNameFromIDList)(pidl, flags, &name); + hr = SHGetNameFromIDList(pidl, flags, &name); PY_INTERFACE_POSTCALL; } if (FAILED(hr)) { @@ -2954,11 +2882,6 @@ static PyObject *PySHGetNameFromIDList(PyObject *self, PyObject *args) // @pymethod |shell|SHCreateShellItemArray|Creates a Shell item array object. static PyObject *PySHCreateShellItemArray(PyObject *self, PyObject *args) { - // @comm This function is only available on Vista and later; a - // COM exception with E_NOTIMPL will be thrown if the function can't be located. - if (pfnSHCreateShellItemArray == NULL) - return PyCom_BuildPyException(E_NOTIMPL); - PyObject *ret = NULL; PyObject *obParent; PyObject *obChildren; @@ -2983,7 +2906,7 @@ static PyObject *PySHCreateShellItemArray(PyObject *self, PyObject *args) HRESULT hr; { PY_INTERFACE_PRECALL; - hr = (*pfnSHCreateShellItemArray)(parent, sf, nchildren, children, &sia_ret); + hr = SHCreateShellItemArray(parent, sf, nchildren, children, &sia_ret); PY_INTERFACE_POSTCALL; } if (FAILED(hr)) { @@ -3006,11 +2929,6 @@ static PyObject *PySHCreateShellItemArray(PyObject *self, PyObject *args) // interface that contains a list of items (eg CF_HDROP) static PyObject *PySHCreateShellItemArrayFromDataObject(PyObject *self, PyObject *args) { - // @comm This function is only available on Vista and later; a - // COM exception with E_NOTIMPL will be thrown if the function can't be located. - if (pfnSHCreateShellItemArrayFromDataObject == NULL) - return PyCom_BuildPyException(E_NOTIMPL); - PyObject *ret = NULL; PyObject *obdo; PyObject *obiid = Py_None; @@ -3028,7 +2946,7 @@ static PyObject *PySHCreateShellItemArrayFromDataObject(PyObject *self, PyObject HRESULT hr; { PY_INTERFACE_PRECALL; - hr = (*pfnSHCreateShellItemArrayFromDataObject)(ido, iid, &iret); + hr = SHCreateShellItemArrayFromDataObject(ido, iid, &iret); PY_INTERFACE_POSTCALL; } if (FAILED(hr)) { @@ -3046,11 +2964,6 @@ static PyObject *PySHCreateShellItemArrayFromDataObject(PyObject *self, PyObject // item identifiers static PyObject *PySHCreateShellItemArrayFromIDLists(PyObject *self, PyObject *args) { - // @comm This function is only available on Vista and later; a - // COM exception with E_NOTIMPL will be thrown if the function can't be located. - if (pfnSHCreateShellItemArrayFromIDLists == NULL) - return PyCom_BuildPyException(E_NOTIMPL); - PyObject *ret = NULL; PyObject *obpidls; PCIDLIST_ABSOLUTE_ARRAY pidls = NULL; @@ -3065,7 +2978,7 @@ static PyObject *PySHCreateShellItemArrayFromIDLists(PyObject *self, PyObject *a { PY_INTERFACE_PRECALL; - hr = (*pfnSHCreateShellItemArrayFromIDLists)(npidls, pidls, &iret); + hr = SHCreateShellItemArrayFromIDLists(npidls, pidls, &iret); PY_INTERFACE_POSTCALL; } if (FAILED(hr)) { @@ -3084,11 +2997,6 @@ static PyObject *PySHCreateShellItemArrayFromIDLists(PyObject *self, PyObject *a // item static PyObject *PySHCreateShellItemArrayFromShellItem(PyObject *self, PyObject *args) { - // @comm This function is only available on Vista and later; a - // COM exception with E_NOTIMPL will be thrown if the function can't be located. - if (pfnSHCreateShellItemArrayFromShellItem == NULL) - return PyCom_BuildPyException(E_NOTIMPL); - PyObject *obsi; IShellItem *isi = NULL; IID iid = IID_IShellItemArray; @@ -3102,7 +3010,7 @@ static PyObject *PySHCreateShellItemArrayFromShellItem(PyObject *self, PyObject HRESULT hr; { PY_INTERFACE_PRECALL; - hr = (*pfnSHCreateShellItemArrayFromShellItem)(isi, iid, &iret); + hr = SHCreateShellItemArrayFromShellItem(isi, iid, &iret); isi->Release(); PY_INTERFACE_POSTCALL; } @@ -3116,10 +3024,6 @@ static PyObject *PySHCreateShellItemArrayFromShellItem(PyObject *self, PyObject // object from a PIDL. Can also create objects. static PyObject *PySHCreateItemFromIDList(PyObject *self, PyObject *args) { - // @comm This function is only available on Vista and later; a - // COM exception with E_NOTIMPL will be thrown if the function can't be located. - if (pfnSHCreateItemFromIDList == NULL) - return PyCom_BuildPyException(E_NOTIMPL); PyObject *ret = NULL; PyObject *obpidl; IID iid = IID_IShellItem; @@ -3135,7 +3039,7 @@ static PyObject *PySHCreateItemFromIDList(PyObject *self, PyObject *args) void *out; { PY_INTERFACE_PRECALL; - hr = (*pfnSHCreateItemFromIDList)(pidl, iid, &out); + hr = SHCreateItemFromIDList(pidl, iid, &out); PY_INTERFACE_POSTCALL; } if (FAILED(hr)) @@ -3151,11 +3055,6 @@ static PyObject *PySHCreateItemFromIDList(PyObject *self, PyObject *args) // parsing name. static PyObject *PySHCreateItemFromParsingName(PyObject *self, PyObject *args) { - // @comm This function is only available on Vista and later; a - // COM exception with E_NOTIMPL will be thrown if the function can't be located. - if (pfnSHCreateItemFromParsingName == NULL) - return PyCom_BuildPyException(E_NOTIMPL); - PyObject *ret = NULL; PyObject *obname, *obctx, *obiid; // @pyparm str|name||The display name of the item to create, eg a file path @@ -3182,7 +3081,7 @@ static PyObject *PySHCreateItemFromParsingName(PyObject *self, PyObject *args) { PY_INTERFACE_PRECALL; - hr = (*pfnSHCreateItemFromParsingName)(name, ctx, iid, &out); + hr = SHCreateItemFromParsingName(name, ctx, iid, &out); PY_INTERFACE_POSTCALL; } if (FAILED(hr)) { @@ -3203,11 +3102,6 @@ static PyObject *PySHCreateItemFromParsingName(PyObject *self, PyObject *args) // relative parsing name. static PyObject *PySHCreateItemFromRelativeName(PyObject *self, PyObject *args) { - // @comm This function is only available on Vista and later; a - // COM exception with E_NOTIMPL will be thrown if the function can't be located. - if (pfnSHCreateItemFromRelativeName == NULL) - return PyCom_BuildPyException(E_NOTIMPL); - PyObject *ret = NULL; PyObject *obname, *obctx, *obiid, *obparent; // @pyparm |Parent||Shell item interface on the parent folder @@ -3239,7 +3133,7 @@ static PyObject *PySHCreateItemFromRelativeName(PyObject *self, PyObject *args) { PY_INTERFACE_PRECALL; - hr = (*pfnSHCreateItemFromRelativeName)(parent, name, ctx, iid, &out); + hr = SHCreateItemFromRelativeName(parent, name, ctx, iid, &out); PY_INTERFACE_POSTCALL; } if (FAILED(hr)) { @@ -3267,11 +3161,6 @@ static PyObject *PySHCreateItemFromRelativeName(PyObject *self, PyObject *args) // inside a known folder. static PyObject *PySHCreateItemInKnownFolder(PyObject *self, PyObject *args) { - // @comm This function is only available on Vista and later; a - // COM exception with E_NOTIMPL will be thrown if the function can't be located. - if (pfnSHCreateItemInKnownFolder == NULL) - return PyCom_BuildPyException(E_NOTIMPL); - DWORD flags; PyObject *obname; IID riid = IID_IShellItem; @@ -3291,7 +3180,7 @@ static PyObject *PySHCreateItemInKnownFolder(PyObject *self, PyObject *args) return NULL; PY_INTERFACE_PRECALL; - hr = (*pfnSHCreateItemInKnownFolder)(folderid, flags, name, riid, &out); + hr = SHCreateItemInKnownFolder(folderid, flags, name, riid, &out); PY_INTERFACE_POSTCALL; if (FAILED(hr)) return PyCom_BuildPyException(hr); @@ -3302,10 +3191,6 @@ static PyObject *PySHCreateItemInKnownFolder(PyObject *self, PyObject *args) // ID. static PyObject *PySHCreateItemWithParent(PyObject *self, PyObject *args) { - // @comm This function is only available on Vista and later; a - // COM exception with E_NOTIMPL will be thrown if the function can't be located. - if (pfnSHCreateItemWithParent == NULL) - return PyCom_BuildPyException(E_NOTIMPL); PyObject *ret = NULL; PyObject *obpidlparent, *obsfparent, *obpidl; IID riid = IID_IShellItem; @@ -3332,7 +3217,7 @@ static PyObject *PySHCreateItemWithParent(PyObject *self, PyObject *args) void *out; { PY_INTERFACE_PRECALL; - hr = (*pfnSHCreateItemWithParent)(parentpidl, sfparent, pidl, riid, &out); + hr = SHCreateItemWithParent(parentpidl, sfparent, pidl, riid, &out); PY_INTERFACE_POSTCALL; } if (FAILED(hr)) { @@ -3352,11 +3237,6 @@ static PyObject *PySHCreateItemWithParent(PyObject *self, PyObject *args) // @pymethod |shell|SHGetIDListFromObject|Retrieves the PIDL of an object. static PyObject *PySHGetIDListFromObject(PyObject *self, PyObject *args) { - // @comm This function is only available on Vista and later; a - // COM exception with E_NOTIMPL will be thrown if the function can't be located. - if (pfnSHGetIDListFromObject == NULL) - return PyCom_BuildPyException(E_NOTIMPL); - PyObject *ret = NULL; PyObject *ob; @@ -3373,7 +3253,7 @@ static PyObject *PySHGetIDListFromObject(PyObject *self, PyObject *args) { PY_INTERFACE_PRECALL; - hr = (*pfnSHGetIDListFromObject)(unk, &pidl); + hr = SHGetIDListFromObject(unk, &pidl); PY_INTERFACE_POSTCALL; } if (FAILED(hr)) { @@ -3866,29 +3746,6 @@ PYWIN_MODULE_INIT_FUNC(shell) (PFNSHShellFolderView_Message)GetProcAddress(shell32, "SHShellFolderView_Message"); pfnIsUserAnAdmin = (PFNIsUserAnAdmin)GetProcAddress(shell32, "IsUserAnAdmin"); pfnSHCreateShellFolderView = (PFNSHCreateShellFolderView)GetProcAddress(shell32, "SHCreateShellFolderView"); - pfnSHCreateDefaultExtractIcon = - (PFNSHCreateDefaultExtractIcon)GetProcAddress(shell32, "SHCreateDefaultExtractIcon"); - pfnSHGetNameFromIDList = (PFNSHGetNameFromIDList)GetProcAddress(shell32, "SHGetNameFromIDList"); - pfnAssocCreateForClasses = (PFNAssocCreateForClasses)GetProcAddress(shell32, "AssocCreateForClasses"); - pfnSHCreateShellItemArray = (PFNSHCreateShellItemArray)GetProcAddress(shell32, "SHCreateShellItemArray"); - pfnSHCreateShellItemArrayFromDataObject = - (PFNSHCreateShellItemArrayFromDataObject)GetProcAddress(shell32, "SHCreateShellItemArrayFromDataObject"); - pfnSHCreateShellItemArrayFromIDLists = - (PFNSHCreateShellItemArrayFromIDLists)GetProcAddress(shell32, "SHCreateShellItemArrayFromIDLists"); - pfnSHCreateShellItemArrayFromShellItem = - (PFNSHCreateShellItemArrayFromShellItem)GetProcAddress(shell32, "SHCreateShellItemArrayFromShellItem"); - pfnSHCreateDefaultContextMenu = - (PFNSHCreateDefaultContextMenu)GetProcAddress(shell32, "SHCreateDefaultContextMenu"); - pfnSHCreateDataObject = (PFNSHCreateDataObject)GetProcAddress(shell32, "SHCreateDataObject"); - pfnSHCreateItemFromIDList = (PFNSHCreateItemFromIDList)GetProcAddress(shell32, "SHCreateItemFromIDList"); - pfnSHCreateItemFromParsingName = - (PFNSHCreateItemFromParsingName)GetProcAddress(shell32, "SHCreateItemFromParsingName"); - pfnSHCreateItemFromRelativeName = - (PFNSHCreateItemFromRelativeName)GetProcAddress(shell32, "SHCreateItemFromRelativeName"); - pfnSHCreateItemInKnownFolder = - (PFNSHCreateItemInKnownFolder)GetProcAddress(shell32, "SHCreateItemInKnownFolder"); - pfnSHCreateItemWithParent = (PFNSHCreateItemWithParent)GetProcAddress(shell32, "SHCreateItemWithParent"); - pfnSHGetIDListFromObject = (PFNSHGetIDListFromObject)GetProcAddress(shell32, "SHGetIDListFromObject"); pfnSHCreateShellItem = (PFNSHCreateShellItem)GetProcAddress(shell32, "SHCreateShellItem"); pfnSHOpenFolderAndSelectItems = (PFNSHOpenFolderAndSelectItems)GetProcAddress(shell32, "SHOpenFolderAndSelectItems"); diff --git a/com/win32comext/shell/src/shell_pch.h b/com/win32comext/shell/src/shell_pch.h index 2915e7a547..45009dd0c6 100644 --- a/com/win32comext/shell/src/shell_pch.h +++ b/com/win32comext/shell/src/shell_pch.h @@ -56,7 +56,6 @@ BOOL PyObject_AsFOLDERSETTINGS(PyObject *ob, FOLDERSETTINGS *pf); BOOL PyWinObject_AsSHELL_ITEM_RESOURCE(PyObject *ob, SHELL_ITEM_RESOURCE *psir); PyObject *PyWinObject_FromSHELL_ITEM_RESOURCE(const SHELL_ITEM_RESOURCE *psir); -// Vista has new spellings for PIDL. inline BOOL PyObject_AsPCUIDLIST_RELATIVE(PyObject *ob, PCUIDLIST_RELATIVE *ppidl, BOOL bNoneOK = FALSE, UINT *pcb = NULL) { diff --git a/win32/Demos/security/GetTokenInformation.py b/win32/Demos/security/GetTokenInformation.py index 7553a2c606..20b7cc1c9c 100644 --- a/win32/Demos/security/GetTokenInformation.py +++ b/win32/Demos/security/GetTokenInformation.py @@ -1,12 +1,9 @@ """Lists various types of information about current user's access token, -including UAC status on Vista -""" +including UAC status.""" -import pywintypes import win32api import win32con import win32security -import winerror from security_enums import ( SECURITY_IMPERSONATION_LEVEL, TOKEN_ELEVATION_TYPE, @@ -59,16 +56,10 @@ def dump_token(th): sid_desc = win32security.LookupAccountSid("", group_sid) print("\t", group_sid, sid_desc, group_attr, flag_desc) - ## Vista token information types, will throw (87, 'GetTokenInformation', 'The parameter is incorrect.') on earier OS - try: - is_elevated = win32security.GetTokenInformation( - th, win32security.TokenElevation - ) - print("TokenElevation:", is_elevated) - except pywintypes.error as details: - if details.winerror != winerror.ERROR_INVALID_PARAMETER: - raise - return None + print( + "TokenElevation:", + win32security.GetTokenInformation(th, win32security.TokenElevation), + ) print( "TokenHasRestrictions:", win32security.GetTokenInformation(th, win32security.TokenHasRestrictions), diff --git a/win32/Lib/win32serviceutil.py b/win32/Lib/win32serviceutil.py index 8df954ba3d..3276bc61b0 100644 --- a/win32/Lib/win32serviceutil.py +++ b/win32/Lib/win32serviceutil.py @@ -246,12 +246,9 @@ def InstallService( password, ) if description is not None: - try: - win32service.ChangeServiceConfig2( - hs, win32service.SERVICE_CONFIG_DESCRIPTION, description - ) - except NotImplementedError: - pass ## ChangeServiceConfig2 and description do not exist on NT + win32service.ChangeServiceConfig2( + hs, win32service.SERVICE_CONFIG_DESCRIPTION, description + ) if delayedstart is not None: try: win32service.ChangeServiceConfig2( @@ -259,11 +256,11 @@ def InstallService( win32service.SERVICE_CONFIG_DELAYED_AUTO_START_INFO, delayedstart, ) - except (win32service.error, NotImplementedError): - ## delayed start only exists on Vista and later - warn only when trying to set delayed to True - warnings.warn( - "Delayed Start not available on this system", stacklevel=2 - ) + except win32service.error as exc: + # Changing Delayed Auto-Start config may be restricted + # Warn only if trying to set delayed to True + if delayedstart: + warnings.warn(exc.strerror, stacklevel=2) win32service.CloseServiceHandle(hs) finally: win32service.CloseServiceHandle(hscm) @@ -329,12 +326,9 @@ def ChangeServiceConfig( displayName, ) if description is not None: - try: - win32service.ChangeServiceConfig2( - hs, win32service.SERVICE_CONFIG_DESCRIPTION, description - ) - except NotImplementedError: - pass ## ChangeServiceConfig2 and description do not exist on NT + win32service.ChangeServiceConfig2( + hs, win32service.SERVICE_CONFIG_DESCRIPTION, description + ) if delayedstart is not None: try: win32service.ChangeServiceConfig2( @@ -342,14 +336,11 @@ def ChangeServiceConfig( win32service.SERVICE_CONFIG_DELAYED_AUTO_START_INFO, delayedstart, ) - except (win32service.error, NotImplementedError): - ## Delayed start only exists on Vista and later. On Nt, will raise NotImplementedError since ChangeServiceConfig2 - ## doensn't exist. On Win2k and XP, will fail with ERROR_INVALID_LEVEL - ## Warn only if trying to set delayed to True + except win32service.error as exc: + # Changing Delayed Auto-Start config may be restricted + # Warn only if trying to set delayed to True if delayedstart: - warnings.warn( - "Delayed Start not available on this system", stacklevel=2 - ) + warnings.warn(exc.strerror, stacklevel=2) finally: win32service.CloseServiceHandle(hs) finally: @@ -969,9 +960,7 @@ class ServiceFramework: _svc_deps_ = None # sequence of service names on which this depends _exe_name_ = None # Default to PythonService.exe _exe_args_ = None # Default to no arguments - _svc_description_ = ( - None # Only exists on Windows 2000 or later, ignored on windows NT - ) + _svc_description_ = None def __init__(self, args): import servicemanager diff --git a/win32/Lib/win32timezone.py b/win32/Lib/win32timezone.py index 33376a4cd4..aa9a3b8d4b 100644 --- a/win32/Lib/win32timezone.py +++ b/win32/Lib/win32timezone.py @@ -100,7 +100,9 @@ >>> estdt.strftime('%Y-%m-%d %H:%M:%S') '2007-06-13 01:00:00' -Microsoft now has a patch for handling time zones in 2007 (see +The following two tests are kept for coverage and historical reasons. + +Microsoft released a patch for handling time zones in 2007 (see https://learn.microsoft.com/en-us/troubleshoot/windows-client/system-management-components/daylight-saving-time-help-support) As a result, patched systems will give an incorrect result for @@ -1027,8 +1029,7 @@ def resolveMUITimeZone(spec: str) -> str | None: >>> import sys >>> result = resolveMUITimeZone('@tzres.dll,-110') - >>> expectedResultType = [type(None),str][sys.getwindowsversion() >= (6,)] - >>> type(result) is expectedResultType + >>> type(result) is str True """ pattern = re.compile(r"@(?P.*),-(?P\d+)(?:;(?P.*))?") diff --git a/win32/src/PyACL.cpp b/win32/src/PyACL.cpp index 693f4f8f6f..aa05517881 100644 --- a/win32/src/PyACL.cpp +++ b/win32/src/PyACL.cpp @@ -1095,8 +1095,6 @@ PyObject *PyACL::PyGetEffectiveRightsFromAcl(PyObject *self, PyObject *args) // @pymethod (SuccessfulAuditedRights,FailedAuditRights)|PyACL|GetAuditedPermissionsFromAcl|Return types of access for // which ACL will generate an audit event for specified trustee -// @comm This function is known to return the success and failure access masks in the the wrong order -// on Windows 2000 service pack 4. Problem has been reported to Microsoft. PyObject *PyACL::PyGetAuditedPermissionsFromAcl(PyObject *self, PyObject *args) { DWORD err = 0; @@ -1110,7 +1108,6 @@ PyObject *PyACL::PyGetAuditedPermissionsFromAcl(PyObject *self, PyObject *args) return NULL; if (!PyWinObject_AsTRUSTEE(obTrustee, &trustee)) return NULL; - // ???? SDK docs say the success mask is first, but on Win2k sp4 they're returned in the opposite order ???? err = GetAuditedPermissionsFromAclW(This->GetACL(), &trustee, &success_mask, &fail_mask); if (err != ERROR_SUCCESS) PyWin_SetAPIError("GetAuditedPermissionsFromAcl", err); diff --git a/win32/src/PySECURITY_DESCRIPTOR.cpp b/win32/src/PySECURITY_DESCRIPTOR.cpp index 8f4d307c9f..ff4dd87ca6 100644 --- a/win32/src/PySECURITY_DESCRIPTOR.cpp +++ b/win32/src/PySECURITY_DESCRIPTOR.cpp @@ -633,7 +633,6 @@ PyObject *PySECURITY_DESCRIPTOR::GetSecurityDescriptorControl(PyObject *self, Py // @pymethod |PySECURITY_DESCRIPTOR|SetSecurityDescriptorControl|Sets the control bit flags related to inheritance for a // security descriptor -// @comm Only exists on Windows 2000 or later PyObject *PySECURITY_DESCRIPTOR::SetSecurityDescriptorControl(PyObject *self, PyObject *args) { SECURITY_DESCRIPTOR_CONTROL ControlBitsOfInterest, ControlBitsToSet; diff --git a/win32/src/win32apimodule.cpp b/win32/src/win32apimodule.cpp index 28cbf626a8..ba7106167a 100644 --- a/win32/src/win32apimodule.cpp +++ b/win32/src/win32apimodule.cpp @@ -2903,7 +2903,6 @@ static PyObject *PyRegConnectRegistry(PyObject *self, PyObject *args) // @pymethod |win32api|RegCopyTree|Copies an entire registry key to another location // @comm Accepts keyword args. -// @comm Requires Vista or later. static PyObject *PyRegCopyTree(PyObject *self, PyObject *args, PyObject *kwargs) { CHECK_PFN(RegCopyTree); @@ -2967,7 +2966,7 @@ static PyObject *PyRegCreateKey(PyObject *self, PyObject *args) // REG_OPENED_EXISTING_KEY) // @pyseeapi RegCreateKeyEx // @comm Implemented only as Unicode (RegCreateKeyExW). Accepts keyword arguments. -// @comm If a transaction handle is passed in, RegCreateKeyTransacted will be called (requires Vista or later) +// @comm If a transaction handle is passed in, RegCreateKeyTransacted will be called // @pyseeapi RegCreateKeyTransacted static PyObject *PyRegCreateKeyEx(PyObject *self, PyObject *args, PyObject *kwargs) { @@ -3053,7 +3052,6 @@ static PyObject *PyRegDeleteKey(PyObject *self, PyObject *args) // @pymethod |win32api|RegDeleteKeyEx|Deletes a registry key from 32 or 64 bit registry view // @pyseeapi RegDeleteKeyEx // @comm Accepts keyword args. -// @comm Requires 64-bit XP, Vista, or later. // @comm Key to be deleted cannot contain subkeys // @comm If a transaction handle is specified, RegDeleteKeyTransacted is called // @pyseeapi RegDeleteKeyTransacted @@ -3105,7 +3103,6 @@ static PyObject *PyRegDeleteKeyEx(PyObject *self, PyObject *args, PyObject *kwar // @pymethod |win32api|RegDeleteTree|Recursively deletes a key's subkeys and values // @comm Accepts keyword args. -// @comm Requires Vista or later. static PyObject *PyRegDeleteTree(PyObject *self, PyObject *args, PyObject *kwargs) { CHECK_PFN(RegDeleteTree); @@ -3696,7 +3693,6 @@ static PyObject *PyRegOpenKey(PyObject *self, PyObject *args) // @rdesc Returns a transacted registry handle. Note that operations on subkeys are not automatically transacted. // @pyseeapi RegOpenKeyTransacted // @comm Accepts keyword arguments. -// @comm Requires Vista or later. static PyObject *PyRegOpenKeyTransacted(PyObject *self, PyObject *args, PyObject *kwargs) { CHECK_PFN(RegOpenKeyTransacted); @@ -3736,7 +3732,6 @@ static PyObject *PyRegOpenKeyTransacted(PyObject *self, PyObject *args, PyObject // @pymethod |win32api|RegOverridePredefKey|Redirects one of the predefined keys to different key // @pyseeapi RegOverridePredefKey -// @comm Requires Windows 2000 or later. static PyObject *PyRegOverridePredefKey(PyObject *self, PyObject *args, PyObject *kwargs) { CHECK_PFN(RegOverridePredefKey); diff --git a/win32/src/win32evtlog.i b/win32/src/win32evtlog.i index 111b0a3b35..9101e089d6 100644 --- a/win32/src/win32evtlog.i +++ b/win32/src/win32evtlog.i @@ -1,8 +1,6 @@ /* File : win32evtlog.i */ %module win32evtlog // A module, encapsulating the Windows Win32 event log API. -// The Evt* functions are only available on Vista and later. Attempting to call -// them on XP will result in the process exiting, rather than a python exception. %include "typemaps.i" %include "pywin32.i" @@ -34,7 +32,7 @@ public: }; // @object PyEVT_HANDLE|Handle to an event log, session, query, or any other object used with -// the Evt* event log functions on Vista and later. +// the Evt* event log functions. // When the object is destroyed, EvtClose is called. class PyEVT_HANDLE: public PyHANDLE { @@ -491,7 +489,6 @@ RegisterEventSourceW ( PyObject *PyWinObject_FromEVT_VARIANT(PEVT_VARIANT val); -// New event log functions available on Vista and later // @pyswig |EvtOpenChannelEnum|Begins an enumeration of event channels // @comm Accepts keyword args static PyObject *PyEvtOpenChannelEnum(PyObject *self, PyObject *args, PyObject *kwargs) diff --git a/win32/src/win32file.i b/win32/src/win32file.i index dce9f040fa..988ec5d61f 100644 --- a/win32/src/win32file.i +++ b/win32/src/win32file.i @@ -1692,9 +1692,6 @@ PyCFunction pfnpy_TransmitFile=(PyCFunction)py_TransmitFile; // ConnectEx(sock, (addr, port), buf, overlap) // @rdesc Returns the completion code and number of bytes sent. // The completion code will be 0 for a completed operation, or ERROR_IO_PENDING for a pending overlapped operation. -// @rdesc If the platform does not support ConnectEx (eg, Windows 2000), an -// exception will be thrown indicating the WSAIoctl function (which is used to -// fetch the function pointer) failed with error code WSAEINVAL (10022). static PyObject *py_ConnectEx( PyObject *self, PyObject *args, PyObject *kwargs ) { OVERLAPPED *pOverlapped = NULL; SOCKET sConnecting; @@ -2947,7 +2944,6 @@ py_SetVolumeMountPoint(PyObject *self, PyObject *args, PyObject *kwargs) // @ex Usage|SetVolumeMountPoint('h:\tmp\','c:\') // @comm Note that both parameters must have trailing backslashes. // @rdesc The result is the GUID of the volume mounted, as a string. - // @comm This method exists only on Windows 2000 or later. On earlier platforms, NotImplementedError will be raised. CHECK_PFN(GetVolumeNameForVolumeMountPoint); CHECK_PFN(SetVolumeMountPoint); PyObject *ret=NULL; @@ -2984,7 +2980,6 @@ py_DeleteVolumeMountPoint(PyObject *self, PyObject *args, PyObject *kwargs) // @ex Usage|DeleteVolumeMountPoint('h:\tmp\') // @comm Throws an error if it is not a valid mount point, returns None on success. // Use carefully - will remove drive letter assignment if no directory specified - // @comm This method requires Windows 2000 or later. On earlier platforms, NotImplementedError will be raised. CHECK_PFN(DeleteVolumeMountPoint); PyObject *ret=NULL; PyObject *mount_point_obj = NULL; @@ -3129,9 +3124,8 @@ py_CreateHardLink(PyObject *self, PyObject *args, PyObject *kwargs) // Both file paths must be on the same NTFS volume.To remove the link, simply delete // it and the original file will still remain. // @ex Usage|CreateHardLink('h:\dir\newfilename.txt','h:\otherdir\existingfile.txt') - // @comm This method exists on Windows 2000 and later. Otherwise NotImplementedError will be raised. // @comm Accepts keyword args. - // @comm If the Transaction parameter is specified, CreateHardLinkTransacted will be called (requires Vista or later) + // @comm If the Transaction parameter is specified, CreateHardLinkTransacted will be called PyObject *ret=NULL; PyObject *new_file_obj; PyObject *existing_file_obj; @@ -3181,7 +3175,6 @@ PyCFunction pfnpy_CreateHardLink=(PyCFunction)py_CreateHardLink; // @pyswig |CreateSymbolicLink|Creates a symbolic link (reparse point) static PyObject *py_CreateSymbolicLink(PyObject *self, PyObject *args, PyObject *kwargs) { - // @comm This method only exists on Vista and later. // @comm Accepts keyword args. // @comm Requires SeCreateSymbolicLink priv. // @comm If the Transaction parameter is passed in, CreateSymbolicLinkTransacted will be called @@ -3299,7 +3292,6 @@ py_EncryptionDisable(PyObject *self, PyObject *args) // FILE_IS_ENCRYPTED, FILE_SYSTEM_ATTR, FILE_ROOT_DIR, FILE_SYSTEM_DIR, // FILE_UNKNOWN, FILE_SYSTEM_NOT_SUPPORT, FILE_USER_DISALLOWED, // or FILE_READ_ONLY -// @comm Requires Windows 2000 or higher. static PyObject* py_FileEncryptionStatus(PyObject *self, PyObject *args) { @@ -3968,7 +3960,7 @@ DWORD CALLBACK CopyFileEx_ProgressRoutine( // @pyseeapi CopyFileEx // @pyseeapi CopyFileTransacted // @comm Accepts keyword args. -// @comm On Vista and later, the Transaction arg can be passed to invoke CopyFileTransacted +// @comm The Transaction arg can be passed to invoke CopyFileTransacted static PyObject* py_CopyFileEx(PyObject *self, PyObject *args, PyObject *kwargs) { @@ -4038,9 +4030,8 @@ py_CopyFileEx(PyObject *self, PyObject *args, PyObject *kwargs) PyCFunction pfnpy_CopyFileEx=(PyCFunction)py_CopyFileEx; // @pyswig |MoveFileWithProgress|Moves a file, and reports progress to a callback function -// @comm Only available on Windows 2000 or later // @comm Accepts keyword arguments. -// @comm On Vista and later, the Transaction arg can be passed to invoke MoveFileTransacted +// @comm The Transaction arg can be passed to invoke MoveFileTransacted static PyObject* py_MoveFileWithProgress(PyObject *self, PyObject *args, PyObject *kwargs) { @@ -4108,7 +4099,6 @@ py_MoveFileWithProgress(PyObject *self, PyObject *args, PyObject *kwargs) PyCFunction pfnpy_MoveFileWithProgress=(PyCFunction)py_MoveFileWithProgress; // @pyswig |ReplaceFile|Replaces one file with another -// @comm Only available on Windows 2000 or later static PyObject* py_ReplaceFile(PyObject *self, PyObject *args) { @@ -4168,7 +4158,6 @@ void encryptedfilecontextdestructor(PyObject *obctxt){ // @rdesc Returns a PyCObject containing an operation context that can be passed to // or . Context must be // destroyed using . -// @comm Only available on Windows 2000 or later static PyObject* py_OpenEncryptedFileRaw(PyObject *self, PyObject *args) { @@ -4232,7 +4221,6 @@ DWORD WINAPI PyExportCallback(PBYTE file_data, PVOID callback_data, ULONG length } // @pyswig |ReadEncryptedFileRaw|Reads the encrypted bytes of a file for backup and restore purposes -// @comm Only available on Windows 2000 or later static PyObject* py_ReadEncryptedFileRaw(PyObject *self, PyObject *args) { @@ -4309,7 +4297,6 @@ DWORD WINAPI PyImportCallback(PBYTE file_data, PVOID callback_data, PULONG pleng } // @pyswig |WriteEncryptedFileRaw|Writes raw bytes to an encrypted file -// @comm Only available on Windows 2000 or later static PyObject* py_WriteEncryptedFileRaw(PyObject *self, PyObject *args) { @@ -4347,7 +4334,6 @@ py_WriteEncryptedFileRaw(PyObject *self, PyObject *args) } // @pyswig |CloseEncryptedFileRaw|Frees a context created by -// @comm Only available on Windows 2000 or later static PyObject* py_CloseEncryptedFileRaw(PyObject *self, PyObject *args) { @@ -4357,8 +4343,7 @@ py_CloseEncryptedFileRaw(PyObject *self, PyObject *args) &obctxt)) // @pyparm PyCObject|Context||Context object returned from return NULL; // We must nuke our ctxt in the CObject afer closing, else when the - // object destructs and we attempt to close it a second time, Vista x64 - // crashes. + // object destructs and we attempt to close it a second time, x64 crashes. // So must bypass the CObject API for this. if (!PyCapsule_IsValid(obctxt, NULL)) return PyErr_Format(PyExc_TypeError, "param must be handle to an encrypted file (got type %s)", obctxt->ob_type->tp_name); @@ -4380,7 +4365,7 @@ py_CloseEncryptedFileRaw(PyObject *self, PyObject *args) // @pyswig |CreateFileW|Unicode version of CreateFile - see for more information. // @pyseeapi CreateFile // @pyseeapi CreateFileTransacted -// @comm If Transaction is specified, CreateFileTransacted will be called (requires Vista or later) +// @comm If Transaction is specified, CreateFileTransacted will be called // @comm Accepts keyword arguments. static PyObject *py_CreateFileW(PyObject *self, PyObject *args, PyObject *kwargs) { @@ -4456,7 +4441,7 @@ PyCFunction pfnpy_CreateFileW=(PyCFunction)py_CreateFileW; // @pyswig |DeleteFileW|Deletes a file // @pyseeapi DeleteFile // @pyseeapi DeleteFileTransacted -// @comm If a transaction handle is passed in, DeleteFileTransacted will be called (requires Windows Vista). +// @comm If a transaction handle is passed in, DeleteFileTransacted will be called. // @comm Accepts keyword arguments. static PyObject *py_DeleteFileW(PyObject *self, PyObject *args, PyObject *kwargs) { @@ -4527,7 +4512,7 @@ static PyObject *PyObject_FromFILEX_INFO(GET_FILEEX_INFO_LEVELS level, void *p) // @pyparm int|InfoLevelId|GetFileExInfoStandard|An integer that gives the set of attribute information to obtain. // See the Win32 SDK documentation for more information. // @pyparm |Transaction|None|Handle to a transaction (optional). See . -// If this parameter is specified, GetFileAttributesTransacted will be called (requires Vista or later). +// If this parameter is specified, GetFileAttributesTransacted will be called. // @rdesc The result is a tuple of: // @tupleitem 0|int|attributes|File Attributes. A combination of the win32com.FILE_ATTRIBUTE_* flags. // @tupleitem 1||creationTime|Specifies when the file or directory was created. @@ -4642,7 +4627,7 @@ PyCFunction pfnpy_GetFileAttributesEx=(PyCFunction)py_GetFileAttributesExW; // @pyswig |SetFileAttributesW|Sets a file's attributes // @pyseeapi SetFileAttributes // @pyseeapi SetFileAttributesTransacted -// @comm If Transaction is not None, SetFileAttributesTransacted will be called (requires Vista or later) +// @comm If Transaction is not None, SetFileAttributesTransacted will be called // @comm Accepts keyword arguments. static PyObject *py_SetFileAttributesW(PyObject *self, PyObject *args, PyObject *kwargs) { @@ -4681,7 +4666,7 @@ PyCFunction pfnpy_SetFileAttributesW=(PyCFunction)py_SetFileAttributesW; // @pyswig |CreateDirectoryExW|Creates a directory // @pyseeapi CreateDirectoryEx // @pyseeapi CreateDirectoryTransacted -// @comm If a transaction handle is passed, CreateDirectoryTransacted will be called (requires Vista or later). +// @comm If a transaction handle is passed, CreateDirectoryTransacted will be called. // @comm Accepts keyword arguments. static PyObject *py_CreateDirectoryExW(PyObject *self, PyObject *args, PyObject *kwargs) { @@ -4727,7 +4712,7 @@ PyCFunction pfnpy_CreateDirectoryExW=(PyCFunction)py_CreateDirectoryExW; // @pyswig |RemoveDirectory|Removes an existing directory // @pyseeapi RemoveDirectory // @pyseeapi RemoveDirectoryTransacted -// @comm If a transaction handle is passed in, RemoveDirectoryTransacted will be called (requires Vista or later) +// @comm If a transaction handle is passed in, RemoveDirectoryTransacted will be called // @comm Accepts keyword arguments. static PyObject *py_RemoveDirectory(PyObject *self, PyObject *args, PyObject *kwargs) { @@ -4953,7 +4938,6 @@ PyCFunction pfnpy_FindStreams=(PyCFunction)py_FindStreams; // @pyswig [string,...]|FindFileNames|Enumerates hard links that point to specified file // @comm This uses the API functions FindFirstFileNameW, FindNextFileNameW and FindClose -// @comm Available on Vista and later // @comm If Transaction is specified, a transacted search is performed using FindFirstFileNameTransacted static PyObject *py_FindFileNames(PyObject *self, PyObject *args, PyObject *kwargs) { @@ -5354,7 +5338,6 @@ static PyObject *py_Wow64RevertWow64FsRedirection(PyObject *self, PyObject *args %{ // @pyswig object|GetFileInformationByHandleEx|Retrieves extended file information for an open file handle. -// @comm Available on Vista and later. // @comm Accepts keyword args. // @rdesc Type of returned object is determined by the requested information class // @flagh Class|Returned info @@ -5580,7 +5563,6 @@ PyCFunction pfnpy_GetFileInformationByHandleEx=(PyCFunction)py_GetFileInformatio %{ // @pyswig |SetFileInformationByHandle|Changes file characteristics by file handle -// @comm Available on Vista and later. // @comm Accepts keyword args. static PyObject *py_SetFileInformationByHandle(PyObject *self, PyObject *args, PyObject *kwargs) { @@ -5733,7 +5715,6 @@ PyCFunction pfnpy_SetFileInformationByHandle=(PyCFunction)py_SetFileInformationB %{ // @pyswig |ReOpenFile|Creates a new handle to an open file -// @comm Available on Vista and later. // @comm Accepts keyword args. static PyObject *py_ReOpenFile(PyObject *self, PyObject *args, PyObject *kwargs) { @@ -5762,7 +5743,6 @@ PyCFunction pfnpy_ReOpenFile=(PyCFunction)py_ReOpenFile; %{ // @pyswig |OpenFileById|Opens a file by File Id or Object Id -// @comm Available on Vista and later. // @comm Accepts keyword args. static PyObject *py_OpenFileById(PyObject *self, PyObject *args, PyObject *kwargs) { diff --git a/win32/src/win32gui.i b/win32/src/win32gui.i index ff844798d1..70bd410d2c 100644 --- a/win32/src/win32gui.i +++ b/win32/src/win32gui.i @@ -7212,7 +7212,6 @@ PyCFunction pfnPyGetLayeredWindowAttributes=(PyCFunction)PyGetLayeredWindowAttri %} // @pyswig |UpdateLayeredWindow|Updates the position, size, shape, content, and translucency of a layered window. -// @comm This function is only available on Windows 2000 and later // @comm Accepts keyword arguments. %{ PyObject *PyUpdateLayeredWindow(PyObject *self, PyObject *args, PyObject *kwargs) diff --git a/win32/src/win32inet.i b/win32/src/win32inet.i index f8e3620667..3093dab4f6 100644 --- a/win32/src/win32inet.i +++ b/win32/src/win32inet.i @@ -825,7 +825,7 @@ PyCFunction pfnPyFtpOpenFile = (PyCFunction)PyFtpOpenFile; %{ // @pyswig |FtpCommand|Allows an application to send commands directly to an FTP server. -// @comm This function may cause a crash on 32-bit XP and Vista due to an internal error in win32inet.dll. +// @comm This function may cause a crash on 32-bit due to an internal error in win32inet.dll. (last checked on Vista) // @comm Accepts keyword args PyObject *PyFtpCommand(PyObject *self, PyObject *args, PyObject *kwargs) { diff --git a/win32/src/win32job.i b/win32/src/win32job.i index 80f3cdf8b8..dc9f167020 100644 --- a/win32/src/win32job.i +++ b/win32/src/win32job.i @@ -1,7 +1,6 @@ /* File : win32job.i */ %module win32job // An interface to the win32 Process and Thread API's, -// available in Windows 2000 and later. %{ #include "PyWinTypes.h" diff --git a/win32/src/win32pdhmodule.cpp b/win32/src/win32pdhmodule.cpp index 8d3c7d7009..1a8272fc9b 100644 --- a/win32/src/win32pdhmodule.cpp +++ b/win32/src/win32pdhmodule.cpp @@ -418,7 +418,6 @@ static PyObject *PyAddCounter(PyObject *self, PyObject *args) } // @pymethod int|win32pdh|AddEnglishCounter|Adds a counter to a query by its English name -// @comm Available on Vista and later // @rdesc Returns a handle to the counter static PyObject *PyAddEnglishCounter(PyObject *self, PyObject *args) { diff --git a/win32/src/win32pipe.i b/win32/src/win32pipe.i index f29125c7c7..71acc71ae9 100644 --- a/win32/src/win32pipe.i +++ b/win32/src/win32pipe.i @@ -495,7 +495,6 @@ PyObject *MyPeekNamedPipe(PyObject *self, PyObject *args) %{ // @pyswig int|GetNamedPipeClientProcessId|Returns the process id of client that is connected to a named pipe -// @comm Requires Vista or later PyObject *MyGetNamedPipeClientProcessId(PyObject *self, PyObject *args) { CHECK_PFN(GetNamedPipeClientProcessId); @@ -513,7 +512,6 @@ PyObject *MyGetNamedPipeClientProcessId(PyObject *self, PyObject *args) } // @pyswig int|GetNamedPipeServerProcessId|Returns pid of server process that created a named pipe -// @comm Requires Vista or later PyObject *MyGetNamedPipeServerProcessId(PyObject *self, PyObject *args) { CHECK_PFN(GetNamedPipeServerProcessId); @@ -531,7 +529,6 @@ PyObject *MyGetNamedPipeServerProcessId(PyObject *self, PyObject *args) } // @pyswig int|GetNamedPipeClientSessionId|Returns the session id of client that is connected to a named pipe -// @comm Requires Vista or later PyObject *MyGetNamedPipeClientSessionId(PyObject *self, PyObject *args) { CHECK_PFN(GetNamedPipeClientSessionId); @@ -549,7 +546,6 @@ PyObject *MyGetNamedPipeClientSessionId(PyObject *self, PyObject *args) } // @pyswig int|GetNamedPipeServerSessionId|Returns session id of server process that created a named pipe -// @comm Requires Vista or later PyObject *MyGetNamedPipeServerSessionId(PyObject *self, PyObject *args) { CHECK_PFN(GetNamedPipeServerSessionId); diff --git a/win32/src/win32process.i b/win32/src/win32process.i index 22f08ef928..f01bc95aa7 100644 --- a/win32/src/win32process.i +++ b/win32/src/win32process.i @@ -658,7 +658,7 @@ PyObject *MyCreateProcess( BOOL bInheritHandles, // @pyparm int|bInheritHandles||handle inheritance flag DWORD dwCreationFlags, // @pyparm int|dwCreationFlags||creation flags. May be a combination of the following values from the win32con module: // @flagh Value|Meaning - // @flag CREATE_BREAKAWAY_FROM_JOB|Windows 2000: The child processes of a process associated with a job are not associated with the job. + // @flag CREATE_BREAKAWAY_FROM_JOB|The child processes of a process associated with a job are not associated with the job. // If the calling process is not associated with a job, this flag has no effect. If the calling process is associated with a job, the job must set the JOB_OBJECT_LIMIT_BREAKAWAY_OK limit or CreateProcess will fail. // @flag CREATE_DEFAULT_ERROR_MODE|The new process does not inherit the error mode of the calling process. Instead, CreateProcess gives the new process the current default error mode. An application sets the current default error mode by calling SetErrorMode. @@ -679,8 +679,8 @@ PyObject *MyCreateProcess( // @flag DETACHED_PROCESS|For console processes, the new process does not have access to the console of the parent process. The new process can call the AllocConsole function at a later time to create a new console. This flag cannot be used with the CREATE_NEW_CONSOLE flag. - // @flag ABOVE_NORMAL_PRIORITY_CLASS|Windows 2000: Indicates a process that has priority higher than NORMAL_PRIORITY_CLASS but lower than HIGH_PRIORITY_CLASS. - // @flag BELOW_NORMAL_PRIORITY_CLASS|Windows 2000: Indicates a process that has priority higher than IDLE_PRIORITY_CLASS but lower than NORMAL_PRIORITY_CLASS. + // @flag ABOVE_NORMAL_PRIORITY_CLASS|Indicates a process that has priority higher than NORMAL_PRIORITY_CLASS but lower than HIGH_PRIORITY_CLASS. + // @flag BELOW_NORMAL_PRIORITY_CLASS|Indicates a process that has priority higher than IDLE_PRIORITY_CLASS but lower than NORMAL_PRIORITY_CLASS. // @flag HIGH_PRIORITY_CLASS|Indicates a process that performs time-critical tasks. The threads of a high-priority class process preempt the threads of normal-priority or idle-priority class processes. An example is the Task List, which must respond quickly when called by the user, regardless of the load on the system. Use extreme care when using the high-priority class, because a CPU-bound application with a high-priority class can use nearly all available cycles. // @flag IDLE_PRIORITY_CLASS|Indicates a process whose threads run only when the system is idle and are preempted by the threads of any process running in a higher priority class. An example is a screen saver. The idle priority class is inherited by child processes. // @flag NORMAL_PRIORITY_CLASS|Indicates a normal process with no special scheduling needs. @@ -1228,7 +1228,6 @@ done: %} // @pyswig (long,....)|EnumProcessModulesEx|Lists 32 or 64-bit modules load by a process -// @comm Requires Vista or later %native(EnumProcessModulesEx) PyEnumProcessModulesEx; %{ PyObject *PyEnumProcessModulesEx(PyObject *self, PyObject *args) @@ -1770,8 +1769,8 @@ PyObject *PyWriteProcessMemory(PyObject *self, PyObject *args) #define DETACHED_PROCESS DETACHED_PROCESS // For console processes, the new process does not have access to the console of the parent process. The new process can call the AllocConsole function at a later time to create a new console. This flag cannot be used with the CREATE_NEW_CONSOLE flag. -#define ABOVE_NORMAL_PRIORITY_CLASS ABOVE_NORMAL_PRIORITY_CLASS // Windows 2000: Indicates a process that has priority above NORMAL_PRIORITY_CLASS but below HIGH_PRIORITY_CLASS. -#define BELOW_NORMAL_PRIORITY_CLASS BELOW_NORMAL_PRIORITY_CLASS // Windows 2000: Indicates a process that has priority above IDLE_PRIORITY_CLASS but below NORMAL_PRIORITY_CLASS. +#define ABOVE_NORMAL_PRIORITY_CLASS ABOVE_NORMAL_PRIORITY_CLASS // Indicates a process that has priority above NORMAL_PRIORITY_CLASS but below HIGH_PRIORITY_CLASS. +#define BELOW_NORMAL_PRIORITY_CLASS BELOW_NORMAL_PRIORITY_CLASS // Indicates a process that has priority above IDLE_PRIORITY_CLASS but below NORMAL_PRIORITY_CLASS. #define HIGH_PRIORITY_CLASS HIGH_PRIORITY_CLASS // Indicates a process that performs time-critical tasks that must be executed immediately for it to run correctly. The threads of a high-priority class process preempt the threads of normal-priority or idle-priority class processes. An example is the Task List, which must respond quickly when called by the user, regardless of the load on the system. Use extreme care when using the high-priority class, because a high-priority class CPU-bound application can use nearly all available cycles. #define IDLE_PRIORITY_CLASS IDLE_PRIORITY_CLASS // Indicates a process whose threads run only when the system is idle and are preempted by the threads of any process running in a higher priority class. An example is a screen saver. The idle priority class is inherited by child processes. #define NORMAL_PRIORITY_CLASS NORMAL_PRIORITY_CLASS // Indicates a normal process with no special scheduling needs. diff --git a/win32/src/win32security.i b/win32/src/win32security.i index ff24c6d9a4..8a8763d562 100644 --- a/win32/src/win32security.i +++ b/win32/src/win32security.i @@ -1000,7 +1000,6 @@ BOOLAPI RevertToSelf(); %{ // @pyswig |LogonUser|Attempts to log a user on to the local computer, that is, to the computer from which LogonUser was called. You cannot use LogonUser to log on to a remote computer. // @comm Accepts keyword args -// @comm On Windows 2000 and earlier, the calling process must have SE_TCB_NAME privilege. PyObject *PyLogonUser(PyObject *self, PyObject *args, PyObject *kwargs) { DWORD logontype, logonprovider; @@ -4129,9 +4128,9 @@ static PyObject *PyMapGenericMask(PyObject *self, PyObject *args) // ACE types #define ACCESS_ALLOWED_ACE_TYPE ACCESS_ALLOWED_ACE_TYPE // Access-allowed ACE that uses the ACCESS_ALLOWED_ACE structure. -#define ACCESS_ALLOWED_OBJECT_ACE_TYPE ACCESS_ALLOWED_OBJECT_ACE_TYPE // Windows 2000/XP: Object-specific access-allowed ACE that uses the ACCESS_ALLOWED_OBJECT_ACE structure. +#define ACCESS_ALLOWED_OBJECT_ACE_TYPE ACCESS_ALLOWED_OBJECT_ACE_TYPE // Object-specific access-allowed ACE that uses the ACCESS_ALLOWED_OBJECT_ACE structure. #define ACCESS_DENIED_ACE_TYPE ACCESS_DENIED_ACE_TYPE // Access-denied ACE that uses the ACCESS_DENIED_ACE structure. -#define ACCESS_DENIED_OBJECT_ACE_TYPE ACCESS_DENIED_OBJECT_ACE_TYPE // Windows 2000/XP: Object-specific access-denied ACE that uses the ACCESS_DENIED_OBJECT_ACE structure. +#define ACCESS_DENIED_OBJECT_ACE_TYPE ACCESS_DENIED_OBJECT_ACE_TYPE // Object-specific access-denied ACE that uses the ACCESS_DENIED_OBJECT_ACE structure. #define SYSTEM_AUDIT_ACE_TYPE SYSTEM_AUDIT_ACE_TYPE // System-audit ACE that uses the SYSTEM_AUDIT_ACE structure. #define SYSTEM_AUDIT_OBJECT_ACE_TYPE SYSTEM_AUDIT_OBJECT_ACE_TYPE diff --git a/win32/src/win32service.i b/win32/src/win32service.i index b91a0e16bf..0cdf94ac2e 100644 --- a/win32/src/win32service.i +++ b/win32/src/win32service.i @@ -1946,7 +1946,6 @@ PyObject *PyQueryServiceConfig2(PyObject *self, PyObject *args) // Types of info used with QueryServiceConfig2 #define SERVICE_CONFIG_DESCRIPTION SERVICE_CONFIG_DESCRIPTION #define SERVICE_CONFIG_FAILURE_ACTIONS SERVICE_CONFIG_FAILURE_ACTIONS -// These require Vista or above #define SERVICE_CONFIG_DELAYED_AUTO_START_INFO SERVICE_CONFIG_DELAYED_AUTO_START_INFO #define SERVICE_CONFIG_FAILURE_ACTIONS_FLAG SERVICE_CONFIG_FAILURE_ACTIONS_FLAG #define SERVICE_CONFIG_PRESHUTDOWN_INFO SERVICE_CONFIG_PRESHUTDOWN_INFO diff --git a/win32/src/win32transactionmodule.cpp b/win32/src/win32transactionmodule.cpp index df39f67a1a..a62de4579d 100644 --- a/win32/src/win32transactionmodule.cpp +++ b/win32/src/win32transactionmodule.cpp @@ -209,7 +209,6 @@ static PyObject *PyOpenTransaction(PyObject *self, PyObject *args, PyObject *kwa // @module win32transaction|Module wrapping Kernal Transaction Manager functions, as used with // transacted NTFS and transacted registry functions. -// @comm These functions are only available on Vista and later. // @comm All functions accept keyword arguments. static PyMethodDef win32transaction_functions[] = { // @pymeth CreateTransaction|Creates a transaction diff --git a/win32/test/test_clipboard.py b/win32/test/test_clipboard.py index 0c89d4babb..8d66e6fdc5 100644 --- a/win32/test/test_clipboard.py +++ b/win32/test/test_clipboard.py @@ -116,11 +116,6 @@ def test_mem(self): def test_bad_mem(self): self.assertRaises(pywintypes.error, GetGlobalMemory, 0) self.assertRaises(pywintypes.error, GetGlobalMemory, -1) - if sys.getwindowsversion()[0] <= 5: - # For some reason, the value '1' dies from a 64bit process, but - # "works" (ie, gives the correct exception) from a 32bit process. - # just silently skip this value on Vista. - self.assertRaises(pywintypes.error, GetGlobalMemory, 1) def test_custom_mem(self): test_data = b"hello\x00\xff" diff --git a/win32/test/test_win32file.py b/win32/test/test_win32file.py index 135478e65e..3bf644feb1 100644 --- a/win32/test/test_win32file.py +++ b/win32/test/test_win32file.py @@ -395,8 +395,7 @@ def _IOCPServerThread(self, handle, port, drop_overlapped_reference): # GetQueuedCompletionStatus will still find it. Our check of # reference counting should catch that error. overlapped = None - # even if we fail, be sure to close the handle; prevents hangs - # on Vista 64... + # even if we fail, be sure to close the handle to prevents hangs try: self.assertRaises( RuntimeError, win32file.GetQueuedCompletionStatus, port, -1 @@ -751,9 +750,9 @@ def testEncrypt(self): class TestConnect(unittest.TestCase): def connect_thread_runner(self, expect_payload, giveup_event): - # As Windows 2000 doesn't do ConnectEx, we need to use a non-blocking - # accept, as our test connection may never come. May as well use - # AcceptEx for this... + # Windows 2000 didn't do ConnectEx, we needed to use a non-blocking + # accept, as our test connection possible would never come if skipped. + # May as well use and test AcceptEx for this... listener = socket.socket() self.addr = ("localhost", random.randint(10000, 64000)) listener.bind(self.addr) @@ -802,8 +801,6 @@ def test_connect_with_payload(self): win32file.ConnectEx(s2, self.addr, ol, b"some expected request") except win32file.error as exc: win32event.SetEvent(giveup_event) - if exc.winerror == 10022: # WSAEINVAL - raise TestSkipped("ConnectEx is not available on this platform") raise # some error error we don't expect. # We occasionally see ERROR_CONNECTION_REFUSED in automation try: @@ -837,8 +834,6 @@ def test_connect_without_payload(self): win32file.ConnectEx(s2, self.addr, ol) except win32file.error as exc: win32event.SetEvent(giveup_event) - if exc.winerror == 10022: # WSAEINVAL - raise TestSkipped("ConnectEx is not available on this platform") raise # some error error we don't expect. # We occasionally see ERROR_CONNECTION_REFUSED in automation try: