Win32 API 日本語リファレンス
ホームNetworkManagement.NetManagement › NetErrorLogWrite

NetErrorLogWrite

関数
サーバーのエラーログにエントリを書き込む。
DLLNETAPI32.dll呼出規約winapi

シグネチャ

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

DWORD NetErrorLogWrite(
    BYTE* Reserved1,   // optional
    DWORD Code,
    LPCWSTR Component,
    BYTE* Buffer,
    DWORD NumBytes,
    BYTE* MsgBuf,
    DWORD StrCount,
    BYTE* Reserved2   // optional
);

パラメーター

名前方向説明
Reserved1BYTE*inoptional未定 (TBD)
CodeDWORDin未定 (TBD)
ComponentLPCWSTRin未定 (TBD)
BufferBYTE*in未定 (TBD)
NumBytesDWORDin未定 (TBD)
MsgBufBYTE*in未定 (TBD)
StrCountDWORDin未定 (TBD)
Reserved2BYTE*inoptional未定 (TBD)

戻り値の型: DWORD

公式ドキュメント

NetErrorLogWrite 関数は廃止されています。16 ビット版の Windows との互換性のために含まれています。他のアプリケーションではイベントログを使用してください。

出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)

各言語での呼び出し定義

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

DWORD NetErrorLogWrite(
    BYTE* Reserved1,   // optional
    DWORD Code,
    LPCWSTR Component,
    BYTE* Buffer,
    DWORD NumBytes,
    BYTE* MsgBuf,
    DWORD StrCount,
    BYTE* Reserved2   // optional
);
[DllImport("NETAPI32.dll", ExactSpelling = true)]
static extern uint NetErrorLogWrite(
    IntPtr Reserved1,   // BYTE* optional
    uint Code,   // DWORD
    [MarshalAs(UnmanagedType.LPWStr)] string Component,   // LPCWSTR
    IntPtr Buffer,   // BYTE*
    uint NumBytes,   // DWORD
    IntPtr MsgBuf,   // BYTE*
    uint StrCount,   // DWORD
    IntPtr Reserved2   // BYTE* optional
);
<DllImport("NETAPI32.dll", ExactSpelling:=True)>
Public Shared Function NetErrorLogWrite(
    Reserved1 As IntPtr,   ' BYTE* optional
    Code As UInteger,   ' DWORD
    <MarshalAs(UnmanagedType.LPWStr)> Component As String,   ' LPCWSTR
    Buffer As IntPtr,   ' BYTE*
    NumBytes As UInteger,   ' DWORD
    MsgBuf As IntPtr,   ' BYTE*
    StrCount As UInteger,   ' DWORD
    Reserved2 As IntPtr   ' BYTE* optional
) As UInteger
End Function
' Reserved1 : BYTE* optional
' Code : DWORD
' Component : LPCWSTR
' Buffer : BYTE*
' NumBytes : DWORD
' MsgBuf : BYTE*
' StrCount : DWORD
' Reserved2 : BYTE* optional
Declare PtrSafe Function NetErrorLogWrite Lib "netapi32" ( _
    ByVal Reserved1 As LongPtr, _
    ByVal Code As Long, _
    ByVal Component As LongPtr, _
    ByVal Buffer As LongPtr, _
    ByVal NumBytes As Long, _
    ByVal MsgBuf As LongPtr, _
    ByVal StrCount As Long, _
    ByVal Reserved2 As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

NetErrorLogWrite = ctypes.windll.netapi32.NetErrorLogWrite
NetErrorLogWrite.restype = wintypes.DWORD
NetErrorLogWrite.argtypes = [
    ctypes.POINTER(ctypes.c_ubyte),  # Reserved1 : BYTE* optional
    wintypes.DWORD,  # Code : DWORD
    wintypes.LPCWSTR,  # Component : LPCWSTR
    ctypes.POINTER(ctypes.c_ubyte),  # Buffer : BYTE*
    wintypes.DWORD,  # NumBytes : DWORD
    ctypes.POINTER(ctypes.c_ubyte),  # MsgBuf : BYTE*
    wintypes.DWORD,  # StrCount : DWORD
    ctypes.POINTER(ctypes.c_ubyte),  # Reserved2 : BYTE* optional
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('NETAPI32.dll')
NetErrorLogWrite = Fiddle::Function.new(
  lib['NetErrorLogWrite'],
  [
    Fiddle::TYPE_VOIDP,  # Reserved1 : BYTE* optional
    -Fiddle::TYPE_INT,  # Code : DWORD
    Fiddle::TYPE_VOIDP,  # Component : LPCWSTR
    Fiddle::TYPE_VOIDP,  # Buffer : BYTE*
    -Fiddle::TYPE_INT,  # NumBytes : DWORD
    Fiddle::TYPE_VOIDP,  # MsgBuf : BYTE*
    -Fiddle::TYPE_INT,  # StrCount : DWORD
    Fiddle::TYPE_VOIDP,  # Reserved2 : BYTE* optional
  ],
  -Fiddle::TYPE_INT)
#[link(name = "netapi32")]
extern "system" {
    fn NetErrorLogWrite(
        Reserved1: *mut u8,  // BYTE* optional
        Code: u32,  // DWORD
        Component: *const u16,  // LPCWSTR
        Buffer: *mut u8,  // BYTE*
        NumBytes: u32,  // DWORD
        MsgBuf: *mut u8,  // BYTE*
        StrCount: u32,  // DWORD
        Reserved2: *mut u8  // BYTE* optional
    ) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("NETAPI32.dll")]
public static extern uint NetErrorLogWrite(IntPtr Reserved1, uint Code, [MarshalAs(UnmanagedType.LPWStr)] string Component, IntPtr Buffer, uint NumBytes, IntPtr MsgBuf, uint StrCount, IntPtr Reserved2);
"@
$api = Add-Type -MemberDefinition $sig -Name 'NETAPI32_NetErrorLogWrite' -Namespace Win32 -PassThru
# $api::NetErrorLogWrite(Reserved1, Code, Component, Buffer, NumBytes, MsgBuf, StrCount, Reserved2)
#uselib "NETAPI32.dll"
#func global NetErrorLogWrite "NetErrorLogWrite" sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr
; NetErrorLogWrite varptr(Reserved1), Code, Component, varptr(Buffer), NumBytes, varptr(MsgBuf), StrCount, varptr(Reserved2)   ; 戻り値は stat
; Reserved1 : BYTE* optional -> "sptr"
; Code : DWORD -> "sptr"
; Component : LPCWSTR -> "sptr"
; Buffer : BYTE* -> "sptr"
; NumBytes : DWORD -> "sptr"
; MsgBuf : BYTE* -> "sptr"
; StrCount : DWORD -> "sptr"
; Reserved2 : BYTE* optional -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "NETAPI32.dll"
#cfunc global NetErrorLogWrite "NetErrorLogWrite" var, int, wstr, var, int, var, int, var
; res = NetErrorLogWrite(Reserved1, Code, Component, Buffer, NumBytes, MsgBuf, StrCount, Reserved2)
; Reserved1 : BYTE* optional -> "var"
; Code : DWORD -> "int"
; Component : LPCWSTR -> "wstr"
; Buffer : BYTE* -> "var"
; NumBytes : DWORD -> "int"
; MsgBuf : BYTE* -> "var"
; StrCount : DWORD -> "int"
; Reserved2 : BYTE* optional -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; DWORD NetErrorLogWrite(BYTE* Reserved1, DWORD Code, LPCWSTR Component, BYTE* Buffer, DWORD NumBytes, BYTE* MsgBuf, DWORD StrCount, BYTE* Reserved2)
#uselib "NETAPI32.dll"
#cfunc global NetErrorLogWrite "NetErrorLogWrite" var, int, wstr, var, int, var, int, var
; res = NetErrorLogWrite(Reserved1, Code, Component, Buffer, NumBytes, MsgBuf, StrCount, Reserved2)
; Reserved1 : BYTE* optional -> "var"
; Code : DWORD -> "int"
; Component : LPCWSTR -> "wstr"
; Buffer : BYTE* -> "var"
; NumBytes : DWORD -> "int"
; MsgBuf : BYTE* -> "var"
; StrCount : DWORD -> "int"
; Reserved2 : BYTE* optional -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	netapi32 = windows.NewLazySystemDLL("NETAPI32.dll")
	procNetErrorLogWrite = netapi32.NewProc("NetErrorLogWrite")
)

// Reserved1 (BYTE* optional), Code (DWORD), Component (LPCWSTR), Buffer (BYTE*), NumBytes (DWORD), MsgBuf (BYTE*), StrCount (DWORD), Reserved2 (BYTE* optional)
r1, _, err := procNetErrorLogWrite.Call(
	uintptr(Reserved1),
	uintptr(Code),
	uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(Component))),
	uintptr(Buffer),
	uintptr(NumBytes),
	uintptr(MsgBuf),
	uintptr(StrCount),
	uintptr(Reserved2),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // DWORD
function NetErrorLogWrite(
  Reserved1: Pointer;   // BYTE* optional
  Code: DWORD;   // DWORD
  Component: PWideChar;   // LPCWSTR
  Buffer: Pointer;   // BYTE*
  NumBytes: DWORD;   // DWORD
  MsgBuf: Pointer;   // BYTE*
  StrCount: DWORD;   // DWORD
  Reserved2: Pointer   // BYTE* optional
): DWORD; stdcall;
  external 'NETAPI32.dll' name 'NetErrorLogWrite';
result := DllCall("NETAPI32\NetErrorLogWrite"
    , "Ptr", Reserved1   ; BYTE* optional
    , "UInt", Code   ; DWORD
    , "WStr", Component   ; LPCWSTR
    , "Ptr", Buffer   ; BYTE*
    , "UInt", NumBytes   ; DWORD
    , "Ptr", MsgBuf   ; BYTE*
    , "UInt", StrCount   ; DWORD
    , "Ptr", Reserved2   ; BYTE* optional
    , "UInt")   ; return: DWORD
●NetErrorLogWrite(Reserved1, Code, Component, Buffer, NumBytes, MsgBuf, StrCount, Reserved2) = DLL("NETAPI32.dll", "dword NetErrorLogWrite(void*, dword, char*, void*, dword, void*, dword, void*)")
# 呼び出し: NetErrorLogWrite(Reserved1, Code, Component, Buffer, NumBytes, MsgBuf, StrCount, Reserved2)
# Reserved1 : BYTE* optional -> "void*"
# Code : DWORD -> "dword"
# Component : LPCWSTR -> "char*"
# Buffer : BYTE* -> "void*"
# NumBytes : DWORD -> "dword"
# MsgBuf : BYTE* -> "void*"
# StrCount : DWORD -> "dword"
# Reserved2 : BYTE* optional -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
const std = @import("std");

extern "netapi32" fn NetErrorLogWrite(
    Reserved1: [*c]u8, // BYTE* optional
    Code: u32, // DWORD
    Component: [*c]const u16, // LPCWSTR
    Buffer: [*c]u8, // BYTE*
    NumBytes: u32, // DWORD
    MsgBuf: [*c]u8, // BYTE*
    StrCount: u32, // DWORD
    Reserved2: [*c]u8 // BYTE* optional
) callconv(std.os.windows.WINAPI) u32;
proc NetErrorLogWrite(
    Reserved1: ptr uint8,  # BYTE* optional
    Code: uint32,  # DWORD
    Component: WideCString,  # LPCWSTR
    Buffer: ptr uint8,  # BYTE*
    NumBytes: uint32,  # DWORD
    MsgBuf: ptr uint8,  # BYTE*
    StrCount: uint32,  # DWORD
    Reserved2: ptr uint8  # BYTE* optional
): uint32 {.importc: "NetErrorLogWrite", stdcall, dynlib: "NETAPI32.dll".}
pragma(lib, "netapi32");
extern(Windows)
uint NetErrorLogWrite(
    ubyte* Reserved1,   // BYTE* optional
    uint Code,   // DWORD
    const(wchar)* Component,   // LPCWSTR
    ubyte* Buffer,   // BYTE*
    uint NumBytes,   // DWORD
    ubyte* MsgBuf,   // BYTE*
    uint StrCount,   // DWORD
    ubyte* Reserved2   // BYTE* optional
);
ccall((:NetErrorLogWrite, "NETAPI32.dll"), stdcall, UInt32,
      (Ptr{UInt8}, UInt32, Cwstring, Ptr{UInt8}, UInt32, Ptr{UInt8}, UInt32, Ptr{UInt8}),
      Reserved1, Code, Component, Buffer, NumBytes, MsgBuf, StrCount, Reserved2)
# Reserved1 : BYTE* optional -> Ptr{UInt8}
# Code : DWORD -> UInt32
# Component : LPCWSTR -> Cwstring
# Buffer : BYTE* -> Ptr{UInt8}
# NumBytes : DWORD -> UInt32
# MsgBuf : BYTE* -> Ptr{UInt8}
# StrCount : DWORD -> UInt32
# Reserved2 : BYTE* optional -> Ptr{UInt8}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。
local ffi = require("ffi")
ffi.cdef[[
uint32_t NetErrorLogWrite(
    uint8_t* Reserved1,
    uint32_t Code,
    const uint16_t* Component,
    uint8_t* Buffer,
    uint32_t NumBytes,
    uint8_t* MsgBuf,
    uint32_t StrCount,
    uint8_t* Reserved2);
]]
local netapi32 = ffi.load("netapi32")
-- netapi32.NetErrorLogWrite(Reserved1, Code, Component, Buffer, NumBytes, MsgBuf, StrCount, Reserved2)
-- Reserved1 : BYTE* optional
-- Code : DWORD
-- Component : LPCWSTR
-- Buffer : BYTE*
-- NumBytes : DWORD
-- MsgBuf : BYTE*
-- StrCount : DWORD
-- Reserved2 : BYTE* optional
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
const koffi = require('koffi');
const lib = koffi.load('NETAPI32.dll');
const NetErrorLogWrite = lib.func('__stdcall', 'NetErrorLogWrite', 'uint32_t', ['uint8_t *', 'uint32_t', 'str16', 'uint8_t *', 'uint32_t', 'uint8_t *', 'uint32_t', 'uint8_t *']);
// NetErrorLogWrite(Reserved1, Code, Component, Buffer, NumBytes, MsgBuf, StrCount, Reserved2)
// Reserved1 : BYTE* optional -> 'uint8_t *'
// Code : DWORD -> 'uint32_t'
// Component : LPCWSTR -> 'str16'
// Buffer : BYTE* -> 'uint8_t *'
// NumBytes : DWORD -> 'uint32_t'
// MsgBuf : BYTE* -> 'uint8_t *'
// StrCount : DWORD -> 'uint32_t'
// Reserved2 : BYTE* optional -> 'uint8_t *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。
const lib = Deno.dlopen("NETAPI32.dll", {
  NetErrorLogWrite: { parameters: ["pointer", "u32", "buffer", "pointer", "u32", "pointer", "u32", "pointer"], result: "u32" },
});
// lib.symbols.NetErrorLogWrite(Reserved1, Code, Component, Buffer, NumBytes, MsgBuf, StrCount, Reserved2)
// Reserved1 : BYTE* optional -> "pointer"
// Code : DWORD -> "u32"
// Component : LPCWSTR -> "buffer"
// Buffer : BYTE* -> "pointer"
// NumBytes : DWORD -> "u32"
// MsgBuf : BYTE* -> "pointer"
// StrCount : DWORD -> "u32"
// Reserved2 : BYTE* optional -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。
<?php
$ffi = FFI::cdef(<<<C
uint32_t NetErrorLogWrite(
    uint8_t* Reserved1,
    uint32_t Code,
    const uint16_t* Component,
    uint8_t* Buffer,
    uint32_t NumBytes,
    uint8_t* MsgBuf,
    uint32_t StrCount,
    uint8_t* Reserved2);
C, "NETAPI32.dll");
// $ffi->NetErrorLogWrite(Reserved1, Code, Component, Buffer, NumBytes, MsgBuf, StrCount, Reserved2);
// Reserved1 : BYTE* optional
// Code : DWORD
// Component : LPCWSTR
// Buffer : BYTE*
// NumBytes : DWORD
// MsgBuf : BYTE*
// StrCount : DWORD
// Reserved2 : BYTE* optional
// 構造体/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 Netapi32 extends StdCallLibrary {
    Netapi32 INSTANCE = Native.load("netapi32", Netapi32.class);
    int NetErrorLogWrite(
        byte[] Reserved1,   // BYTE* optional
        int Code,   // DWORD
        WString Component,   // LPCWSTR
        byte[] Buffer,   // BYTE*
        int NumBytes,   // DWORD
        byte[] MsgBuf,   // BYTE*
        int StrCount,   // DWORD
        byte[] Reserved2   // BYTE* optional
    );
}
@[Link("netapi32")]
lib LibNETAPI32
  fun NetErrorLogWrite = NetErrorLogWrite(
    Reserved1 : UInt8*,   # BYTE* optional
    Code : UInt32,   # DWORD
    Component : UInt16*,   # LPCWSTR
    Buffer : UInt8*,   # BYTE*
    NumBytes : UInt32,   # DWORD
    MsgBuf : UInt8*,   # BYTE*
    StrCount : UInt32,   # DWORD
    Reserved2 : UInt8*   # BYTE* optional
  ) : UInt32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。
import 'dart:ffi';
import 'package:ffi/ffi.dart';

typedef NetErrorLogWriteNative = Uint32 Function(Pointer<Uint8>, Uint32, Pointer<Utf16>, Pointer<Uint8>, Uint32, Pointer<Uint8>, Uint32, Pointer<Uint8>);
typedef NetErrorLogWriteDart = int Function(Pointer<Uint8>, int, Pointer<Utf16>, Pointer<Uint8>, int, Pointer<Uint8>, int, Pointer<Uint8>);
final NetErrorLogWrite = DynamicLibrary.open('NETAPI32.dll')
    .lookupFunction<NetErrorLogWriteNative, NetErrorLogWriteDart>('NetErrorLogWrite');
// Reserved1 : BYTE* optional -> Pointer<Uint8>
// Code : DWORD -> Uint32
// Component : LPCWSTR -> Pointer<Utf16>
// Buffer : BYTE* -> Pointer<Uint8>
// NumBytes : DWORD -> Uint32
// MsgBuf : BYTE* -> Pointer<Uint8>
// StrCount : DWORD -> Uint32
// Reserved2 : BYTE* optional -> Pointer<Uint8>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。
{$mode objfpc}{$H+}
function NetErrorLogWrite(
  Reserved1: Pointer;   // BYTE* optional
  Code: DWORD;   // DWORD
  Component: PWideChar;   // LPCWSTR
  Buffer: Pointer;   // BYTE*
  NumBytes: DWORD;   // DWORD
  MsgBuf: Pointer;   // BYTE*
  StrCount: DWORD;   // DWORD
  Reserved2: Pointer   // BYTE* optional
): DWORD; stdcall;
  external 'NETAPI32.dll' name 'NetErrorLogWrite';
import Foreign
import Foreign.C.Types
import Foreign.C.String

foreign import stdcall safe "NetErrorLogWrite"
  c_NetErrorLogWrite :: Ptr Word8 -> Word32 -> CWString -> Ptr Word8 -> Word32 -> Ptr Word8 -> Word32 -> Ptr Word8 -> IO Word32
-- Reserved1 : BYTE* optional -> Ptr Word8
-- Code : DWORD -> Word32
-- Component : LPCWSTR -> CWString
-- Buffer : BYTE* -> Ptr Word8
-- NumBytes : DWORD -> Word32
-- MsgBuf : BYTE* -> Ptr Word8
-- StrCount : DWORD -> Word32
-- Reserved2 : BYTE* optional -> Ptr Word8
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。
open Ctypes
open Foreign

let neterrorlogwrite =
  foreign "NetErrorLogWrite"
    ((ptr uint8_t) @-> uint32_t @-> (ptr uint16_t) @-> (ptr uint8_t) @-> uint32_t @-> (ptr uint8_t) @-> uint32_t @-> (ptr uint8_t) @-> returning uint32_t)
(* Reserved1 : BYTE* optional -> (ptr uint8_t) *)
(* Code : DWORD -> uint32_t *)
(* Component : LPCWSTR -> (ptr uint16_t) *)
(* Buffer : BYTE* -> (ptr uint8_t) *)
(* NumBytes : DWORD -> uint32_t *)
(* MsgBuf : BYTE* -> (ptr uint8_t) *)
(* StrCount : DWORD -> uint32_t *)
(* Reserved2 : BYTE* optional -> (ptr uint8_t) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)
(cffi:define-foreign-library netapi32 (t "NETAPI32.dll"))
(cffi:use-foreign-library netapi32)

(cffi:defcfun ("NetErrorLogWrite" net-error-log-write :convention :stdcall) :uint32
  (reserved1 :pointer)   ; BYTE* optional
  (code :uint32)   ; DWORD
  (component (:string :encoding :utf-16le))   ; LPCWSTR
  (buffer :pointer)   ; BYTE*
  (num-bytes :uint32)   ; DWORD
  (msg-buf :pointer)   ; BYTE*
  (str-count :uint32)   ; DWORD
  (reserved2 :pointer))   ; BYTE* optional
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。
use Win32::API;
my $NetErrorLogWrite = Win32::API::More->new('NETAPI32',
    'DWORD NetErrorLogWrite(LPVOID Reserved1, DWORD Code, LPCWSTR Component, LPVOID Buffer, DWORD NumBytes, LPVOID MsgBuf, DWORD StrCount, LPVOID Reserved2)');
# my $ret = $NetErrorLogWrite->Call($Reserved1, $Code, $Component, $Buffer, $NumBytes, $MsgBuf, $StrCount, $Reserved2);
# Reserved1 : BYTE* optional -> LPVOID
# Code : DWORD -> DWORD
# Component : LPCWSTR -> LPCWSTR
# Buffer : BYTE* -> LPVOID
# NumBytes : DWORD -> DWORD
# MsgBuf : BYTE* -> LPVOID
# StrCount : DWORD -> DWORD
# Reserved2 : BYTE* optional -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。