1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
U
W±dXã@s°dZddlmZddlmZmZmZmZmZm    Z    ddl
m Z dZ dZdd„Zdd    „Zd
d „Zd d „Zefdd„Zdd„Zdd„Zdd„Zdd„Zefdd„Zdd„Zdd„ZdS)z0 A module, encapsulating the Windows Win32 API. é)Úabsolute_import)Ú_commonÚ_dllÚ    _resourceÚ_system_informationÚ_backendÚ_time)Ú pywin32erroréc
Cs<|dkstdƒ‚tƒt |d|¡W5QR£SQRXdS)ai Loads the specified DLL, and returns the handle.
 
    Parameters
    ----------
    fileName : unicode
        The filename of the module to load.
 
    handle : int
        Reserved, always zero.
 
    flags : int
        The action to be taken when loading the module.
 
    Returns
    -------
    handle : hModule
        The handle of the loaded module
 
    rzhandle != 0 not supportedN)Ú
ValueErrorÚ _pywin32errorrZ_LoadLibraryEx)ÚfileNameÚhandleÚflags©rúSd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\win32ctypes/pywin32/win32api.pyÚ LoadLibraryExsrc    s:g‰‡fdd„}tƒt |t |¡d¡W5QRXˆS)zë Enumerates resource types within a module.
 
    Parameters
    ----------
    hModule : handle
        The handle to the module.
 
    Returns
    -------
    resource_types : list
       The list of resource types in the module.
 
    csˆ |¡dS©NT©Úappend)ÚhModuleÚtype_Úparam©Zresource_typesrrÚcallback>s
z#EnumResourceTypes.<locals>.callbackr)r rZ_EnumResourceTypesZENUMRESTYPEPROC)rrrrrÚEnumResourceTypes.s ÿrc    s<g‰‡fdd„}tƒt ||t |¡d¡W5QRXˆS)a„ Enumerates all the resources of the specified type within a module.
 
    Parameters
    ----------
    hModule : handle
        The handle to the module.
    resType : str : int
        The type or id of resource to enumerate.
 
    Returns
    -------
    resource_names : list
       The list of resource names (unicode strings) of the specific
       resource type in the module.
 
    csˆ |¡dSrr)rrÚ    type_namer©Zresource_namesrrr[s
z#EnumResourceNames.<locals>.callbackr)r rZ_EnumResourceNamesZENUMRESNAMEPROC)rZresTyperrrrÚEnumResourceNamesHs ÿrc    s>g‰‡fdd„}tƒt |||t |¡d¡W5QRXˆS)az List languages of a resource module.
 
    Parameters
    ----------
    hModule : handle
        Handle to the resource module.
 
    lpType : str : int
        The type or id of resource to enumerate.
 
    lpName : str : int
        The type or id of resource to enumerate.
 
    Returns
    -------
    resource_languages : list
        List of the resource language ids.
 
    csˆ |¡dSrr)rrZres_nameZ language_idr©Zresource_languagesrrr{s
z'EnumResourceLanguages.<locals>.callbackr)r rZ_EnumResourceLanguagesZENUMRESLANGPROC)rZlpTypeZlpNamerrrrÚEnumResourceLanguageses ÿr c
Csztƒjt ||||¡}t ||¡}t ||¡}tdkrNt t |¡tj    ¡}n
t |¡}t 
||¡W5QR£SQRXdS)aì Find and Load a resource component.
 
    Parameters
    ----------
    handle : hModule
        The handle of the module containing the resource.
        Use None for current process executable.
 
    type : str : int
        The type of resource to load.
 
    name : str : int
        The name or Id of the resource to load.
 
    language : int
        Language to use, default is LANG_NEUTRAL.
 
    Returns
    -------
    resource : bytes
        The byte string blob of the resource
 
    ÚctypesN) r rZ_FindResourceExZ_SizeofResourceZ _LoadResourcerrÚcastZ _LockResourceÚc_char_pZ_PyBytes_FromStringAndSize)rÚtypeÚnameÚlanguageZhrsrcÚsizeZhglobÚpointerrrrÚ LoadResource…s  ÿ
r)c
Cs(tƒt |¡W5QR£SQRXdS)zë Free the loaded dynamic-link library (DLL) module.
 
    If necessary, decrements its reference count.
 
    Parameters
    ----------
    handle : hModule
        The handle to the library as returned by the LoadLibrary function.
 
    N)r rZ _FreeLibrary)rrrrÚ FreeLibrary©s r*cCst ¡S)zŸ The number of milliseconds that have elapsed since startup
 
    Returns
    -------
    counts : int
        The millisecond counts since system startup.
    )rZ _GetTickCountrrrrÚ GetTickCount¸sr+c
Cs*tƒt ||¡W5QR£SQRXdS)a: Get a handle that can be used by the :func:`UpdateResource`.
 
    Parameters
    ----------
    fileName : unicode
        The filename of the module to load.
    delete : bool
        When true all existing resources are deleted
 
    Returns
    -------
    result : hModule
        Handle of the resource.
 
    N)r rZ_BeginUpdateResource)ÚfilenameÚdeleterrrÚBeginUpdateResourceÃsr.c    Cs"tƒt ||¡W5QRXdS)zý End the update resource of the handle.
 
    Parameters
    ----------
    handle : hModule
        The handle of the resource as it is returned
        by :func:`BeginUpdateResource`
 
    discard : bool
        When True all writes are discarded.
 
    N)r rZ_EndUpdateResource)rÚdiscardrrrÚEndUpdateResource×s r0c
CsXtƒHz t|ƒ}Wntk
r0tdƒ‚YnXt |||||t|ƒ¡W5QRXdS)a< Update a resource.
 
    Parameters
    ----------
    handle : hModule
        The handle of the resource file as returned by
        :func:`BeginUpdateResource`.
 
    type : str : int
        The type of resource to update.
 
    name : str : int
        The name or Id of the resource to update.
 
    data : bytes
        A bytes like object is expected.
 
        .. note::
          PyWin32 version 219, on Python 2.7, can handle unicode inputs.
          However, the data are stored as bytes and it is not really
          possible to convert the information back into the original
          unicode string. To be consistent with the Python 3 behaviour
          of PyWin32, we raise an error if the input cannot be
          converted to `bytes`.
 
    language : int
        Language to use, default is LANG_NEUTRAL.
 
    z0a bytes-like object is required, not a 'unicode'N)r ÚbytesÚUnicodeEncodeErrorÚ    TypeErrorrZ_UpdateResourceÚlen)rr$r%Údatar&Zlp_datarrrÚUpdateResourceès ÿ
ÿr6c
Cs*tƒtt ¡ƒW5QR£SQRXdS)z~ Get the ``Windows`` directory.
 
    Returns
    -------
    result : str
        The path to the ``Windows`` directory.
 
    N)r ÚstrrZ_GetWindowsDirectoryrrrrÚGetWindowsDirectorys    r8c
Cs*tƒtt ¡ƒW5QR£SQRXdS)z| Get the ``System`` directory.
 
    Returns
    -------
    result : str
        The path to the ``System`` directory.
 
    N)r r7rZ_GetSystemDirectoryrrrrÚGetSystemDirectorys    r9N)Ú__doc__Ú
__future__rZwin32ctypes.corerrrrrrZwin32ctypes.pywin32.pywintypesr    r ZLOAD_LIBRARY_AS_DATAFILEZ LANG_NEUTRALrrrr r)r*r+r.r0r6r8r9rrrrÚ<module>s"     $  (