1 /* autoload.cc: all dynamic load stuff.
3 This file is part of Cygwin.
5 This software is a copyrighted work licensed under the terms of the
6 Cygwin license. Please consult the file "CYGWIN_LICENSE" for
10 #include "miscfuncs.h"
12 #define USE_SYS_TYPES_FD_SET
15 bool NO_COPY wsock_started
;
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.
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.
30 * So, immediately following the the call to one of the above routines
32 * DLL info (4/8 bytes) Pointer to a block of information concerning
33 * the DLL (see below).
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
40 * func addr (8 bytes) Address of the actual Win32 function. For the
41 * reason why this is necessary, see the below
42 * description of the load_state.
43 * func name (n bytes) asciz string containing the name of the function
46 * The DLL info block consists of the following
47 * load_state (4/8 bytes) Pointer to a word containing the routine used
48 * to eventually invoke the function. Initially
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.
53 * On x86_64, the jmp is not tweaked directly. Rather,
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.
61 * DLL locker (4 bytes) Word to use to avoid multi-thread access during
63 * extra init (4/8 bytes) Extra initialization function.
64 * DLL name (n bytes) asciz string containing the name of the DLL.
67 /* LoadDLLprime is used to prime the DLL info information, providing an
68 additional initialization routine to call prior to calling the first
71 #define LoadDLLprime(dllname, init_also, no_resolve_on_fork) __asm__ (" \n\
72 .ifndef " #dllname "_primed \n\
73 .section .data_cygwin_nocopy,\"w\" \n\
75 ."#dllname "_info: \n\
76 .quad _std_dll_init \n\
77 .quad " #no_resolve_on_fork " \n\
80 .quad " #init_also " \n\
81 .string16 \"" #dllname ".dll\" \n\
83 .set " #dllname "_primed, 1 \n\
87 #error unimplemented for this target
90 /* Standard DLL load macro. May invoke a fatal error if the function isn't
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)
99 /* Main DLL setup stuff. */
101 #define LoadDLLfuncEx3(name, dllname, notimp, err, no_resolve_on_fork) \
102 LoadDLLprime (dllname, dll_func_load, no_resolve_on_fork) \
104 .section ." #dllname "_autoload_text,\"wx\" \n\
105 .global " #name " \n\
106 .global _win32_" #name " \n\
109 _win32_" #name ": \n\
110 movq 3f(%rip),%rax \n\
112 1:movq 2f(%rip),%rax \n\
113 push %rbp # Keep 16 byte aligned \n\
119 2:.quad ." #dllname "_info \n\
120 .hword " #notimp " \n\
121 .hword ((" #err ") & 0xffff) \n\
123 .asciz \"" #name "\" \n\
127 #error unimplemented for this target
130 /* DLL loader helper functions used during initialization. */
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
135 extern "C" void dll_func_load () __asm__ ("dll_func_load");
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. */
140 extern "C" void dll_chain () __asm__ ("dll_chain");
146 .section .rdata,\"r\" \n\
148 .ascii \"couldn't dynamically determine load address for '%s' (handle %p), %E\\0\"\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\
157 andl $0xffff0000,%eax# upper word (== desired return value) \n\
158 sarl $16,%eax # swap to low order word \n\
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\
163 addq $40,%rsp # Revert stack \n\
164 pop %r10 # Drop pointer to 'return address' \n\
165 pop %rcx # Restore arg registers \n\
169 pop %rbp # ...and restore frame pointer \n\
172 movq (%rdx),%rax # Handle value \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\
178 .globl dll_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\
188 jmp noload # Issue an error or return \n\
190 addq $40,%rsp # Revert stack \n\
191 pop %r10 # Pointer to 'return address' \n\
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\
198 pop %rbp # ...and restore frame pointer \n\
199 jmp *%r10 # Jump to actual function \n\
201 .global dll_chain \n\
203 push %rax # Restore 'return address' \n\
204 jmp *%rdx # Jump to next init function \n\
207 #error unimplemented for this target
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? */
224 struct dll_info
*dll
;
230 /* Mechanism for setting up info for passing to dll_chain routines. */
231 typedef __uint128_t two_addr_t
;
234 struct {uintptr_t high
; uintptr_t low
;};
238 /* This function handles the problem described here:
240 http://www.microsoft.com/technet/security/advisory/2269637.mspx
241 https://msdn.microsoft.com/library/ff919712 */
243 dll_load (HANDLE
& handle
, PWCHAR name
)
246 WCHAR dll_path
[MAX_PATH
];
248 /* Try loading with full path, which sometimes fails for no good reason. */
249 wcpcpy (wcpcpy (dll_path
, windows_system_directory
), name
);
250 h
= LoadLibraryW (dll_path
);
251 /* If it failed, try loading just by name. */
253 h
= LoadLibraryW (name
);
260 #define RETRY_COUNT 10
262 /* The standard DLL initialization routine. */
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. */
275 #define INIT_WRAPPER(func) \
279 .seh_proc _" #func " \n\
282 .seh_pushreg %rbp \n\
284 .seh_setframe %rbp,0 \n\
286 .seh_stackalloc 32 \n\
288 movq 0x28(%rsp),%rcx # return address as parameter \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\
301 INIT_WRAPPER (std_dll_init
)
304 #error unimplemented for this target
307 __attribute__ ((used
, noinline
)) static two_addr_t
308 std_dll_init (struct func_info
*func
)
310 struct dll_info
*dll
= func
->dll
;
313 if (InterlockedIncrement (&dll
->here
))
316 InterlockedDecrement (&dll
->here
);
319 while (InterlockedIncrement (&dll
->here
));
320 else if ((uintptr_t) dll
->handle
<= 1)
324 DWORD err
= ERROR_SUCCESS
;
326 /* MSDN seems to imply that LoadLibrary can fail mysteriously, so,
327 since there have been reports of this in the mailing list, retry
328 several times before giving up. */
329 for (i
= 1; i
<= RETRY_COUNT
; i
++)
331 /* If loading the library succeeds, just leave the loop. */
332 if (dll_load (dll
->handle
, dll
->name
))
334 /* Otherwise check error code returned by LoadLibrary. If the
335 error code is neither NOACCESS nor DLL_INIT_FAILED, break out
337 err
= GetLastError ();
338 if (err
!= ERROR_NOACCESS
&& err
!= ERROR_DLL_INIT_FAILED
)
343 if ((uintptr_t) dll
->handle
<= 1)
345 if ((func
->decoration
& 1))
346 dll
->handle
= INVALID_HANDLE_VALUE
;
348 api_fatal ("unable to load %W, %E", dll
->name
);
353 /* Set "arguments" for dll_chain. */
354 ret
.low
= (uintptr_t) dll
->init
;
355 ret
.high
= (uintptr_t) func
;
357 InterlockedDecrement (&dll
->here
);
361 /* Initialization function for winsock stuff. */
364 /* See above comment preceeding std_dll_init. */
365 INIT_WRAPPER (wsock_init
)
367 #error unimplemented for this target
370 __attribute__ ((used
, noinline
)) static two_addr_t
371 wsock_init (struct func_info
*func
)
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
;
377 static LONG NO_COPY here
= -1L;
378 struct dll_info
*dll
= func
->dll
;
380 while (InterlockedIncrement (&here
))
382 InterlockedDecrement (&here
);
388 int (*wsastartup
) (int, WSADATA
*);
390 /* Don't use autoload to load WSAStartup to eliminate recursion. */
391 wsastartup
= (int (*)(int, WSADATA
*))
392 GetProcAddress ((HMODULE
) (dll
->handle
), "WSAStartup");
395 int res
= wsastartup (MAKEWORD (2, 2), &wsadata
);
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
);
408 InterlockedDecrement (&here
);
409 volatile retchain ret
;
410 /* Set "arguments for dll_chain. */
411 ret
.low
= (uintptr_t) dll_func_load
;
412 ret
.high
= (uintptr_t) func
;
416 LoadDLLprime (ws2_32
, _wsock_init
, 0)
418 LoadDLLfunc (CheckTokenMembership
, advapi32
)
419 LoadDLLfunc (CreateProcessAsUserW
, advapi32
)
420 LoadDLLfunc (DeregisterEventSource
, advapi32
)
421 LoadDLLfunc (DecryptFileW
, advapi32
)
422 LoadDLLfunc (EncryptFileW
, advapi32
)
423 LoadDLLfunc (LogonUserW
, advapi32
)
424 LoadDLLfunc (LookupAccountNameW
, advapi32
)
425 LoadDLLfunc (LookupAccountSidW
, advapi32
)
426 LoadDLLfunc (LsaClose
, advapi32
)
427 LoadDLLfunc (LsaEnumerateAccountRights
, advapi32
)
428 LoadDLLfunc (LsaFreeMemory
, advapi32
)
429 LoadDLLfunc (LsaLookupSids
, advapi32
)
430 LoadDLLfunc (LsaOpenPolicy
, advapi32
)
431 LoadDLLfunc (LsaQueryInformationPolicy
, advapi32
)
432 LoadDLLfunc (LsaRetrievePrivateData
, advapi32
)
433 LoadDLLfunc (LsaStorePrivateData
, advapi32
)
434 LoadDLLfunc (RegOpenUserClassesRoot
, advapi32
)
435 LoadDLLfunc (RegOpenCurrentUser
, advapi32
)
436 LoadDLLfunc (RegCloseKey
, advapi32
)
437 LoadDLLfunc (RegCreateKeyExW
, advapi32
)
438 LoadDLLfunc (RegEnumKeyExW
, advapi32
)
439 LoadDLLfunc (RegEnumValueW
, advapi32
)
440 LoadDLLfunc (RegGetKeySecurity
, advapi32
)
441 LoadDLLfunc (RegOpenKeyExW
, advapi32
)
442 LoadDLLfunc (RegQueryInfoKeyW
, advapi32
)
443 LoadDLLfunc (RegQueryValueExW
, advapi32
)
444 LoadDLLfunc (RegisterEventSourceW
, advapi32
)
445 LoadDLLfunc (ReportEventW
, advapi32
)
446 LoadDLLfunc (SystemFunction036
, advapi32
) /* Aka "RtlGenRandom" */
448 LoadDLLfunc (AuthzAccessCheck
, authz
)
449 LoadDLLfunc (AuthzFreeContext
, authz
)
450 LoadDLLfunc (AuthzInitializeContextFromSid
, authz
)
451 LoadDLLfunc (AuthzInitializeContextFromToken
, authz
)
452 LoadDLLfunc (AuthzInitializeResourceManager
, authz
)
454 LoadDLLfunc (DnsQuery_A
, dnsapi
)
455 LoadDLLfunc (DnsFree
, dnsapi
)
457 LoadDLLfunc (GetAdaptersAddresses
, iphlpapi
)
458 LoadDLLfunc (GetIfEntry
, iphlpapi
)
459 LoadDLLfunc (GetIpAddrTable
, iphlpapi
)
460 LoadDLLfunc (GetIpForwardTable
, iphlpapi
)
461 LoadDLLfunc (GetNetworkParams
, iphlpapi
)
462 LoadDLLfunc (GetTcpTable
, iphlpapi
)
463 LoadDLLfunc (GetTcp6Table
, iphlpapi
)
464 LoadDLLfunc (GetUdpTable
, iphlpapi
)
466 LoadDLLfuncEx2 (DiscardVirtualMemory
, kernel32
, 1, 127)
467 LoadDLLfuncEx (ClosePseudoConsole
, kernel32
, 1)
468 LoadDLLfuncEx (CreatePseudoConsole
, kernel32
, 1)
469 LoadDLLfuncEx (IsWow64Process2
, kernel32
, 1)
470 LoadDLLfuncEx (ResizePseudoConsole
, kernel32
, 1)
472 /* MSDN claims these are exported by kernel32.dll, but only
473 QueryUnbiasedInterruptTime actually is. The others are only
474 available via KernelBase.dll. */
475 LoadDLLfunc (QueryInterruptTime
, KernelBase
)
476 LoadDLLfunc (QueryInterruptTimePrecise
, KernelBase
)
477 LoadDLLfunc (QueryUnbiasedInterruptTimePrecise
, KernelBase
)
478 LoadDLLfuncEx (SetThreadDescription
, KernelBase
, 1)
479 LoadDLLfunc (VirtualAlloc2
, KernelBase
)
481 LoadDLLfunc (NtMapViewOfSectionEx
, ntdll
)
482 LoadDLLfuncEx (RtlSetProcessPlaceholderCompatibilityMode
, ntdll
, 1)
484 LoadDLLfunc (ldap_bind_s
, wldap32
)
485 LoadDLLfunc (ldap_count_entries
, wldap32
)
486 LoadDLLfunc (ldap_count_valuesW
, wldap32
)
487 LoadDLLfunc (ldap_first_entry
, wldap32
)
488 LoadDLLfunc (ldap_get_next_page_s
, wldap32
)
489 LoadDLLfunc (ldap_get_valuesW
, wldap32
)
490 LoadDLLfunc (ldap_get_values_lenW
, wldap32
)
491 LoadDLLfunc (ldap_initW
, wldap32
)
492 LoadDLLfunc (ldap_msgfree
, wldap32
)
493 LoadDLLfunc (ldap_next_entry
, wldap32
)
494 LoadDLLfunc (ldap_search_abandon_page
, wldap32
)
495 LoadDLLfunc (ldap_search_init_pageW
, wldap32
)
496 LoadDLLfunc (ldap_search_sW
, wldap32
)
497 LoadDLLfunc (ldap_set_option
, wldap32
)
498 LoadDLLfunc (ldap_sslinitW
, wldap32
)
499 LoadDLLfunc (ldap_unbind
, wldap32
)
500 LoadDLLfunc (ldap_value_freeW
, wldap32
)
501 LoadDLLfunc (ldap_value_free_len
, wldap32
)
502 LoadDLLfunc (LdapGetLastError
, wldap32
)
503 LoadDLLfunc (LdapMapErrorToWin32
, wldap32
)
505 LoadDLLfunc (WNetCloseEnum
, mpr
)
506 LoadDLLfunc (WNetEnumResourceW
, mpr
)
507 LoadDLLfunc (WNetGetProviderNameW
, mpr
)
508 LoadDLLfunc (WNetGetResourceInformationW
, mpr
)
509 LoadDLLfunc (WNetOpenEnumW
, mpr
)
511 LoadDLLfunc (DsEnumerateDomainTrustsW
, netapi32
)
512 LoadDLLfunc (DsGetDcNameW
, netapi32
)
513 LoadDLLfunc (NetApiBufferFree
, netapi32
)
514 LoadDLLfunc (NetGroupEnum
, netapi32
)
515 LoadDLLfunc (NetLocalGroupEnum
, netapi32
)
516 LoadDLLfunc (NetLocalGroupGetInfo
, netapi32
)
517 LoadDLLfunc (NetUseGetInfo
, netapi32
)
518 LoadDLLfunc (NetUserEnum
, netapi32
)
519 LoadDLLfunc (NetUserGetGroups
, netapi32
)
520 LoadDLLfunc (NetUserGetInfo
, netapi32
)
521 LoadDLLfunc (NetUserGetLocalGroups
, netapi32
)
523 LoadDLLfunc (CoInitialize
, ole32
)
524 LoadDLLfunc (CoUninitialize
, ole32
)
525 LoadDLLfunc (CoTaskMemFree
, ole32
)
527 LoadDLLfunc (LsaConnectUntrusted
, secur32
)
528 LoadDLLfunc (LsaDeregisterLogonProcess
, secur32
)
529 LoadDLLfunc (LsaFreeReturnBuffer
, secur32
)
530 LoadDLLfunc (LsaLogonUser
, secur32
)
531 LoadDLLfunc (LsaLookupAuthenticationPackage
, secur32
)
532 LoadDLLfunc (LsaRegisterLogonProcess
, secur32
)
533 LoadDLLfunc (TranslateNameW
, secur32
)
535 LoadDLLfunc (SHCreateItemFromParsingName
, shell32
)
536 LoadDLLfunc (SHGetDesktopFolder
, shell32
)
537 LoadDLLfunc (SHGetKnownFolderItem
, shell32
)
539 LoadDLLfunc (CreateFontW
, gdi32
)
540 LoadDLLfunc (DeleteObject
, gdi32
)
541 LoadDLLfunc (EnumFontFamiliesExW
, gdi32
)
542 LoadDLLfunc (GetGlyphIndicesW
, gdi32
)
543 LoadDLLfunc (SelectObject
, gdi32
)
545 LoadDLLfunc (CloseClipboard
, user32
)
546 LoadDLLfunc (CloseDesktop
, user32
)
547 LoadDLLfunc (CloseWindowStation
, user32
)
548 LoadDLLfunc (CreateDesktopW
, user32
)
549 LoadDLLfunc (CreateWindowExW
, user32
)
550 LoadDLLfunc (CreateWindowStationW
, user32
)
551 LoadDLLfunc (DefWindowProcW
, user32
)
552 LoadDLLfunc (DestroyWindow
, user32
)
553 LoadDLLfunc (DispatchMessageW
, user32
)
554 LoadDLLfunc (EmptyClipboard
, user32
)
555 LoadDLLfunc (EnumChildWindows
, user32
)
556 LoadDLLfunc (EnumWindows
, user32
)
557 LoadDLLfunc (GetClassNameA
, user32
)
558 LoadDLLfunc (GetClipboardData
, user32
)
559 LoadDLLfunc (GetDC
, user32
)
560 LoadDLLfunc (GetForegroundWindow
, user32
)
561 LoadDLLfunc (GetKeyboardLayout
, user32
)
562 LoadDLLfunc (GetMessageW
, user32
)
563 LoadDLLfunc (GetPriorityClipboardFormat
, user32
)
564 LoadDLLfunc (GetProcessWindowStation
, user32
)
565 LoadDLLfunc (GetThreadDesktop
, user32
)
566 LoadDLLfunc (GetUserObjectInformationW
, user32
)
567 LoadDLLfunc (GetWindowThreadProcessId
, user32
)
568 LoadDLLfunc (MessageBeep
, user32
)
569 LoadDLLfunc (MessageBoxW
, user32
)
570 LoadDLLfunc (MsgWaitForMultipleObjectsEx
, user32
)
571 LoadDLLfunc (OpenClipboard
, user32
)
572 LoadDLLfunc (PeekMessageW
, user32
)
573 LoadDLLfunc (PostMessageW
, user32
)
574 LoadDLLfunc (PostQuitMessage
, user32
)
575 LoadDLLfunc (RegisterClassW
, user32
)
576 LoadDLLfunc (RegisterClipboardFormatW
, user32
)
577 LoadDLLfunc (SendNotifyMessageW
, user32
)
578 LoadDLLfunc (SetClipboardData
, user32
)
579 LoadDLLfunc (SetParent
, user32
)
580 LoadDLLfunc (SetProcessWindowStation
, user32
)
581 LoadDLLfunc (SetThreadDesktop
, user32
)
582 LoadDLLfunc (UnregisterClassW
, user32
)
584 LoadDLLfuncEx (CreateEnvironmentBlock
, userenv
, 1)
585 LoadDLLfuncEx2 (CreateProfile
, userenv
, 1, 1)
586 LoadDLLfunc (DestroyEnvironmentBlock
, userenv
)
587 LoadDLLfunc (LoadUserProfileW
, userenv
)
589 LoadDLLfuncEx3 (waveInAddBuffer
, winmm
, 1, 0, 1)
590 LoadDLLfuncEx3 (waveInClose
, winmm
, 1, 0, 1)
591 LoadDLLfuncEx3 (waveInGetNumDevs
, winmm
, 1, 0, 1)
592 LoadDLLfuncEx3 (waveInOpen
, winmm
, 1, 0, 1)
593 LoadDLLfuncEx3 (waveInPrepareHeader
, winmm
, 1, 0, 1)
594 LoadDLLfuncEx3 (waveInReset
, winmm
, 1, 0, 1)
595 LoadDLLfuncEx3 (waveInStart
, winmm
, 1, 0, 1)
596 LoadDLLfuncEx3 (waveInUnprepareHeader
, winmm
, 1, 0, 1)
597 LoadDLLfuncEx3 (waveOutClose
, winmm
, 1, 0, 1)
598 LoadDLLfuncEx3 (waveOutGetNumDevs
, winmm
, 1, 0, 1)
599 LoadDLLfuncEx3 (waveOutGetVolume
, winmm
, 1, 0, 1)
600 LoadDLLfuncEx3 (waveOutOpen
, winmm
, 1, 0, 1)
601 LoadDLLfuncEx3 (waveOutPrepareHeader
, winmm
, 1, 0, 1)
602 LoadDLLfuncEx3 (waveOutReset
, winmm
, 1, 0, 1)
603 LoadDLLfuncEx3 (waveOutSetVolume
, winmm
, 1, 0, 1)
604 LoadDLLfuncEx3 (waveOutUnprepareHeader
, winmm
, 1, 0, 1)
605 LoadDLLfuncEx3 (waveOutWrite
, winmm
, 1, 0, 1)
606 LoadDLLfuncEx3 (waveOutMessage
, winmm
, 1, 0, 1)
607 LoadDLLfuncEx3 (waveOutGetDevCapsA
, winmm
, 1, 0, 1)
609 LoadDLLfunc (accept
, ws2_32
)
610 LoadDLLfunc (bind
, ws2_32
)
611 LoadDLLfunc (closesocket
, ws2_32
)
612 LoadDLLfunc (connect
, ws2_32
)
613 LoadDLLfunc (FreeAddrInfoW
, ws2_32
)
614 LoadDLLfunc (GetAddrInfoW
, ws2_32
)
615 LoadDLLfunc (GetNameInfoW
, ws2_32
)
616 LoadDLLfunc (gethostbyaddr
, ws2_32
)
617 LoadDLLfunc (gethostbyname
, ws2_32
)
618 LoadDLLfunc (gethostname
, ws2_32
)
619 LoadDLLfunc (getpeername
, ws2_32
)
620 LoadDLLfunc (getprotobyname
, ws2_32
)
621 LoadDLLfunc (getprotobynumber
, ws2_32
)
622 LoadDLLfunc (getservbyname
, ws2_32
)
623 LoadDLLfunc (getservbyport
, ws2_32
)
624 LoadDLLfunc (getsockname
, ws2_32
)
625 LoadDLLfunc (getsockopt
, ws2_32
)
626 LoadDLLfunc (ioctlsocket
, ws2_32
)
627 LoadDLLfunc (listen
, ws2_32
)
628 LoadDLLfunc (setsockopt
, ws2_32
)
629 LoadDLLfunc (shutdown
, ws2_32
)
630 LoadDLLfunc (socket
, ws2_32
)
631 LoadDLLfunc (WSAAsyncSelect
, ws2_32
)
632 LoadDLLfunc (WSADuplicateSocketW
, ws2_32
)
633 LoadDLLfunc (WSAEnumNetworkEvents
, ws2_32
)
634 LoadDLLfunc (WSAEventSelect
, ws2_32
)
635 LoadDLLfunc (WSAGetLastError
, ws2_32
)
636 LoadDLLfunc (WSAIoctl
, ws2_32
)
637 LoadDLLfunc (WSAPoll
, ws2_32
)
638 LoadDLLfunc (WSARecv
, ws2_32
)
639 LoadDLLfunc (WSARecvFrom
, ws2_32
)
640 LoadDLLfunc (WSASendMsg
, ws2_32
)
641 LoadDLLfunc (WSASendTo
, ws2_32
)
642 LoadDLLfunc (WSASetLastError
, ws2_32
)
643 LoadDLLfunc (WSASocketW
, ws2_32
)
644 // LoadDLLfunc (WSAStartup, ws2_32)
645 LoadDLLfunc (WSAWaitForMultipleEvents
, ws2_32
)
647 LoadDLLfunc (PdhAddEnglishCounterW
, pdh
)
648 LoadDLLfunc (PdhCollectQueryData
, pdh
)
649 LoadDLLfunc (PdhGetFormattedCounterValue
, pdh
)
650 LoadDLLfunc (PdhOpenQueryW
, pdh
)