QueryServiceLockStatusW
関数シグネチャ
// ADVAPI32.dll (Unicode / -W)
#include <windows.h>
BOOL QueryServiceLockStatusW(
SC_HANDLE hSCManager,
QUERY_SERVICE_LOCK_STATUSW* lpLockStatus, // optional
DWORD cbBufSize,
DWORD* pcbBytesNeeded
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| hSCManager | SC_HANDLE | in | サービス制御マネージャーのデータベースへのハンドル。 OpenSCManager 関数がこのハンドルを返します。このハンドルには SC_MANAGER_QUERY_LOCK_STATUS アクセス権が必要です。詳細については、 Service Security and Access Rights を参照してください。 |
| lpLockStatus | QUERY_SERVICE_LOCK_STATUSW* | outoptional | 指定したデータベースのロック状態と、そのメンバーが指す文字列を受け取る QUERY_SERVICE_LOCK_STATUS 構造体へのポインター。 |
| cbBufSize | DWORD | in | lpLockStatus パラメーターが指すバッファーのサイズ(バイト単位)。 |
| pcbBytesNeeded | DWORD* | out | 関数が失敗した場合に、すべてのロック状態情報を返すために必要なバイト数を受け取る変数へのポインター。 |
戻り値の型: BOOL
公式ドキュメント
指定したサービス制御マネージャーのデータベースのロック状態を取得します。(Unicode)
戻り値
関数が成功した場合、戻り値は 0 以外の値です。
関数が失敗した場合、戻り値は 0 です。拡張エラー情報を取得するには、 GetLastError を呼び出します。
次のエラーコードはサービス制御マネージャーによって設定される場合があります。これ以外のエラーコードは、サービス制御マネージャーが呼び出すレジストリ関数によって設定される場合があります。
| 戻り値 | 説明 |
|---|---|
| ハンドルに SC_MANAGER_QUERY_LOCK_STATUS アクセス権がありません。 | |
| lpLockStatus バッファーに収まる量を超えるロック状態情報があります。すべての情報を取得するために必要なバイト数が pcbBytesNeeded パラメーターに返されます。lpLockStatus には何も書き込まれません。 | |
| 指定したハンドルが無効です。 |
解説(Remarks)
QueryServiceLockStatus 関数は、指定したデータベースがロックされているかどうかを示す QUERY_SERVICE_LOCK_STATUS 構造体を返します。データベースがロックされている場合、この構造体はロックを所有するユーザーのアカウント名と、ロックが保持されている時間の長さを提供します。
プロセスは、サービス制御マネージャーのデータベースロックの所有権を取得するために LockServiceDatabase 関数を呼び出し、ロックを解放するために UnlockServiceDatabase 関数を呼び出します。
winsvc.h ヘッダーは QueryServiceLockStatus を、UNICODE プリプロセッサ定数の定義に基づいてこの関数の ANSI 版または Unicode 版を自動的に選択するエイリアスとして定義します。エンコーディングに依存しないエイリアスの使用を、エンコーディングに依存しないわけではないコードと混在させると、不一致が生じ、コンパイルエラーや実行時エラーを引き起こす可能性があります。詳細については、Conventions for Function Prototypes を参照してください。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
各言語での呼び出し定義
// ADVAPI32.dll (Unicode / -W)
#include <windows.h>
BOOL QueryServiceLockStatusW(
SC_HANDLE hSCManager,
QUERY_SERVICE_LOCK_STATUSW* lpLockStatus, // optional
DWORD cbBufSize,
DWORD* pcbBytesNeeded
);[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("ADVAPI32.dll", CharSet = CharSet.Unicode, SetLastError = true, ExactSpelling = true)]
static extern bool QueryServiceLockStatusW(
IntPtr hSCManager, // SC_HANDLE
IntPtr lpLockStatus, // QUERY_SERVICE_LOCK_STATUSW* optional, out
uint cbBufSize, // DWORD
out uint pcbBytesNeeded // DWORD* out
);<DllImport("ADVAPI32.dll", CharSet:=CharSet.Unicode, SetLastError:=True, ExactSpelling:=True)>
Public Shared Function QueryServiceLockStatusW(
hSCManager As IntPtr, ' SC_HANDLE
lpLockStatus As IntPtr, ' QUERY_SERVICE_LOCK_STATUSW* optional, out
cbBufSize As UInteger, ' DWORD
<Out> ByRef pcbBytesNeeded As UInteger ' DWORD* out
) As <MarshalAs(UnmanagedType.Bool)> Boolean
End Function' hSCManager : SC_HANDLE
' lpLockStatus : QUERY_SERVICE_LOCK_STATUSW* optional, out
' cbBufSize : DWORD
' pcbBytesNeeded : DWORD* out
Declare PtrSafe Function QueryServiceLockStatusW Lib "advapi32" ( _
ByVal hSCManager As LongPtr, _
ByVal lpLockStatus As LongPtr, _
ByVal cbBufSize As Long, _
ByRef pcbBytesNeeded As Long) As Long
' Unicode(W): 文字列は ByVal As LongPtr とし StrPtr(unicodeStr) を渡す
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
QueryServiceLockStatusW = ctypes.windll.advapi32.QueryServiceLockStatusW
QueryServiceLockStatusW.restype = wintypes.BOOL
QueryServiceLockStatusW.argtypes = [
wintypes.HANDLE, # hSCManager : SC_HANDLE
ctypes.c_void_p, # lpLockStatus : QUERY_SERVICE_LOCK_STATUSW* optional, out
wintypes.DWORD, # cbBufSize : DWORD
ctypes.POINTER(wintypes.DWORD), # pcbBytesNeeded : DWORD* out
]
# GetLastError: use ctypes.GetLastError() (or ctypes.WinDLL(use_last_error=True))require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('ADVAPI32.dll')
QueryServiceLockStatusW = Fiddle::Function.new(
lib['QueryServiceLockStatusW'],
[
Fiddle::TYPE_VOIDP, # hSCManager : SC_HANDLE
Fiddle::TYPE_VOIDP, # lpLockStatus : QUERY_SERVICE_LOCK_STATUSW* optional, out
-Fiddle::TYPE_INT, # cbBufSize : DWORD
Fiddle::TYPE_VOIDP, # pcbBytesNeeded : DWORD* out
],
Fiddle::TYPE_INT)
# Wide strings: pass str.encode("UTF-16LE") + "\x00\x00"#[link(name = "advapi32")]
extern "system" {
fn QueryServiceLockStatusW(
hSCManager: *mut core::ffi::c_void, // SC_HANDLE
lpLockStatus: *mut QUERY_SERVICE_LOCK_STATUSW, // QUERY_SERVICE_LOCK_STATUSW* optional, out
cbBufSize: u32, // DWORD
pcbBytesNeeded: *mut u32 // DWORD* out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("ADVAPI32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
public static extern bool QueryServiceLockStatusW(IntPtr hSCManager, IntPtr lpLockStatus, uint cbBufSize, out uint pcbBytesNeeded);
"@
$api = Add-Type -MemberDefinition $sig -Name 'ADVAPI32_QueryServiceLockStatusW' -Namespace Win32 -PassThru
# $api::QueryServiceLockStatusW(hSCManager, lpLockStatus, cbBufSize, pcbBytesNeeded)#uselib "ADVAPI32.dll"
#func global QueryServiceLockStatusW "QueryServiceLockStatusW" wptr, wptr, wptr, wptr
; QueryServiceLockStatusW hSCManager, varptr(lpLockStatus), cbBufSize, varptr(pcbBytesNeeded) ; 戻り値は stat
; hSCManager : SC_HANDLE -> "wptr"
; lpLockStatus : QUERY_SERVICE_LOCK_STATUSW* optional, out -> "wptr"
; cbBufSize : DWORD -> "wptr"
; pcbBytesNeeded : DWORD* out -> "wptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "ADVAPI32.dll" #cfunc global QueryServiceLockStatusW "QueryServiceLockStatusW" sptr, var, int, var ; res = QueryServiceLockStatusW(hSCManager, lpLockStatus, cbBufSize, pcbBytesNeeded) ; hSCManager : SC_HANDLE -> "sptr" ; lpLockStatus : QUERY_SERVICE_LOCK_STATUSW* optional, out -> "var" ; cbBufSize : DWORD -> "int" ; pcbBytesNeeded : DWORD* out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "ADVAPI32.dll" #cfunc global QueryServiceLockStatusW "QueryServiceLockStatusW" sptr, sptr, int, sptr ; res = QueryServiceLockStatusW(hSCManager, varptr(lpLockStatus), cbBufSize, varptr(pcbBytesNeeded)) ; hSCManager : SC_HANDLE -> "sptr" ; lpLockStatus : QUERY_SERVICE_LOCK_STATUSW* optional, out -> "sptr" ; cbBufSize : DWORD -> "int" ; pcbBytesNeeded : DWORD* out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
; BOOL QueryServiceLockStatusW(SC_HANDLE hSCManager, QUERY_SERVICE_LOCK_STATUSW* lpLockStatus, DWORD cbBufSize, DWORD* pcbBytesNeeded) #uselib "ADVAPI32.dll" #cfunc global QueryServiceLockStatusW "QueryServiceLockStatusW" intptr, var, int, var ; res = QueryServiceLockStatusW(hSCManager, lpLockStatus, cbBufSize, pcbBytesNeeded) ; hSCManager : SC_HANDLE -> "intptr" ; lpLockStatus : QUERY_SERVICE_LOCK_STATUSW* optional, out -> "var" ; cbBufSize : DWORD -> "int" ; pcbBytesNeeded : DWORD* out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; BOOL QueryServiceLockStatusW(SC_HANDLE hSCManager, QUERY_SERVICE_LOCK_STATUSW* lpLockStatus, DWORD cbBufSize, DWORD* pcbBytesNeeded) #uselib "ADVAPI32.dll" #cfunc global QueryServiceLockStatusW "QueryServiceLockStatusW" intptr, intptr, int, intptr ; res = QueryServiceLockStatusW(hSCManager, varptr(lpLockStatus), cbBufSize, varptr(pcbBytesNeeded)) ; hSCManager : SC_HANDLE -> "intptr" ; lpLockStatus : QUERY_SERVICE_LOCK_STATUSW* optional, out -> "intptr" ; cbBufSize : DWORD -> "int" ; pcbBytesNeeded : DWORD* out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
advapi32 = windows.NewLazySystemDLL("ADVAPI32.dll")
procQueryServiceLockStatusW = advapi32.NewProc("QueryServiceLockStatusW")
)
// hSCManager (SC_HANDLE), lpLockStatus (QUERY_SERVICE_LOCK_STATUSW* optional, out), cbBufSize (DWORD), pcbBytesNeeded (DWORD* out)
r1, _, err := procQueryServiceLockStatusW.Call(
uintptr(hSCManager),
uintptr(lpLockStatus),
uintptr(cbBufSize),
uintptr(pcbBytesNeeded),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // BOOLfunction QueryServiceLockStatusW(
hSCManager: THandle; // SC_HANDLE
lpLockStatus: Pointer; // QUERY_SERVICE_LOCK_STATUSW* optional, out
cbBufSize: DWORD; // DWORD
pcbBytesNeeded: Pointer // DWORD* out
): BOOL; stdcall;
external 'ADVAPI32.dll' name 'QueryServiceLockStatusW';result := DllCall("ADVAPI32\QueryServiceLockStatusW"
, "Ptr", hSCManager ; SC_HANDLE
, "Ptr", lpLockStatus ; QUERY_SERVICE_LOCK_STATUSW* optional, out
, "UInt", cbBufSize ; DWORD
, "Ptr", pcbBytesNeeded ; DWORD* out
, "Int") ; return: BOOL●QueryServiceLockStatusW(hSCManager, lpLockStatus, cbBufSize, pcbBytesNeeded) = DLL("ADVAPI32.dll", "bool QueryServiceLockStatusW(void*, void*, dword, void*)")
# 呼び出し: QueryServiceLockStatusW(hSCManager, lpLockStatus, cbBufSize, pcbBytesNeeded)
# hSCManager : SC_HANDLE -> "void*"
# lpLockStatus : QUERY_SERVICE_LOCK_STATUSW* optional, out -> "void*"
# cbBufSize : DWORD -> "dword"
# pcbBytesNeeded : DWORD* out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※-W(Unicode)関数。なでしこ1はANSIのため -A 版の利用を推奨。const std = @import("std");
extern "advapi32" fn QueryServiceLockStatusW(
hSCManager: ?*anyopaque, // SC_HANDLE
lpLockStatus: [*c]QUERY_SERVICE_LOCK_STATUSW, // QUERY_SERVICE_LOCK_STATUSW* optional, out
cbBufSize: u32, // DWORD
pcbBytesNeeded: [*c]u32 // DWORD* out
) callconv(std.os.windows.WINAPI) i32;
// Unicode(-W): UTF-16LE のヌル終端バッファ([*c]const u16)を渡す。proc QueryServiceLockStatusW(
hSCManager: pointer, # SC_HANDLE
lpLockStatus: ptr QUERY_SERVICE_LOCK_STATUSW, # QUERY_SERVICE_LOCK_STATUSW* optional, out
cbBufSize: uint32, # DWORD
pcbBytesNeeded: ptr uint32 # DWORD* out
): int32 {.importc: "QueryServiceLockStatusW", stdcall, dynlib: "ADVAPI32.dll".}
# Unicode(-W): WideCString は newWideCString("...") で生成。pragma(lib, "advapi32");
extern(Windows)
int QueryServiceLockStatusW(
void* hSCManager, // SC_HANDLE
QUERY_SERVICE_LOCK_STATUSW* lpLockStatus, // QUERY_SERVICE_LOCK_STATUSW* optional, out
uint cbBufSize, // DWORD
uint* pcbBytesNeeded // DWORD* out
);ccall((:QueryServiceLockStatusW, "ADVAPI32.dll"), stdcall, Int32,
(Ptr{Cvoid}, Ptr{QUERY_SERVICE_LOCK_STATUSW}, UInt32, Ptr{UInt32}),
hSCManager, lpLockStatus, cbBufSize, pcbBytesNeeded)
# hSCManager : SC_HANDLE -> Ptr{Cvoid}
# lpLockStatus : QUERY_SERVICE_LOCK_STATUSW* optional, out -> Ptr{QUERY_SERVICE_LOCK_STATUSW}
# cbBufSize : DWORD -> UInt32
# pcbBytesNeeded : DWORD* out -> Ptr{UInt32}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。
# Unicode(-W): Cwstring には transcode(UInt16, "...") 等で UTF-16 を渡す。local ffi = require("ffi")
ffi.cdef[[
int32_t QueryServiceLockStatusW(
void* hSCManager,
void* lpLockStatus,
uint32_t cbBufSize,
uint32_t* pcbBytesNeeded);
]]
local advapi32 = ffi.load("advapi32")
-- advapi32.QueryServiceLockStatusW(hSCManager, lpLockStatus, cbBufSize, pcbBytesNeeded)
-- hSCManager : SC_HANDLE
-- lpLockStatus : QUERY_SERVICE_LOCK_STATUSW* optional, out
-- cbBufSize : DWORD
-- pcbBytesNeeded : DWORD* out
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
-- Unicode(-W): uint16_t* には UTF-16LE のバッファ(ffi.new("uint16_t[?]", ...))を渡す。const koffi = require('koffi');
const lib = koffi.load('ADVAPI32.dll');
const QueryServiceLockStatusW = lib.func('__stdcall', 'QueryServiceLockStatusW', 'int32_t', ['void *', 'void *', 'uint32_t', 'uint32_t *']);
// QueryServiceLockStatusW(hSCManager, lpLockStatus, cbBufSize, pcbBytesNeeded)
// hSCManager : SC_HANDLE -> 'void *'
// lpLockStatus : QUERY_SERVICE_LOCK_STATUSW* optional, out -> 'void *'
// cbBufSize : DWORD -> 'uint32_t'
// pcbBytesNeeded : DWORD* out -> 'uint32_t *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("ADVAPI32.dll", {
QueryServiceLockStatusW: { parameters: ["pointer", "pointer", "u32", "pointer"], result: "i32" },
});
// lib.symbols.QueryServiceLockStatusW(hSCManager, lpLockStatus, cbBufSize, pcbBytesNeeded)
// hSCManager : SC_HANDLE -> "pointer"
// lpLockStatus : QUERY_SERVICE_LOCK_STATUSW* optional, out -> "pointer"
// cbBufSize : DWORD -> "u32"
// pcbBytesNeeded : DWORD* out -> "pointer"
// 文字列は "buffer"。Unicode(-W) は new TextEncoder() ではなく UTF-16LE のバイト列(末尾に \x00\x00)を Uint8Array で渡す。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
int32_t QueryServiceLockStatusW(
void* hSCManager,
void* lpLockStatus,
uint32_t cbBufSize,
uint32_t* pcbBytesNeeded);
C, "ADVAPI32.dll");
// $ffi->QueryServiceLockStatusW(hSCManager, lpLockStatus, cbBufSize, pcbBytesNeeded);
// hSCManager : SC_HANDLE
// lpLockStatus : QUERY_SERVICE_LOCK_STATUSW* optional, out
// cbBufSize : DWORD
// pcbBytesNeeded : DWORD* out
// 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
// WINAPI(stdcall): x64 では呼出規約が統一されるため問題なし。x86 では __stdcall 対応のラッパが必要な場合あり。import com.sun.jna.*;
import com.sun.jna.ptr.*;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;
public interface Advapi32 extends StdCallLibrary {
Advapi32 INSTANCE = Native.load("advapi32", Advapi32.class, W32APIOptions.UNICODE_OPTIONS);
boolean QueryServiceLockStatusW(
Pointer hSCManager, // SC_HANDLE
Pointer lpLockStatus, // QUERY_SERVICE_LOCK_STATUSW* optional, out
int cbBufSize, // DWORD
IntByReference pcbBytesNeeded // DWORD* out
);
}
// Unicode(-W): WString(入力)/char[](出力)で UTF-16 をマーシャリング。@[Link("advapi32")]
lib LibADVAPI32
fun QueryServiceLockStatusW = QueryServiceLockStatusW(
hSCManager : Void*, # SC_HANDLE
lpLockStatus : QUERY_SERVICE_LOCK_STATUSW*, # QUERY_SERVICE_LOCK_STATUSW* optional, out
cbBufSize : UInt32, # DWORD
pcbBytesNeeded : UInt32* # DWORD* out
) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef QueryServiceLockStatusWNative = Int32 Function(Pointer<Void>, Pointer<Void>, Uint32, Pointer<Uint32>);
typedef QueryServiceLockStatusWDart = int Function(Pointer<Void>, Pointer<Void>, int, Pointer<Uint32>);
final QueryServiceLockStatusW = DynamicLibrary.open('ADVAPI32.dll')
.lookupFunction<QueryServiceLockStatusWNative, QueryServiceLockStatusWDart>('QueryServiceLockStatusW');
// hSCManager : SC_HANDLE -> Pointer<Void>
// lpLockStatus : QUERY_SERVICE_LOCK_STATUSW* optional, out -> Pointer<Void>
// cbBufSize : DWORD -> Uint32
// pcbBytesNeeded : DWORD* out -> Pointer<Uint32>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
function QueryServiceLockStatusW(
hSCManager: THandle; // SC_HANDLE
lpLockStatus: Pointer; // QUERY_SERVICE_LOCK_STATUSW* optional, out
cbBufSize: DWORD; // DWORD
pcbBytesNeeded: Pointer // DWORD* out
): BOOL; stdcall;
external 'ADVAPI32.dll' name 'QueryServiceLockStatusW';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import stdcall safe "QueryServiceLockStatusW"
c_QueryServiceLockStatusW :: Ptr () -> Ptr () -> Word32 -> Ptr Word32 -> IO CInt
-- hSCManager : SC_HANDLE -> Ptr ()
-- lpLockStatus : QUERY_SERVICE_LOCK_STATUSW* optional, out -> Ptr ()
-- cbBufSize : DWORD -> Word32
-- pcbBytesNeeded : DWORD* out -> Ptr Word32
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let queryservicelockstatusw =
foreign "QueryServiceLockStatusW"
((ptr void) @-> (ptr void) @-> uint32_t @-> (ptr uint32_t) @-> returning int32_t)
(* hSCManager : SC_HANDLE -> (ptr void) *)
(* lpLockStatus : QUERY_SERVICE_LOCK_STATUSW* optional, out -> (ptr void) *)
(* cbBufSize : DWORD -> uint32_t *)
(* pcbBytesNeeded : DWORD* out -> (ptr uint32_t) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library advapi32 (t "ADVAPI32.dll"))
(cffi:use-foreign-library advapi32)
(cffi:defcfun ("QueryServiceLockStatusW" query-service-lock-status-w :convention :stdcall) :int32
(h-scmanager :pointer) ; SC_HANDLE
(lp-lock-status :pointer) ; QUERY_SERVICE_LOCK_STATUSW* optional, out
(cb-buf-size :uint32) ; DWORD
(pcb-bytes-needed :pointer)) ; DWORD* out
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $QueryServiceLockStatusW = Win32::API::More->new('ADVAPI32',
'BOOL QueryServiceLockStatusW(HANDLE hSCManager, LPVOID lpLockStatus, DWORD cbBufSize, LPVOID pcbBytesNeeded)');
# my $ret = $QueryServiceLockStatusW->Call($hSCManager, $lpLockStatus, $cbBufSize, $pcbBytesNeeded);
# hSCManager : SC_HANDLE -> HANDLE
# lpLockStatus : QUERY_SERVICE_LOCK_STATUSW* optional, out -> LPVOID
# cbBufSize : DWORD -> DWORD
# pcbBytesNeeded : DWORD* out -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。
# Unicode(-W): LPCWSTR/LPWSTR は Win32::API が UTF-16 変換を行う。関連項目
- f QueryServiceLockStatusA (ANSI版) — SCMデータベースのロック状態を取得する。
- f LockServiceDatabase — SCMデータベースをロックする。
- f OpenSCManagerW — サービス制御マネージャーへの接続を確立しハンドルを取得する。
- f UnlockServiceDatabase — ロックしたSCMデータベースのロックを解除する。