Win32 API 日本語リファレンス
ホームNetworking.Clustering › ResUtilVerifyResourceService

ResUtilVerifyResourceService

関数
指定したリソースサービスの状態を検証する。
DLLRESUTILS.dll呼出規約winapi対応OSwindowsserver2008

シグネチャ

// RESUTILS.dll
#include <windows.h>

DWORD ResUtilVerifyResourceService(
    LPCWSTR pszServiceName
);

パラメーター

名前方向
pszServiceNameLPCWSTRin

戻り値の型: DWORD

各言語での呼び出し定義

// RESUTILS.dll
#include <windows.h>

DWORD ResUtilVerifyResourceService(
    LPCWSTR pszServiceName
);
[DllImport("RESUTILS.dll", ExactSpelling = true)]
static extern uint ResUtilVerifyResourceService(
    [MarshalAs(UnmanagedType.LPWStr)] string pszServiceName   // LPCWSTR
);
<DllImport("RESUTILS.dll", ExactSpelling:=True)>
Public Shared Function ResUtilVerifyResourceService(
    <MarshalAs(UnmanagedType.LPWStr)> pszServiceName As String   ' LPCWSTR
) As UInteger
End Function
' pszServiceName : LPCWSTR
Declare PtrSafe Function ResUtilVerifyResourceService Lib "resutils" ( _
    ByVal pszServiceName As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

ResUtilVerifyResourceService = ctypes.windll.resutils.ResUtilVerifyResourceService
ResUtilVerifyResourceService.restype = wintypes.DWORD
ResUtilVerifyResourceService.argtypes = [
    wintypes.LPCWSTR,  # pszServiceName : LPCWSTR
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('RESUTILS.dll')
ResUtilVerifyResourceService = Fiddle::Function.new(
  lib['ResUtilVerifyResourceService'],
  [
    Fiddle::TYPE_VOIDP,  # pszServiceName : LPCWSTR
  ],
  -Fiddle::TYPE_INT)
#[link(name = "resutils")]
extern "system" {
    fn ResUtilVerifyResourceService(
        pszServiceName: *const u16  // LPCWSTR
    ) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("RESUTILS.dll")]
public static extern uint ResUtilVerifyResourceService([MarshalAs(UnmanagedType.LPWStr)] string pszServiceName);
"@
$api = Add-Type -MemberDefinition $sig -Name 'RESUTILS_ResUtilVerifyResourceService' -Namespace Win32 -PassThru
# $api::ResUtilVerifyResourceService(pszServiceName)
#uselib "RESUTILS.dll"
#func global ResUtilVerifyResourceService "ResUtilVerifyResourceService" sptr
; ResUtilVerifyResourceService pszServiceName   ; 戻り値は stat
; pszServiceName : LPCWSTR -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "RESUTILS.dll"
#cfunc global ResUtilVerifyResourceService "ResUtilVerifyResourceService" wstr
; res = ResUtilVerifyResourceService(pszServiceName)
; pszServiceName : LPCWSTR -> "wstr"
; DWORD ResUtilVerifyResourceService(LPCWSTR pszServiceName)
#uselib "RESUTILS.dll"
#cfunc global ResUtilVerifyResourceService "ResUtilVerifyResourceService" wstr
; res = ResUtilVerifyResourceService(pszServiceName)
; pszServiceName : LPCWSTR -> "wstr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	resutils = windows.NewLazySystemDLL("RESUTILS.dll")
	procResUtilVerifyResourceService = resutils.NewProc("ResUtilVerifyResourceService")
)

// pszServiceName (LPCWSTR)
r1, _, err := procResUtilVerifyResourceService.Call(
	uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(pszServiceName))),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // DWORD
function ResUtilVerifyResourceService(
  pszServiceName: PWideChar   // LPCWSTR
): DWORD; stdcall;
  external 'RESUTILS.dll' name 'ResUtilVerifyResourceService';
result := DllCall("RESUTILS\ResUtilVerifyResourceService"
    , "WStr", pszServiceName   ; LPCWSTR
    , "UInt")   ; return: DWORD
●ResUtilVerifyResourceService(pszServiceName) = DLL("RESUTILS.dll", "dword ResUtilVerifyResourceService(char*)")
# 呼び出し: ResUtilVerifyResourceService(pszServiceName)
# pszServiceName : LPCWSTR -> "char*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。