From: david-sarah Date: Mon, 2 Aug 2010 22:45:05 +0000 (-0700) Subject: bundled setuptools/command/scriptsetup.py: use SendMessageTimeoutW, to test whether... X-Git-Tag: allmydata-tahoe-1.8.0b2~44 X-Git-Url: https://git.rkrishnan.org/components/com_hotproperty/css?a=commitdiff_plain;h=58cce54ada16c0124358c5735f56fc7085f60d9d;p=tahoe-lafs%2Ftahoe-lafs.git bundled setuptools/command/scriptsetup.py: use SendMessageTimeoutW, to test whether that broadcasts environment changes any better. --- diff --git a/setuptools-0.6c16dev.egg/setuptools/command/scriptsetup.py b/setuptools-0.6c16dev.egg/setuptools/command/scriptsetup.py index 48e6b53f..df60f9c4 100644 --- a/setuptools-0.6c16dev.egg/setuptools/command/scriptsetup.py +++ b/setuptools-0.6c16dev.egg/setuptools/command/scriptsetup.py @@ -224,20 +224,20 @@ def do_scriptsetup(allusers=False): # # - # LRESULT WINAPI SendMessageTimeoutA(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, + # LRESULT WINAPI SendMessageTimeoutW(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, # UINT fuFlags, UINT uTimeout, PDWORD_PTR lpdwResult); try: - from ctypes import WINFUNCTYPE, POINTER, windll, addressof, c_char_p + from ctypes import WINFUNCTYPE, POINTER, windll, addressof, c_wchar_p from ctypes.wintypes import LONG, HWND, UINT, WPARAM, LPARAM, DWORD SendMessageTimeout = WINFUNCTYPE(POINTER(LONG), HWND, UINT, WPARAM, LPARAM, UINT, UINT, POINTER(POINTER(DWORD))) \ - (("SendMessageTimeoutA", windll.user32)) + (("SendMessageTimeoutW", windll.user32)) HWND_BROADCAST = 0xFFFF WM_SETTINGCHANGE = 0x001A SMTO_ABORTIFHUNG = 0x0002 SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, change_allusers and 1 or 0, - addressof(c_char_p("Environment")), SMTO_ABORTIFHUNG, 5000, None); + addressof(c_wchar_p(u"Environment")), SMTO_ABORTIFHUNG, 5000, None); except Exception, e: print "Warning: %r" % (e,)