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