mirror of
https://github.com/odin-lang/Odin.git
synced 2026-04-19 21:10:30 +00:00
Fix minor issues with Windows bindings
This commit is contained in:
@@ -300,7 +300,7 @@ _iterate_gpus :: proc(it: ^GPU_Iterator, minimum_vram := i64(256 * 1024 * 1024))
|
||||
gpu_key,
|
||||
auto_cast it._index,
|
||||
&buf_wstring[0],
|
||||
&buf_len,
|
||||
buf_len,
|
||||
); status != i32(sys.ERROR_SUCCESS) {
|
||||
return {}, it.index, false
|
||||
}
|
||||
|
||||
@@ -171,7 +171,7 @@ foreign advapi32 {
|
||||
hKey: HKEY,
|
||||
dwIndex: DWORD,
|
||||
lpName: LPWSTR,
|
||||
lpcchName: LPDWORD,
|
||||
cchName: DWORD,
|
||||
) -> LSTATUS ---
|
||||
|
||||
RegEnumKeyExW :: proc(
|
||||
|
||||
@@ -465,7 +465,7 @@ get_computer_name_and_account_sid :: proc(username: string) -> (computer_name: s
|
||||
return "", {}, false
|
||||
}
|
||||
|
||||
cname_w := make([]u16, min(computer_name_size, 1), context.temp_allocator)
|
||||
cname_w := make([]u16, computer_name_size context.temp_allocator)
|
||||
|
||||
res = LookupAccountNameW(
|
||||
nil,
|
||||
@@ -507,7 +507,7 @@ get_sid :: proc(username: string, sid: ^SID) -> (ok: bool) {
|
||||
return false
|
||||
}
|
||||
|
||||
cname_w := make([]u16, min(computer_name_size, 1), context.temp_allocator)
|
||||
cname_w := make([]u16, computer_name_size, context.temp_allocator)
|
||||
|
||||
res = LookupAccountNameW(
|
||||
nil,
|
||||
@@ -707,7 +707,6 @@ run_as_user :: proc(username, password, application, commandline: string, pi: ^P
|
||||
}
|
||||
si := STARTUPINFOW{}
|
||||
si.cb = size_of(STARTUPINFOW)
|
||||
pi := pi
|
||||
|
||||
ok = bool(CreateProcessAsUserW(
|
||||
user_token,
|
||||
@@ -738,7 +737,7 @@ ensure_winsock_initialized :: proc "contextless" () {
|
||||
@static gate := false
|
||||
@static initted := false
|
||||
|
||||
if initted {
|
||||
if intrinsics.atomic_load(&initted) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -752,5 +751,5 @@ ensure_winsock_initialized :: proc "contextless" () {
|
||||
res := WSAStartup(version_requested, &unused_info)
|
||||
assert_contextless(res == 0, "unable to initialized Winsock2")
|
||||
|
||||
initted = true
|
||||
intrinsics.atomic_store(&initted, true)
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ foreign version {
|
||||
GetFileVersionInfoW :: proc(lptstrFilename: LPCWSTR, dwHandle: DWORD, dwLen: DWORD, lpData: LPVOID) -> BOOL ---
|
||||
|
||||
GetFileVersionInfoSizeExW :: proc(dwFlags: FILE_VER_GET_FLAGS, lpwstrFilename: LPCWSTR, lpdwHandle: LPDWORD) -> DWORD ---
|
||||
GetFileVersionInfoExW :: proc(dwFlags: FILE_VER_GET_FLAGS, lpwstrFilename: LPCWSTR, dwHandle, dwLen: DWORD, lpData: LPVOID) -> DWORD ---
|
||||
GetFileVersionInfoExW :: proc(dwFlags: FILE_VER_GET_FLAGS, lpwstrFilename: LPCWSTR, dwHandle, dwLen: DWORD, lpData: LPVOID) -> BOOL ---
|
||||
|
||||
VerLanguageNameW :: proc(wLang: DWORD, szLang: LPWSTR, cchLang: DWORD) -> DWORD ---
|
||||
VerQueryValueW :: proc(pBlock: LPCVOID, lpSubBlock: LPCWSTR, lplpBuffer: ^LPVOID, puLen: PUINT) -> BOOL ---
|
||||
|
||||
Reference in New Issue
Block a user