Changeset 175
- Timestamp:
- Mar 21, 2007, 7:06:34 PM (18 years ago)
- Location:
- Include
- Files:
-
- 2 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
Include/Classes/System/OperatingSystem.ab
r173 r175 1 1 ' System/OperatingSystem.ab 2 3 #ifndef _SYSYTEM_OPERATINGSYSTEM_AB_ 4 #define _SYSYTEM_OPERATINGSYSTEM_AB_ 2 5 3 6 #require <Classes/System/Version.ab> … … 79 82 Unix = 4 80 83 End Enum 84 85 #endif '_SYSYTEM_OPERATINGSYSTEM_AB_ -
Include/Classes/System/String.ab
r143 r175 233 233 End Sub 234 234 235 Sub AssignFromStrChar(text As *StrChar, textLength As Long) 236 If text = Chars Then Exit Sub 237 If AllocStringBuffer(textLength) <> 0 Then 238 memcpy(Chars, text, SizeOf (StrChar) * textLength) 239 Chars[m_Length] = 0 240 End If 241 End Sub 242 #ifdef __STRCHAR_IS_NOT_UNICODE 243 Sub AssignFromWideChar(text As PCWSTR, textLengthW As Long) 235 Sub Assign(text As PCSTR, textLengthA As Long) 236 #ifdef __STRING_IS_NOT_UNICODE 237 AssignFromStrChar(text, textLengthA) 238 #else 239 Dim textLengthW = MultiByteToWideChar(CP_THREAD_ACP, 0, text, textLengthA, 0, 0) 240 If AllocStringBuffer(textLengthW) <> 0 Then 241 MultiByteToWideChar(CP_THREAD_ACP, 0, text, textLengthA, Chars, textLengthW) 242 End If 243 #endif 244 End Sub 245 246 Sub Assign(text As PCWSTR, textLengthW As Long) 247 #ifdef __STRING_IS_NOT_UNICODE 244 248 Dim textLengthA = WideCharToMultiByte(CP_THREAD_ACP, 0, text, textLengthW, 0, 0, 0, 0) 245 249 If AllocStringBuffer(textLengthA) <> 0 Then 246 250 WideCharToMultiByte(CP_THREAD_ACP, 0, text, textLengthW, Chars, textLengthA, 0, 0) 247 251 End If 248 End Sub249 252 #else 250 Sub AssignFromMultiByte(text As PCSTR, textLengthA As Long) 251 Dim textLengthW = MultiByteToWideChar(CP_THREAD_ACP, 0, text, textLengthA, 0, 0) 252 If AllocStringBuffer(textLengthW) <> 0 Then 253 MultiByteToWideChar(CP_THREAD_ACP, 0, text, textLengthA, Chars, textLengthW) 254 End If 255 End Sub 256 #endif 257 Sub Assign(text As PCSTR, textLength As Long) 258 #ifdef __STRING_IS_NOT_UNICODE 259 AssignFromStrChar(text, textLength) 260 #else 261 AssignFromMultiByte(text, textLength) 262 #endif 263 End Sub 264 265 Sub Assign(text As PCWSTR, textLength As Long) 266 #ifdef __STRING_IS_NOT_UNICODE 267 AssignFromWideChar(text, textLength) 268 #else 269 AssignFromStrChar(text, textLength) 253 AssignFromStrChar(text, textLengthW) 270 254 #endif 271 255 End Sub … … 571 555 Dim size = m_Length 572 556 #endif 573 Dim hash = 0 As DWord 574 Dim p = Chars As *Word 575 Dim i As Long 576 For i = 0 To ELM(size) 577 hash = ((hash << 16) + p[i]) Mod &h7fffffff 578 Next 579 Return hash As Long 557 Return _System_GetHashFromWordArray(Chars As *Word, size) 580 558 End Function 581 559 Private … … 617 595 End Function 618 596 597 Sub AssignFromStrChar(text As *StrChar, textLength As Long) 598 If text = Chars Then Exit Sub 599 If AllocStringBuffer(textLength) <> 0 Then 600 memcpy(Chars, text, SizeOf (StrChar) * textLength) 601 Chars[m_Length] = 0 602 End If 603 End Sub 619 604 End Class -
Include/Classes/System/Version.ab
r161 r175 1 1 ' System/Version.ab 2 3 #ifndef __SYSTEM_VERSION_AB__ 4 #define __SYSTEM_VERSION_AB__ 5 6 #require <api_winsock2.sbp> 2 7 3 8 Class Version … … 75 80 76 81 Override Function GetHashCode() As Long 77 Return htonl(major) Xor minor Xor build Xor htonl(rivision)82 Return _System_BSwap(major As DWord) Xor minor Xor build Xor _System_BSwap(rivision As DWord) 78 83 End Function 79 84 … … 143 148 rivision As Long 144 149 End Class 150 151 #endif '__SYSTEM_VERSION_AB__ -
Include/Classes/System/index.ab
r142 r175 1 #require "DateTime.ab"2 #require "Math.ab"3 #require "Object.ab"4 #require "String.ab"5 #require "TimeSpan.ab"6 #require "OperatingSystem.ab"7 #require "Version.ab"8 #require "Environment.ab"1 #require <Classes/System/DateTime.ab> 2 #require <Classes/System/Math.ab> 3 #require <Classes/System/Object.ab> 4 #require <Classes/System/String.ab. 5 #require <Classes/System/TimeSpan.ab> 6 #require <Classes/System/OperatingSystem.ab> 7 #require <Classes/System/Version.ab> 8 #require <Classes/System/Environment.ab> -
Include/basic/command.sbp
r173 r175 34 34 35 35 Macro END() 36 Dim exitCode = Environment.ExitCode 36 37 _System_EndProgram() 37 ExitProcess( Environment.ExitCode)38 ExitProcess(exitCode) 38 39 End Macro 39 40 -
Include/basic/function.sbp
r170 r175 1086 1086 End Function 1087 1087 1088 Function _System_HashFromPtr(p As VoidPtr) As Long 1089 #ifdef _WIN64 1090 Dim qw = p As QWord 1091 Return (HIDWORD(qw) Xor LODWORD(qw)) As Long 1092 #else 1093 Return p As Long 1094 #endif 1095 End Function 1096 1088 1097 '-------- 1089 1098 ' 文字列関数その2 … … 1183 1192 End Function 1184 1193 1194 Function _System_GetHashFromWordArray(p As *Word, n As SIZE_T) As Long 1195 Dim hash = 0 As DWord 1196 Dim i As Long 1197 For i = 0 To ELM(n) 1198 hash = ((hash << 16) + p[i]) Mod &h7fffffff 1199 Next 1200 _System_GetHashFromWordArray = hash As Long 1201 End Function 1202 1185 1203 #endif '_INC_FUNCTION -
Include/com/bstring.ab
r142 r175 66 66 Sub AssignFromBStr(bstr As BSTR) 67 67 Clear() 68 BString(bstr)68 String.Copy(bs, bstr) 69 69 End Sub 70 71 Const Function Copy() As BSTR 72 BString.Copy(Copy, bs) 73 End Function 70 74 71 75 Sub Clear() … … 78 82 Sub Attach(bstr As BSTR) 79 83 Clear() 80 bs = bstr84 BString.Move(bs, bstr) 81 85 End Sub 82 86 83 87 Function Detach() As BSTR 84 Detach = bs 85 bs = 0 88 BString.Move(Detach, bs) 86 89 End Function 87 90 … … 113 116 114 117 Override Function ToString() As String 115 Dim s As String(bs , Length)118 Dim s As String(bs As PCWSTR, Length As Long) 116 119 Return s 120 End Function 121 122 Override Function GetHashCode() As Long 123 Return _System_GetHashFromWordArray(bs, Length) 117 124 End Function 118 125 119 126 Private 120 127 bs As BSTR 128 129 Static Sub Copy(ByRef dst As BSTR, ByVal src As BSTR) 130 dst = SysAllocStringLen(src, SysStringLen(src)) 131 End Sub 132 133 Static Sub Move(ByRef dst As BSTR, ByRef src As BSTR) 134 dst = src 135 src = 0 136 End Sub 121 137 End Class 122 138 -
Include/objbase.sbp
r170 r175 60 60 Const STGM_PRIORITY = &h00040000 61 61 Const STGM_DELETEONRELEASE = &h04000000 62 '#if (WINVER >= 400)62 '#if (WINVER >= &h400) 63 63 Const STGM_NOSCRATCH = &h00100000 64 64 '#endif /* WINVER */ … … 69 69 70 70 Const STGM_NOSNAPSHOT = &h00200000 71 '#if (_WIN32_WINNT >= 0x0500)71 '#if (_WIN32_WINNT >= &h0500) 72 72 Const STGM_DIRECT_SWMR = &h00400000 73 73 '#endif … … 136 136 dwAuthnSvc As DWord 137 137 dwAuthzSvc As DWord 138 pwszServerPrincName As PWSTR138 pwszServerPrincName As LPWSTR 139 139 dwAuthnLevel As DWord 140 140 dwImpersonationLevel As DWord … … 144 144 Type COSERVERINFO 145 145 dwReserved1 As DWord 146 pwszName As PWSTR146 pwszName As LPWSTR 147 147 pAuthInfo As *COAUTHINFO 148 148 dwReserved2 As DWord … … 157 157 158 158 159 '#if (_WIN32_WINNT >= 0x0400 ) ||defined(_WIN32_DCOM)159 '#if (_WIN32_WINNT >= &h0400) Or defined(_WIN32_DCOM) 160 160 #ifdef _WIN32_DCOM 161 161 Const Enum COINIT 162 COINIT_MULTITHREADED = =&h0163 COINIT_APARTMENTTHREADED = =&h2164 COINIT_DISABLE_OLE1DDE = =&h4165 COINIT_SPEED_OVER_MEMORY = =&h8162 COINIT_MULTITHREADED = &h0 163 COINIT_APARTMENTTHREADED = &h2 164 COINIT_DISABLE_OLE1DDE = &h4 165 COINIT_SPEED_OVER_MEMORY = &h8 166 166 End Enum 167 167 Declare Function CoInitializeEx Lib "ole32" (pvReserved As VoidPtr, dwCoInit As DWord) As HRESULT … … 170 170 171 171 #ifdef __UNDECLARED__ 172 '#if (_WIN32_WINNT >= 0x0501)172 '#if (_WIN32_WINNT >= &h0501) 173 173 ' 注意:このcokkieは本来ULARGE_INTEGER型 174 174 'Declare Function CoRegisterInitializeSpy Lib "ole32" (pSpy As *IInitializeSpy, ByRef uliCokkie As QWord) As HRESULT … … 191 191 '#endif 192 192 193 '#if (_WIN32_WINNT >= 0x0500)193 '#if (_WIN32_WINNT >= &h0500) 194 194 195 195 Type SOleTlsDataPublic … … 258 258 Declare Sub CoFreeAllLibraries Lib "ole32" () 259 259 Declare Sub CoFreeUnusedLibraries Lib "ole32" () 260 '#if (_WIN32_WINNT >= 0x0501)260 '#if (_WIN32_WINNT >= &h0501) 261 261 Declare Sub CoFreeUnusedLibrariesEx Lib "ole32" (dwUnloadDelay As DWord, dwReserved As DWord) 262 262 '#endif 263 263 264 '#if (_WIN32_WINNT >= 0x0400 ) ||defined(_WIN32_DCOM) 'DCOM264 '#if (_WIN32_WINNT >= &h0400) Or defined(_WIN32_DCOM) 'DCOM 265 265 #ifdef _WIN32_DCOM 266 266 … … 329 329 Declare Function CoCreateInstance Lib "ole32" (ByRef clsid As CLSID, pUnknown As *IUnknown, dwClsContext As DWord, ByRef refiid As IID, ByRef pObj As Any) As HRESULT 330 330 331 '#if (_WIN32_WINNT >= 0x0400 ) ||defined(_WIN32_DCOM) 'DCOM331 '#if (_WIN32_WINNT >= &h0400) Or defined(_WIN32_DCOM) 'DCOM 332 332 #ifdef _WIN32_DCOM 333 /* objidl.hでのMULTI_QIの宣言が必要。334 333 Declare Function CoGetInstanceFromFile Lib "ole32" ( 335 334 ByVal pServerInfo As *COSERVERINFO, … … 356 355 ByVal punkOuter As *IUnknown, 357 356 ByVal dwClsCtx As DWord, 358 ByVal pServerInfo As *COSERVERINFO,357 ByVal pServerInfo As COSERVERINFO, 359 358 ByVal dwCount As DWord, 360 359 ByVal pResults As *MULTI_QI) As HRESULT 361 */362 360 #endif ' DCOM 363 361 364 362 /* Call related APIs */ 365 '#if (_WIN32_WINNT >= 0x0400 ) ||defined(_WIN32_DCOM) 'DCOM363 '#if (_WIN32_WINNT >= &h0400) Or defined(_WIN32_DCOM) 'DCOM 366 364 #ifdef _WIN32_DCOM 367 365 … … 397 395 Declare Function CoRegisterMessageFilter Lib "ole32" (pMessageFilter As *IMessageFilter, ByRef pMessageFilter As *IMessageFilter) As HRESULT 398 396 399 '#if (_WIN32_WINNT >= 0x0400 ) ||defined(_WIN32_DCOM) 'DCOM397 '#if (_WIN32_WINNT >= &h0400) Or defined(_WIN32_DCOM) 'DCOM 400 398 #ifdef _WIN32_DCOM 401 399 Declare Function CoRegisterChannelHook Lib "ole32" (ByRef ExtensionUuid As GUID, pChannelHook As *IChannelHook) As HRESULT 402 400 #endif ' DCOM 403 401 404 '#if (_WIN32_WINNT >= 0x0400 ) ||defined(_WIN32_DCOM) 'DCOM402 '#if (_WIN32_WINNT >= &h0400) Or defined(_WIN32_DCOM) 'DCOM 405 403 #ifdef _WIN32_DCOM 406 404 … … 425 423 426 424 #ifdef __UNDECLARED__ 427 '#if (_WIN32_WINNT >= 0x0501)425 '#if (_WIN32_WINNT >= &h0501) 428 426 Declare Function CoInvalidateRemoteMachineBindings Lib "ole32" (pszMachineName As LPOLESTR) As HRESULT 429 427 #endif … … 519 517 /* 520 518 // STG initialization options for StgCreateStorageEx and StgOpenStorageEx 521 #if _WIN32_WINNT == 0x500519 #if _WIN32_WINNT == &h500 522 520 #define STGOPTIONS_VERSION 1 523 #elif _WIN32_WINNT > 0x500521 #elif _WIN32_WINNT > &h500 524 522 #define STGOPTIONS_VERSION 2 525 523 #else -
Include/objidl.sbp
r173 r175 25 25 ' IExternalCennection 26 26 27 ' IMultiQI 27 Type MULTI_QI 28 pIID As * /*Const*/ IID 29 pItf As *IUnknown 30 hr As HRESULT 31 End Type 32 33 Dim IID_IMultiQI = [&h00000020, &h0000, &h0000, [&hC0, &h00, &h00, &h00, &h00, &h00, &h00, &h46]] As IID 34 35 Interface IMultiQI 36 Inherits IUnknown 37 38 Function QueryMultipleInterfaces( 39 /* [in] */ cMQIs As DWord, 40 /* [out][in] */ pMQIs As *MULTI_QI) As HRESULT 41 End Interface 28 42 29 43 ' AsyncIMultiQI -
Include/system/string.sbp
r167 r175 28 28 Function GetStr(psz As PSTR, ByRef wcs As PWSTR) As SIZE_T 29 29 If psz <> 0 Then 30 Return GetStr(psz, lstrlenA(psz) , wcs)30 Return GetStr(psz, lstrlenA(psz) As SIZE_T, wcs) 31 31 Else 32 32 Return 0 … … 45 45 wcs = psz 46 46 If psz <> 0 Then 47 Return lstrlenW(psz) 47 Return lstrlenW(psz) As SIZE_T 48 48 Else 49 49 Return 0 … … 64 64 Return 0 65 65 Else 66 Return GetStr(psz, lstrlenW(psz) , mbs)66 Return GetStr(psz, lstrlenW(psz) As SIZE_T, mbs) 67 67 End If 68 68 End Function … … 79 79 mbs = psz 80 80 If psz <> 0 Then 81 Return lstrlenA(psz) 81 Return lstrlenA(psz) As SIZE_T 82 82 Else 83 83 Return 0 … … 199 199 200 200 Function ToWCStr(ByRef s As String) As PWSTR 201 GetStr(s.Chars As PWSTR, s.Length As SIZE_T, ToWCStr)201 GetStr(s.Chars, s.Length As SIZE_T, ToWCStr) 202 202 End Function 203 203
Note:
See TracChangeset
for help on using the changeset viewer.