Win32 API 日本語リファレンス
ホームSystem.DataExchange › InitAtomTable

InitAtomTable

関数
ローカルアトムテーブルを指定サイズで初期化する。
DLLKERNEL32.dll呼出規約winapi対応OSWindows 2000 以降

シグネチャ

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

BOOL InitAtomTable(
    DWORD nSize
);

パラメーター

名前方向
nSizeDWORDin

戻り値の型: BOOL

各言語での呼び出し定義

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

BOOL InitAtomTable(
    DWORD nSize
);
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("KERNEL32.dll", ExactSpelling = true)]
static extern bool InitAtomTable(
    uint nSize   // DWORD
);
<DllImport("KERNEL32.dll", ExactSpelling:=True)>
Public Shared Function InitAtomTable(
    nSize As UInteger   ' DWORD
) As Boolean
End Function
' nSize : DWORD
Declare PtrSafe Function InitAtomTable Lib "kernel32" ( _
    ByVal nSize As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

InitAtomTable = ctypes.windll.kernel32.InitAtomTable
InitAtomTable.restype = wintypes.BOOL
InitAtomTable.argtypes = [
    wintypes.DWORD,  # nSize : DWORD
]
require 'fiddle'
require 'fiddle/import'

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

var (
	kernel32 = windows.NewLazySystemDLL("KERNEL32.dll")
	procInitAtomTable = kernel32.NewProc("InitAtomTable")
)

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