mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
Add #[link]
attributes to dll imports
This avoids using jmp stubs when calling functions exported from a dll.
This commit is contained in:
parent
bacf770f29
commit
25712afd94
@ -688,6 +688,7 @@ if #[cfg(not(target_vendor = "uwp"))] {
|
|||||||
|
|
||||||
pub const TOKEN_READ: DWORD = 0x20008;
|
pub const TOKEN_READ: DWORD = 0x20008;
|
||||||
|
|
||||||
|
#[link(name="kernel32")]
|
||||||
extern "system" {
|
extern "system" {
|
||||||
#[link_name = "SystemFunction036"]
|
#[link_name = "SystemFunction036"]
|
||||||
pub fn RtlGenRandom(RandomBuffer: *mut u8, RandomBufferLength: ULONG) -> BOOLEAN;
|
pub fn RtlGenRandom(RandomBuffer: *mut u8, RandomBufferLength: ULONG) -> BOOLEAN;
|
||||||
@ -744,6 +745,7 @@ if #[cfg(target_vendor = "uwp")] {
|
|||||||
pub Directory: BOOLEAN,
|
pub Directory: BOOLEAN,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[link(name="kernel32")]
|
||||||
extern "system" {
|
extern "system" {
|
||||||
pub fn GetFileInformationByHandleEx(hFile: HANDLE,
|
pub fn GetFileInformationByHandleEx(hFile: HANDLE,
|
||||||
fileInfoClass: FILE_INFO_BY_HANDLE_CLASS,
|
fileInfoClass: FILE_INFO_BY_HANDLE_CLASS,
|
||||||
@ -756,6 +758,7 @@ if #[cfg(target_vendor = "uwp")] {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Shared between Desktop & UWP
|
// Shared between Desktop & UWP
|
||||||
|
#[link(name = "kernel32")]
|
||||||
extern "system" {
|
extern "system" {
|
||||||
pub fn WSAStartup(wVersionRequested: WORD, lpWSAData: LPWSADATA) -> c_int;
|
pub fn WSAStartup(wVersionRequested: WORD, lpWSAData: LPWSADATA) -> c_int;
|
||||||
pub fn WSACleanup() -> c_int;
|
pub fn WSACleanup() -> c_int;
|
||||||
|
Loading…
Reference in New Issue
Block a user