Skip to content

Commit 2515951

Browse files
Removed nstd_os_windows_shared_lib_set_dir.
1 parent 2188e4b commit 2515951

File tree

2 files changed

+2
-46
lines changed

2 files changed

+2
-46
lines changed

include/nstd/os/windows/shared_lib.h

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#ifndef NSTD_OS_WINDOWS_SHARED_LIB_H
22
#define NSTD_OS_WINDOWS_SHARED_LIB_H
3-
#include "../../core/def.h"
43
#include "../../core/optional.h"
54
#include "../../nstd.h"
65

@@ -13,22 +12,6 @@ typedef struct {
1312
/// An optional (possibly null) shared Windows library handle.
1413
NSTDOptional(NSTDWindowsSharedLib) NSTDWindowsOptionalSharedLib;
1514

16-
/// Sets a directory to the system's search path used to load shared libraries.
17-
///
18-
/// # Parameters:
19-
///
20-
/// - `const NSTDChar *path` - A path to a directory to search when looking for DLLs. Pass null to
21-
/// restore the default search path.
22-
///
23-
/// # Returns
24-
///
25-
/// `NSTDErrorCode errc` - Nonzero on error.
26-
///
27-
/// # Safety
28-
///
29-
/// See <https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-setdlldirectorya>.
30-
NSTDAPI NSTDErrorCode nstd_os_windows_shared_lib_set_dir(const NSTDChar *path);
31-
3215
/// Loads a shared library/module by name.
3316
///
3417
/// # Parameters:

src/os/windows/shared_lib.rs

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
//! 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};
94

105
/// A handle to a loaded library.
116
#[repr(C)]
@@ -25,28 +20,6 @@ impl Drop for NSTDWindowsSharedLib {
2520
/// An optional (possibly null) shared Windows library handle.
2621
pub type NSTDWindowsOptionalSharedLib = NSTDOptional<NSTDWindowsSharedLib>;
2722

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-
5023
/// Loads a shared library/module by name.
5124
///
5225
/// # Parameters:

0 commit comments

Comments
 (0)