Skip to content

Commit b64507f

Browse files
committed
Remove considerations for Windows 2000 and Windows Vista
1 parent fb13fc0 commit b64507f

31 files changed

+68
-236
lines changed

CHANGES.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ Coming in build 312, as yet unreleased
1919
--------------------------------------
2020

2121
* Fixed missing version stamp on built `.dll` and `.exe` files (mhammond#2647, [@Avasam][Avasam])
22+
* Removed considerations for Windows 2000 and Windows Vista (mhammond#2667, [@Avasam][Avasam])
23+
* This mostly updates obsolete documentation and tests
2224
* Removed considerations for Windows 95/98/ME (mhammond#2400, [@Avasam][Avasam])
2325
This removes the following constants:
2426
* `win32con.FILE_ATTRIBUTE_ATOMIC_WRITE`

com/help/active_directory.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,11 @@ <h2><a name="getobj">Getting Active Directory Objects</a></h2>
8383

8484
<h3><a name="discovery">Discovery</a></h3>
8585
<p>
86-
A tool that can be of a great help is ADSIedit which is in the Windows
87-
2000 support tools on the Windows 2000 server cdrom. It gives you the
88-
raw ldap view of active directory.</p>
86+
A tool that can be of a great help is the ADSI Edit MMC snap-in, aka <b>ADSIEdit.msc</b>. See
87+
<a href="https://www.microsoft.com/en-us/download/details.aspx?id=45520"
88+
>Remote Server Administration Tools for Windows 10</a> for installation instructions.
89+
It gives you the raw ldap view of active directory.
90+
Note that it is not available for the Home edition of Windows.</p>
8991
<code>
9092
def discover():
9193
Here is a function that helps you determine the active directory ldap strings that you can actually use.

com/win32com/server/register.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
import os
1111
import sys
12+
import tempfile
1213

1314
import pythoncom
1415
import win32api
@@ -541,8 +542,6 @@ def UnregisterInfoClasses(*classes, **flags):
541542

542543
# Attempt to 're-execute' our current process with elevation.
543544
def ReExecuteElevated(flags):
544-
import tempfile
545-
546545
import win32console
547546
import win32event # we've already checked we are running XP above
548547
import win32process
@@ -646,14 +645,9 @@ def UseCommandLine(*classes, **flags):
646645
else:
647646
RegisterClasses(*classes, **flags)
648647
except win32api.error as exc:
649-
# If we are on xp+ and have "access denied", retry using
650-
# ShellExecuteEx with 'runas' verb to force elevation (vista) and/or
651-
# admin login dialog (vista/xp)
652-
if (
653-
flags["unattended"]
654-
or exc.winerror != winerror.ERROR_ACCESS_DENIED
655-
or sys.getwindowsversion()[0] < 5
656-
):
648+
# If we have "access denied", retry using
649+
# ShellExecuteEx with 'runas' verb to force elevation
650+
if flags["unattended"] or exc.winerror != winerror.ERROR_ACCESS_DENIED:
657651
raise
658652
ReExecuteElevated(flags)
659653

com/win32com/src/PythonCOM.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ extern LONG _PyCom_GetGatewayCount(void);
9292
typedef HRESULT(STDAPICALLTYPE *CreateURLMonikerExfunc)(LPMONIKER, LPCWSTR, LPMONIKER *, DWORD);
9393
static CreateURLMonikerExfunc pfnCreateURLMonikerEx = NULL;
9494

95-
// Win2k or later
9695
typedef HRESULT(STDAPICALLTYPE *CoWaitForMultipleHandlesfunc)(DWORD dwFlags, DWORD dwTimeout, ULONG cHandles,
9796
LPHANDLE pHandles, LPDWORD lpdwindex);
9897
static CoWaitForMultipleHandlesfunc pfnCoWaitForMultipleHandles = NULL;
@@ -104,7 +103,6 @@ typedef HRESULT(STDAPICALLTYPE *CoSetCancelObjectfunc)(IUnknown *);
104103
static CoSetCancelObjectfunc pfnCoSetCancelObject = NULL;
105104

106105
// typedefs for the function pointers are in OleAcc.h
107-
// WinXP or later
108106
LPFNOBJECTFROMLRESULT pfnObjectFromLresult = NULL;
109107

110108
typedef HRESULT(STDAPICALLTYPE *CoCreateInstanceExfunc)(REFCLSID, IUnknown *, DWORD, COSERVERINFO *, ULONG, MULTI_QI *);

com/win32comext/propsys/src/propsys.cpp

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
// $Id$
33

44
// Implements wrappers for the Property System functions and interfaces.
5-
// These interfaces are present on Windows Vista and later, but can also
6-
// be installed on XP with Desktop Search 3.
7-
// However, this module doeen't dynamically load any libraries or functions,
8-
// so it will fail to import if the components are not installed.
95

106
// This source file contains autoduck documentation.
117
// @doc
@@ -41,7 +37,6 @@
4137
#define CHECK_PFN(fname) \
4238
if (pfn##fname == NULL) \
4339
return PyErr_Format(PyExc_NotImplementedError, "%s is not available on this platform", #fname);
44-
// Not available on Vista or earlier
4540
typedef HRESULT(WINAPI *PFNSHGetPropertyStoreForWindow)(HWND, REFIID, void **);
4641
static PFNSHGetPropertyStoreForWindow pfnSHGetPropertyStoreForWindow = NULL;
4742

@@ -546,7 +541,7 @@ static PyObject *PySHSetDefaultProperties(PyObject *self, PyObject *args)
546541
}
547542

548543
/* List of module functions */
549-
// @module propsys|A module, encapsulating the Vista Property System interfaces
544+
// @module propsys|A module, encapsulating the Property System interfaces
550545
static struct PyMethodDef propsys_methods[] = {
551546
// { "SHGetPropertyStoreFromIDList", PySHGetPropertyStoreFromIDList, 1 }, // @pymeth
552547
// SHGetPropertyStoreFromIDList|Retrieves the property store from an absolute ID list
@@ -618,10 +613,7 @@ static const PyCom_InterfaceSupportInfo g_interfaceSupportData[] = {
618613
/* Module initialisation */
619614
PYWIN_MODULE_INIT_FUNC(propsys)
620615
{
621-
PYWIN_MODULE_INIT_PREPARE(propsys, propsys_methods,
622-
"A module, encapsulating the Property System interfaces."
623-
"Available on Windows Vista and later, but can also be used"
624-
"on XP if Desktop Search 3 is installed.");
616+
PYWIN_MODULE_INIT_PREPARE(propsys, propsys_methods, "A module, encapsulating the Property System interfaces.");
625617

626618
if (PyDict_SetItemString(dict, "error", PyWinExc_COMError) == -1)
627619
PYWIN_MODULE_INIT_RETURN_ERROR;

com/win32comext/shell/demos/explorer_browser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# A sample of using Vista's IExplorerBrowser interfaces...
1+
# A sample of using IExplorerBrowser interfaces...
22
# Currently doesn't quite work:
33
# * CPU sits at 100% while running.
44

com/win32comext/shell/demos/servers/folder_view.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
import os
99
import pickle
1010
import random
11-
import sys
11+
import struct
12+
import winreg
1213

1314
import commctrl
1415
import pythoncom
@@ -796,12 +797,6 @@ def get_schema_fname():
796797

797798

798799
def DllRegisterServer():
799-
import winreg
800-
801-
if sys.getwindowsversion()[0] < 6:
802-
print("This sample only works on Vista")
803-
sys.exit(1)
804-
805800
key = winreg.CreateKey(
806801
winreg.HKEY_LOCAL_MACHINE,
807802
"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
@@ -816,7 +811,6 @@ def DllRegisterServer():
816811
attr = (
817812
shellcon.SFGAO_FOLDER | shellcon.SFGAO_HASSUBFOLDER | shellcon.SFGAO_BROWSABLE
818813
)
819-
import struct
820814

821815
s = struct.pack("i", attr)
822816
winreg.SetValueEx(key, "Attributes", 0, winreg.REG_BINARY, s)
@@ -832,7 +826,6 @@ def DllRegisterServer():
832826

833827

834828
def DllUnregisterServer():
835-
import winreg
836829

837830
paths = [
838831
"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Desktop\\Namespace\\"

com/win32comext/shell/src/PyIFileOperation.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,6 @@ PyObject *PyIFileOperation::GetAnyOperationsAborted(PyObject *self, PyObject *ar
629629
// performed by the shell as a unit. Serves as a replacement for <om shell.SHFileOperation>.
630630
// <nl>No changes are actually made until PerformOperations is called.
631631
// <nl>Progress can be monitored by implementing <o PyGFileOperationProgressSink>.
632-
// <nl>Requires Vista or later.
633632
static struct PyMethodDef PyIFileOperation_methods[] = {
634633
{"Advise", PyIFileOperation::Advise, 1}, // @pymeth Advise|Connects an event sink to receive updates
635634
{"Unadvise", PyIFileOperation::Unadvise, 1}, // @pymeth Unadvise|Disconnects a progress sink

com/win32comext/shell/src/PyIKnownFolder.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,6 @@ PyObject *PyIKnownFolder::GetFolderDefinition(PyObject *self, PyObject *args)
211211

212212
// @object PyIKnownFolder|Interface representing a known folder that serves
213213
// as a replacement for the numeric CSIDL definitions and API functions.
214-
// Requires Vista or later.
215214
static struct PyMethodDef PyIKnownFolder_methods[] = {
216215
{"GetId", PyIKnownFolder::GetId, 1}, // @pymeth GetId|Returns the id of the folder
217216
{"GetCategory", PyIKnownFolder::GetCategory,

com/win32comext/shell/src/PyIShellFolder2.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,7 @@ PyObject *PyIShellFolder2::GetDetailsOf(PyObject *self, PyObject *args)
165165
}
166166

167167
// @pymethod <o SHCOLUMNID>|PyIShellFolder2|MapColumnToSCID|Returns the unique identifier (FMTID, pid) of a column
168-
// @rdesc On XP and earlier, this is the Column Id as provided by <o PyIColumnProvider>.
169-
// For Vista and later, this is the Property Key used with the property system interfaces.
168+
// @rdesc This is the Property Key used with the property system interfaces.
170169
PyObject *PyIShellFolder2::MapColumnToSCID(PyObject *self, PyObject *args)
171170
{
172171
IShellFolder2 *pISF2 = GetI(self);

0 commit comments

Comments
 (0)