ホーム › System.WindowsProgramming › GlobalWire
GlobalWire
関数グローバルメモリブロックをロックする旧式関数。
シグネチャ
// KERNEL32.dll
#include <windows.h>
void* GlobalWire(
HGLOBAL hMem
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| hMem | HGLOBAL | in |
戻り値の型: void*
各言語での呼び出し定義
// KERNEL32.dll
#include <windows.h>
void* GlobalWire(
HGLOBAL hMem
);[DllImport("KERNEL32.dll", ExactSpelling = true)]
static extern IntPtr GlobalWire(
IntPtr hMem // HGLOBAL
);<DllImport("KERNEL32.dll", ExactSpelling:=True)>
Public Shared Function GlobalWire(
hMem As IntPtr ' HGLOBAL
) As IntPtr
End Function' hMem : HGLOBAL
Declare PtrSafe Function GlobalWire Lib "kernel32" ( _
ByVal hMem As LongPtr) As LongPtr
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
GlobalWire = ctypes.windll.kernel32.GlobalWire
GlobalWire.restype = ctypes.c_void_p
GlobalWire.argtypes = [
wintypes.HANDLE, # hMem : HGLOBAL
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('KERNEL32.dll')
GlobalWire = Fiddle::Function.new(
lib['GlobalWire'],
[
Fiddle::TYPE_VOIDP, # hMem : HGLOBAL
],
Fiddle::TYPE_VOIDP)#[link(name = "kernel32")]
extern "system" {
fn GlobalWire(
hMem: *mut core::ffi::c_void // HGLOBAL
) -> *mut ();
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("KERNEL32.dll")]
public static extern IntPtr GlobalWire(IntPtr hMem);
"@
$api = Add-Type -MemberDefinition $sig -Name 'KERNEL32_GlobalWire' -Namespace Win32 -PassThru
# $api::GlobalWire(hMem)#uselib "KERNEL32.dll"
#func global GlobalWire "GlobalWire" sptr
; GlobalWire hMem ; 戻り値は stat
; hMem : HGLOBAL -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "KERNEL32.dll"
#cfunc global GlobalWire "GlobalWire" sptr
; res = GlobalWire(hMem)
; hMem : HGLOBAL -> "sptr"; void* GlobalWire(HGLOBAL hMem)
#uselib "KERNEL32.dll"
#cfunc global GlobalWire "GlobalWire" intptr
; res = GlobalWire(hMem)
; hMem : HGLOBAL -> "intptr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
kernel32 = windows.NewLazySystemDLL("KERNEL32.dll")
procGlobalWire = kernel32.NewProc("GlobalWire")
)
// hMem (HGLOBAL)
r1, _, err := procGlobalWire.Call(
uintptr(hMem),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // void*function GlobalWire(
hMem: THandle // HGLOBAL
): Pointer; stdcall;
external 'KERNEL32.dll' name 'GlobalWire';result := DllCall("KERNEL32\GlobalWire"
, "Ptr", hMem ; HGLOBAL
, "Ptr") ; return: void*●GlobalWire(hMem) = DLL("KERNEL32.dll", "void* GlobalWire(void*)")
# 呼び出し: GlobalWire(hMem)
# hMem : HGLOBAL -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。