ホーム › Networking.Clustering › ResUtilStopResourceService
ResUtilStopResourceService
関数指定したリソースのサービスを停止する。
シグネチャ
// RESUTILS.dll
#include <windows.h>
DWORD ResUtilStopResourceService(
LPCWSTR pszServiceName
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| pszServiceName | LPCWSTR | in |
戻り値の型: DWORD
各言語での呼び出し定義
// RESUTILS.dll
#include <windows.h>
DWORD ResUtilStopResourceService(
LPCWSTR pszServiceName
);[DllImport("RESUTILS.dll", ExactSpelling = true)]
static extern uint ResUtilStopResourceService(
[MarshalAs(UnmanagedType.LPWStr)] string pszServiceName // LPCWSTR
);<DllImport("RESUTILS.dll", ExactSpelling:=True)>
Public Shared Function ResUtilStopResourceService(
<MarshalAs(UnmanagedType.LPWStr)> pszServiceName As String ' LPCWSTR
) As UInteger
End Function' pszServiceName : LPCWSTR
Declare PtrSafe Function ResUtilStopResourceService 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
ResUtilStopResourceService = ctypes.windll.resutils.ResUtilStopResourceService
ResUtilStopResourceService.restype = wintypes.DWORD
ResUtilStopResourceService.argtypes = [
wintypes.LPCWSTR, # pszServiceName : LPCWSTR
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('RESUTILS.dll')
ResUtilStopResourceService = Fiddle::Function.new(
lib['ResUtilStopResourceService'],
[
Fiddle::TYPE_VOIDP, # pszServiceName : LPCWSTR
],
-Fiddle::TYPE_INT)#[link(name = "resutils")]
extern "system" {
fn ResUtilStopResourceService(
pszServiceName: *const u16 // LPCWSTR
) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("RESUTILS.dll")]
public static extern uint ResUtilStopResourceService([MarshalAs(UnmanagedType.LPWStr)] string pszServiceName);
"@
$api = Add-Type -MemberDefinition $sig -Name 'RESUTILS_ResUtilStopResourceService' -Namespace Win32 -PassThru
# $api::ResUtilStopResourceService(pszServiceName)#uselib "RESUTILS.dll"
#func global ResUtilStopResourceService "ResUtilStopResourceService" sptr
; ResUtilStopResourceService pszServiceName ; 戻り値は stat
; pszServiceName : LPCWSTR -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "RESUTILS.dll"
#cfunc global ResUtilStopResourceService "ResUtilStopResourceService" wstr
; res = ResUtilStopResourceService(pszServiceName)
; pszServiceName : LPCWSTR -> "wstr"; DWORD ResUtilStopResourceService(LPCWSTR pszServiceName)
#uselib "RESUTILS.dll"
#cfunc global ResUtilStopResourceService "ResUtilStopResourceService" wstr
; res = ResUtilStopResourceService(pszServiceName)
; pszServiceName : LPCWSTR -> "wstr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
resutils = windows.NewLazySystemDLL("RESUTILS.dll")
procResUtilStopResourceService = resutils.NewProc("ResUtilStopResourceService")
)
// pszServiceName (LPCWSTR)
r1, _, err := procResUtilStopResourceService.Call(
uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(pszServiceName))),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // DWORDfunction ResUtilStopResourceService(
pszServiceName: PWideChar // LPCWSTR
): DWORD; stdcall;
external 'RESUTILS.dll' name 'ResUtilStopResourceService';result := DllCall("RESUTILS\ResUtilStopResourceService"
, "WStr", pszServiceName ; LPCWSTR
, "UInt") ; return: DWORD●ResUtilStopResourceService(pszServiceName) = DLL("RESUTILS.dll", "dword ResUtilStopResourceService(char*)")
# 呼び出し: ResUtilStopResourceService(pszServiceName)
# pszServiceName : LPCWSTR -> "char*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。