Win32 API 日本語リファレンス
ホームSecurity.Isolation › DeleteAppContainerProfile

DeleteAppContainerProfile

関数
指定したAppContainerプロファイルを削除する。
DLLUSERENV.dll呼出規約winapi対応OSwindows8.0

シグネチャ

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

HRESULT DeleteAppContainerProfile(
    LPCWSTR pszAppContainerName
);

パラメーター

名前方向
pszAppContainerNameLPCWSTRin

戻り値の型: HRESULT

各言語での呼び出し定義

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

HRESULT DeleteAppContainerProfile(
    LPCWSTR pszAppContainerName
);
[DllImport("USERENV.dll", ExactSpelling = true)]
static extern int DeleteAppContainerProfile(
    [MarshalAs(UnmanagedType.LPWStr)] string pszAppContainerName   // LPCWSTR
);
<DllImport("USERENV.dll", ExactSpelling:=True)>
Public Shared Function DeleteAppContainerProfile(
    <MarshalAs(UnmanagedType.LPWStr)> pszAppContainerName As String   ' LPCWSTR
) As Integer
End Function
' pszAppContainerName : LPCWSTR
Declare PtrSafe Function DeleteAppContainerProfile Lib "userenv" ( _
    ByVal pszAppContainerName As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

DeleteAppContainerProfile = ctypes.windll.userenv.DeleteAppContainerProfile
DeleteAppContainerProfile.restype = ctypes.c_int
DeleteAppContainerProfile.argtypes = [
    wintypes.LPCWSTR,  # pszAppContainerName : LPCWSTR
]
require 'fiddle'
require 'fiddle/import'

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

var (
	userenv = windows.NewLazySystemDLL("USERENV.dll")
	procDeleteAppContainerProfile = userenv.NewProc("DeleteAppContainerProfile")
)

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