Win32 API 日本語リファレンス
ホームData.RightsManagement › DRMCloseSession

DRMCloseSession

関数
RMSのセッションを閉じる。
DLLmsdrm.dll呼出規約winapi

シグネチャ

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

HRESULT DRMCloseSession(
    DWORD hSession
);

パラメーター

名前方向
hSessionDWORDin

戻り値の型: HRESULT

各言語での呼び出し定義

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

HRESULT DRMCloseSession(
    DWORD hSession
);
[DllImport("msdrm.dll", ExactSpelling = true)]
static extern int DRMCloseSession(
    uint hSession   // DWORD
);
<DllImport("msdrm.dll", ExactSpelling:=True)>
Public Shared Function DRMCloseSession(
    hSession As UInteger   ' DWORD
) As Integer
End Function
' hSession : DWORD
Declare PtrSafe Function DRMCloseSession Lib "msdrm" ( _
    ByVal hSession As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

DRMCloseSession = ctypes.windll.msdrm.DRMCloseSession
DRMCloseSession.restype = ctypes.c_int
DRMCloseSession.argtypes = [
    wintypes.DWORD,  # hSession : DWORD
]
require 'fiddle'
require 'fiddle/import'

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

var (
	msdrm = windows.NewLazySystemDLL("msdrm.dll")
	procDRMCloseSession = msdrm.NewProc("DRMCloseSession")
)

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