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

WsResetError

関数
エラーオブジェクトを再利用可能にリセットする。
DLLwebservices.dll呼出規約winapi対応OSWindows 7 以降

シグネチャ

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

HRESULT WsResetError(
    WS_ERROR* error
);

パラメーター

名前方向
errorWS_ERROR*in

戻り値の型: HRESULT

各言語での呼び出し定義

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

HRESULT WsResetError(
    WS_ERROR* error
);
[DllImport("webservices.dll", ExactSpelling = true)]
static extern int WsResetError(
    ref IntPtr error   // WS_ERROR*
);
<DllImport("webservices.dll", ExactSpelling:=True)>
Public Shared Function WsResetError(
    ByRef [error] As IntPtr   ' WS_ERROR*
) As Integer
End Function
' error : WS_ERROR*
Declare PtrSafe Function WsResetError Lib "webservices" ( _
    ByRef error As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

WsResetError = ctypes.windll.webservices.WsResetError
WsResetError.restype = ctypes.c_int
WsResetError.argtypes = [
    ctypes.c_void_p,  # error : WS_ERROR*
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('webservices.dll')
WsResetError = Fiddle::Function.new(
  lib['WsResetError'],
  [
    Fiddle::TYPE_VOIDP,  # error : WS_ERROR*
  ],
  Fiddle::TYPE_INT)
#[link(name = "webservices")]
extern "system" {
    fn WsResetError(
        error: *mut isize  // WS_ERROR*
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("webservices.dll")]
public static extern int WsResetError(ref IntPtr error);
"@
$api = Add-Type -MemberDefinition $sig -Name 'webservices_WsResetError' -Namespace Win32 -PassThru
# $api::WsResetError(error)
#uselib "webservices.dll"
#func global WsResetError "WsResetError" sptr
; WsResetError error   ; 戻り値は stat
; error : WS_ERROR* -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "webservices.dll"
#cfunc global WsResetError "WsResetError" int
; res = WsResetError(error)
; error : WS_ERROR* -> "int"
; HRESULT WsResetError(WS_ERROR* error)
#uselib "webservices.dll"
#cfunc global WsResetError "WsResetError" int
; res = WsResetError(error)
; error : WS_ERROR* -> "int"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	webservices = windows.NewLazySystemDLL("webservices.dll")
	procWsResetError = webservices.NewProc("WsResetError")
)

// error (WS_ERROR*)
r1, _, err := procWsResetError.Call(
	uintptr(error),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // HRESULT
function WsResetError(
  error: Pointer   // WS_ERROR*
): Integer; stdcall;
  external 'webservices.dll' name 'WsResetError';
result := DllCall("webservices\WsResetError"
    , "Ptr", error   ; WS_ERROR*
    , "Int")   ; return: HRESULT
●WsResetError(error) = DLL("webservices.dll", "int WsResetError(void*)")
# 呼び出し: WsResetError(error)
# error : WS_ERROR* -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。