Skip to content

Commit

Permalink
[server\register.py] Use WinDLL instead of windll
Browse files Browse the repository at this point in the history
Partially fix enthought#735
  • Loading branch information
moi15moi committed Jan 13, 2025
1 parent 41e2eac commit d72f57d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions comtypes/server/register.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
import os
import sys
import winreg
from ctypes import WinError, windll
from ctypes import WinDLL, WinError
from ctypes.wintypes import HKEY, LONG
from typing import Iterator, List, Optional, Tuple, Type, Union

import comtypes
Expand Down Expand Up @@ -73,9 +74,12 @@ def _non_zero(retval, func, args):
return retval


SHDeleteKey = windll.shlwapi.SHDeleteKeyW
_shlwapi = WinDLL("shlwapi")
LSTATUS = LONG
SHDeleteKey = _shlwapi.SHDeleteKeyW
SHDeleteKey.errcheck = _non_zero
SHDeleteKey.argtypes = ctypes.c_ulong, ctypes.c_wchar_p
SHDeleteKey.argtypes = HKEY, ctypes.c_wchar_p
SHDeleteKey.restype = LSTATUS


_KEYS = {
Expand Down

0 comments on commit d72f57d

Please sign in to comment.