diff --git a/CHANGES.txt b/CHANGES.txt index 39f95c0fd6..d6bc199f35 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -13,6 +13,8 @@ https://mhammond.github.io/pywin32_installers.html . Coming in build 310, as yet unreleased -------------------------------------- +* Drop support for Vista, set Windows 7 as the minimal Windows version. (#, @Avasam) + * Restores many IIDs in `win32com(ext).shell.shell`. See #2486 for details. Build 309, released 2025/03/09 ------------------------------ diff --git a/com/win32comext/shell/src/PyIApplicationDestinations.cpp b/com/win32comext/shell/src/PyIApplicationDestinations.cpp index f495904000..58256cd88d 100644 --- a/com/win32comext/shell/src/PyIApplicationDestinations.cpp +++ b/com/win32comext/shell/src/PyIApplicationDestinations.cpp @@ -3,9 +3,6 @@ #include "shell_pch.h" -// Requires Windows 7 SDK to build -#if WINVER >= 0x0601 - #include "PyIApplicationDestinations.h" // @doc - This file contains autoduck documentation @@ -90,7 +87,6 @@ PyObject *PyIApplicationDestinations::RemoveAllDestinations(PyObject *self, PyOb } // @object PyIApplicationDestinations|Allows an application to removed items from its jump lists -// @comm Available on Windows 7 and later static struct PyMethodDef PyIApplicationDestinations_methods[] = { {"SetAppID", PyIApplicationDestinations::SetAppID, 1}, // @pymeth SetAppID|Specifies the application whose jump list is to be accessed @@ -103,4 +99,3 @@ static struct PyMethodDef PyIApplicationDestinations_methods[] = { PyComTypeObject PyIApplicationDestinations::type("PyIApplicationDestinations", &PyIUnknown::type, sizeof(PyIApplicationDestinations), PyIApplicationDestinations_methods, GET_PYCOM_CTOR(PyIApplicationDestinations)); -#endif // WINVER diff --git a/com/win32comext/shell/src/PyIApplicationDestinations.h b/com/win32comext/shell/src/PyIApplicationDestinations.h index d2943b4f2a..6c12ce5777 100644 --- a/com/win32comext/shell/src/PyIApplicationDestinations.h +++ b/com/win32comext/shell/src/PyIApplicationDestinations.h @@ -1,5 +1,3 @@ -// Requires Windows 7 SDK to build -#if WINVER >= 0x0601 // This file declares the IApplicationDestinations Interface for Python. // Generated by makegw.py // --------------------------------------------------- @@ -21,5 +19,3 @@ class PyIApplicationDestinations : public PyIUnknown { PyIApplicationDestinations(IUnknown *pdisp); ~PyIApplicationDestinations(); }; - -#endif // WINVER diff --git a/com/win32comext/shell/src/PyIApplicationDocumentLists.cpp b/com/win32comext/shell/src/PyIApplicationDocumentLists.cpp index e02789d4b2..5491b00475 100644 --- a/com/win32comext/shell/src/PyIApplicationDocumentLists.cpp +++ b/com/win32comext/shell/src/PyIApplicationDocumentLists.cpp @@ -3,9 +3,6 @@ #include "shell_pch.h" -// Requires Windows 7 SDK to build -#if WINVER >= 0x0601 - #include "PyIApplicationDocumentLists.h" // @doc - This file contains autoduck documentation @@ -72,7 +69,6 @@ PyObject *PyIApplicationDocumentLists::GetList(PyObject *self, PyObject *args) } // @object PyIApplicationDocumentLists|Interface used to retrieve the jump lists for an application -// @comm Available on Windows 7 and later static struct PyMethodDef PyIApplicationDocumentLists_methods[] = { {"SetAppID", PyIApplicationDocumentLists::SetAppID, 1}, // @pymeth SetAppID|Specifies the application whose jump list is to be accessed @@ -83,5 +79,3 @@ PyComTypeObject PyIApplicationDocumentLists::type("PyIApplicationDocumentLists", sizeof(PyIApplicationDocumentLists), PyIApplicationDocumentLists_methods, GET_PYCOM_CTOR(PyIApplicationDocumentLists)); - -#endif // WINVER diff --git a/com/win32comext/shell/src/PyIApplicationDocumentLists.h b/com/win32comext/shell/src/PyIApplicationDocumentLists.h index 1020a20410..05e423facb 100644 --- a/com/win32comext/shell/src/PyIApplicationDocumentLists.h +++ b/com/win32comext/shell/src/PyIApplicationDocumentLists.h @@ -1,6 +1,3 @@ -// Requires Windows 7 SDK to build -#if WINVER >= 0x0601 - // This file declares the IApplicationDocumentLists Interface for Python. // Generated by makegw.py // --------------------------------------------------- @@ -21,5 +18,3 @@ class PyIApplicationDocumentLists : public PyIUnknown { PyIApplicationDocumentLists(IUnknown *pdisp); ~PyIApplicationDocumentLists(); }; - -#endif // WINVER diff --git a/com/win32comext/shell/src/PyICustomDestinationList.cpp b/com/win32comext/shell/src/PyICustomDestinationList.cpp index cb60226dd9..8b1eced758 100644 --- a/com/win32comext/shell/src/PyICustomDestinationList.cpp +++ b/com/win32comext/shell/src/PyICustomDestinationList.cpp @@ -3,9 +3,6 @@ #include "shell_pch.h" -// Requires Windows 7 SDK to build -#if WINVER >= 0x0601 - #include "PyICustomDestinationList.h" // @doc - This file contains autoduck documentation @@ -228,7 +225,6 @@ PyObject *PyICustomDestinationList::AbortList(PyObject *self, PyObject *args) } // @object PyICustomDestinationList|Interface used to customize an application's jump list -// @comm Requires Windows 7 or later static struct PyMethodDef PyICustomDestinationList_methods[] = { {"SetAppID", PyICustomDestinationList::SetAppID, 1}, // @pymeth SetAppID|Specifies the taskbar identifier for the jump list @@ -251,5 +247,3 @@ static struct PyMethodDef PyICustomDestinationList_methods[] = { PyComTypeObject PyICustomDestinationList::type("PyICustomDestinationList", &PyIUnknown::type, sizeof(PyICustomDestinationList), PyICustomDestinationList_methods, GET_PYCOM_CTOR(PyICustomDestinationList)); - -#endif // WINVER diff --git a/com/win32comext/shell/src/PyICustomDestinationList.h b/com/win32comext/shell/src/PyICustomDestinationList.h index 01db00e019..7cc3f370f8 100644 --- a/com/win32comext/shell/src/PyICustomDestinationList.h +++ b/com/win32comext/shell/src/PyICustomDestinationList.h @@ -4,9 +4,6 @@ // // Interface Declaration -// Requires Windows 7 SDK to build -#if WINVER >= 0x0601 - class PyICustomDestinationList : public PyIUnknown { public: MAKE_PYCOM_CTOR(PyICustomDestinationList); @@ -28,5 +25,3 @@ class PyICustomDestinationList : public PyIUnknown { PyICustomDestinationList(IUnknown *pdisp); ~PyICustomDestinationList(); }; - -#endif // WINVER diff --git a/com/win32comext/shell/src/PyIObjectArray.cpp b/com/win32comext/shell/src/PyIObjectArray.cpp index 2fc551044c..5d412f2685 100644 --- a/com/win32comext/shell/src/PyIObjectArray.cpp +++ b/com/win32comext/shell/src/PyIObjectArray.cpp @@ -3,9 +3,6 @@ #include "shell_pch.h" -// Requires Windows 7 SDK to build -#if WINVER >= 0x0601 - #include "PyIObjectArray.h" // @doc - This file contains autoduck documentation @@ -67,5 +64,3 @@ static struct PyMethodDef PyIObjectArray_methods[] = { PyComTypeObject PyIObjectArray::type("PyIObjectArray", &PyIUnknown::type, sizeof(PyIObjectArray), PyIObjectArray_methods, GET_PYCOM_CTOR(PyIObjectArray)); - -#endif // WINVER diff --git a/com/win32comext/shell/src/PyIObjectArray.h b/com/win32comext/shell/src/PyIObjectArray.h index 6f189657a5..64c392178e 100644 --- a/com/win32comext/shell/src/PyIObjectArray.h +++ b/com/win32comext/shell/src/PyIObjectArray.h @@ -4,9 +4,6 @@ // // Interface Declaration -// Requires Windows 7 SDK to build -#if WINVER >= 0x0601 - class PyIObjectArray : public PyIUnknown { public: MAKE_PYCOM_CTOR(PyIObjectArray); @@ -21,5 +18,3 @@ class PyIObjectArray : public PyIUnknown { PyIObjectArray(IUnknown *pdisp); ~PyIObjectArray(); }; - -#endif // WINVER diff --git a/com/win32comext/shell/src/PyIObjectCollection.cpp b/com/win32comext/shell/src/PyIObjectCollection.cpp index c1779ce764..9f36e5d3ef 100644 --- a/com/win32comext/shell/src/PyIObjectCollection.cpp +++ b/com/win32comext/shell/src/PyIObjectCollection.cpp @@ -3,9 +3,6 @@ #include "shell_pch.h" -// Requires Windows 7 SDK to build -#if WINVER >= 0x0601 - #include "PyIObjectArray.h" #include "PyIObjectCollection.h" @@ -124,5 +121,3 @@ PyComTypeObject PyIObjectCollection::type("PyIObjectCollection", &PyIObjectArray::type, // @base PyIObjectCollection|PyIObjectArray sizeof(PyIObjectCollection), PyIObjectCollection_methods, GET_PYCOM_CTOR(PyIObjectCollection)); - -#endif // WINVER diff --git a/com/win32comext/shell/src/PyIObjectCollection.h b/com/win32comext/shell/src/PyIObjectCollection.h index ef87aa1b77..062fb5104b 100644 --- a/com/win32comext/shell/src/PyIObjectCollection.h +++ b/com/win32comext/shell/src/PyIObjectCollection.h @@ -4,9 +4,6 @@ // // Interface Declaration -// Requires Windows 7 SDK to build -#if WINVER >= 0x0601 - class PyIObjectCollection : public PyIObjectArray { public: MAKE_PYCOM_CTOR(PyIObjectCollection); @@ -23,5 +20,3 @@ class PyIObjectCollection : public PyIObjectArray { PyIObjectCollection(IUnknown *pdisp); ~PyIObjectCollection(); }; - -#endif // WINVER diff --git a/com/win32comext/shell/src/PyIShellLibrary.cpp b/com/win32comext/shell/src/PyIShellLibrary.cpp index f3dab63c53..7949d87105 100644 --- a/com/win32comext/shell/src/PyIShellLibrary.cpp +++ b/com/win32comext/shell/src/PyIShellLibrary.cpp @@ -3,9 +3,6 @@ #include "shell_pch.h" -// Requires Windows 7 SDK to build -#if WINVER >= 0x0601 - #include "PyIShellLibrary.h" // @doc - This file contains autoduck documentation @@ -431,7 +428,6 @@ PyObject *PyIShellLibrary::SaveInKnownFolder(PyObject *self, PyObject *args) } // @object PyIShellLibrary|Interface used to access Libraries -// @comm Requires Windows 7 or later static struct PyMethodDef PyIShellLibrary_methods[] = { {"LoadLibraryFromItem", PyIShellLibrary::LoadLibraryFromItem, 1}, // @pymeth LoadLibraryFromItem|Loads an existing library file @@ -463,5 +459,3 @@ static struct PyMethodDef PyIShellLibrary_methods[] = { PyComTypeObject PyIShellLibrary::type("PyIShellLibrary", &PyIUnknown::type, sizeof(PyIShellLibrary), PyIShellLibrary_methods, GET_PYCOM_CTOR(PyIShellLibrary)); - -#endif // WINVER diff --git a/com/win32comext/shell/src/PyIShellLibrary.h b/com/win32comext/shell/src/PyIShellLibrary.h index 0c0f61bcf5..03ccb86af5 100644 --- a/com/win32comext/shell/src/PyIShellLibrary.h +++ b/com/win32comext/shell/src/PyIShellLibrary.h @@ -4,9 +4,6 @@ // // Interface Declaration -// Requires Windows 7 SDK to build -#if WINVER >= 0x0601 - class PyIShellLibrary : public PyIUnknown { public: MAKE_PYCOM_CTOR(PyIShellLibrary); @@ -36,5 +33,3 @@ class PyIShellLibrary : public PyIUnknown { PyIShellLibrary(IUnknown *pdisp); ~PyIShellLibrary(); }; - -#endif // WINVER diff --git a/com/win32comext/shell/src/shell.cpp b/com/win32comext/shell/src/shell.cpp index 51c24df598..cc649838d4 100644 --- a/com/win32comext/shell/src/shell.cpp +++ b/com/win32comext/shell/src/shell.cpp @@ -82,7 +82,6 @@ generates Windows .hlp files. #include "PyITransferMediumItem.h" #include "PyIIdentityName.h" -// These Require Windows 7 SDK to build #include "PyIEnumObjects.h" #include "PyIApplicationDocumentLists.h" #include "PyIApplicationDestinations.h" @@ -1492,7 +1491,7 @@ static PyObject *PySHGetFolderLocation(PyObject *self, PyObject *args) // @pymethod |shell|SHAddToRecentDocs|Adds a document to the shell's list of recently used documents or clears all // documents from the list. The user gains access to the list through the Start menu of the Windows taskbar. -// @comm On Windows 7, the entry is also added to the application's jump list. +// @comm The entry is also added to the application's jump list. // @pyseeapi SHAddToRecentDocs // @comm The underlying API function has no return value, and therefore no way to indicate failure. static PyObject *PySHAddToRecentDocs(PyObject *self, PyObject *args) @@ -1557,8 +1556,6 @@ static PyObject *PySHAddToRecentDocs(PyObject *self, PyObject *args) PyObject_FreePIDL(buf); break; } -#if WINVER >= 0x0601 - // Introduced in Windows 7 case SHARD_APPIDINFO: { // @flag SHARD_APPIDINFO|Tuple of (, str), where str is an AppID SHARDAPPIDINFO buf; @@ -1639,7 +1636,6 @@ static PyObject *PySHAddToRecentDocs(PyObject *self, PyObject *args) PY_INTERFACE_POSTCALL; break; } -#endif // WINVER default: PyErr_SetString(PyExc_NotImplementedError, "SHARD value not supported"); return NULL; @@ -3520,7 +3516,6 @@ static PyObject *PySHCreateStreamOnFileEx(PyObject *self, PyObject *args, PyObje static PyObject *PySetCurrentProcessExplicitAppUserModelID(PyObject *self, PyObject *args) { // @comm Should be used early in process startup before creating any windows - // @comm Requires Windows 7 or later // @pyparm str|AppID||The Application User Model ID used to group taskbar buttons if (pfnSetCurrentProcessExplicitAppUserModelID == NULL) return PyCom_BuildPyException(E_NOTIMPL); @@ -3543,7 +3538,6 @@ static PyObject *PySetCurrentProcessExplicitAppUserModelID(PyObject *self, PyObj // @pymethod str|shell|GetCurrentProcessExplicitAppUserModelID|Retrieves the current taskbar identifier // @comm Will only retrieve an identifier if set by the application, not a system-assigned default. -// @comm Requires Windows 7 or later static PyObject *PyGetCurrentProcessExplicitAppUserModelID(PyObject *self, PyObject *args) { if (pfnGetCurrentProcessExplicitAppUserModelID == NULL) @@ -3805,8 +3799,6 @@ static const PyCom_InterfaceSupportInfo g_interfaceSupportData[] = { PYCOM_INTERFACE_FULL(CurrentItem), // based on IRelatedItem with no extra methods PYCOM_INTERFACE_FULL(DisplayItem), // based on IRelatedItem with no extra methods PYCOM_INTERFACE_FULL(IdentityName), // based on IRelatedItem with no extra methods - // These require Windows 7 SDK to build -#if WINVER >= 0x0601 PYCOM_INTERFACE_CLIENT_ONLY(EnumObjects), PYCOM_INTERFACE_CLIENT_ONLY(ApplicationDocumentLists), PYCOM_INTERFACE_CLSID_ONLY(ApplicationDocumentLists), @@ -3821,7 +3813,6 @@ static const PyCom_InterfaceSupportInfo g_interfaceSupportData[] = { PYCOM_INTERFACE_CLIENT_ONLY(CustomDestinationList), PYCOM_INTERFACE_CLSID_ONLY(ShellLibrary), PYCOM_INTERFACE_CLIENT_ONLY(ShellLibrary), -#endif }; static int AddConstant(PyObject *dict, const char *key, long value) @@ -4115,8 +4106,6 @@ PYWIN_MODULE_INIT_FUNC(shell) ADD_IID(FOLDERID_Contacts); ADD_IID(FOLDERID_SidebarParts); ADD_IID(FOLDERID_SidebarDefaultParts); - // Removed in Windows 7 SDK - // ADD_IID(FOLDERID_TreeProperties); ADD_IID(FOLDERID_PublicGameTasks); ADD_IID(FOLDERID_GameTasks); ADD_IID(FOLDERID_SavedGames); @@ -4127,8 +4116,6 @@ PYWIN_MODULE_INIT_FUNC(shell) ADD_IID(FOLDERID_UsersFiles); ADD_IID(FOLDERID_SearchHome); ADD_IID(FOLDERID_OriginalImages); -#if WINVER >= 0x0601 - // Added in Windows 7 SDK ADD_IID(FOLDERID_DeviceMetadataStore); ADD_IID(FOLDERID_DocumentsLibrary); ADD_IID(FOLDERID_HomeGroup); @@ -4145,7 +4132,6 @@ PYWIN_MODULE_INIT_FUNC(shell) ADD_IID(FOLDERID_UserProgramFilesCommon); ADD_IID(FOLDERID_UsersLibraries); ADD_IID(FOLDERID_VideosLibrary); -#endif // WINVER // Known folder types ADD_IID(FOLDERTYPEID_Invalid); @@ -4161,13 +4147,6 @@ PYWIN_MODULE_INIT_FUNC(shell) ADD_IID(FOLDERTYPEID_Contacts); ADD_IID(FOLDERTYPEID_NetworkExplorer); ADD_IID(FOLDERTYPEID_UserFiles); - // Removed in Windows 7 SDK - // ADD_IID(FOLDERTYPEID_Library); - // ADD_IID(FOLDERTYPEID_MusicDetails); - // ADD_IID(FOLDERTYPEID_MusicIcons); - // ADD_IID(FOLDERTYPEID_NotSpecified); -#if WINVER >= 0x0601 - // Added in Windows 7 SDK ADD_IID(FOLDERTYPEID_Communications); ADD_IID(FOLDERTYPEID_Generic); ADD_IID(FOLDERTYPEID_GenericLibrary); @@ -4184,7 +4163,6 @@ PYWIN_MODULE_INIT_FUNC(shell) ADD_IID(FOLDERTYPEID_StartMenu); ADD_IID(FOLDERTYPEID_UsersLibraries); ADD_IID(FOLDERTYPEID_Videos); -#endif // WINVER // ??? The shell passes this resource type to IShellResources.OpenResource, // but it doesn't seem to be defined anywhere ??? diff --git a/setup.py b/setup.py index 543955e3a7..946d4d567b 100644 --- a/setup.py +++ b/setup.py @@ -130,10 +130,10 @@ def __init__( # CRYPT_DECRYPT_MESSAGE_PARA.dwflags is in an ifdef for some unknown reason # See github PR #1444 for more details... ("CRYPT_DECRYPT_MESSAGE_PARA_HAS_EXTRA_FIELDS", None), - # Minimum Windows version supported (Vista / Windows Server 2008) + # Minimum Windows version supported (Windows 7 / Windows Server 2008) # https://learn.microsoft.com/en-us/cpp/porting/modifying-winver-and-win32-winnt - ("_WIN32_WINNT", hex(0x0600)), - ("WINVER", hex(0x0600)), + ("_WIN32_WINNT", hex(0x0601)), + ("WINVER", hex(0x0601)), ) ) self.pch_header = pch_header