]> sourceware.org Git - newlib-cygwin.git/blame - winsup/cygwin/autoload.cc
Cygwin: mixer: Fix volume control for no WAVECAPS_LRVOLUME device
[newlib-cygwin.git] / winsup / cygwin / autoload.cc
CommitLineData
a5cc215f
CV
1/* autoload.cc: all dynamic load stuff.
2
a5cc215f
CV
3This file is part of Cygwin.
4
5This software is a copyrighted work licensed under the terms of the
6Cygwin license. Please consult the file "CYGWIN_LICENSE" for
7details. */
8
9#include "winsup.h"
ade47a34 10#include "miscfuncs.h"
81137c50 11#include <fenv.h>
d61b1993
CF
12#define USE_SYS_TYPES_FD_SET
13#include <winsock2.h>
14
ade47a34
CF
15bool NO_COPY wsock_started;
16
d61b1993
CF
17/* Macro for defining "auto-load" functions.
18 * Note that this is self-modifying code *gasp*.
19 * The first invocation of a routine will trigger the loading of
20 * the DLL. This will then be followed by the discovery of
21 * the procedure's entry point, which is placed into the location
22 * pointed to by the stack pointer. This code then changes
23 * the "call" operand which invoked it to a "jmp" which will
24 * transfer directly to the DLL function on the next invocation.
25 *
26 * Subsequent calls to routines whose transfer address has not been
27 * determined will skip the "load the dll" step, starting at the
28 * "discovery of the entry point" step.
29 *
30 * So, immediately following the the call to one of the above routines
31 * we have:
61522196 32 * DLL info (4/8 bytes) Pointer to a block of information concerning
d61b1993 33 * the DLL (see below).
77680cac
CV
34 * DLL notimp (2 bytes) Bool value flagging that non-existence of this
35 * function is not a fatal error.
36 * DLL error (2 bytes) Error value returned if function load fails.
37 * Depends on the return type of the function.
38 * Default is 0 == BOOL FALSE or == HANDLE NULL or
39 * == Pointer NULL.
1f962581 40 * func addr (8 bytes) Address of the actual Win32 function. For the
61522196
CV
41 * reason why this is necessary, see the below
42 * description of the load_state.
d61b1993
CF
43 * func name (n bytes) asciz string containing the name of the function
44 * to be loaded.
45 *
46 * The DLL info block consists of the following
61522196 47 * load_state (4/8 bytes) Pointer to a word containing the routine used
d61b1993 48 * to eventually invoke the function. Initially
61522196
CV
49 * points to an init function which loads the DLL,
50 * gets the process's load address, changes the contents
51 * here to point to the function address, and changes
52 * the address argument of the initial jmp call.
1f962581 53 * On x86_64, the jmp is not tweaked directly. Rather,
61522196
CV
54 * the address of the Win32 function is stored in the
55 * aforementioned Win32 function address slot and fetched
56 * there for a jmp *%rax call. This indirection is
57 * necessary to workaround the lack of a jmp opcode with
58 * offset values > 32 bit. If the initialization has
59 * been done, only the load part is done.
60 * DLL handle (4/8 bytes) The handle to use when loading the DLL.
d61b1993
CF
61 * DLL locker (4 bytes) Word to use to avoid multi-thread access during
62 * initialization.
61522196 63 * extra init (4/8 bytes) Extra initialization function.
d61b1993
CF
64 * DLL name (n bytes) asciz string containing the name of the DLL.
65 */
66
67/* LoadDLLprime is used to prime the DLL info information, providing an
68 additional initialization routine to call prior to calling the first
69 function. */
bbfe79fb 70#ifdef __x86_64__
61522196
CV
71#define LoadDLLprime(dllname, init_also, no_resolve_on_fork) __asm__ (" \n\
72.ifndef " #dllname "_primed \n\
73 .section .data_cygwin_nocopy,\"w\" \n\
74 .align 8 \n\
75."#dllname "_info: \n\
76 .quad _std_dll_init \n\
77 .quad " #no_resolve_on_fork " \n\
78 .long -1 \n\
79 .align 8 \n\
80 .quad " #init_also " \n\
81 .string16 \"" #dllname ".dll\" \n\
82 .text \n\
83 .set " #dllname "_primed, 1 \n\
84.endif \n\
85");
bbfe79fb
KB
86#else
87#error unimplemented for this target
88#endif
d61b1993 89
ebd2f65c 90/* Standard DLL load macro. May invoke a fatal error if the function isn't
d61b1993 91 found. */
77680cac
CV
92#define LoadDLLfunc(name, dllname) \
93 LoadDLLfuncEx (name, dllname, 0)
94#define LoadDLLfuncEx(name, dllname, notimp) \
95 LoadDLLfuncEx2(name, dllname, notimp, 0)
96#define LoadDLLfuncEx2(name, dllname, notimp, err) \
97 LoadDLLfuncEx3(name, dllname, notimp, err, 0)
d61b1993
CF
98
99/* Main DLL setup stuff. */
bbfe79fb 100#ifdef __x86_64__
77680cac 101#define LoadDLLfuncEx3(name, dllname, notimp, err, no_resolve_on_fork) \
61522196
CV
102 LoadDLLprime (dllname, dll_func_load, no_resolve_on_fork) \
103 __asm__ (" \n\
104 .section ." #dllname "_autoload_text,\"wx\" \n\
105 .global " #name " \n\
106 .global _win32_" #name " \n\
107 .align 16 \n\
108" #name ": \n\
109_win32_" #name ": \n\
110 movq 3f(%rip),%rax \n\
111 jmp *%rax \n\
1121:movq 2f(%rip),%rax \n\
113 push %rbp # Keep 16 byte aligned \n\
114 push %r9 \n\
115 push %r8 \n\
116 push %rdx \n\
117 push %rcx \n\
118 call *(%rax) \n\
1192:.quad ." #dllname "_info \n\
77680cac
CV
120 .hword " #notimp " \n\
121 .hword ((" #err ") & 0xffff) \n\
61522196
CV
1223:.quad 1b \n\
123 .asciz \"" #name "\" \n\
124 .text \n\
125");
bbfe79fb
KB
126#else
127#error unimplemented for this target
128#endif
d61b1993
CF
129
130/* DLL loader helper functions used during initialization. */
131
132/* The function which finds the address, given the name and overwrites
133 the call so that future invocations go straight to the function in
134 the DLL. */
135extern "C" void dll_func_load () __asm__ ("dll_func_load");
136
137/* Called by the primary initialization function "init_std_dll" to
138 setup the stack and eliminate future calls to init_std_dll for other
139 functions from this DLL. */
140extern "C" void dll_chain () __asm__ ("dll_chain");
141
a5cc215f
CV
142extern "C" {
143
bbfe79fb 144#ifdef __x86_64__
61522196
CV
145__asm__ (" \n\
146 .section .rdata,\"r\" \n\
147msg1: \n\
148 .ascii \"couldn't dynamically determine load address for '%s' (handle %p), %E\\0\"\n\
149 \n\
150 .text \n\
151 .p2align 4,,15 \n\
152noload: \n\
153 movq 40(%rsp),%rdx # Get the address of the information block\n\
154 movl 8(%rdx),%eax # Should we 'ignore' the lack \n\
155 test $1,%eax # of this function? \n\
156 jz 1f # Nope. \n\
157 andl $0xffff0000,%eax# upper word (== desired return value) \n\
77680cac 158 sarl $16,%eax # swap to low order word \n\
61522196
CV
159 movl %eax,32(%rsp) # Save for later (in shadow space) \n\
160 movl $127,%ecx # ERROR_PROC_NOT_FOUND \n\
161 call SetLastError # Set it \n\
162 movl 32(%rsp),%eax # Get back return value \n\
61522196
CV
163 addq $40,%rsp # Revert stack \n\
164 pop %r10 # Drop pointer to 'return address' \n\
165 pop %rcx # Restore arg registers \n\
166 pop %rdx \n\
167 pop %r8 \n\
168 pop %r9 \n\
169 pop %rbp # ...and restore frame pointer \n\
170 ret # Return \n\
1711: \n\
172 movq (%rdx),%rax # Handle value \n\
173 movq 8(%rax),%r8 \n\
174 lea 20(%rdx),%rdx # Location of name of function \n\
175 lea msg1(%rip),%rcx # The message \n\
176 call api_fatal # Print message. Never returns \n\
177 \n\
178 .globl dll_func_load \n\
179dll_func_load: \n\
180 movq (%rsp),%rdx # 'Return address' contains load info \n\
181 movq (%rdx),%rcx # Where handle lives \n\
182 movq 8(%rcx),%rcx # Address of Handle to DLL \n\
183 addq $20,%rdx # Address of name of function to load \n\
184 subq $40,%rsp # Shadow space + 8 byte for alignment \n\
185 call GetProcAddress # Load it \n\
186 test %rax,%rax # Success? \n\
187 jne gotit # Yes \n\
188 jmp noload # Issue an error or return \n\
189gotit: \n\
190 addq $40,%rsp # Revert stack \n\
d2ef2331 191 pop %r10 # Pointer to 'return address' \n\
61522196
CV
192 movq %rax,12(%r10) # Move absolute address to address slot \n\
193 subq $25,%r10 # Point to jmp \n\
194 pop %rcx # Restore arg registers \n\
195 pop %rdx \n\
196 pop %r8 \n\
197 pop %r9 \n\
198 pop %rbp # ...and restore frame pointer \n\
199 jmp *%r10 # Jump to actual function \n\
200 \n\
201 .global dll_chain \n\
202dll_chain: \n\
203 push %rax # Restore 'return address' \n\
204 jmp *%rdx # Jump to next init function \n\
205");
bbfe79fb
KB
206#else
207#error unimplemented for this target
208#endif
d61b1993
CF
209
210/* C representations of the two info blocks described above.
211 FIXME: These structures confuse gdb for some reason. GDB can print
212 the whole structure but has problems with the name field? */
213struct dll_info
a5cc215f 214{
61522196 215 UINT_PTR load_state;
d61b1993
CF
216 HANDLE handle;
217 LONG here;
218 void (*init) ();
893a8b78 219 WCHAR name[];
a5cc215f
CV
220};
221
d61b1993
CF
222struct func_info
223{
224 struct dll_info *dll;
225 LONG decoration;
61522196 226 UINT_PTR func_addr;
d61b1993
CF
227 char name[];
228};
a5cc215f 229
d61b1993 230/* Mechanism for setting up info for passing to dll_chain routines. */
61522196 231typedef __uint128_t two_addr_t;
d61b1993
CF
232union retchain
233{
61522196
CV
234 struct {uintptr_t high; uintptr_t low;};
235 two_addr_t ll;
d61b1993
CF
236};
237
15d6f564
CV
238/* This function handles the problem described here:
239
240 http://www.microsoft.com/technet/security/advisory/2269637.mspx
105f79b4 241 https://msdn.microsoft.com/library/ff919712 */
8ceb4854 242static __inline bool
15d6f564 243dll_load (HANDLE& handle, PWCHAR name)
a16b0549 244{
fc449e1c 245 HANDLE h = NULL;
fcda8810 246 WCHAR dll_path[MAX_PATH];
15d6f564 247
105f79b4 248 /* Try loading with full path, which sometimes fails for no good reason. */
fcda8810
CV
249 wcpcpy (wcpcpy (dll_path, windows_system_directory), name);
250 h = LoadLibraryW (dll_path);
105f79b4 251 /* If it failed, try loading just by name. */
15d6f564 252 if (!h)
fcda8810 253 h = LoadLibraryW (name);
8ceb4854
CF
254 if (!h)
255 return false;
256 handle = h;
257 return true;
a16b0549
CF
258}
259
0dcfb061
CV
260#define RETRY_COUNT 10
261
d61b1993 262/* The standard DLL initialization routine. */
bbfe79fb 263#ifdef __x86_64__
61522196
CV
264
265/* On x86_64, we need assembler wrappers for std_dll_init and wsock_init.
266 In the x86_64 ABI it's no safe bet that frame[1] (aka 8(%rbp)) contains
267 the return address. Consequentially, if we try to overwrite frame[1]
268 with the address of dll_chain, we end up with a scrambled stack, the
269 result depending on the optimization settings and the current frame of
270 mind of the compiler. So for x86_64, we disable overwriting the return
271 address in the real std_dll_init/wsock_init function, but rather do this
272 in the wrapper, after return from the function, when we exactly know
273 where the original return address is stored on the stack. */
274
275#define INIT_WRAPPER(func) \
276__asm__ (" \n\
277 .text \n\
278 .p2align 4,,15 \n\
279 .seh_proc _" #func " \n\
280_" #func ": \n\
281 pushq %rbp \n\
282 .seh_pushreg %rbp \n\
283 movq %rsp,%rbp \n\
284 .seh_setframe %rbp,0 \n\
285 subq $0x20,%rsp \n\
286 .seh_stackalloc 32 \n\
287 .seh_endprologue \n\
288 movq 0x28(%rsp),%rcx # return address as parameter \n\
289 call " #func " \n\
290 movdqa %xmm0,0x10(%rsp) # 128 bit return value in xmm0 \n\
291 movq 0x10(%rsp),%rax # copy over to %rax and %rdx \n\
292 movq 0x18(%rsp),%rdx \n\
293 leaq dll_chain(%rip),%rcx # load address of dll_chain \n\
294 movq %rcx,0x28(%rsp) # and overwrite return address \n\
295 addq $0x20,%rsp \n\
296 popq %rbp \n\
297 ret \n\
298 .seh_endproc \n\
299");
300
301INIT_WRAPPER (std_dll_init)
302
bbfe79fb
KB
303#else
304#error unimplemented for this target
305#endif
306
61522196
CV
307__attribute__ ((used, noinline)) static two_addr_t
308std_dll_init (struct func_info *func)
a5cc215f 309{
d61b1993
CF
310 struct dll_info *dll = func->dll;
311 retchain ret;
312
313 if (InterlockedIncrement (&dll->here))
314 do
315 {
316 InterlockedDecrement (&dll->here);
084ea510 317 yield ();
d61b1993
CF
318 }
319 while (InterlockedIncrement (&dll->here));
a16b0549 320 else if ((uintptr_t) dll->handle <= 1)
d61b1993 321 {
0f81b5d4
DK
322 fenv_t fpuenv;
323 fegetenv (&fpuenv);
0dcfb061 324 DWORD err = ERROR_SUCCESS;
a16b0549 325 int i;
b66f2546
CF
326 /* MSDN seems to imply that LoadLibrary can fail mysteriously, so,
327 since there have been reports of this in the mailing list, retry
0dcfb061 328 several times before giving up. */
a16b0549 329 for (i = 1; i <= RETRY_COUNT; i++)
0dcfb061
CV
330 {
331 /* If loading the library succeeds, just leave the loop. */
15d6f564 332 if (dll_load (dll->handle, dll->name))
0dcfb061
CV
333 break;
334 /* Otherwise check error code returned by LoadLibrary. If the
335 error code is neither NOACCESS nor DLL_INIT_FAILED, break out
336 of the loop. */
337 err = GetLastError ();
338 if (err != ERROR_NOACCESS && err != ERROR_DLL_INIT_FAILED)
339 break;
340 if (i < RETRY_COUNT)
341 yield ();
342 }
a16b0549 343 if ((uintptr_t) dll->handle <= 1)
0dcfb061 344 {
15d6f564 345 if ((func->decoration & 1))
0dcfb061
CV
346 dll->handle = INVALID_HANDLE_VALUE;
347 else
15d6f564 348 api_fatal ("unable to load %W, %E", dll->name);
0dcfb061 349 }
92626feb 350 fesetenv (&fpuenv);
d61b1993
CF
351 }
352
b66f2546 353 /* Set "arguments" for dll_chain. */
61522196
CV
354 ret.low = (uintptr_t) dll->init;
355 ret.high = (uintptr_t) func;
8d07b1aa 356
d61b1993 357 InterlockedDecrement (&dll->here);
d61b1993
CF
358 return ret.ll;
359}
360
361/* Initialization function for winsock stuff. */
61522196 362
bbfe79fb 363#ifdef __x86_64__
61522196
CV
364/* See above comment preceeding std_dll_init. */
365INIT_WRAPPER (wsock_init)
bbfe79fb
KB
366#else
367#error unimplemented for this target
368#endif
61522196
CV
369
370__attribute__ ((used, noinline)) static two_addr_t
371wsock_init (struct func_info *func)
d61b1993 372{
264b5e13
CV
373 /* CV 2016-03-09: Moved wsadata into wsock_init to workaround a problem
374 with the NO_COPY definition of wsadata and here starting with gcc-5.3.0.
375 See the git log for a description. */
376 static WSADATA NO_COPY wsadata;
d61b1993 377 static LONG NO_COPY here = -1L;
d61b1993 378 struct dll_info *dll = func->dll;
d61b1993 379
63b61cd1 380 while (InterlockedIncrement (&here))
a5cc215f 381 {
63b61cd1 382 InterlockedDecrement (&here);
084ea510 383 yield ();
a5cc215f
CV
384 }
385
ee0afa42 386 if (!wsock_started)
d61b1993 387 {
7073ef4e 388 int (*wsastartup) (int, WSADATA *);
a5cc215f 389
7c8d92d7 390 /* Don't use autoload to load WSAStartup to eliminate recursion. */
7073ef4e 391 wsastartup = (int (*)(int, WSADATA *))
1ff9f4b9 392 GetProcAddress ((HMODULE) (dll->handle), "WSAStartup");
d61b1993 393 if (wsastartup)
1ff9f4b9 394 {
8cd1ff7a 395 int res = wsastartup (MAKEWORD (2, 2), &wsadata);
a5cc215f 396
d61b1993
CF
397 debug_printf ("res %d", res);
398 debug_printf ("wVersion %d", wsadata.wVersion);
399 debug_printf ("wHighVersion %d", wsadata.wHighVersion);
400 debug_printf ("szDescription %s", wsadata.szDescription);
401 debug_printf ("szSystemStatus %s", wsadata.szSystemStatus);
402 debug_printf ("iMaxSockets %d", wsadata.iMaxSockets);
403 debug_printf ("iMaxUdpDg %d", wsadata.iMaxUdpDg);
c4458148 404
d61b1993 405 wsock_started = 1;
1ff9f4b9 406 }
d61b1993 407 }
c0508da2 408 InterlockedDecrement (&here);
bc6ed549 409 volatile retchain ret;
ee0afa42 410 /* Set "arguments for dll_chain. */
61522196
CV
411 ret.low = (uintptr_t) dll_func_load;
412 ret.high = (uintptr_t) func;
d61b1993 413 return ret.ll;
b0a50cf3
CF
414}
415
a16b0549 416LoadDLLprime (ws2_32, _wsock_init, 0)
d61b1993 417
77680cac
CV
418LoadDLLfunc (CheckTokenMembership, advapi32)
419LoadDLLfunc (CreateProcessAsUserW, advapi32)
420LoadDLLfunc (DeregisterEventSource, advapi32)
421LoadDLLfunc (DecryptFileW, advapi32)
422LoadDLLfunc (EncryptFileW, advapi32)
423LoadDLLfunc (LogonUserW, advapi32)
424LoadDLLfunc (LookupAccountNameW, advapi32)
425LoadDLLfunc (LookupAccountSidW, advapi32)
426LoadDLLfunc (LsaClose, advapi32)
427LoadDLLfunc (LsaEnumerateAccountRights, advapi32)
428LoadDLLfunc (LsaFreeMemory, advapi32)
429LoadDLLfunc (LsaLookupSids, advapi32)
430LoadDLLfunc (LsaOpenPolicy, advapi32)
431LoadDLLfunc (LsaQueryInformationPolicy, advapi32)
432LoadDLLfunc (LsaRetrievePrivateData, advapi32)
433LoadDLLfunc (LsaStorePrivateData, advapi32)
434LoadDLLfunc (RegOpenUserClassesRoot, advapi32)
435LoadDLLfunc (RegOpenCurrentUser, advapi32)
436LoadDLLfunc (RegCloseKey, advapi32)
437LoadDLLfunc (RegCreateKeyExW, advapi32)
438LoadDLLfunc (RegEnumKeyExW, advapi32)
439LoadDLLfunc (RegEnumValueW, advapi32)
440LoadDLLfunc (RegGetKeySecurity, advapi32)
441LoadDLLfunc (RegOpenKeyExW, advapi32)
442LoadDLLfunc (RegQueryInfoKeyW, advapi32)
443LoadDLLfunc (RegQueryValueExW, advapi32)
444LoadDLLfunc (RegisterEventSourceW, advapi32)
445LoadDLLfunc (ReportEventW, advapi32)
446LoadDLLfunc (SystemFunction036, advapi32) /* Aka "RtlGenRandom" */
447
448LoadDLLfunc (AuthzAccessCheck, authz)
449LoadDLLfunc (AuthzFreeContext, authz)
450LoadDLLfunc (AuthzInitializeContextFromSid, authz)
451LoadDLLfunc (AuthzInitializeContextFromToken, authz)
452LoadDLLfunc (AuthzInitializeResourceManager, authz)
453
454LoadDLLfunc (DnsQuery_A, dnsapi)
455LoadDLLfunc (DnsFree, dnsapi)
456
457LoadDLLfunc (GetAdaptersAddresses, iphlpapi)
458LoadDLLfunc (GetIfEntry, iphlpapi)
459LoadDLLfunc (GetIpAddrTable, iphlpapi)
460LoadDLLfunc (GetIpForwardTable, iphlpapi)
461LoadDLLfunc (GetNetworkParams, iphlpapi)
462LoadDLLfunc (GetTcpTable, iphlpapi)
463LoadDLLfunc (GetTcp6Table, iphlpapi)
464LoadDLLfunc (GetUdpTable, iphlpapi)
77680cac 465
013de6b0 466LoadDLLfuncEx2 (DiscardVirtualMemory, kernel32, 1, 127)
77680cac
CV
467LoadDLLfuncEx (ClosePseudoConsole, kernel32, 1)
468LoadDLLfuncEx (CreatePseudoConsole, kernel32, 1)
469LoadDLLfuncEx (IsWow64Process2, kernel32, 1)
470LoadDLLfuncEx (ResizePseudoConsole, kernel32, 1)
92626feb 471
c05df027
CV
472/* MSDN claims these are exported by kernel32.dll, but only
473 QueryUnbiasedInterruptTime actually is. The others are only
474 available via KernelBase.dll. */
77680cac
CV
475LoadDLLfunc (QueryInterruptTime, KernelBase)
476LoadDLLfunc (QueryInterruptTimePrecise, KernelBase)
477LoadDLLfunc (QueryUnbiasedInterruptTimePrecise, KernelBase)
478LoadDLLfuncEx (SetThreadDescription, KernelBase, 1)
479LoadDLLfunc (VirtualAlloc2, KernelBase)
480
481LoadDLLfunc (NtMapViewOfSectionEx, ntdll)
f6b56abe 482LoadDLLfuncEx (RtlSetProcessPlaceholderCompatibilityMode, ntdll, 1)
77680cac
CV
483
484LoadDLLfunc (ldap_bind_s, wldap32)
485LoadDLLfunc (ldap_count_entries, wldap32)
486LoadDLLfunc (ldap_count_valuesW, wldap32)
487LoadDLLfunc (ldap_first_entry, wldap32)
488LoadDLLfunc (ldap_get_next_page_s, wldap32)
489LoadDLLfunc (ldap_get_valuesW, wldap32)
490LoadDLLfunc (ldap_get_values_lenW, wldap32)
491LoadDLLfunc (ldap_initW, wldap32)
492LoadDLLfunc (ldap_msgfree, wldap32)
493LoadDLLfunc (ldap_next_entry, wldap32)
494LoadDLLfunc (ldap_search_abandon_page, wldap32)
495LoadDLLfunc (ldap_search_init_pageW, wldap32)
496LoadDLLfunc (ldap_search_sW, wldap32)
497LoadDLLfunc (ldap_set_option, wldap32)
498LoadDLLfunc (ldap_sslinitW, wldap32)
499LoadDLLfunc (ldap_unbind, wldap32)
500LoadDLLfunc (ldap_value_freeW, wldap32)
501LoadDLLfunc (ldap_value_free_len, wldap32)
502LoadDLLfunc (LdapGetLastError, wldap32)
503LoadDLLfunc (LdapMapErrorToWin32, wldap32)
504
7db1c6fc
CV
505LoadDLLfunc (WNetCloseEnum, mpr)
506LoadDLLfunc (WNetEnumResourceW, mpr)
507LoadDLLfunc (WNetGetProviderNameW, mpr)
508LoadDLLfunc (WNetGetResourceInformationW, mpr)
509LoadDLLfunc (WNetOpenEnumW, mpr)
510
77680cac
CV
511LoadDLLfunc (DsEnumerateDomainTrustsW, netapi32)
512LoadDLLfunc (DsGetDcNameW, netapi32)
513LoadDLLfunc (NetApiBufferFree, netapi32)
514LoadDLLfunc (NetGroupEnum, netapi32)
515LoadDLLfunc (NetLocalGroupEnum, netapi32)
516LoadDLLfunc (NetLocalGroupGetInfo, netapi32)
517LoadDLLfunc (NetUseGetInfo, netapi32)
518LoadDLLfunc (NetUserEnum, netapi32)
519LoadDLLfunc (NetUserGetGroups, netapi32)
520LoadDLLfunc (NetUserGetInfo, netapi32)
521LoadDLLfunc (NetUserGetLocalGroups, netapi32)
522
205190a8
CV
523LoadDLLfunc (CoInitialize, ole32)
524LoadDLLfunc (CoUninitialize, ole32)
77680cac
CV
525LoadDLLfunc (CoTaskMemFree, ole32)
526
527LoadDLLfunc (LsaConnectUntrusted, secur32)
528LoadDLLfunc (LsaDeregisterLogonProcess, secur32)
529LoadDLLfunc (LsaFreeReturnBuffer, secur32)
530LoadDLLfunc (LsaLogonUser, secur32)
531LoadDLLfunc (LsaLookupAuthenticationPackage, secur32)
532LoadDLLfunc (LsaRegisterLogonProcess, secur32)
533LoadDLLfunc (TranslateNameW, secur32)
534
205190a8 535LoadDLLfunc (SHCreateItemFromParsingName, shell32)
77680cac 536LoadDLLfunc (SHGetDesktopFolder, shell32)
205190a8 537LoadDLLfunc (SHGetKnownFolderItem, shell32)
77680cac
CV
538
539LoadDLLfunc (CreateFontW, gdi32)
540LoadDLLfunc (DeleteObject, gdi32)
541LoadDLLfunc (EnumFontFamiliesExW, gdi32)
542LoadDLLfunc (GetGlyphIndicesW, gdi32)
543LoadDLLfunc (SelectObject, gdi32)
544
545LoadDLLfunc (CloseClipboard, user32)
546LoadDLLfunc (CloseDesktop, user32)
547LoadDLLfunc (CloseWindowStation, user32)
548LoadDLLfunc (CreateDesktopW, user32)
549LoadDLLfunc (CreateWindowExW, user32)
550LoadDLLfunc (CreateWindowStationW, user32)
551LoadDLLfunc (DefWindowProcW, user32)
552LoadDLLfunc (DestroyWindow, user32)
553LoadDLLfunc (DispatchMessageW, user32)
554LoadDLLfunc (EmptyClipboard, user32)
8aad3a7e 555LoadDLLfunc (EnumChildWindows, user32)
77680cac 556LoadDLLfunc (EnumWindows, user32)
8aad3a7e 557LoadDLLfunc (GetClassNameA, user32)
77680cac
CV
558LoadDLLfunc (GetClipboardData, user32)
559LoadDLLfunc (GetDC, user32)
560LoadDLLfunc (GetForegroundWindow, user32)
561LoadDLLfunc (GetKeyboardLayout, user32)
562LoadDLLfunc (GetMessageW, user32)
563LoadDLLfunc (GetPriorityClipboardFormat, user32)
564LoadDLLfunc (GetProcessWindowStation, user32)
565LoadDLLfunc (GetThreadDesktop, user32)
566LoadDLLfunc (GetUserObjectInformationW, user32)
567LoadDLLfunc (GetWindowThreadProcessId, user32)
568LoadDLLfunc (MessageBeep, user32)
569LoadDLLfunc (MessageBoxW, user32)
570LoadDLLfunc (MsgWaitForMultipleObjectsEx, user32)
571LoadDLLfunc (OpenClipboard, user32)
572LoadDLLfunc (PeekMessageW, user32)
573LoadDLLfunc (PostMessageW, user32)
574LoadDLLfunc (PostQuitMessage, user32)
575LoadDLLfunc (RegisterClassW, user32)
576LoadDLLfunc (RegisterClipboardFormatW, user32)
577LoadDLLfunc (SendNotifyMessageW, user32)
578LoadDLLfunc (SetClipboardData, user32)
579LoadDLLfunc (SetParent, user32)
580LoadDLLfunc (SetProcessWindowStation, user32)
581LoadDLLfunc (SetThreadDesktop, user32)
582LoadDLLfunc (UnregisterClassW, user32)
583
584LoadDLLfuncEx (CreateEnvironmentBlock, userenv, 1)
585LoadDLLfuncEx2 (CreateProfile, userenv, 1, 1)
586LoadDLLfunc (DestroyEnvironmentBlock, userenv)
587LoadDLLfunc (LoadUserProfileW, userenv)
588
589LoadDLLfuncEx3 (waveInAddBuffer, winmm, 1, 0, 1)
590LoadDLLfuncEx3 (waveInClose, winmm, 1, 0, 1)
591LoadDLLfuncEx3 (waveInGetNumDevs, winmm, 1, 0, 1)
592LoadDLLfuncEx3 (waveInOpen, winmm, 1, 0, 1)
593LoadDLLfuncEx3 (waveInPrepareHeader, winmm, 1, 0, 1)
594LoadDLLfuncEx3 (waveInReset, winmm, 1, 0, 1)
595LoadDLLfuncEx3 (waveInStart, winmm, 1, 0, 1)
596LoadDLLfuncEx3 (waveInUnprepareHeader, winmm, 1, 0, 1)
597LoadDLLfuncEx3 (waveOutClose, winmm, 1, 0, 1)
598LoadDLLfuncEx3 (waveOutGetNumDevs, winmm, 1, 0, 1)
599LoadDLLfuncEx3 (waveOutGetVolume, winmm, 1, 0, 1)
600LoadDLLfuncEx3 (waveOutOpen, winmm, 1, 0, 1)
601LoadDLLfuncEx3 (waveOutPrepareHeader, winmm, 1, 0, 1)
602LoadDLLfuncEx3 (waveOutReset, winmm, 1, 0, 1)
603LoadDLLfuncEx3 (waveOutSetVolume, winmm, 1, 0, 1)
604LoadDLLfuncEx3 (waveOutUnprepareHeader, winmm, 1, 0, 1)
605LoadDLLfuncEx3 (waveOutWrite, winmm, 1, 0, 1)
abfa508e
TY
606LoadDLLfuncEx3 (waveOutMessage, winmm, 1, 0, 1)
607LoadDLLfuncEx3 (waveOutGetDevCapsA, winmm, 1, 0, 1)
77680cac
CV
608
609LoadDLLfunc (accept, ws2_32)
610LoadDLLfunc (bind, ws2_32)
611LoadDLLfunc (closesocket, ws2_32)
612LoadDLLfunc (connect, ws2_32)
613LoadDLLfunc (FreeAddrInfoW, ws2_32)
614LoadDLLfunc (GetAddrInfoW, ws2_32)
615LoadDLLfunc (GetNameInfoW, ws2_32)
616LoadDLLfunc (gethostbyaddr, ws2_32)
617LoadDLLfunc (gethostbyname, ws2_32)
618LoadDLLfunc (gethostname, ws2_32)
619LoadDLLfunc (getpeername, ws2_32)
620LoadDLLfunc (getprotobyname, ws2_32)
621LoadDLLfunc (getprotobynumber, ws2_32)
622LoadDLLfunc (getservbyname, ws2_32)
623LoadDLLfunc (getservbyport, ws2_32)
624LoadDLLfunc (getsockname, ws2_32)
625LoadDLLfunc (getsockopt, ws2_32)
626LoadDLLfunc (ioctlsocket, ws2_32)
627LoadDLLfunc (listen, ws2_32)
628LoadDLLfunc (setsockopt, ws2_32)
629LoadDLLfunc (shutdown, ws2_32)
630LoadDLLfunc (socket, ws2_32)
631LoadDLLfunc (WSAAsyncSelect, ws2_32)
632LoadDLLfunc (WSADuplicateSocketW, ws2_32)
633LoadDLLfunc (WSAEnumNetworkEvents, ws2_32)
634LoadDLLfunc (WSAEventSelect, ws2_32)
635LoadDLLfunc (WSAGetLastError, ws2_32)
636LoadDLLfunc (WSAIoctl, ws2_32)
7db1c6fc 637LoadDLLfunc (WSAPoll, ws2_32)
77680cac
CV
638LoadDLLfunc (WSARecv, ws2_32)
639LoadDLLfunc (WSARecvFrom, ws2_32)
640LoadDLLfunc (WSASendMsg, ws2_32)
641LoadDLLfunc (WSASendTo, ws2_32)
642LoadDLLfunc (WSASetLastError, ws2_32)
643LoadDLLfunc (WSASocketW, ws2_32)
644// LoadDLLfunc (WSAStartup, ws2_32)
645LoadDLLfunc (WSAWaitForMultipleEvents, ws2_32)
646
647LoadDLLfunc (PdhAddEnglishCounterW, pdh)
648LoadDLLfunc (PdhCollectQueryData, pdh)
649LoadDLLfunc (PdhGetFormattedCounterValue, pdh)
650LoadDLLfunc (PdhOpenQueryW, pdh)
a5cc215f 651}
This page took 0.554191 seconds and 5 git commands to generate.