Changeset 252
- Timestamp:
- Jun 16, 2011, 11:39:42 AM (13 years ago)
- Location:
- Common
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
Common/StopWatch.pas
r118 r252 4 4 interface 5 5 6 uses Windows, SysUtils, DateUtils; 6 uses 7 {$IFDEF Windows}Windows,{$ENDIF} 8 SysUtils, DateUtils; 7 9 8 type 10 type 11 TLargeInteger = Int64; 12 9 13 TStopWatch = class 10 14 private … … 36 40 fIsRunning := False; 37 41 42 {$IFDEF Windows} 38 43 fIsHighResolution := QueryPerformanceFrequency(fFrequency) ; 44 {$ELSE} 45 raise Exception.Create('Not implemeneted'); 46 {$ENDIF} 39 47 if NOT fIsHighResolution then fFrequency := MSecsPerSec; 40 48 … … 50 58 begin 51 59 if fIsHighResolution then 60 {$IFDEF Windows} 52 61 QueryPerformanceCounter(lInt) 62 {$ELSE} 63 raise Exception.Create('Not implemeneted') 64 {$ENDIF} 53 65 else 54 66 lInt := MilliSecondOf(Now) ; -
Common/UCommon.pas
r250 r252 6 6 7 7 uses 8 Windows, Classes, SysUtils, SpecializedList, StrUtils, Dialogs, 8 {$IFDEF Windows}Windows,{$ENDIF} 9 Classes, SysUtils, SpecializedList, StrUtils, Dialogs, 9 10 FileUtil; //, ShFolder, ShellAPI; 10 11 … … 29 30 ExceptionHandler: TExceptionEvent; 30 31 DLLHandle1: HModule; 32 33 {$IFDEF Windows} 31 34 GetUserNameEx: procedure (NameFormat: DWORD; 32 35 lpNameBuffer: LPSTR; nSize: PULONG); stdcall; 33 36 {$ENDIF} 34 37 35 38 function IntToBin(Data: Cardinal; Count: Byte): string; … … 41 44 function BCDToInt(Value: Byte): Byte; 42 45 function CompareByteArray(Data1, Data2: TArrayOfByte): Boolean; 46 {$IFDEF Windows} 43 47 function GetUserName: string; 44 48 function LoggedOnUserNameEx(Format: TUserNameFormat): string; 49 {$ENDIF} 45 50 function SplitString(var Text: string; Count: Word): string; 46 51 function GetBit(Variable: QWord; Index: Byte): Boolean; … … 250 255 end; 251 256 257 {$IFDEF Windows} 252 258 function GetUserName: string; 253 259 const … … 283 289 end else Result := GetUserName; 284 290 end; 291 {$ENDIF} 285 292 286 293 function SplitString(var Text: string; Count: Word): string; … … 317 324 procedure LoadLibraries; 318 325 begin 326 {$IFDEF Windows} 319 327 DLLHandle1 := LoadLibrary('secur32.dll'); 320 328 if DLLHandle1 <> 0 then … … 322 330 @GetUserNameEx := GetProcAddress(DLLHandle1, 'GetUserNameExA'); 323 331 end; 332 {$ENDIF} 324 333 end; 325 334 326 335 procedure FreeLibraries; 327 336 begin 337 {$IFDEF Windows} 328 338 if DLLHandle1 <> 0 then FreeLibrary(DLLHandle1); 339 {$ENDIF} 329 340 end; 330 341
Note:
See TracChangeset
for help on using the changeset viewer.