Changeset 160 for Include/api_system.sbp


Ignore:
Timestamp:
Mar 13, 2007, 1:13:06 AM (17 years ago)
Author:
イグトランス (egtra)
Message:

API宣言の追加(主にフォーラムに投稿されたものより)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Include/api_system.sbp

    r142 r160  
    1818Const _FuncName_CreateProcess = "CreateProcessW"
    1919Const _FuncName_DeleteFile = "DeleteFileW"
     20Const _FuncName_ExpandEnvironmentStrings = "ExpandEnvironmentStringsW"
    2021Const _FuncName_FatalAppExit = "FatalAppExitW"
    2122Const _FuncName_FindFirstChangeNotification = "FindFirstChangeNotificationW"
    2223Const _FuncName_FindFirstFile = "FindFirstFileW"
    2324Const _FuncName_FindNextFile = "FindNextFileW"
     25Const _FuncName_FindResource = "FindResourceW"
    2426Const _FuncName_FormatMessage = "FormatMessageW"
    2527Const _FuncName_FreeEnvironmentStrings = "FreeEnvironmentStringsW"
     
    3739Const _FuncName_GetFullPathName = "GetFullPathNameW"
    3840Const _FuncName_GetLogicalDriveStrings = "GetLogicalDriveStringsW"
     41Const _FuncName_GetLongPathName = "GetLongPathNameW"
    3942Const _FuncName_GetModuleFileName = "GetModuleFileNameW"
    4043Const _FuncName_GetModuleHandle = "GetModuleHandleW"
     
    5154Const _FuncName_LoadLibrary = "LoadLibraryW"
    5255Const _FuncName_LoadLibraryEx = "LoadLibraryExW"
     56Const _FuncName_LookupPrivilegeValue = "LookupPrivilegeValueW"
    5357Const _FuncName_lstrcat = "lstrcatW"
    5458Const _FuncName_lstrcmp = "lstrcmpW"
    5559Const _FuncName_lstrcmpi = "lstrcmpiW"
    5660Const _FuncName_lstrcpy = "lstrcpyW"
     61Const _FuncName_lstrcpyn = "lstrcpynW"
    5762Const _FuncName_MoveFile = "MoveFileW"
    5863Const _FuncName_OpenEvent = "OpenEventW"
     
    8085Const _FuncName_CreateProcess = "CreateProcessA"
    8186Const _FuncName_DeleteFile = "DeleteFileA"
     87Const _FuncName_ExpandEnvironmentStrings = "ExpandEnvironmentStringsA"
    8288Const _FuncName_FatalAppExit = "FatalAppExitA"
    8389Const _FuncName_FindFirstChangeNotification = "FindFirstChangeNotificationA"
    8490Const _FuncName_FindFirstFile = "FindFirstFileA"
    8591Const _FuncName_FindNextFile = "FindNextFileA"
     92Const _FuncName_FindResource = "FindResourceA"
    8693Const _FuncName_FormatMessage = "FormatMessageA"
    8794Const _FuncName_FreeEnvironmentStrings = "FreeEnvironmentStringsA"
     
    99106Const _FuncName_GetFullPathName = "GetFullPathNameA"
    100107Const _FuncName_GetLogicalDriveStrings = "GetLogicalDriveStringsA"
     108Const _FuncName_GetLongPathName = "GetLongPathNameA"
    101109Const _FuncName_GetModuleFileName = "GetModuleFileNameA"
    102110Const _FuncName_GetModuleHandle = "GetModuleHandleA"
     
    113121Const _FuncName_LoadLibrary = "LoadLibraryA"
    114122Const _FuncName_LoadLibraryEx = "LoadLibraryExA"
     123Const _FuncName_LookupPrivilegeValue = "LookupPrivilegeValueA"
    115124Const _FuncName_lstrcat = "lstrcatA"
    116125Const _FuncName_lstrcmp = "lstrcmpA"
    117126Const _FuncName_lstrcmpi = "lstrcmpiA"
    118127Const _FuncName_lstrcpy = "lstrcpyA"
     128Const _FuncName_lstrcpyn = "lstrcpynA"
    119129Const _FuncName_MoveFile = "MoveFileA"
    120130Const _FuncName_OpenEvent = "OpenEventA"
     
    483493Declare Function CreateEvent Lib "kernel32" Alias _FuncName_CreateEvent (pEventAttributes As *SECURITY_ATTRIBUTES, bManualReset As BOOL, bInitialState As BOOL, pName As PCTSTR) As HANDLE
    484494Declare Function CreateMutex Lib "kernel32" Alias _FuncName_CreateMutex (lpMutexAttributes As *SECURITY_ATTRIBUTES, bInitialOwner As BOOL, lpName As PCTSTR) As HANDLE
     495Declare Function CreatePipe Lib "Kernel32" (
     496    ByRef hReadPipe As HANDLE,
     497    ByRef hWritePipe As HANDLE,
     498    ByVal pPipeAttributes As *SECURITY_ATTRIBUTES,
     499    ByVal nSize As DWORD) As Long
    485500Declare Function CreateSemaphore Lib "kernel32" Alias _FuncName_CreateSemaphore (pSemaphoreAttributes As *SECURITY_ATTRIBUTES, lInitialCount As Long, lMaximumCount As Long, pName As PCTSTR) As HANDLE
    486501
     
    646661) As Long
    647662Declare Function DisableThreadLibraryCalls Lib "kernel32" (hLibModule As HINSTANCE) As BOOL
    648 Declare Function DosDateTimeToFileTime Lib "kernel32" (wFatDate As Word, wFatTime As Word, ByRef lpFileTime As FILETIME) As BOOL
     663Declare Function DosDateTimeToFileTime Lib "kernel32" (wFatDate As Word, wFatTime As Word, ByRef FileTime As FILETIME) As BOOL
    649664
    650665Const DUPLICATE_CLOSE_SOURCE = 1
     
    788803Declare Function GetLogicalDrives Lib "kernel32" () As DWord
    789804Declare Function GetLogicalDriveStrings Lib "kernel32" Alias _FuncName_GetLogicalDriveStrings (nBufferLength As DWord, pBuffer As PTSTR) As DWord
     805Declare Function GetLongPathName Lib "kernel32" Alias _FuncName_GetLongPathName (lpszShortPath As LPCTSTR, lpszLongPath As LPTSTR, cchBuffer As DWord) As DWord
    790806Declare Function GetModuleFileName Lib "kernel32" Alias _FuncName_GetModuleFileName (hModule As HINSTANCE, lpFileName As PTSTR, nSize As DWord) As DWord
    791807Declare Function GetModuleHandle Lib "kernel32" Alias _FuncName_GetModuleHandle (lpModuleName As PTSTR) As HINSTANCE
     
    796812    bWait As BOOL
    797813) As BOOL
     814Type SYSTEM_POWER_STATUS
     815    ACLineStatus As Byte
     816    BatteryFlag As Byte
     817    BatteryLifePercent As Byte
     818    Reserved1 As Byte
     819    BatteryLifeTime As Long
     820    BatteryFullLifeTime As Long
     821End Type
     822Declare Function GetSystemPowerStatus Lib "kernel32" (ByRef SystemPowerStatus As SYSTEM_POWER_STATUS) As Long
    798823Declare Function GetPriorityClass Lib "kernel32" (hProcess As HANDLE) As DWord
    799824Declare Function GetProcAddress Lib "kernel32" (hModule As HINSTANCE, pProcName As PCSTR) As DWord
     
    868893Const TIME_FORCE24HOURFORMAT   = &H00000008
    869894Declare Function GetTimeFormat Lib "kernel32" Alias _FuncName_GetTimeFormat (Locale As LCID, dwFlags As DWord, ByRef Time As SYSTEMTIME, lpFormat As PCTSTR, lpTimeStr As PTSTR, cchTime As DWord) As BOOL
    870 
    871895Declare Function GetUserDefaultLCID Lib "kernel32" () As LCID
    872896Declare Function GetUserName Lib "advapi32" Alias _FuncName_GetUserName (pBuffer As PTSTR, ByRef nSize As DWord) As BOOL
     
    967991Declare Function LoadLibraryEx Lib "kernel32" Alias _FuncName_LoadLibraryEx (pLibFileName As PCTSTR, hFile As HANDLE, dwFlags As DWord) As HINSTANCE
    968992
    969 Declare Function lstrcat Lib "kernel32" Alias _FuncName_lstrcat (pString1 As PTSTR, pString2 As PCTSTR) As PSTR
    970 Declare Function lstrcmp Lib "kernel32" Alias _FuncName_lstrcmp (pString1 As PCTSTR, pString2 As PCTSTR) As Long
    971 Declare Function lstrcmpi Lib "kernel32" Alias _FuncName_lstrcmpi (pString1 As PCTSTR, pString2 As PCTSTR) As Long
    972 Declare Function lstrcpy Lib "kernel32" Alias _FuncName_lstrcpy (pString1 As PTSTR, pString2 As PCTSTR) As PSTR
    973 Declare Function lstrlenA Lib "kernel32" (pString As PCSTR) As Long
    974 Declare Function lstrlenW Lib "kernel32" (pString As PCWSTR) As Long
     993Declare Function lstrcat Lib "kernel32" Alias _FuncName_lstrcat (lpString1 As LPTSTR, lpString2 As LPCTSTR) As LPTSTR
     994Declare Function lstrcmp Lib "kernel32" Alias _FuncName_lstrcmp (lpString1 As LPCTSTR, lpString2 As LPCTSTR) As Long
     995Declare Function lstrcmpi Lib "kernel32" Alias _FuncName_lstrcmpi (lpString1 As LPCTSTR, lpString2 As LPCTSTR) As Long
     996Declare Function lstrcpy Lib "kernel32" Alias _FuncName_lstrcpy (lpString1 As LPTSTR, lpString2 As LPCTSTR) As LPTSTR
     997Declare Function lstrcpyn Lib "kernel32" Alias _FuncName_lstrcpyn (lpString1 As LPTSTR,ByVal lpString2 As LPCTSTR,ByVal iMaxLength As Long) As LPTSTR
     998Declare Function lstrlenA Lib "kernel32" (lpString As LPCSTR) As Long
     999Declare Function lstrlenW Lib "kernel32" (lpString As LPCWSTR) As Long
    9751000#ifdef UNICODE
    976 Declare Function lstrlen Lib "kernel32" Alias "lstrlenW" (pString As PCWSTR) As Long
     1001Declare Function lstrlen Lib "kernel32" Alias "lstrlenW" (lpString As LPCWSTR) As Long
    9771002#else
    978 Declare Function lstrlen Lib "kernel32" Alias "lstrlenA" (pString As PCSTR) As Long
     1003Declare Function lstrlen Lib "kernel32" Alias "lstrlenA" (lpString As LPCSTR) As Long
    9791004#endif
    9801005Declare Sub memcpy Lib "kernel32" Alias "RtlMoveMemory" (pDest As VoidPtr, pSrc As VoidPtr, length As SIZE_T)
    9811006Declare Function MoveFile Lib "kernel32" Alias _FuncName_MoveFile (lpExistingFileName As LPCTSTR, lpNewFileName As LPCTSTR) As BOOL
    982 Declare Sub MoveMemory Lib "kernel32" Alias "RtlMoveMemory" (pDest As VoidPtr, pSrc As VoidPtr, length As SIZE_T)
     1007Declare Sub MoveMemory Lib "kernel32" Alias "RtlMoveMemory" (pDest As PVOID, pSrc As VoidPtr, length As SIZE_T)
    9831008
    9841009Declare Function MulDiv Lib "kernel32" (
     
    10301055    pArguments As *ULONG_PTR)
    10311056Declare Function ReadFile Lib "kernel32" (hFile As HANDLE, lpBuffer As VoidPtr, nNumberOfBytesToRead As DWord, lpNumberOfBytesRead As DWordPtr, ByRef lpOverlapped As OVERLAPPED) As BOOL
     1057Declare Function ReadProcessMemory Lib "Kernel32"  (hProcess As HANDLE, lpBaseAddress As VoidPtr, lpBuffer As VoidPtr, nSize As SIZE_T, lpNumberOfBytesRead As *SIZE_T) As BOOL
    10321058Declare Function ReleaseMutex Lib "kernel32" (hMutex As HANDLE) As BOOL
    10331059Declare Function ReleaseSemaphore Lib "kernel32" (hSemaphore As HANDLE, lReleaseCount As Long, ByRef lpPreviousCount As Long) As BOOL
     
    10661092) As BOOL
    10671093
    1068 Const EXCEPTION_MAXIMUM_PARAMETERS = ELM(15)
     1094Const EXCEPTION_MAXIMUM_PARAMETERS = 15
    10691095
    10701096Type EXCEPTION_RECORD
     
    10741100    ExceptionAddress As VoidPtr
    10751101    NumberParameters As DWord
    1076     ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS] As ULONG_PTR
     1102    ExceptionInformation[ELM(EXCEPTION_MAXIMUM_PARAMETERS)] As ULONG_PTR
    10771103End Type
    10781104
     
    14161442Const WAIT_IO_COMPLETION = &h000000C0 'STATUS_USER_APC
    14171443
     1444Declare Function FindResource Lib "kernel32" Alias _FuncName_FindResource (hInstance As HINSTANCE, lpName As LPCTSTR, lpType As LPCTSTR) As HRSRC
     1445Declare Function LoadResource Lib "kernel32" (hModule As HMODULE, hResInfo As HRSRC) As HGLOBAL
     1446Declare Function FreeResource Lib "kernel32" (hResData As HGLOBAL) As BOOL
     1447Declare Function LockResource Lib "kernel32" (hResData As HGLOBAL) As VoidPtr
     1448Declare Function SizeofResource Lib "kernel32" (hModule As HANDLE, hResInfo As HRSRC) As DWord
     1449
     1450Declare Function ExpandEnvironmentStrings Lib "kernel32" Alias _FuncName_ExpandEnvironmentStrings (lpSrc As LPCTSTR, lpDst As LPTSTR, nSize As DWord) As DWord
     1451
     1452Type DCB
     1453    DCBlength As DWord
     1454    BaudRate As DWord
     1455    fBitFields As DWord
     1456    wReserved As Word
     1457    XonLim As Word
     1458    XoffLim As Word
     1459    ByteSize As Byte
     1460    Parity As Byte
     1461    StopBits As Byte
     1462    XonChar As CHAR
     1463    XoffChar As CHAR
     1464    ErrorChar As CHAR
     1465    EofChar As CHAR
     1466    EvtChar As CHAR
     1467    wReserved1 As Word
     1468End Type
     1469
     1470Type COMMTIMEOUTS
     1471    ReadIntervalTimeout As DWord
     1472    ReadTotalTimeoutMultiplier As DWord
     1473    ReadTotalTimeoutConstant As DWord
     1474    WriteTotalTimeoutMultiplier As DWord
     1475    WriteTotalTimeoutConstant As DWord
     1476End Type
     1477Type COMSTAT
     1478 fCoBitFlds As Long 'See Comment in Win32API.Txt
     1479 cbInQue As DWord
     1480 cbOutQue As DWord
     1481End Type
     1482Declare Function SetCommState Lib "kernel32" (hCommDev As HANDLE, ByRef dcb As DCB) As BOOL
     1483Declare Function SetCommTimeouts Lib "kernel32" (hFile As HANDLE ,ByRef pCommTimeouts As COMMTIMEOUTS) As BOOL
     1484Declare Function ClearCommError Lib "kernel32" (hCommDevs As HANDLE, ByRef Errors As DWord, ByRef Stat As COMSTAT) As BOOL
     1485Declare Function EscapeCommFunction Lib "kernel32" (nCid As HANDLE, ByVal nFunc As DWord) As BOOL
     1486Declare Function GetCommModemStatus Lib "kernel32" (hFile As HANDLE, ByRef ModemStat As DWord) As BOOL
     1487Declare Function SetCommMask Lib "kernel32" (hFile As HANDLE, dwEvtMask As DWord) As BOOL
     1488Declare Function WaitCommEvent Lib "kernel32" (hFile As HANDLE, ByRef EvtMask As DWord, lpOverlapped As *OVERLAPPED)  As BOOL
     1489
     1490Const ANYSIZE_ARRAY = 1
     1491Type LUID
     1492    LowPart As DWord
     1493    HighPart As Long
     1494End Type
     1495Type LUID_AND_ATTRIBUTES
     1496    Luid As LUID
     1497    Attributes As DWord
     1498End Type
     1499TypeDef PLUID_AND_ATTRIBUTES = *LUID_AND_ATTRIBUTES
     1500'TypeDef LUID_AND_ATTRIBUTES_ARRAY = LUID_AND_ATTRIBUTES[ANYSIZE_ARRAY]
     1501'TypeDef PLUID_AND_ATTRIBUTES_ARRAY = *LUID_AND_ATTRIBUTES_ARRAY
     1502
     1503Type TOKEN_PRIVILEGES
     1504    PrivilegeCount As DWord
     1505    Privileges[ELM(ANYSIZE_ARRAY)] As LUID_AND_ATTRIBUTES
     1506End Type
     1507
     1508Declare Function OpenProcessToken Lib "advapi32" (ProcessHandle As HANDLE, DesiredAccess As DWord, ByRef TokenHandle As HANDLE) As BOOL
     1509Declare Function LookupPrivilegeValue Lib "advapi32" Alias _FuncName_LookupPrivilegeValue (lpSystemName As LPCTSTR, lpName As LPCTSTR, ByRef Luid As LUID) As Long
     1510Declare Function AdjustTokenPrivileges Lib "advapi32" (TokenHandle As Long, DisableAllPrivileges As Long,_
     1511    ByRef NewState As TOKEN_PRIVILEGES, BufferLength As Long,
     1512    ByRef PreviousState As TOKEN_PRIVILEGES, ByRef ReturnLength As Long) As Long
     1513
    14181514#endif '_INC_SYSTEM
Note: See TracChangeset for help on using the changeset viewer.