1
1
//! Shared library/module access for Windows.
2
- use crate :: {
3
- core:: { def:: NSTDErrorCode , optional:: NSTDOptional } ,
4
- NSTDAny , NSTDAnyMut , NSTDChar , NSTDInt ,
5
- } ;
6
- use windows_sys:: Win32 :: System :: LibraryLoader :: {
7
- FreeLibrary , GetProcAddress , LoadLibraryA , SetDllDirectoryA ,
8
- } ;
2
+ use crate :: { core:: optional:: NSTDOptional , NSTDAny , NSTDAnyMut , NSTDChar , NSTDInt } ;
3
+ use windows_sys:: Win32 :: System :: LibraryLoader :: { FreeLibrary , GetProcAddress , LoadLibraryA } ;
9
4
10
5
/// A handle to a loaded library.
11
6
#[ repr( C ) ]
@@ -25,28 +20,6 @@ impl Drop for NSTDWindowsSharedLib {
25
20
/// An optional (possibly null) shared Windows library handle.
26
21
pub type NSTDWindowsOptionalSharedLib = NSTDOptional < NSTDWindowsSharedLib > ;
27
22
28
- /// Sets a directory to the system's search path used to load shared libraries.
29
- ///
30
- /// # Parameters:
31
- ///
32
- /// - `const NSTDChar *path` - A path to a directory to search when looking for DLLs. Pass null to
33
- /// restore the default search path.
34
- ///
35
- /// # Returns
36
- ///
37
- /// `NSTDErrorCode errc` - Nonzero on error.
38
- ///
39
- /// # Safety
40
- ///
41
- /// See <https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-setdlldirectorya>.
42
- #[ inline]
43
- #[ cfg_attr( feature = "clib" , no_mangle) ]
44
- pub unsafe extern "C" fn nstd_os_windows_shared_lib_set_dir (
45
- path : * const NSTDChar ,
46
- ) -> NSTDErrorCode {
47
- ( SetDllDirectoryA ( path. cast ( ) ) == 0 ) . into ( )
48
- }
49
-
50
23
/// Loads a shared library/module by name.
51
24
///
52
25
/// # Parameters:
0 commit comments