Changeset 252 for Common/UCommon.pas


Ignore:
Timestamp:
Jun 16, 2011, 11:39:42 AM (13 years ago)
Author:
george
Message:
  • Fixed: Compilation on Linux.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Common/UCommon.pas

    r250 r252  
    66
    77uses
    8   Windows, Classes, SysUtils, SpecializedList, StrUtils, Dialogs,
     8  {$IFDEF Windows}Windows,{$ENDIF}
     9  Classes, SysUtils, SpecializedList, StrUtils, Dialogs,
    910  FileUtil; //, ShFolder, ShellAPI;
    1011
     
    2930  ExceptionHandler: TExceptionEvent;
    3031  DLLHandle1: HModule;
     32
     33{$IFDEF Windows}
    3134  GetUserNameEx: procedure (NameFormat: DWORD;
    3235    lpNameBuffer: LPSTR; nSize: PULONG); stdcall;
    33 
     36{$ENDIF}
    3437
    3538function IntToBin(Data: Cardinal; Count: Byte): string;
     
    4144function BCDToInt(Value: Byte): Byte;
    4245function CompareByteArray(Data1, Data2: TArrayOfByte): Boolean;
     46{$IFDEF Windows}
    4347function GetUserName: string;
    4448function LoggedOnUserNameEx(Format: TUserNameFormat): string;
     49{$ENDIF}
    4550function SplitString(var Text: string; Count: Word): string;
    4651function GetBit(Variable: QWord; Index: Byte): Boolean;
     
    250255end;
    251256
     257{$IFDEF Windows}
    252258function GetUserName: string;
    253259const
     
    283289  end else Result := GetUserName;
    284290end;
     291{$ENDIF}
    285292
    286293function SplitString(var Text: string; Count: Word): string;
     
    317324procedure LoadLibraries;
    318325begin
     326  {$IFDEF Windows}
    319327  DLLHandle1 := LoadLibrary('secur32.dll');
    320328  if DLLHandle1 <> 0 then
     
    322330    @GetUserNameEx := GetProcAddress(DLLHandle1, 'GetUserNameExA');
    323331  end;
     332  {$ENDIF}
    324333end;
    325334
    326335procedure FreeLibraries;
    327336begin
     337  {$IFDEF Windows}
    328338  if DLLHandle1 <> 0 then FreeLibrary(DLLHandle1);
     339  {$ENDIF}
    329340end;
    330341
Note: See TracChangeset for help on using the changeset viewer.