Changeset 628 for trunk/ab5.0


Ignore:
Timestamp:
Sep 21, 2008, 2:01:36 AM (16 years ago)
Author:
イグトランス (egtra)
Message:

winnls.ab, winsvc.abを追加

Location:
trunk/ab5.0/ablib/src
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/ab5.0/ablib/src/api_system.sbp

    r599 r628  
    33#ifdef UNICODE
    44Const _FuncName_AddAtom = "AddAtomW"
    5 Const _FuncName_CompareString = "CompareStringW"
    65Const _FuncName_CopyFile = "CopyFileW"
    76Const _FuncName_CreateDirectory = "CreateDirectoryW"
     
    2827Const _FuncName_GetComputerName = "GetComputerNameW"
    2928Const _FuncName_GetCurrentDirectory = "GetCurrentDirectoryW"
    30 Const _FuncName_GetDateFormat = "GetDateFormatW"
    3129Const _FuncName_GetDiskFreeSpace = "GetDiskFreeSpaceW"
    3230Const _FuncName_GetDiskFreeSpaceEx = "GetDiskFreeSpaceExW"
     
    5048Const _FuncName_GetTempFileName = "GetTempFileNameW"
    5149Const _FuncName_GetTempPath = "GetTempPathW"
    52 Const _FuncName_GetTimeFormat = "GetTimeFormatW"
    5350Const _FuncName_GetUserName = "GetUserNameW"
    5451Const _FuncName_GetVersionEx = "GetVersionExW"
    5552Const _FuncName_GetWindowsDirectory = "GetWindowsDirectoryW"
    56 Const _FuncName_LCMapString = "LCMapStringW"
    5753Const _FuncName_LoadLibrary = "LoadLibraryW"
    5854Const _FuncName_LoadLibraryEx = "LoadLibraryExW"
     
    7672#else
    7773Const _FuncName_AddAtom = "AddAtomA"
    78 Const _FuncName_CompareString = "CompareStringA"
    7974Const _FuncName_CopyFile = "CopyFileA"
    8075Const _FuncName_CreateDirectory = "CreateDirectoryA"
     
    105100Const _FuncName_GetComputerName = "GetComputerNameA"
    106101Const _FuncName_GetCurrentDirectory = "GetCurrentDirectoryA"
    107 Const _FuncName_GetDateFormat = "GetDateFormatA"
    108102Const _FuncName_GetDiskFreeSpace = "GetDiskFreeSpaceA"
    109103Const _FuncName_GetDiskFreeSpaceEx = "GetDiskFreeSpaceExA"
     
    123117Const _FuncName_GetTempFileName = "GetTempFileNameA"
    124118Const _FuncName_GetTempPath = "GetTempPathA"
    125 Const _FuncName_GetTimeFormat = "GetTimeFormatA"
    126119Const _FuncName_GetUserName = "GetUserNameA"
    127120Const _FuncName_GetVersionEx = "GetVersionExA"
    128121Const _FuncName_GetWindowsDirectory = "GetWindowsDirectoryA"
    129 Const _FuncName_LCMapString = "LCMapStringA"
    130122Const _FuncName_LoadLibrary = "LoadLibraryA"
    131123Const _FuncName_LoadLibraryEx = "LoadLibraryExA"
     
    207199Const GPTR =                GMEM_FIXED or GMEM_ZEROINIT
    208200Const GMEM_DISCARDED =      &H4000
    209 
    210 ' Locale flag
    211 Const LOCALE_NOUSEROVERRIDE = &H80000000
    212201
    213202'Critical Section
     
    272261#endif
    273262
    274 
    275263Declare Function Beep Lib "kernel32" (dwFreq As DWord, dwDuration As DWord) As BOOL
    276264Declare Function CloseHandle Lib "kernel32" (hObject As HANDLE) As BOOL
    277265
    278266Declare Function CompareFileTime Lib "kernel32" (ByRef FileTime1 As FILETIME, ByRef FileTime2 As FILETIME) As Long
    279 
    280 Const NORM_IGNORECASE =     &H00000001
    281 Const NORM_IGNORENONSPACE = &H00000002
    282 Const NORM_IGNORESYMBOLS =  &H00000004
    283 Const SORT_STRINGSORT =     &H00001000
    284 Const NORM_IGNOREKANATYPE = &H00010000
    285 Const NORM_IGNOREWIDTH =    &H00020000
    286 Const CSTR_LESS_THAN =    1
    287 Const CSTR_EQUAL =        2
    288 Const CSTR_GREATER_THAN = 3
    289 Declare Function CompareString Lib "kernel32" Alias _FuncName_CompareString (Locale As LCID, dwCmpFlags As DWord, pString1 As PCTSTR, cchCount1 As Long, pString2 As PCTSTR, cchCount2 As Long) As Long
    290267
    291268Declare Function CopyFile Lib "kernel32" Alias _FuncName_CopyFile (pExistingFileName As PCTSTR, pNewFileName As PCTSTR, bFailIfExists As BOOL) As BOOL
     
    294271Declare Function CreateMutex Lib "kernel32" Alias _FuncName_CreateMutex (lpMutexAttributes As *SECURITY_ATTRIBUTES, bInitialOwner As BOOL, lpName As PCTSTR) As HANDLE
    295272Declare Function CreatePipe Lib "Kernel32" (
    296     ByRef hReadPipe As HANDLE,
    297     ByRef hWritePipe As HANDLE,
    298     ByVal pPipeAttributes As *SECURITY_ATTRIBUTES,
    299     ByVal nSize As DWord) As Long
     273    ByRef hReadPipe As HANDLE,
     274    ByRef hWritePipe As HANDLE,
     275    ByVal pPipeAttributes As *SECURITY_ATTRIBUTES,
     276    ByVal nSize As DWord) As Long
    300277Declare Function CreateSemaphore Lib "kernel32" Alias _FuncName_CreateSemaphore (pSemaphoreAttributes As *SECURITY_ATTRIBUTES, lInitialCount As Long, lMaximumCount As Long, pName As PCTSTR) As HANDLE
    301278
     
    517494Declare Function GetCurrentThreadId Lib "kernel32" () As DWord
    518495
    519 Const DATE_SHORTDATE =        &H00000001
    520 Const DATE_LONGDATE =         &H00000002
    521 Const DATE_USE_ALT_CALENDAR = &H00000004
    522 Declare Function GetDateFormat Lib "kernel32" Alias _FuncName_GetDateFormat (Locale As LCID, dwFlags As DWord, ByRef Date As SYSTEMTIME, pFormat As PCTSTR, pDateStr As PTSTR, cchDate As Long) As Long
    523 
    524496Declare Function GetDiskFreeSpace Lib "kernel32" Alias _FuncName_GetDiskFreeSpace (pRootPathName As PCTSTR, lpSectorsPerCluster As *DWord, pBytesPerSector As *DWord, pNumberOfFreeClusters As *DWord, pTotalNumberOfClusters As *DWord) As BOOL
    525497Declare Function GetDiskFreeSpaceEx Lib "kernel32" Alias _FuncName_GetDiskFreeSpaceEx (pDirectoryName As PCTSTR, ByRef lpFreeBytesAvailableToCaller As ULARGE_INTEGER, ByRef TotalNumberOfBytes As ULARGE_INTEGER, ByRef TotalNumberOfFreeBytes As ULARGE_INTEGER) As BOOL
     
    656628Declare Function GetTickCount Lib "kernel32" () As DWord
    657629
    658 Const TIME_NOMINUTESORSECONDS  = &H00000001
    659 Const TIME_NOSECONDS           = &H00000002
    660 Const TIME_NOTIMEMARKER        = &H00000004
    661 Const TIME_FORCE24HOURFORMAT   = &H00000008
    662 Declare 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
    663 Declare Function GetUserDefaultLCID Lib "kernel32" () As LCID
    664630Declare Function GetUserName Lib "advapi32" Alias _FuncName_GetUserName (pBuffer As PTSTR, ByRef nSize As DWord) As BOOL
    665631Declare Function GetVersionEx Lib "kernel32" Alias _FuncName_GetVersionEx (ByRef VersionInformation As OSVERSIONINFO) As BOOL
     
    696662Declare Function IsBadReadPtr Lib "kernel32" (lp As VoidPtr, ucb As ULONG_PTR) As BOOL
    697663Declare Function IsBadWritePtr Lib "kernel32" (lp As VoidPtr, ucb As ULONG_PTR) As BOOL
    698 Declare Function IsDBCSLeadByte Lib "kernel32" (TestChar As Byte) As BOOL
    699664
    700665#ifdef _WIN64
    701666Declare Function IsWow64Process Lib "kernel32" (hProcess As HANDLE, ByRef bWow64Process As BOOL) As BOOL
    702667#endif
    703 
    704 Const LCMAP_LOWERCASE           = &H00000100  ' lower case letters
    705 Const LCMAP_UPPERCASE           = &H00000200  ' upper case letters
    706 Const LCMAP_SORTKEY             = &H00000400  ' WC sort key (normalize)
    707 Const LCMAP_BYTEREV             = &H00000800  ' byte reversal
    708 Const LCMAP_HIRAGANA            = &H00100000  ' map katakana to hiragana
    709 Const LCMAP_KATAKANA            = &H00200000  ' map hiragana to katakana
    710 Const LCMAP_HALFWIDTH           = &H00400000  ' map double byte to single byte
    711 Const LCMAP_FULLWIDTH           = &H00800000  ' map single byte to double byte
    712 Const LCMAP_LINGUISTIC_CASING   = &H01000000  ' use linguistic rules for casing
    713 Const LCMAP_SIMPLIFIED_CHINESE  = &H02000000  ' map traditional chinese to simplified chinese
    714 Const LCMAP_TRADITIONAL_CHINESE = &H04000000  ' map simplified chinese to traditional chinese
    715 Declare Function LCMapString Lib "kernel32" Alias _FuncName_LCMapString (Locale As LCID, dwMapFlags As DWord, lpSrcStr As LPCTSTR, cchSrc As Long, lpDestStr As LPTSTR, cchDest As Long) As Long
    716668
    717669Declare Sub LeaveCriticalSection Lib "kernel32" (ByRef lpCriticalSection As CRITICAL_SECTION)
     
    755707) As Long
    756708
    757 Const CP_ACP        = 0      'default to ANSI code page
    758 Const CP_OEMCP      = 1      'default to OEM  code page
    759 Const CP_MACCP      = 2      'default to MAC  code page
    760 Const CP_THREAD_ACP = 3      'current thread's ANSI code page
    761 Const CP_SYMBOL     = 42     'SYMBOL translations
    762 Const CP_UTF7       = 65000  'UTF-7 translation
    763 Const CP_UTF8       = 65001  'UTF-8 translation
    764 
    765 Declare Function MultiByteToWideChar Lib "kernel32" (CodePage As DWord, dwFlags As DWord, pMultiByteStr As PCSTR, cchMultiByte As Long, pWideCharStr As PWSTR, cchWideChar As Long) As Long
    766709Declare Function OpenEvent Lib "kernel32" Alias _FuncName_OpenEvent (dwDesiredAccess As DWord, bInheritHandle As BOOL, lpName As LPCTSTR) As HANDLE
    767710Declare Function OpenMutex Lib "kernel32" Alias _FuncName_OpenMutex (dwDesiredAccess As DWord, bInheritHandle As BOOL, lpName As LPCTSTR) As HANDLE
     
    831774Declare Function TerminateProcess Lib "kernel32" (hProcess As HANDLE, dwExitCode As DWord) As BOOL
    832775Declare Function TerminateThread Lib "kernel32" (hThread As HANDLE, dwExitCode As DWord) As BOOL
     776
     777Const TLS_OUT_OF_INDEXES = &hffffffff As DWord
    833778Declare Function TlsAlloc Lib "kernel32" () As DWord
    834779Declare Function TlsFree Lib "kernel32" (dwTlsIndex As DWord) As BOOL
     
    870815Declare Function WaitForSingleObjectEx Lib "kernel32" (hHandle As HANDLE, dwMilliseconds As DWord, bAlertable As BOOL) As DWord
    871816
    872 Const WC_COMPOSITECHECK    = &H00000200
    873 Const WC_DISCARDNS         = &H00000010
    874 Const WC_SEPCHARS          = &H00000020
    875 Const WC_DEFAULTCHAR       = &H00000040
    876 Const WC_NO_BEST_FIT_CHARS = &H00000400
    877 Declare Function WideCharToMultiByte Lib "Kernel32" (
    878     CodePage As DWord,
    879     dwFlags As DWord,
    880     pWideCharStr As PCWSTR,
    881     cchWideChar As Long,
    882     pMultiByteStr As PSTR,
    883     cbMultiByte As Long,
    884     pDefaultChar As PCSTR,
    885     pUsedDefaultChar As *BOOL
    886 ) As Long
    887 
    888817Declare Function WriteFile Lib "kernel32" (hFile As HANDLE, lpBuffer As VoidPtr, nNumberOfBytesToWrite As DWord, lpNumberOfBytesWritten As *DWord, ByRef pOverlapped As OVERLAPPED) As BOOL
    889818Declare Sub ZeroMemory Lib "kernel32" Alias "RtlZeroMemory" (Destination As VoidPtr, dwLength As DWord)
  • trunk/ab5.0/ablib/src/basic/command.sbp

    r497 r628  
    5959
    6060Macro MSGBOX(hwnd As HWND, str As String)(title As String, boxType As DWord, ByRef retAns As DWord)
    61 '   Dim ret = MessageBox(hwnd, ToTCStr(str), ToTCStr(title), boxType)
    62 '   If VarPtr(retAns) Then
    63 '       retAns = ret
    64 '   End If
     61    Dim ret = MessageBox(hwnd, ToTCStr(str), ToTCStr(title), boxType)
     62    If VarPtr(retAns) Then
     63        retAns = ret
     64    End If
    6565End Macro
    6666
     
    136136Macro CLOSE()(FileNumber As Long)
    137137    FileNumber--
     138    ActiveBasic.Detail.ThrowIfInvaildFileNum(FileNumber)
    138139
    139140    If _System_hFile(FileNumber) Then
     
    148149Sub INPUT_FromFile(FileNumber As Long)
    149150    FileNumber--
     151    ActiveBasic.Detail.ThrowIfInvaildFileNum(FileNumber)
    150152
    151153    Dim i = 0 As Long
     
    238240    Dim dwAccessByte As DWord
    239241    FileNumber--
     242    ActiveBasic.Detail.ThrowIfInvaildFileNum(FileNumber)
    240243
    241244    WriteFile(_System_hFile(FileNumber), StrPtr(buf), Len(buf), VarPtr(dwAccessByte), ByVal 0)
     
    404407Macro FIELD(FileNumber As Long, FieldSize As Long)
    405408    FileNumber--
     409    ActiveBasic.Detail.ThrowIfInvaildFileNum(FileNumber)
    406410    _System_FieldSize(FileNumber)=FieldSize
    407411End Macro
     
    410414
    411415    FileNumber--
     416    ActiveBasic.Detail.ThrowIfInvaildFileNum(FileNumber)
    412417    RecodeNumber--
    413418
     
    425430
    426431    FileNumber--
     432    ActiveBasic.Detail.ThrowIfInvaildFileNum(FileNumber)
    427433    RecodeNumber--
    428434
  • trunk/ab5.0/ablib/src/basic/function.sbp

    r589 r628  
    123123*/
    124124Function Sgn(n As Double) As Long
    125 '   Sgn = ActiveBasic..Math.Sign(n)
     125'   Sgn = ActiveBasic.Math.Sign(n)
    126126End Function
    127127
     
    205205        Return New String(t, 2)
    206206    Else
    207         Throw New System.ArgumentOutOfRangeException("ChrW: c is invalid Unicode code point.", "c")
     207        Throw New System.ArgumentOutOfRangeException("ChrW: c is invalid unicode code point.", "c")
    208208    End If
    209209End Function
     
    665665Function Eof(FileNum As Long) As Long
    666666    FileNum--
     667    ActiveBasic.Detail.ThrowIfInvaildFileNum(FileNum)
    667668    Dim dwCurrent = SetFilePointer(_System_hFile(FileNum), 0,NULL, FILE_CURRENT)
    668669    Dim dwEnd = SetFilePointer(_System_hFile(FileNum), 0, NULL, FILE_END)
     
    677678
    678679Function Lof(FileNum As Long) As Long
    679     Lof = GetFileSize(_System_hFile(FileNum-1), 0)
     680    FileNum--
     681    ActiveBasic.Detail.ThrowIfInvaildFileNum(FileNum)
     682    Lof = GetFileSize(_System_hFile(FileNum), 0)
    680683End Function
    681684
    682685Function Loc(FileNum As Long) As Long
    683686    FileNum--
    684 
     687    ActiveBasic.Detail.ThrowIfInvaildFileNum(FileNum)
    685688    Dim NowPos = SetFilePointer(_System_hFile(FileNum), 0, 0, FILE_CURRENT)
    686689    Dim BeginPos = SetFilePointer(_System_hFile(FileNum), 0, 0, FILE_BEGIN)
     
    690693End Function
    691694
     695Namespace ActiveBasic
     696Namespace Detail
     697
     698Sub ThrowIfInvaildFileNum(n As Long)
     699    If n < 0 Or n > 255 Then
     700        Throw New System.ArgumentOutOfRangeException("FileNum", "Invalid file number")
     701    ElseIf _System_hFile(n) = 0 Then
     702        Throw New System.InvalidOperationException("File number " & Str$(n + 1) & "is not opend.")
     703    End If
     704End Sub
     705
     706End Namespace
     707End Namespace
    692708
    693709'------------------
  • trunk/ab5.0/ablib/src/windows.sbp

    r575 r628  
    44TypeDef LPOLESTR = *OLECHAR
    55TypeDef LPCOLESTR = *OLECHAR
    6 
    7 TypeDef LANGID = Word
    8 TypeDef LCID = DWord
    9 TypeDef LCTYPE = DWord
    10 TypeDef LGRPID = DWord
    116
    127TypeDef PROPID = DWord
     
    1712#require <api_gdi.sbp>
    1813#require <api_window.sbp>
     14#require <winnls.ab>
    1915#require <api_shell.sbp>
    2016#require <api_msg.sbp>
     
    2622
    2723#require <api_mmsys.sbp>
     24#require <api_commdlg.sbp>
    2825#require <ole2.ab>
    29 #require <api_commdlg.sbp>
    30 
     26#require <winsvc.ab>
    3127#require <api_imm.sbp>
    3228
Note: See TracChangeset for help on using the changeset viewer.