text stringlengths 14 6.51M |
|---|
unit MediaProcessing.Convertor.HH.RGB.Impl;
interface
uses Windows,SysUtils,Classes,MediaProcessing.Convertor.HH.RGB,MediaProcessing.Definitions,MediaProcessing.Global,HHCommon, HHDecoder;
type
TMediaProcessor_ConvertorHh_Rgb_Impl =class (TMediaProcessor_Convertor_Hh_Rgb,IMediaProcessorImpl)
private
FVideoDecoder: THHVideoDecoder;
FLastVideoFrameTimeStamp: cardinal;
protected
procedure Process(aInData: pointer; aInDataSize:cardinal; const aInFormat: TMediaStreamDataHeader; aInfo: pointer; aInfoSize: cardinal;
out aOutData: pointer; out aOutDataSize: cardinal; out aOutFormat: TMediaStreamDataHeader; out aOutInfo: pointer; out aOutInfoSize: cardinal); override;
public
constructor Create; override;
destructor Destroy; override;
end;
implementation
uses uBaseClasses;
{ TMediaProcessor_ConvertorHh_Rgb_Impl }
constructor TMediaProcessor_ConvertorHh_Rgb_Impl.Create;
begin
inherited;
FVideoDecoder:=THHVideoDecoder.Create;
end;
destructor TMediaProcessor_ConvertorHh_Rgb_Impl.Destroy;
begin
FreeAndNil(FVideoDecoder);
inherited;
end;
procedure TMediaProcessor_ConvertorHh_Rgb_Impl.Process(aInData: pointer; aInDataSize:cardinal; const aInFormat: TMediaStreamDataHeader; aInfo: pointer; aInfoSize: cardinal;
out aOutData: pointer; out aOutDataSize: cardinal; out aOutFormat: TMediaStreamDataHeader; out aOutInfo: pointer; out aOutInfoSize: cardinal);
var
aStreamData: PHV_FRAME;
aMetaInfo: PHHAV_INFO;
aMinDelta : cardinal;
aKX,aKY: integer;
begin
CheckIfChannel0(aInFormat);
TArgumentValidation.NotNil(aInData);
Assert(aInfoSize=sizeof(HHAV_INFO));
aStreamData:=aInData;
Assert(aStreamData.zeroFlag=0);
Assert(aStreamData.oneFlag=1);
aOutData:=nil;
aOutDataSize:=0;
aOutInfo:=nil;
aOutInfoSize:=0;
if aStreamData.streamFlag=FRAME_FLAG_A then
exit;
Assert(aStreamData.streamFlag in [FRAME_FLAG_VP,FRAME_FLAG_VI]);
aMetaInfo:=PHHAV_INFO(aInfo);
//Только опорные кадры
if (FChangeFPSMode = cfmVIFrameOnly) then
if aStreamData.streamFlag<>FRAME_FLAG_VI then
exit;
FVideoDecoder.Lock;
try
if FVideoDecoder.DecodeToBitmap(aStreamData,aMetaInfo^,false) then
begin
//Прореживание кадров
if FChangeFPSMode=cfmAbsolute then
begin
if (FLastVideoFrameTimeStamp<>0) and (FLastVideoFrameTimeStamp<aStreamData.nTimestamp) then
begin
aMinDelta:=25 div FFPSValue;
if aStreamData.nTimestamp-FLastVideoFrameTimeStamp<aMinDelta then
exit;
end;
end;
if FImageSizeMode=cismScale then
begin
if FImageSizeScale<>1 then
FVideoDecoder.ScaleCurrentBmp(FImageSizeScale,FImageSizeScale);
end
else if FImageSizeMode=cismCustomSize then
begin
aKX:=1;
if FImageSizeWidth>0 then
begin
aKX:=Round(FVideoDecoder.CurrentBmpInfoHeader.biWidth/FImageSizeWidth);
if aKX<1 then
aKX:=1;
end;
aKY:=1;
if FImageSizeWidth>0 then
begin
aKY:=Round(FVideoDecoder.CurrentBmpInfoHeader.biHeight/FImageSizeHeight);
if aKY<1 then
aKY:=1;
end;
FVideoDecoder.ScaleCurrentBmp(aKX,aKY);
end;
aOutData:=FVideoDecoder.CurrentBmpDIB;
aOutDataSize:=FVideoDecoder.CurrentBmpInfoHeader.biSizeImage;
aOutInfo:=@FVideoDecoder.CurrentBmpInfoHeader;
aOutInfoSize:=sizeof(FVideoDecoder.CurrentBmpInfoHeader);
aOutFormat.Assign(FVideoDecoder.CurrentBmpInfoHeader);
aOutFormat.Channel:=aInFormat.Channel;
aOutFormat.TimeStamp:=aInFormat.TimeStamp;
aOutFormat.TimeKoeff:=aInFormat.TimeKoeff;
aOutFormat.VideoReversedVertical:=true; //Декодер дает перевернутую картинку
Include(aOutFormat.biFrameFlags,ffKeyFrame);
FLastVideoFrameTimeStamp:=aStreamData.nTimestamp;
end;
finally
FVideoDecoder.Unlock;
end;
end;
initialization
MediaProceccorFactory.RegisterMediaProcessorImplementation(TMediaProcessor_ConvertorHh_Rgb_Impl);
end.
|
unit uText;
interface
uses
SysUtils, Character;
type
TPosInText = record
private
procedure Init;
public
Line : Cardinal;
LinePos : Cardinal;
Pos : Cardinal;
end;
//function GetNext: Char; overload;
//function GetNext(const AAddIndex: NativeUInt): Char; overload;
//procedure Error(const AMsg: string); overload;
//procedure Error(const AMsg: string; const Args: array of const); overload;
IText = interface
// getters and setters
function GetText : string;
function GetLen : Cardinal;
function GetPos : TPosInText;
function GetCh : Char;
// ---
function Eof: Boolean;
procedure First;
procedure Next;
function NextIf(const AChar: Char): Boolean; overload;
function NextIf(const ACharSet: array of Char): Boolean; overload;
procedure NextWhile(const AChar: Char); overload;
procedure NextWhile(const ACharSet: array of Char); overload;
procedure SkipWhiteChar;
function Copy(const APos, ASize: Cardinal): string;
property Text : string read GetText;
property Len : Cardinal read GetLen;
property Pos : TPosInText read GetPos;
property Ch : Char read GetCh;
end;
TText = class(TInterfacedObject, IText)
strict protected
FText : string;
FPos : TPosInText;
FCh : Char;
function GetText : string;
function GetLen : Cardinal;
function GetPos : TPosInText;
function GetCh : Char;
public
constructor Create(const AText: string); reintroduce;
function Copy(const APos, ASize: Cardinal): string;
function Eof: Boolean;
function NextIf(const AChar: Char): Boolean; overload;
function NextIf(const ACharSet: array of Char): Boolean; overload;
procedure NextWhile(const AChar: Char); overload;
procedure NextWhile(const ACharSet: array of Char); overload;
procedure SkipWhiteChar;
procedure First;
procedure Next;
property Text : string read GetText;
property Len : Cardinal read GetLen;
property Pos : TPosInText read GetPos;
property Ch : Char read GetCh;
end;
const
chEofChar = #0;
chSpace = ' ';
chTab = #9;
chCR = #13;
chLF = #10;
chQuote = '''';
implementation
{ TText }
function TText.Copy(const APos, ASize: Cardinal): string;
begin
Result := System.Copy(FText, APos, ASize);
end;
constructor TText.Create(const AText: string);
begin
FText := AText;
First;
end;
function TText.Eof: Boolean;
begin
Result := FCh = chEofChar;
end;
procedure TText.First;
begin
FPos.Init;
if FText.IsEmpty then
FCh := #0
else
FCh := FText[1];
end;
function TText.GetCh: Char;
begin
Result := FCh;
end;
function TText.GetLen: Cardinal;
begin
Result := Length(FText);
end;
function TText.GetPos: TPosInText;
begin
Result := FPos;
end;
function TText.GetText: string;
begin
Result := FText;
end;
procedure TText.Next;
begin
if FCh = chEofChar then
Exit;
if FPos.Pos >= Len then
begin
FCh := chEofChar;
Exit;
end;
if FCh = #10 then
begin
Inc(FPos.Line);
FPos.LinePos := 1;
end
else
Inc(FPos.LinePos);
Inc(FPos.Pos);
FCh := FText[FPos.Pos];
end;
function TText.NextIf(const ACharSet: array of Char): Boolean;
var
c: Char;
begin
for c in ACharSet do
if c = FCh then
begin
Next;
Exit(True);
end;
Result := False;
end;
function TText.NextIf(const AChar: Char): Boolean;
begin
Result := FCh = AChar;
if Result then
Next;
end;
procedure TText.NextWhile(const ACharSet: array of Char);
var
c: Char;
Flag: Boolean;
begin
repeat
Flag := False;
for c in ACharSet do
if c = FCh then
begin
Flag := True;
Break;
end;
if Flag then
Next;
until not Flag;
end;
procedure TText.SkipWhiteChar;
begin
while FCh.IsWhiteSpace do
Next;
end;
procedure TText.NextWhile(const AChar: Char);
begin
while FCh = AChar do
Next;
end;
{ TPosInText }
procedure TPosInText.Init;
begin
Line := 1;
LinePos := 1;
Pos := 1;
end;
end.
|
{*******************************************************}
{ }
{ Borland Delphi Runtime Library }
{ Win32 registry interface unit }
{ }
{ Copyright (C) 1996,98 Inprise Corporation }
{ }
{*******************************************************}
unit RegStr;
{$WEAKPACKAGEUNIT}
(*$HPPEMIT '#include <regstr.h>'*)
{ This module contains public registry string definitions. }
interface
uses Windows;
{ Public registry key names }
const
{$EXTERNALSYM REGSTR_KEY_CLASS}
REGSTR_KEY_CLASS = 'Class'; { child of LOCAL_MACHINE }
{$EXTERNALSYM REGSTR_KEY_CONFIG}
REGSTR_KEY_CONFIG = 'Config'; { child of LOCAL_MACHINE }
{$EXTERNALSYM REGSTR_KEY_ENUM}
REGSTR_KEY_ENUM = 'Enum'; { child of LOCAL_MACHINE }
{$EXTERNALSYM REGSTR_KEY_ROOTENUM}
REGSTR_KEY_ROOTENUM = 'Root'; { child of ENUM }
{$EXTERNALSYM REGSTR_KEY_BIOSENUM}
REGSTR_KEY_BIOSENUM = 'BIOS'; { child of ENUM }
{$EXTERNALSYM REGSTR_KEY_PCMCIAENUM}
REGSTR_KEY_PCMCIAENUM = 'PCMCIA'; { child of ENUM }
{$EXTERNALSYM REGSTR_KEY_PCIENUM}
REGSTR_KEY_PCIENUM = 'PCI'; { child of ENUM }
{$EXTERNALSYM REGSTR_KEY_ISAENUM}
REGSTR_KEY_ISAENUM = 'ISAPnP'; { child of ENUM }
{$EXTERNALSYM REGSTR_KEY_EISAENUM}
REGSTR_KEY_EISAENUM = 'EISA'; { child of ENUM }
{$EXTERNALSYM REGSTR_KEY_ISAENUM_NEC_98}
REGSTR_KEY_ISAENUM_NEC_98 = 'C98PnP'; { child of ENUM }
{$EXTERNALSYM REGSTR_KEY_EISAENUM_NEC_98}
REGSTR_KEY_EISAENUM_NEC_98 = 'NESA'; { child of ENUM }
{$EXTERNALSYM REGSTR_KEY_LOGCONFIG}
REGSTR_KEY_LOGCONFIG = 'LogConfig'; { child of enum\root\dev\inst }
{$EXTERNALSYM REGSTR_KEY_SYSTEMBOARD}
REGSTR_KEY_SYSTEMBOARD = '*PNP0C01'; { child of enum\root }
{$EXTERNALSYM REGSTR_KEY_APM}
REGSTR_KEY_APM = '*PNP0C05'; { child of enum\root }
{$EXTERNALSYM REGSTR_KEY_INIUPDATE}
REGSTR_KEY_INIUPDATE = 'IniUpdate';
{$EXTERNALSYM REG_KEY_INSTDEV}
REG_KEY_INSTDEV = 'Installed'; { Child of hklm\class\classname }
{$EXTERNALSYM REGSTR_KEY_DOSOPTCDROM}
REGSTR_KEY_DOSOPTCDROM = 'CD-ROM';
{$EXTERNALSYM REGSTR_KEY_DOSOPTMOUSE}
REGSTR_KEY_DOSOPTMOUSE = 'MOUSE';
{ Public registry paths }
{$EXTERNALSYM REGSTR_DEFAULT_INSTANCE}
REGSTR_DEFAULT_INSTANCE = '0000';
{$EXTERNALSYM REGSTR_PATH_MOTHERBOARD}
REGSTR_PATH_MOTHERBOARD = REGSTR_KEY_SYSTEMBOARD + '\' + REGSTR_DEFAULT_INSTANCE;
{$EXTERNALSYM REGSTR_PATH_SETUP}
REGSTR_PATH_SETUP = 'Software\Microsoft\Windows\CurrentVersion';
{$EXTERNALSYM REGSTR_PATH_PIFCONVERT}
REGSTR_PATH_PIFCONVERT = 'Software\Microsoft\Windows\CurrentVersion\PIFConvert';
{$EXTERNALSYM REGSTR_PATH_MSDOSOPTS}
REGSTR_PATH_MSDOSOPTS = 'Software\Microsoft\Windows\CurrentVersion\MS-DOSOptions';
{$EXTERNALSYM REGSTR_PATH_MSDOSEMU}
REGSTR_PATH_MSDOSEMU = 'Software\Microsoft\Windows\CurrentVersion\MS-DOS Emulation';
{$EXTERNALSYM REGSTR_PATH_NOSUGGMSDOS}
REGSTR_PATH_NOSUGGMSDOS = 'Software\Microsoft\Windows\CurrentVersion\NoMSDOSWarn';
{$EXTERNALSYM REGSTR_PATH_NEWDOSBOX}
REGSTR_PATH_NEWDOSBOX = 'Software\Microsoft\Windows\CurrentVersion\MS-DOSSpecialConfig';
{$EXTERNALSYM REGSTR_PATH_RUNONCE}
REGSTR_PATH_RUNONCE = 'Software\Microsoft\Windows\CurrentVersion\RunOnce';
{$EXTERNALSYM REGSTR_PATH_RUN}
REGSTR_PATH_RUN = 'Software\Microsoft\Windows\CurrentVersion\Run';
{$EXTERNALSYM REGSTR_PATH_RUNSERVICESONCE}
REGSTR_PATH_RUNSERVICESONCE = 'Software\Microsoft\Windows\CurrentVersion\RunServicesOnce';
{$EXTERNALSYM REGSTR_PATH_RUNSERVICES}
REGSTR_PATH_RUNSERVICES = 'Software\Microsoft\Windows\CurrentVersion\RunServices';
{$EXTERNALSYM REGSTR_PATH_EXPLORER}
REGSTR_PATH_EXPLORER = 'Software\Microsoft\Windows\CurrentVersion\Explorer';
{$EXTERNALSYM REGSTR_PATH_DETECT}
REGSTR_PATH_DETECT = 'Software\Microsoft\Windows\CurrentVersion\Detect';
{$EXTERNALSYM REGSTR_PATH_APPPATHS}
REGSTR_PATH_APPPATHS = 'Software\Microsoft\Windows\CurrentVersion\App Paths';
{$EXTERNALSYM REGSTR_PATH_UNINSTALL}
REGSTR_PATH_UNINSTALL = 'Software\Microsoft\Windows\CurrentVersion\Uninstall';
{$EXTERNALSYM REGSTR_PATH_REALMODENET}
REGSTR_PATH_REALMODENET = 'Software\Microsoft\Windows\CurrentVersion\Network\Real Mode Net';
{$EXTERNALSYM REGSTR_PATH_NETEQUIV}
REGSTR_PATH_NETEQUIV = 'Software\Microsoft\Windows\CurrentVersion\Network\Equivalent';
{$EXTERNALSYM REGSTR_PATH_CVNETWORK}
REGSTR_PATH_CVNETWORK = 'Software\Microsoft\Windows\CurrentVersion\Network';
{$EXTERNALSYM REGSTR_PATH_IDCONFIGDB}
REGSTR_PATH_IDCONFIGDB = 'System\CurrentControlSet\Control\IDConfigDB';
{$EXTERNALSYM REGSTR_PATH_CLASS}
REGSTR_PATH_CLASS = 'System\CurrentControlSet\Services\Class';
{$EXTERNALSYM REGSTR_PATH_DISPLAYSETTINGS}
REGSTR_PATH_DISPLAYSETTINGS = 'Display\Settings';
{$EXTERNALSYM REGSTR_PATH_FONTS}
REGSTR_PATH_FONTS = 'Display\Fonts';
{$EXTERNALSYM REGSTR_PATH_ENUM}
REGSTR_PATH_ENUM = 'Enum';
{$EXTERNALSYM REGSTR_PATH_ROOT}
REGSTR_PATH_ROOT = 'Enum\Root';
{$EXTERNALSYM REGSTR_PATH_SERVICES}
REGSTR_PATH_SERVICES = 'System\CurrentControlSet\Services';
{$EXTERNALSYM REGSTR_PATH_VXD}
REGSTR_PATH_VXD = 'System\CurrentControlSet\Services\VxD';
{$EXTERNALSYM REGSTR_PATH_IOS}
REGSTR_PATH_IOS = 'System\CurrentControlSet\Services\VxD\IOS';
{$EXTERNALSYM REGSTR_PATH_VMM}
REGSTR_PATH_VMM = 'System\CurrentControlSet\Services\VxD\VMM';
{$EXTERNALSYM REGSTR_PATH_VPOWERD}
REGSTR_PATH_VPOWERD = 'System\CurrentControlSet\Services\VxD\VPOWERD';
{$EXTERNALSYM REGSTR_PATH_VNETSUP}
REGSTR_PATH_VNETSUP = 'System\CurrentControlSet\Services\VxD\VNETSUP';
{$EXTERNALSYM REGSTR_PATH_NWREDIR}
REGSTR_PATH_NWREDIR = 'System\CurrentControlSet\Services\VxD\NWREDIR';
{$EXTERNALSYM REGSTR_PATH_NCPSERVER}
REGSTR_PATH_NCPSERVER = 'System\CurrentControlSet\Services\NcpServer\Parameters';
{$EXTERNALSYM REGSTR_PATH_IOARB}
REGSTR_PATH_IOARB = 'System\CurrentControlSet\Services\Arbitrators\IOArb';
{$EXTERNALSYM REGSTR_PATH_ADDRARB}
REGSTR_PATH_ADDRARB = 'System\CurrentControlSet\Services\Arbitrators\AddrArb';
{$EXTERNALSYM REGSTR_PATH_DMAARB}
REGSTR_PATH_DMAARB = 'System\CurrentControlSet\Services\Arbitrators\DMAArb';
{$EXTERNALSYM REGSTR_PATH_IRQARB}
REGSTR_PATH_IRQARB = 'System\CurrentControlSet\Services\Arbitrators\IRQArb';
{$EXTERNALSYM REGSTR_PATH_CODEPAGE}
REGSTR_PATH_CODEPAGE = 'System\CurrentControlSet\Control\Nls\Codepage';
{$EXTERNALSYM REGSTR_PATH_FILESYSTEM}
REGSTR_PATH_FILESYSTEM = 'System\CurrentControlSet\Control\FileSystem';
{$EXTERNALSYM REGSTR_PATH_FILESYSTEM_NOVOLTRACK}
REGSTR_PATH_FILESYSTEM_NOVOLTRACK = 'System\CurrentControlSet\Control\FileSystem\NoVolTrack';
{$EXTERNALSYM REGSTR_PATH_CDFS}
REGSTR_PATH_CDFS = 'System\CurrentControlSet\Control\FileSystem\CDFS';
{$EXTERNALSYM REGSTR_PATH_WINBOOT}
REGSTR_PATH_WINBOOT = 'System\CurrentControlSet\Control\WinBoot';
{$EXTERNALSYM REGSTR_PATH_INSTALLEDFILES}
REGSTR_PATH_INSTALLEDFILES = 'System\CurrentControlSet\Control\InstalledFiles';
{$EXTERNALSYM REGSTR_PATH_VMM32FILES}
REGSTR_PATH_VMM32FILES = 'System\CurrentControlSet\Control\VMM32Files';
{ Reasonable Limit for Values Names }
{$EXTERNALSYM REGSTR_MAX_VALUE_LENGTH}
REGSTR_MAX_VALUE_LENGTH = 256;
{ Values under REGSTR_PATH_DISPLAYSETTINGS }
{$EXTERNALSYM REGSTR_VAL_BITSPERPIXEL}
REGSTR_VAL_BITSPERPIXEL = 'BitsPerPixel';
{$EXTERNALSYM REGSTR_VAL_RESOLUTION}
REGSTR_VAL_RESOLUTION = 'Resolution';
{$EXTERNALSYM REGSTR_VAL_DPILOGICALX}
REGSTR_VAL_DPILOGICALX = 'DPILogicalX';
{$EXTERNALSYM REGSTR_VAL_DPILOGICALY}
REGSTR_VAL_DPILOGICALY = 'DPILogicalY';
{$EXTERNALSYM REGSTR_VAL_DPIPHYSICALX}
REGSTR_VAL_DPIPHYSICALX = 'DPIPhysicalX';
{$EXTERNALSYM REGSTR_VAL_DPIPHYSICALY}
REGSTR_VAL_DPIPHYSICALY = 'DPIPhysicalY';
{$EXTERNALSYM REGSTR_VAL_REFRESHRATE}
REGSTR_VAL_REFRESHRATE = 'RefreshRate';
{$EXTERNALSYM REGSTR_VAL_DISPLAYFLAGS}
REGSTR_VAL_DISPLAYFLAGS = 'DisplayFlags';
{ under HKEY_CURRENT_USER }
{$EXTERNALSYM REGSTR_PATH_CONTROLPANEL}
REGSTR_PATH_CONTROLPANEL = 'Control Panel';
{ under HKEY_LOCAL_MACHINE }
{$EXTERNALSYM REGSTR_PATH_CONTROLSFOLDER}
REGSTR_PATH_CONTROLSFOLDER = 'Software\Microsoft\Windows\CurrentVersion\Controls Folder';
{ Entries under REGSTR_PATH_CODEPAGE }
{$EXTERNALSYM REGSTR_VAL_DOSCP}
REGSTR_VAL_DOSCP = 'OEMCP';
{$EXTERNALSYM REGSTR_VAL_WINCP}
REGSTR_VAL_WINCP = 'ACP';
{$EXTERNALSYM REGSTR_PATH_DYNA_ENUM}
REGSTR_PATH_DYNA_ENUM = 'Config Manager\Enum';
{ Entries under REGSTR_PATH_DYNA_ENUM }
{$EXTERNALSYM REGSTR_VAL_HARDWARE_KEY}
REGSTR_VAL_HARDWARE_KEY = 'HardWareKey';
{$EXTERNALSYM REGSTR_VAL_ALLOCATION}
REGSTR_VAL_ALLOCATION = 'Allocation';
{$EXTERNALSYM REGSTR_VAL_PROBLEM}
REGSTR_VAL_PROBLEM = 'Problem';
{$EXTERNALSYM REGSTR_VAL_STATUS}
REGSTR_VAL_STATUS = 'Status';
{ Used by address arbitrator }
{$EXTERNALSYM REGSTR_VAL_DONTUSEMEM}
REGSTR_VAL_DONTUSEMEM = 'DontAllocLastMem';
{ Entries under REGSTR_PATH_SETUP }
{$EXTERNALSYM REGSTR_VAL_SYSTEMROOT}
REGSTR_VAL_SYSTEMROOT = 'SystemRoot';
{$EXTERNALSYM REGSTR_VAL_BOOTCOUNT}
REGSTR_VAL_BOOTCOUNT = 'BootCount';
{$EXTERNALSYM REGSTR_VAL_REALNETSTART}
REGSTR_VAL_REALNETSTART = 'RealNetStart';
{$EXTERNALSYM REGSTR_VAL_MEDIA}
REGSTR_VAL_MEDIA = 'MediaPath';
{$EXTERNALSYM REGSTR_VAL_CONFIG}
REGSTR_VAL_CONFIG = 'ConfigPath';
{$EXTERNALSYM REGSTR_VAL_DEVICEPATH}
REGSTR_VAL_DEVICEPATH = 'DevicePath'; { default search path for .INFs }
{$EXTERNALSYM REGSTR_VAL_SRCPATH}
REGSTR_VAL_SRCPATH = 'SourcePath'; { last source files path during setup. }
{$EXTERNALSYM REGSTR_VAL_OLDWINDIR}
REGSTR_VAL_OLDWINDIR = 'OldWinDir'; { old windows location }
{$EXTERNALSYM REGSTR_VAL_SETUPFLAGS}
REGSTR_VAL_SETUPFLAGS = 'SetupFlags'; { flags that setup passes on after install. }
{$EXTERNALSYM REGSTR_VAL_REGOWNER}
REGSTR_VAL_REGOWNER = 'RegisteredOwner';
{$EXTERNALSYM REGSTR_VAL_REGORGANIZATION}
REGSTR_VAL_REGORGANIZATION = 'RegisteredOrganization';
{$EXTERNALSYM REGSTR_VAL_LICENSINGINFO}
REGSTR_VAL_LICENSINGINFO = 'LicensingInfo';
{$EXTERNALSYM REGSTR_VAL_OLDMSDOSVER}
REGSTR_VAL_OLDMSDOSVER = 'OldMSDOSVer'; { will be DOS ver < 7 (when Setup run) }
{$EXTERNALSYM REGSTR_VAL_FIRSTINSTALLDATETIME}
REGSTR_VAL_FIRSTINSTALLDATETIME = 'FirstInstallDateTime'; { will Win 95 install date-time }
{$EXTERNALSYM REGSTR_VAL_INSTALLTYPE}
REGSTR_VAL_INSTALLTYPE = 'InstallType';
{$EXTERNALSYM REGSTR_VAL_WRAPPER}
REGSTR_VAL_WRAPPER = 'Wrapper';
{ Values for InstallType }
{$EXTERNALSYM IT_COMPACT}
IT_COMPACT = $0000;
{$EXTERNALSYM IT_TYPICAL}
IT_TYPICAL = $0001;
{$EXTERNALSYM IT_PORTABLE}
IT_PORTABLE = $0002;
{$EXTERNALSYM IT_CUSTOM}
IT_CUSTOM = $0003;
{$EXTERNALSYM REGSTR_KEY_SETUP}
REGSTR_KEY_SETUP = '\Setup';
{$EXTERNALSYM REGSTR_VAL_BOOTDIR}
REGSTR_VAL_BOOTDIR = 'BootDir';
{$EXTERNALSYM REGSTR_VAL_WINBOOTDIR}
REGSTR_VAL_WINBOOTDIR = 'WinbootDir';
{$EXTERNALSYM REGSTR_VAL_WINDIR}
REGSTR_VAL_WINDIR = 'WinDir';
{$EXTERNALSYM REGSTR_VAL_APPINSTPATH}
REGSTR_VAL_APPINSTPATH = 'AppInstallPath'; { Used by install wizard }
{ Values for international startup disk }
{$EXTERNALSYM REGSTR_PATH_EBD}
REGSTR_PATH_EBD = REGSTR_PATH_SETUP + REGSTR_KEY_SETUP + '\EBD';
{ Keys under REGSTR_KEY_EBD }
{$EXTERNALSYM REGSTR_KEY_EBDFILESLOCAL}
REGSTR_KEY_EBDFILESLOCAL = 'EBDFilesLocale';
{$EXTERNALSYM REGSTR_KEY_EBDFILESKEYBOARD}
REGSTR_KEY_EBDFILESKEYBOARD = 'EBDFilesKeyboard';
{$EXTERNALSYM REGSTR_KEY_EBDAUTOEXECBATLOCAL}
REGSTR_KEY_EBDAUTOEXECBATLOCAL = 'EBDAutoexecBatLocale';
{$EXTERNALSYM REGSTR_KEY_EBDAUTOEXECBATKEYBOARD}
REGSTR_KEY_EBDAUTOEXECBATKEYBOARD = 'EBDAutoexecBatKeyboard';
{$EXTERNALSYM REGSTR_KEY_EBDCONFIGSYSLOCAL}
REGSTR_KEY_EBDCONFIGSYSLOCAL = 'EBDConfigSysLocale';
{$EXTERNALSYM REGSTR_KEY_EBDCONFIGSYSKEYBOARD}
REGSTR_KEY_EBDCONFIGSYSKEYBOARD = 'EBDConfigSysKeyboard';
{ Entries under REGSTR_PATH_PIFCONVERT }
{$EXTERNALSYM REGSTR_VAL_MSDOSMODE}
REGSTR_VAL_MSDOSMODE = 'MSDOSMode';
{$EXTERNALSYM REGSTR_VAL_MSDOSMODEDISCARD}
REGSTR_VAL_MSDOSMODEDISCARD = 'Discard';
{ Entries under REGSTR_PATH_MSDOSOPTS (global settings) }
{$EXTERNALSYM REGSTR_VAL_DOSOPTGLOBALFLAGS}
REGSTR_VAL_DOSOPTGLOBALFLAGS = 'GlobalFlags';
{ Flags for GlobalFlags }
{$EXTERNALSYM DOSOPTGF_DEFCLEAN}
DOSOPTGF_DEFCLEAN = $00000001; { Default action is clean config }
{ Entries under REGSTR_PATH_MSDOSOPTS \ OptionSubkey }
{$EXTERNALSYM REGSTR_VAL_DOSOPTFLAGS}
REGSTR_VAL_DOSOPTFLAGS = 'Flags';
{$EXTERNALSYM REGSTR_VAL_OPTORDER}
REGSTR_VAL_OPTORDER = 'Order';
{$EXTERNALSYM REGSTR_VAL_CONFIGSYS}
REGSTR_VAL_CONFIGSYS = 'Config.Sys';
{$EXTERNALSYM REGSTR_VAL_AUTOEXEC}
REGSTR_VAL_AUTOEXEC = 'Autoexec.Bat';
{$EXTERNALSYM REGSTR_VAL_STDDOSOPTION}
REGSTR_VAL_STDDOSOPTION = 'StdOption';
{$EXTERNALSYM REGSTR_VAL_DOSOPTTIP}
REGSTR_VAL_DOSOPTTIP = 'TipText';
{ Flags for DOSOPTFLAGS }
{$EXTERNALSYM DOSOPTF_DEFAULT}
DOSOPTF_DEFAULT = $00000001; { Default enabled for clean config }
{$EXTERNALSYM DOSOPTF_SUPPORTED}
DOSOPTF_SUPPORTED = $00000002; { Option actually supported }
{$EXTERNALSYM DOSOPTF_ALWAYSUSE}
DOSOPTF_ALWAYSUSE = $00000004; { Always use this option }
{$EXTERNALSYM DOSOPTF_USESPMODE}
DOSOPTF_USESPMODE = $00000008; { Option puts machine in Prot Mode }
{$EXTERNALSYM DOSOPTF_PROVIDESUMB}
DOSOPTF_PROVIDESUMB = $00000010; { Can load drivers high }
{$EXTERNALSYM DOSOPTF_NEEDSETUP}
DOSOPTF_NEEDSETUP = $00000020; { Need to configure option }
{$EXTERNALSYM DOSOPTF_INDOSSTART}
DOSOPTF_INDOSSTART = $00000040; { Suppored by DOSSTART.BAT }
{$EXTERNALSYM DOSOPTF_MULTIPLE}
DOSOPTF_MULTIPLE = $00000080; { Load multiple configuration lines }
{ Flags returned by SUGetSetSetupFlags and in the registry }
{$EXTERNALSYM SUF_FIRSTTIME}
SUF_FIRSTTIME = $00000001; { First boot into Win95. }
{$EXTERNALSYM SUF_EXPRESS}
SUF_EXPRESS = $00000002; { User Setup via express mode (vs customize). }
{$EXTERNALSYM SUF_BATCHINF}
SUF_BATCHINF = $00000004; { Setup using batch file (MSBATCH.INF). }
{$EXTERNALSYM SUF_CLEAN}
SUF_CLEAN = $00000008; { Setup was done to a clean directory. }
{$EXTERNALSYM SUF_INSETUP}
SUF_INSETUP = $00000010; { You're in Setup. }
{$EXTERNALSYM SUF_NETSETUP}
SUF_NETSETUP = $00000020; { Doing a net (workstation) setup. }
{$EXTERNALSYM SUF_NETHDBOOT}
SUF_NETHDBOOT = $00000040; { Workstation boots from local harddrive }
{$EXTERNALSYM SUF_NETRPLBOOT}
SUF_NETRPLBOOT = $00000080; { Workstation boots via RPL (vs floppy) }
{$EXTERNALSYM SUF_SBSCOPYOK}
SUF_SBSCOPYOK = $00000100; { Can copy to LDID_SHARED (SBS) }
{ Entries under REGSTR_PATH_VMM }
{$EXTERNALSYM REGSTR_VAL_DOSPAGER}
REGSTR_VAL_DOSPAGER = 'DOSPager';
{$EXTERNALSYM REGSTR_VAL_VXDGROUPS}
REGSTR_VAL_VXDGROUPS = 'VXDGroups';
{ Entries under REGSTR_PATH_VPOWERD }
{$EXTERNALSYM REGSTR_VAL_VPOWERDFLAGS}
REGSTR_VAL_VPOWERDFLAGS = 'Flags'; { Stupid machine workarounds }
{$EXTERNALSYM VPDF_DISABLEPWRMGMT}
VPDF_DISABLEPWRMGMT = $00000001; { Don't load device }
{$EXTERNALSYM VPDF_FORCEAPM10MODE}
VPDF_FORCEAPM10MODE = $00000002; { Always go into 1.0 mode }
{$EXTERNALSYM VPDF_SKIPINTELSLCHECK}
VPDF_SKIPINTELSLCHECK = $00000004; { Don't detect Intel SL chipset }
{$EXTERNALSYM VPDF_DISABLEPWRSTATUSPOLL}
VPDF_DISABLEPWRSTATUSPOLL = $00000008; { Don't poll power status }
{ Entries under REGSTR_PATH_VNETSUP }
{$EXTERNALSYM REGSTR_VAL_WORKGROUP}
REGSTR_VAL_WORKGROUP = 'Workgroup';
{$EXTERNALSYM REGSTR_VAL_DIRECTHOST}
REGSTR_VAL_DIRECTHOST = 'DirectHost';
{$EXTERNALSYM REGSTR_VAL_FILESHARING}
REGSTR_VAL_FILESHARING = 'FileSharing';
{$EXTERNALSYM REGSTR_VAL_PRINTSHARING}
REGSTR_VAL_PRINTSHARING = 'PrintSharing';
{ Entries under REGSTR_PATH_NWREDIR }
{$EXTERNALSYM REGSTR_VAL_FIRSTNETDRIVE}
REGSTR_VAL_FIRSTNETDRIVE = 'FirstNetworkDrive';
{$EXTERNALSYM REGSTR_VAL_MAXCONNECTIONS}
REGSTR_VAL_MAXCONNECTIONS = 'MaxConnections';
{$EXTERNALSYM REGSTR_VAL_APISUPPORT}
REGSTR_VAL_APISUPPORT = 'APISupport';
{$EXTERNALSYM REGSTR_VAL_MAXRETRY}
REGSTR_VAL_MAXRETRY = 'MaxRetry';
{$EXTERNALSYM REGSTR_VAL_MINRETRY}
REGSTR_VAL_MINRETRY = 'MinRetry';
{$EXTERNALSYM REGSTR_VAL_SUPPORTLFN}
REGSTR_VAL_SUPPORTLFN = 'SupportLFN';
{$EXTERNALSYM REGSTR_VAL_SUPPORTBURST}
REGSTR_VAL_SUPPORTBURST = 'SupportBurst';
{$EXTERNALSYM REGSTR_VAL_SUPPORTTUNNELLING}
REGSTR_VAL_SUPPORTTUNNELLING = 'SupportTunnelling';
{$EXTERNALSYM REGSTR_VAL_FULLTRACE}
REGSTR_VAL_FULLTRACE = 'FullTrace';
{$EXTERNALSYM REGSTR_VAL_READCACHING}
REGSTR_VAL_READCACHING = 'ReadCaching';
{$EXTERNALSYM REGSTR_VAL_SHOWDOTS}
REGSTR_VAL_SHOWDOTS = 'ShowDots';
{$EXTERNALSYM REGSTR_VAL_GAPTIME}
REGSTR_VAL_GAPTIME = 'GapTime';
{$EXTERNALSYM REGSTR_VAL_SEARCHMODE}
REGSTR_VAL_SEARCHMODE = 'SearchMode';
{$EXTERNALSYM REGSTR_VAL_SHELLVERSION}
REGSTR_VAL_SHELLVERSION = 'ShellVersion';
{$EXTERNALSYM REGSTR_VAL_MAXLIP}
REGSTR_VAL_MAXLIP = 'MaxLIP';
{$EXTERNALSYM REGSTR_VAL_PRESERVECASE}
REGSTR_VAL_PRESERVECASE = 'PreserveCase';
{$EXTERNALSYM REGSTR_VAL_OPTIMIZESFN}
REGSTR_VAL_OPTIMIZESFN = 'OptimizeSFN';
{ Entries under REGSTR_PATH_NCPSERVER }
{$EXTERNALSYM REGSTR_VAL_NCP_BROWSEMASTER}
REGSTR_VAL_NCP_BROWSEMASTER = 'BrowseMaster';
{$EXTERNALSYM REGSTR_VAL_NCP_USEPEERBROWSING}
REGSTR_VAL_NCP_USEPEERBROWSING = 'Use_PeerBrowsing';
{$EXTERNALSYM REGSTR_VAL_NCP_USESAP}
REGSTR_VAL_NCP_USESAP = 'Use_Sap';
{ Entries under REGSTR_PATH_FILESYSTEM }
{$EXTERNALSYM REGSTR_VAL_WIN31FILESYSTEM}
REGSTR_VAL_WIN31FILESYSTEM = 'Win31FileSystem';
{$EXTERNALSYM REGSTR_VAL_PRESERVELONGNAMES}
REGSTR_VAL_PRESERVELONGNAMES = 'PreserveLongNames';
{$EXTERNALSYM REGSTR_VAL_DRIVEWRITEBEHIND}
REGSTR_VAL_DRIVEWRITEBEHIND = 'DriveWriteBehind';
{$EXTERNALSYM REGSTR_VAL_ASYNCFILECOMMIT}
REGSTR_VAL_ASYNCFILECOMMIT = 'AsyncFileCommit';
{$EXTERNALSYM REGSTR_VAL_PATHCACHECOUNT}
REGSTR_VAL_PATHCACHECOUNT = 'PathCache';
{$EXTERNALSYM REGSTR_VAL_NAMECACHECOUNT}
REGSTR_VAL_NAMECACHECOUNT = 'NameCache';
{$EXTERNALSYM REGSTR_VAL_CONTIGFILEALLOC}
REGSTR_VAL_CONTIGFILEALLOC = 'ContigFileAllocSize';
{$EXTERNALSYM REGSTR_VAL_VOLIDLETIMEOUT}
REGSTR_VAL_VOLIDLETIMEOUT = 'VolumeIdleTimeout';
{$EXTERNALSYM REGSTR_VAL_BUFFIDLETIMEOUT}
REGSTR_VAL_BUFFIDLETIMEOUT = 'BufferIdleTimeout';
{$EXTERNALSYM REGSTR_VAL_BUFFAGETIMEOUT}
REGSTR_VAL_BUFFAGETIMEOUT = 'BufferAgeTimeout';
{$EXTERNALSYM REGSTR_VAL_NAMENUMERICTAIL}
REGSTR_VAL_NAMENUMERICTAIL = 'NameNumericTail';
{$EXTERNALSYM REGSTR_VAL_READAHEADTHRESHOLD}
REGSTR_VAL_READAHEADTHRESHOLD = 'ReadAheadThreshold';
{$EXTERNALSYM REGSTR_VAL_DOUBLEBUFFER}
REGSTR_VAL_DOUBLEBUFFER = 'DoubleBuffer';
{$EXTERNALSYM REGSTR_VAL_SOFTCOMPATMODE}
REGSTR_VAL_SOFTCOMPATMODE = 'SoftCompatMode';
{$EXTERNALSYM REGSTR_VAL_DRIVESPINDOWN}
REGSTR_VAL_DRIVESPINDOWN = 'DriveSpinDown';
{$EXTERNALSYM REGSTR_VAL_FORCEPMIO}
REGSTR_VAL_FORCEPMIO = 'ForcePMIO';
{$EXTERNALSYM REGSTR_VAL_FORCERMIO}
REGSTR_VAL_FORCERMIO = 'ForceRMIO';
{$EXTERNALSYM REGSTR_VAL_LASTBOOTPMDRVS}
REGSTR_VAL_LASTBOOTPMDRVS = 'LastBootPMDrvs';
{$EXTERNALSYM REGSTR_VAL_VIRTUALHDIRQ}
REGSTR_VAL_VIRTUALHDIRQ = 'VirtualHDIRQ';
{$EXTERNALSYM REGSTR_VAL_SRVNAMECACHECOUNT}
REGSTR_VAL_SRVNAMECACHECOUNT = 'ServerNameCacheMax';
{$EXTERNALSYM REGSTR_VAL_SRVNAMECACHE}
REGSTR_VAL_SRVNAMECACHE = 'ServerNameCache';
{$EXTERNALSYM REGSTR_VAL_SRVNAMECACHENETPROV}
REGSTR_VAL_SRVNAMECACHENETPROV = 'ServerNameCacheNumNets';
{$EXTERNALSYM REGSTR_VAL_AUTOMOUNT}
REGSTR_VAL_AUTOMOUNT = 'AutoMountDrives';
{$EXTERNALSYM REGSTR_VAL_COMPRESSIONMETHOD}
REGSTR_VAL_COMPRESSIONMETHOD = 'CompressionAlgorithm';
{$EXTERNALSYM REGSTR_VAL_COMPRESSIONTHRESHOLD}
REGSTR_VAL_COMPRESSIONTHRESHOLD = 'CompressionThreshold';
{ Entries under REGSTR_PATH_FILESYSTEM_NOVOLTRACK }
{ A sub-key under which a variable number of variable length structures are stored. }
{ Each structure contains an offset followed by a number of pattern bytes. }
{ The pattern in each structure is compared at the specified offset within }
{ the boot record at the time a volume is mounted. If any pattern in this }
{ set of patterns matches a pattern already in the boot record, VFAT will not }
{ write a volume tracking serial number in the OEM_SerialNum field of the }
{ boot record on the volume being mounted. }
{ Entries under REGSTR_PATH_CDFS }
{$EXTERNALSYM REGSTR_VAL_CDCACHESIZE}
REGSTR_VAL_CDCACHESIZE = 'CacheSize'; { Number of 2K cache sectors }
{$EXTERNALSYM REGSTR_VAL_CDPREFETCH}
REGSTR_VAL_CDPREFETCH = 'Prefetch'; { Number of 2K cache sectors for prefetching }
{$EXTERNALSYM REGSTR_VAL_CDPREFETCHTAIL}
REGSTR_VAL_CDPREFETCHTAIL = 'PrefetchTail'; { Number of LRU1 prefetch sectors }
{$EXTERNALSYM REGSTR_VAL_CDRAWCACHE}
REGSTR_VAL_CDRAWCACHE = 'RawCache'; { Number of 2352-byte cache sectors }
{$EXTERNALSYM REGSTR_VAL_CDEXTERRORS}
REGSTR_VAL_CDEXTERRORS = 'ExtendedErrors'; { Return extended error codes }
{$EXTERNALSYM REGSTR_VAL_CDSVDSENSE}
REGSTR_VAL_CDSVDSENSE = 'SVDSense'; { 0=PVD, 1=Kanji, 2=Unicode }
{$EXTERNALSYM REGSTR_VAL_CDSHOWVERSIONS}
REGSTR_VAL_CDSHOWVERSIONS = 'ShowVersions'; { Show file version numbers }
{$EXTERNALSYM REGSTR_VAL_CDCOMPATNAMES}
REGSTR_VAL_CDCOMPATNAMES = 'MSCDEXCompatNames'; { Disable Numeric Tails on long file names }
{$EXTERNALSYM REGSTR_VAL_CDNOREADAHEAD}
REGSTR_VAL_CDNOREADAHEAD = 'NoReadAhead'; { Disable Read Ahead if set to 1 }
{ define values for IOS devices }
{$EXTERNALSYM REGSTR_VAL_SCSI}
REGSTR_VAL_SCSI = 'SCSI\';
{$EXTERNALSYM REGSTR_VAL_ESDI}
REGSTR_VAL_ESDI = 'ESDI\';
{$EXTERNALSYM REGSTR_VAL_FLOP}
REGSTR_VAL_FLOP = 'FLOP\';
{ define defs for IOS device types and values for IOS devices }
{$EXTERNALSYM REGSTR_VAL_DISK}
REGSTR_VAL_DISK = 'GenDisk';
{$EXTERNALSYM REGSTR_VAL_CDROM}
REGSTR_VAL_CDROM = 'GenCD';
{$EXTERNALSYM REGSTR_VAL_TAPE}
REGSTR_VAL_TAPE = 'TAPE';
{$EXTERNALSYM REGSTR_VAL_SCANNER}
REGSTR_VAL_SCANNER = 'SCANNER';
{$EXTERNALSYM REGSTR_VAL_FLOPPY}
REGSTR_VAL_FLOPPY = 'FLOPPY';
{$EXTERNALSYM REGSTR_VAL_SCSITID}
REGSTR_VAL_SCSITID = 'SCSITargetID';
{$EXTERNALSYM REGSTR_VAL_SCSILUN}
REGSTR_VAL_SCSILUN = 'SCSILUN';
{$EXTERNALSYM REGSTR_VAL_REVLEVEL}
REGSTR_VAL_REVLEVEL = 'RevisionLevel';
{$EXTERNALSYM REGSTR_VAL_PRODUCTID}
REGSTR_VAL_PRODUCTID = 'ProductId';
{$EXTERNALSYM REGSTR_VAL_PRODUCTTYPE}
REGSTR_VAL_PRODUCTTYPE = 'ProductType';
{$EXTERNALSYM REGSTR_VAL_DEVTYPE}
REGSTR_VAL_DEVTYPE = 'DeviceType';
{$EXTERNALSYM REGSTR_VAL_REMOVABLE}
REGSTR_VAL_REMOVABLE = 'Removable';
{$EXTERNALSYM REGSTR_VAL_CURDRVLET}
REGSTR_VAL_CURDRVLET = 'CurrentDriveLetterAssignment';
{$EXTERNALSYM REGSTR_VAL_USRDRVLET}
REGSTR_VAL_USRDRVLET = 'UserDriveLetterAssignment';
{$EXTERNALSYM REGSTR_VAL_SYNCDATAXFER}
REGSTR_VAL_SYNCDATAXFER = 'SyncDataXfer';
{$EXTERNALSYM REGSTR_VAL_AUTOINSNOTE}
REGSTR_VAL_AUTOINSNOTE = 'AutoInsertNotification';
{$EXTERNALSYM REGSTR_VAL_DISCONNECT}
REGSTR_VAL_DISCONNECT = 'Disconnect';
{$EXTERNALSYM REGSTR_VAL_INT13}
REGSTR_VAL_INT13 = 'Int13';
{$EXTERNALSYM REGSTR_VAL_PMODE_INT13}
REGSTR_VAL_PMODE_INT13 = 'PModeInt13';
{$EXTERNALSYM REGSTR_VAL_USERSETTINGS}
REGSTR_VAL_USERSETTINGS = 'AdapterSettings';
{$EXTERNALSYM REGSTR_VAL_NOIDE}
REGSTR_VAL_NOIDE = 'NoIDE';
{ The foll. clase name definitions should be the same as in dirkdrv.inx and }
{ cdrom.inx }
{$EXTERNALSYM REGSTR_VAL_DISKCLASSNAME}
REGSTR_VAL_DISKCLASSNAME = 'DiskDrive';
{$EXTERNALSYM REGSTR_VAL_CDROMCLASSNAME}
REGSTR_VAL_CDROMCLASSNAME = 'CDROM';
{ The foll. value determines whether a port driver should be force loaded }
{ or not. }
{$EXTERNALSYM REGSTR_VAL_FORCELOAD}
REGSTR_VAL_FORCELOAD = 'ForceLoadPD';
{ The foll. value determines whether or not the FIFO is used on the Floppy }
{ controller. }
{$EXTERNALSYM REGSTR_VAL_FORCEFIFO}
REGSTR_VAL_FORCEFIFO = 'ForceFIFO';
{$EXTERNALSYM REGSTR_VAL_FORCECL}
REGSTR_VAL_FORCECL = 'ForceChangeLine';
{ Generic CLASS Entries }
{$EXTERNALSYM REGSTR_VAL_NOUSECLASS}
REGSTR_VAL_NOUSECLASS = 'NoUseClass'; { Don't include this class in PnP functions }
{$EXTERNALSYM REGSTR_VAL_NOINSTALLCLASS}
REGSTR_VAL_NOINSTALLCLASS = 'NoInstallClass'; { Don't include this class in New Device Wizard }
{$EXTERNALSYM REGSTR_VAL_NODISPLAYCLASS}
REGSTR_VAL_NODISPLAYCLASS = 'NoDisplayClass'; { Don't include this class in Device Manager }
{$EXTERNALSYM REGSTR_VAL_SILENTINSTALL}
REGSTR_VAL_SILENTINSTALL = 'SilentInstall'; { Always Silent Install devices of this class. }
{ Class Names }
{$EXTERNALSYM REGSTR_KEY_PCMCIA_CLASS}
REGSTR_KEY_PCMCIA_CLASS = 'PCMCIA'; { child of PATH_CLASS }
{$EXTERNALSYM REGSTR_KEY_SCSI_CLASS}
REGSTR_KEY_SCSI_CLASS = 'SCSIAdapter';
{$EXTERNALSYM REGSTR_KEY_PORTS_CLASS}
REGSTR_KEY_PORTS_CLASS = 'ports';
{$EXTERNALSYM REGSTR_KEY_MEDIA_CLASS}
REGSTR_KEY_MEDIA_CLASS = 'MEDIA';
{$EXTERNALSYM REGSTR_KEY_DISPLAY_CLASS}
REGSTR_KEY_DISPLAY_CLASS = 'Display';
{$EXTERNALSYM REGSTR_KEY_KEYBOARD_CLASS}
REGSTR_KEY_KEYBOARD_CLASS = 'Keyboard';
{$EXTERNALSYM REGSTR_KEY_MOUSE_CLASS}
REGSTR_KEY_MOUSE_CLASS = 'Mouse';
{$EXTERNALSYM REGSTR_KEY_MONITOR_CLASS}
REGSTR_KEY_MONITOR_CLASS = 'Monitor';
{ Values under PATH_CLASS\PCMCIA }
{$EXTERNALSYM REGSTR_VAL_PCMCIA_OPT}
REGSTR_VAL_PCMCIA_OPT = 'Options';
{$EXTERNALSYM PCMCIA_OPT_HAVE_SOCKET}
PCMCIA_OPT_HAVE_SOCKET = $00000001;
{ PCMCIA_OPT_ENABLED = $00000002l; }
{$EXTERNALSYM PCMCIA_OPT_AUTOMEM}
PCMCIA_OPT_AUTOMEM = $00000004;
{$EXTERNALSYM PCMCIA_OPT_NO_SOUND}
PCMCIA_OPT_NO_SOUND = $00000008;
{$EXTERNALSYM PCMCIA_OPT_NO_AUDIO}
PCMCIA_OPT_NO_AUDIO = $00000010;
{$EXTERNALSYM PCMCIA_OPT_NO_APMREMOVE}
PCMCIA_OPT_NO_APMREMOVE = $00000020;
{$EXTERNALSYM REGSTR_VAL_PCMCIA_MEM}
REGSTR_VAL_PCMCIA_MEM = 'Memory'; { Card services shared mem range }
{$EXTERNALSYM PCMCIA_DEF_MEMBEGIN}
PCMCIA_DEF_MEMBEGIN = $000C0000; { default 0xC0000 - 0x00FFFFFF }
{$EXTERNALSYM PCMCIA_DEF_MEMEND}
PCMCIA_DEF_MEMEND = $00FFFFFF; { (0 - 16meg) }
{$EXTERNALSYM PCMCIA_DEF_MEMLEN}
PCMCIA_DEF_MEMLEN = $00001000; { default 4k window }
{$EXTERNALSYM REGSTR_VAL_PCMCIA_ALLOC}
REGSTR_VAL_PCMCIA_ALLOC = 'AllocMemWin'; { PCCard alloced memory Window }
{$EXTERNALSYM REGSTR_VAL_PCMCIA_ATAD}
REGSTR_VAL_PCMCIA_ATAD = 'ATADelay'; { ATA device config start delay }
{$EXTERNALSYM REGSTR_VAL_PCMCIA_SIZ}
REGSTR_VAL_PCMCIA_SIZ = 'MinRegionSize'; { Minimum region size }
{$EXTERNALSYM PCMCIA_DEF_MIN_REGION}
PCMCIA_DEF_MIN_REGION = $00010000; { 64K minimum region size }
{ Values in LPTENUM keys }
{$EXTERNALSYM REGSTR_VAL_P1284MDL}
REGSTR_VAL_P1284MDL = 'Model';
{$EXTERNALSYM REGSTR_VAL_P1284MFG}
REGSTR_VAL_P1284MFG = 'Manufacturer';
{ Values under PATH_CLASS\ISAPNP }
{$EXTERNALSYM REGSTR_VAL_ISAPNP}
REGSTR_VAL_ISAPNP = 'ISAPNP'; { ISAPNP VxD name }
{$EXTERNALSYM REGSTR_VAL_ISAPNP_RDP_OVERRIDE}
REGSTR_VAL_ISAPNP_RDP_OVERRIDE = 'RDPOverRide'; { ReadDataPort OverRide }
{ Values under PATH_CLASS\PCI }
{$EXTERNALSYM REGSTR_VAL_PCI}
REGSTR_VAL_PCI = 'PCI'; { PCI VxD name }
{$EXTERNALSYM REGSTR_PCI_OPTIONS}
REGSTR_PCI_OPTIONS = 'Options'; { Possible PCI options }
{$EXTERNALSYM REGSTR_PCI_DUAL_IDE}
REGSTR_PCI_DUAL_IDE = 'PCIDualIDE'; { Dual IDE flag }
{$EXTERNALSYM PCI_OPTIONS_USE_BIOS}
PCI_OPTIONS_USE_BIOS = $00000001;
{$EXTERNALSYM PCI_OPTIONS_USE_IRQ_STEERING}
PCI_OPTIONS_USE_IRQ_STEERING = $00000002;
{$EXTERNALSYM PCI_FLAG_NO_VIDEO_IRQ}
PCI_FLAG_NO_VIDEO_IRQ = $00000001;
{$EXTERNALSYM PCI_FLAG_PCMCIA_WANT_IRQ}
PCI_FLAG_PCMCIA_WANT_IRQ = $00000002;
{$EXTERNALSYM PCI_FLAG_DUAL_IDE}
PCI_FLAG_DUAL_IDE = $00000004;
{$EXTERNALSYM PCI_FLAG_NO_ENUM_AT_ALL}
PCI_FLAG_NO_ENUM_AT_ALL = $00000008;
{$EXTERNALSYM PCI_FLAG_ENUM_NO_RESOURCE}
PCI_FLAG_ENUM_NO_RESOURCE = $00000010;
{$EXTERNALSYM PCI_FLAG_NEED_DWORD_ACCESS}
PCI_FLAG_NEED_DWORD_ACCESS = $00000020;
{$EXTERNALSYM PCI_FLAG_SINGLE_FUNCTION}
PCI_FLAG_SINGLE_FUNCTION = $00000040;
{$EXTERNALSYM PCI_FLAG_ALWAYS_ENABLED}
PCI_FLAG_ALWAYS_ENABLED = $00000080;
{$EXTERNALSYM PCI_FLAG_IS_IDE}
PCI_FLAG_IS_IDE = $00000100;
{$EXTERNALSYM PCI_FLAG_IS_VIDEO}
PCI_FLAG_IS_VIDEO = $00000200;
{$EXTERNALSYM PCI_FLAG_FAIL_START}
PCI_FLAG_FAIL_START = $00000400;
{ Detection related values }
{$EXTERNALSYM REGSTR_KEY_CRASHES}
REGSTR_KEY_CRASHES = 'Crashes'; { key of REGSTR_PATH_DETECT }
{$EXTERNALSYM REGSTR_KEY_DANGERS}
REGSTR_KEY_DANGERS = 'Dangers'; { key of REGSTR_PATH_DETECT }
{$EXTERNALSYM REGSTR_KEY_DETMODVARS}
REGSTR_KEY_DETMODVARS = 'DetModVars'; { key of REGSTR_PATH_DETECT }
{$EXTERNALSYM REGSTR_KEY_NDISINFO}
REGSTR_KEY_NDISINFO = 'NDISInfo'; { key of netcard hw entry }
{$EXTERNALSYM REGSTR_VAL_PROTINIPATH}
REGSTR_VAL_PROTINIPATH = 'ProtIniPath'; { protocol.ini path }
{$EXTERNALSYM REGSTR_VAL_RESOURCES}
REGSTR_VAL_RESOURCES = 'Resources'; { resources of crash func. }
{$EXTERNALSYM REGSTR_VAL_CRASHFUNCS}
REGSTR_VAL_CRASHFUNCS = 'CrashFuncs'; { detfunc caused the crash }
{$EXTERNALSYM REGSTR_VAL_CLASS}
REGSTR_VAL_CLASS = 'Class'; { device class }
{$EXTERNALSYM REGSTR_VAL_DEVDESC}
REGSTR_VAL_DEVDESC = 'DeviceDesc'; { device description }
{$EXTERNALSYM REGSTR_VAL_BOOTCONFIG}
REGSTR_VAL_BOOTCONFIG = 'BootConfig'; { detected configuration }
{$EXTERNALSYM REGSTR_VAL_DETFUNC}
REGSTR_VAL_DETFUNC = 'DetFunc'; { specifies detect mod/func. }
{$EXTERNALSYM REGSTR_VAL_DETFLAGS}
REGSTR_VAL_DETFLAGS = 'DetFlags'; { detection flags }
{$EXTERNALSYM REGSTR_VAL_COMPATIBLEIDS}
REGSTR_VAL_COMPATIBLEIDS = 'CompatibleIDs'; { value of enum\dev\inst }
{$EXTERNALSYM REGSTR_VAL_DETCONFIG}
REGSTR_VAL_DETCONFIG = 'DetConfig'; { detected configuration }
{$EXTERNALSYM REGSTR_VAL_VERIFYKEY}
REGSTR_VAL_VERIFYKEY = 'VerifyKey'; { key used in verify mode }
{$EXTERNALSYM REGSTR_VAL_COMINFO}
REGSTR_VAL_COMINFO = 'ComInfo'; { com info. for serial mouse }
{$EXTERNALSYM REGSTR_VAL_INFNAME}
REGSTR_VAL_INFNAME = 'InfName'; { INF filename }
{$EXTERNALSYM REGSTR_VAL_CARDSPECIFIC}
REGSTR_VAL_CARDSPECIFIC = 'CardSpecific'; { Netcard specific info (WORD) }
{$EXTERNALSYM REGSTR_VAL_NETOSTYPE}
REGSTR_VAL_NETOSTYPE = 'NetOSType'; { NetOS type associate w/ card }
{$EXTERNALSYM REGSTR_DATA_NETOS_NDIS}
REGSTR_DATA_NETOS_NDIS = 'NDIS'; { Data of REGSTR_VAL_NETOSTYPE }
{$EXTERNALSYM REGSTR_DATA_NETOS_ODI}
REGSTR_DATA_NETOS_ODI = 'ODI'; { Data of REGSTR_VAL_NETOSTYPE }
{$EXTERNALSYM REGSTR_DATA_NETOS_IPX}
REGSTR_DATA_NETOS_IPX = 'IPX'; { Data of REGSTR_VAL_NETOSTYPE }
{$EXTERNALSYM REGSTR_VAL_MFG}
REGSTR_VAL_MFG = 'Mfg';
{$EXTERNALSYM REGSTR_VAL_SCAN_ONLY_FIRST}
REGSTR_VAL_SCAN_ONLY_FIRST = 'ScanOnlyFirstDrive'; { used with IDE driver }
{$EXTERNALSYM REGSTR_VAL_SHARE_IRQ}
REGSTR_VAL_SHARE_IRQ = 'ForceIRQSharing'; { used with IDE driver }
{$EXTERNALSYM REGSTR_VAL_NONSTANDARD_ATAPI}
REGSTR_VAL_NONSTANDARD_ATAPI = 'NonStandardATAPI'; { used with IDE driver }
{$EXTERNALSYM REGSTR_VAL_IDE_FORCE_SERIALIZE}
REGSTR_VAL_IDE_FORCE_SERIALIZE = 'ForceSerialization'; { used with IDE driver }
{$EXTERNALSYM REGSTR_VAL_MAX_HCID_LEN}
REGSTR_VAL_MAX_HCID_LEN = 1024; { Maximum hardware/compat ID len }
{$EXTERNALSYM REGSTR_VAL_HWREV}
REGSTR_VAL_HWREV = 'HWRevision';
{$EXTERNALSYM REGSTR_VAL_ENABLEINTS}
REGSTR_VAL_ENABLEINTS = 'EnableInts';
{ Bit values of REGSTR_VAL_DETFLAGS }
{$EXTERNALSYM REGDF_NOTDETIO}
REGDF_NOTDETIO = $00000001; { cannot detect I/O resource }
{$EXTERNALSYM REGDF_NOTDETMEM}
REGDF_NOTDETMEM = $00000002; { cannot detect mem resource }
{$EXTERNALSYM REGDF_NOTDETIRQ}
REGDF_NOTDETIRQ = $00000004; { cannot detect IRQ resource }
{$EXTERNALSYM REGDF_NOTDETDMA}
REGDF_NOTDETDMA = $00000008; { cannot detect DMA resource }
{$EXTERNALSYM REGDF_NOTDETALL}
REGDF_NOTDETALL = REGDF_NOTDETIO or REGDF_NOTDETMEM or REGDF_NOTDETIRQ or REGDF_NOTDETDMA;
{$EXTERNALSYM REGDF_NEEDFULLCONFIG}
REGDF_NEEDFULLCONFIG = $00000010; { stop devnode if lack resource }
{$EXTERNALSYM REGDF_GENFORCEDCONFIG}
REGDF_GENFORCEDCONFIG = $00000020; { also generate forceconfig }
{$EXTERNALSYM REGDF_NODETCONFIG}
REGDF_NODETCONFIG = $00008000; { don't write detconfig to reg. }
{$EXTERNALSYM REGDF_CONFLICTIO}
REGDF_CONFLICTIO = $00010000; { I/O res. in conflict }
{$EXTERNALSYM REGDF_CONFLICTMEM}
REGDF_CONFLICTMEM = $00020000; { mem res. in conflict }
{$EXTERNALSYM REGDF_CONFLICTIRQ}
REGDF_CONFLICTIRQ = $00040000; { IRQ res. in conflict }
{$EXTERNALSYM REGDF_CONFLICTDMA}
REGDF_CONFLICTDMA = $00080000; { DMA res. in conflict }
{$EXTERNALSYM REGDF_CONFLICTALL}
REGDF_CONFLICTALL = REGDF_CONFLICTIO or REGDF_CONFLICTMEM or REGDF_CONFLICTIRQ or REGDF_CONFLICTDMA;
{$EXTERNALSYM REGDF_MAPIRQ2TO9}
REGDF_MAPIRQ2TO9 = $00100000; { IRQ2 has been mapped to 9 }
{$EXTERNALSYM REGDF_NOTVERIFIED}
REGDF_NOTVERIFIED = $80000000; { previous device unverified }
{ Values in REGSTR_KEY_SYSTEMBOARD }
{$EXTERNALSYM REGSTR_VAL_APMBIOSVER}
REGSTR_VAL_APMBIOSVER = 'APMBiosVer';
{$EXTERNALSYM REGSTR_VAL_APMFLAGS}
REGSTR_VAL_APMFLAGS = 'APMFlags';
{$EXTERNALSYM REGSTR_VAL_SLSUPPORT}
REGSTR_VAL_SLSUPPORT = 'SLSupport';
{$EXTERNALSYM REGSTR_VAL_MACHINETYPE}
REGSTR_VAL_MACHINETYPE = 'MachineType';
{$EXTERNALSYM REGSTR_VAL_SETUPMACHINETYPE}
REGSTR_VAL_SETUPMACHINETYPE = 'SetupMachineType';
{$EXTERNALSYM REGSTR_MACHTYPE_UNKNOWN}
REGSTR_MACHTYPE_UNKNOWN = 'Unknown';
{$EXTERNALSYM REGSTR_MACHTYPE_IBMPC}
REGSTR_MACHTYPE_IBMPC = 'IBM PC';
{$EXTERNALSYM REGSTR_MACHTYPE_IBMPCJR}
REGSTR_MACHTYPE_IBMPCJR = 'IBM PCjr';
{$EXTERNALSYM REGSTR_MACHTYPE_IBMPCCONV}
REGSTR_MACHTYPE_IBMPCCONV = 'IBM PC Convertible';
{$EXTERNALSYM REGSTR_MACHTYPE_IBMPCXT}
REGSTR_MACHTYPE_IBMPCXT = 'IBM PC/XT';
{$EXTERNALSYM REGSTR_MACHTYPE_IBMPCXT_286}
REGSTR_MACHTYPE_IBMPCXT_286 = 'IBM PC/XT 286';
{$EXTERNALSYM REGSTR_MACHTYPE_IBMPCAT}
REGSTR_MACHTYPE_IBMPCAT = 'IBM PC/AT';
{$EXTERNALSYM REGSTR_MACHTYPE_IBMPS2_25}
REGSTR_MACHTYPE_IBMPS2_25 = 'IBM PS/2-25';
{$EXTERNALSYM REGSTR_MACHTYPE_IBMPS2_30_286}
REGSTR_MACHTYPE_IBMPS2_30_286 = 'IBM PS/2-30 286';
{$EXTERNALSYM REGSTR_MACHTYPE_IBMPS2_30}
REGSTR_MACHTYPE_IBMPS2_30 = 'IBM PS/2-30';
{$EXTERNALSYM REGSTR_MACHTYPE_IBMPS2_50}
REGSTR_MACHTYPE_IBMPS2_50 = 'IBM PS/2-50';
{$EXTERNALSYM REGSTR_MACHTYPE_IBMPS2_50Z}
REGSTR_MACHTYPE_IBMPS2_50Z = 'IBM PS/2-50Z';
{$EXTERNALSYM REGSTR_MACHTYPE_IBMPS2_55SX}
REGSTR_MACHTYPE_IBMPS2_55SX = 'IBM PS/2-55SX';
{$EXTERNALSYM REGSTR_MACHTYPE_IBMPS2_60}
REGSTR_MACHTYPE_IBMPS2_60 = 'IBM PS/2-60';
{$EXTERNALSYM REGSTR_MACHTYPE_IBMPS2_65SX}
REGSTR_MACHTYPE_IBMPS2_65SX = 'IBM PS/2-65SX';
{$EXTERNALSYM REGSTR_MACHTYPE_IBMPS2_70}
REGSTR_MACHTYPE_IBMPS2_70 = 'IBM PS/2-70';
{$EXTERNALSYM REGSTR_MACHTYPE_IBMPS2_P70}
REGSTR_MACHTYPE_IBMPS2_P70 = 'IBM PS/2-P70';
{$EXTERNALSYM REGSTR_MACHTYPE_IBMPS2_70_80}
REGSTR_MACHTYPE_IBMPS2_70_80 = 'IBM PS/2-70/80';
{$EXTERNALSYM REGSTR_MACHTYPE_IBMPS2_80}
REGSTR_MACHTYPE_IBMPS2_80 = 'IBM PS/2-80';
{$EXTERNALSYM REGSTR_MACHTYPE_IBMPS2_90}
REGSTR_MACHTYPE_IBMPS2_90 = 'IBM PS/2-90';
{$EXTERNALSYM REGSTR_MACHTYPE_IBMPS1}
REGSTR_MACHTYPE_IBMPS1 = 'IBM PS/1';
{$EXTERNALSYM REGSTR_MACHTYPE_PHOENIX_PCAT}
REGSTR_MACHTYPE_PHOENIX_PCAT = 'Phoenix PC/AT Compatible';
{$EXTERNALSYM REGSTR_MACHTYPE_HP_VECTRA}
REGSTR_MACHTYPE_HP_VECTRA = 'HP Vectra';
{$EXTERNALSYM REGSTR_MACHTYPE_ATT_PC}
REGSTR_MACHTYPE_ATT_PC = 'AT&T PC';
{$EXTERNALSYM REGSTR_MACHTYPE_ZENITH_PC}
REGSTR_MACHTYPE_ZENITH_PC = 'Zenith PC';
{$EXTERNALSYM REGSTR_VAL_APMMENUSUSPEND}
REGSTR_VAL_APMMENUSUSPEND = 'APMMenuSuspend';
{$EXTERNALSYM APMMENUSUSPEND_DISABLED}
APMMENUSUSPEND_DISABLED = 0; { always disabled }
{$EXTERNALSYM APMMENUSUSPEND_ENABLED}
APMMENUSUSPEND_ENABLED = 1; { always enabled }
{$EXTERNALSYM APMMENUSUSPEND_UNDOCKED}
APMMENUSUSPEND_UNDOCKED = 2; { enabled undocked }
{$EXTERNALSYM APMMENUSUSPEND_NOCHANGE}
APMMENUSUSPEND_NOCHANGE = $80; { bitflag - cannot change setting via UI }
{$EXTERNALSYM REGSTR_VAL_BUSTYPE}
REGSTR_VAL_BUSTYPE = 'BusType';
{$EXTERNALSYM REGSTR_VAL_CPU}
REGSTR_VAL_CPU = 'CPU';
{$EXTERNALSYM REGSTR_VAL_NDP}
REGSTR_VAL_NDP = 'NDP';
{$EXTERNALSYM REGSTR_VAL_PNPBIOSVER}
REGSTR_VAL_PNPBIOSVER = 'PnPBIOSVer';
{$EXTERNALSYM REGSTR_VAL_PNPSTRUCOFFSET}
REGSTR_VAL_PNPSTRUCOFFSET = 'PnPStrucOffset';
{$EXTERNALSYM REGSTR_VAL_PCIBIOSVER}
REGSTR_VAL_PCIBIOSVER = 'PCIBIOSVer';
{$EXTERNALSYM REGSTR_VAL_HWMECHANISM}
REGSTR_VAL_HWMECHANISM = 'HWMechanism';
{$EXTERNALSYM REGSTR_VAL_LASTPCIBUSNUM}
REGSTR_VAL_LASTPCIBUSNUM = 'LastPCIBusNum';
{$EXTERNALSYM REGSTR_VAL_CONVMEM}
REGSTR_VAL_CONVMEM = 'ConvMem';
{$EXTERNALSYM REGSTR_VAL_EXTMEM}
REGSTR_VAL_EXTMEM = 'ExtMem';
{$EXTERNALSYM REGSTR_VAL_COMPUTERNAME}
REGSTR_VAL_COMPUTERNAME = 'ComputerName';
{$EXTERNALSYM REGSTR_VAL_BIOSNAME}
REGSTR_VAL_BIOSNAME = 'BIOSName';
{$EXTERNALSYM REGSTR_VAL_BIOSVERSION}
REGSTR_VAL_BIOSVERSION = 'BIOSVersion';
{$EXTERNALSYM REGSTR_VAL_BIOSDATE}
REGSTR_VAL_BIOSDATE = 'BIOSDate';
{$EXTERNALSYM REGSTR_VAL_MODEL}
REGSTR_VAL_MODEL = 'Model';
{$EXTERNALSYM REGSTR_VAL_SUBMODEL}
REGSTR_VAL_SUBMODEL = 'Submodel';
{$EXTERNALSYM REGSTR_VAL_REVISION}
REGSTR_VAL_REVISION = 'Revision';
{ Values used in the LPT(ECP) device entry }
{$EXTERNALSYM REGSTR_VAL_FIFODEPTH}
REGSTR_VAL_FIFODEPTH = 'FIFODepth';
{$EXTERNALSYM REGSTR_VAL_RDINTTHRESHOLD}
REGSTR_VAL_RDINTTHRESHOLD = 'RDIntThreshold';
{$EXTERNALSYM REGSTR_VAL_WRINTTHRESHOLD}
REGSTR_VAL_WRINTTHRESHOLD = 'WRIntThreshold';
{ used in enum\xxx\<devname>\<instname> }
{$EXTERNALSYM REGSTR_VAL_PRIORITY}
REGSTR_VAL_PRIORITY = 'Priority'; { WHAT IS THIS FOR?? }
{$EXTERNALSYM REGSTR_VAL_DRIVER}
REGSTR_VAL_DRIVER = 'Driver';
{$EXTERNALSYM REGSTR_VAL_FUNCDESC}
REGSTR_VAL_FUNCDESC = 'FunctionDesc';
{$EXTERNALSYM REGSTR_VAL_FORCEDCONFIG}
REGSTR_VAL_FORCEDCONFIG = 'ForcedConfig';
{$EXTERNALSYM REGSTR_VAL_CONFIGFLAGS}
REGSTR_VAL_CONFIGFLAGS = 'ConfigFlags'; { (binary ULONG) }
{$EXTERNALSYM REGSTR_VAL_CSCONFIGFLAGS}
REGSTR_VAL_CSCONFIGFLAGS = 'CSConfigFlags'; { (binary ULONG) }
{$EXTERNALSYM CONFIGFLAG_DISABLED}
CONFIGFLAG_DISABLED = $00000001; { Set if disabled }
{$EXTERNALSYM CONFIGFLAG_REMOVED}
CONFIGFLAG_REMOVED = $00000002; { Set if a present hardware enum device deleted }
{$EXTERNALSYM CONFIGFLAG_MANUAL_INSTALL}
CONFIGFLAG_MANUAL_INSTALL = $00000004; { Set if the devnode was manually installed }
{$EXTERNALSYM CONFIGFLAG_IGNORE_BOOT_LC}
CONFIGFLAG_IGNORE_BOOT_LC = $00000008; { Set if skip the boot config }
{$EXTERNALSYM CONFIGFLAG_NET_BOOT}
CONFIGFLAG_NET_BOOT = $00000010; { Load this devnode when in net boot }
{$EXTERNALSYM CONFIGFLAG_REINSTALL}
CONFIGFLAG_REINSTALL = $00000020; { Redo install }
{$EXTERNALSYM CONFIGFLAG_FAILEDINSTALL}
CONFIGFLAG_FAILEDINSTALL = $00000040; { Failed the install }
{$EXTERNALSYM CONFIGFLAG_CANTSTOPACHILD}
CONFIGFLAG_CANTSTOPACHILD = $00000080; { Can't stop/remove a single child }
{$EXTERNALSYM CONFIGFLAG_OKREMOVEROM}
CONFIGFLAG_OKREMOVEROM = $00000100; { Can remove even if rom. }
{$EXTERNALSYM CONFIGFLAG_NOREMOVEEXIT}
CONFIGFLAG_NOREMOVEEXIT = $00000200; { Don't remove at exit. }
{$EXTERNALSYM CSCONFIGFLAG_BITS}
CSCONFIGFLAG_BITS = $00000007; { OR of below bits }
{$EXTERNALSYM CSCONFIGFLAG_DISABLED}
CSCONFIGFLAG_DISABLED = $00000001; { Set if }
{$EXTERNALSYM CSCONFIGFLAG_DO_NOT_CREATE}
CSCONFIGFLAG_DO_NOT_CREATE = $00000002; { Set if }
{$EXTERNALSYM CSCONFIGFLAG_DO_NOT_START}
CSCONFIGFLAG_DO_NOT_START = $00000004; { Set if }
{$EXTERNALSYM DMSTATEFLAG_APPLYTOALL}
DMSTATEFLAG_APPLYTOALL = $00000001; { Set if Apply To All check box is checked }
{ Special devnodes name }
{$EXTERNALSYM REGSTR_VAL_ROOT_DEVNODE}
REGSTR_VAL_ROOT_DEVNODE = 'HTREE\ROOT\0';
{$EXTERNALSYM REGSTR_VAL_RESERVED_DEVNODE}
REGSTR_VAL_RESERVED_DEVNODE = 'HTREE\RESERVED\0';
{$EXTERNALSYM REGSTR_PATH_READDATAPORT}
REGSTR_PATH_READDATAPORT = REGSTR_KEY_ISAENUM + '\ReadDataPort\0';
{ Multifunction definitions }
{$EXTERNALSYM REGSTR_PATH_MULTI_FUNCTION}
REGSTR_PATH_MULTI_FUNCTION = 'MF';
{$EXTERNALSYM REGSTR_VAL_RESOURCE_MAP}
REGSTR_VAL_RESOURCE_MAP = 'ResourceMap';
{$EXTERNALSYM REGSTR_PATH_CHILD_PREFIX}
REGSTR_PATH_CHILD_PREFIX = 'Child';
{$EXTERNALSYM NUM_RESOURCE_MAP}
NUM_RESOURCE_MAP = 256;
{$EXTERNALSYM REGSTR_VAL_MF_FLAGS}
REGSTR_VAL_MF_FLAGS = 'MFFlags';
{$EXTERNALSYM MF_FLAGS_EVEN_IF_NO_RESOURCE}
MF_FLAGS_EVEN_IF_NO_RESOURCE = $00000001;
{$EXTERNALSYM MF_FLAGS_NO_CREATE_IF_NO_RESOURCE}
MF_FLAGS_NO_CREATE_IF_NO_RESOURCE = $00000002;
{$EXTERNALSYM MF_FLAGS_FILL_IN_UNKNOWN_RESOURCE}
MF_FLAGS_FILL_IN_UNKNOWN_RESOURCE = $00000004;
{$EXTERNALSYM MF_FLAGS_CREATE_BUT_NO_SHOW_DISABLED}
MF_FLAGS_CREATE_BUT_NO_SHOW_DISABLED = $00000008;
{ EISA multi functions add-on }
{$EXTERNALSYM REGSTR_VAL_EISA_RANGES}
REGSTR_VAL_EISA_RANGES = 'EISARanges';
{$EXTERNALSYM REGSTR_VAL_EISA_FUNCTIONS}
REGSTR_VAL_EISA_FUNCTIONS = 'EISAFunctions';
{$EXTERNALSYM REGSTR_VAL_EISA_FUNCTIONS_MASK}
REGSTR_VAL_EISA_FUNCTIONS_MASK = 'EISAFunctionsMask';
{$EXTERNALSYM REGSTR_VAL_EISA_FLAGS}
REGSTR_VAL_EISA_FLAGS = 'EISAFlags';
{$EXTERNALSYM REGSTR_VAL_EISA_SIMULATE_INT15}
REGSTR_VAL_EISA_SIMULATE_INT15 = 'EISASimulateInt15';
{$EXTERNALSYM REGSTR_VAL_EISA_RANGES_NEC_98}
REGSTR_VAL_EISA_RANGES_NEC_98 = 'NESARanges';
{$EXTERNALSYM REGSTR_VAL_EISA_FUNCTIONS_NEC_98}
REGSTR_VAL_EISA_FUNCTIONS_NEC_98 = 'NESAFunctions';
{$EXTERNALSYM REGSTR_VAL_EISA_FUNCTIONS_MASK_NEC_98}
REGSTR_VAL_EISA_FUNCTIONS_MASK_NEC_98 = 'NESAFunctionsMask';
{$EXTERNALSYM REGSTR_VAL_EISA_FLAGS_NEC_98}
REGSTR_VAL_EISA_FLAGS_NEC_98 = 'NESAFlags';
{$EXTERNALSYM REGSTR_VAL_EISA_SIMULATE_INT15_NEC_98}
REGSTR_VAL_EISA_SIMULATE_INT15_NEC_98 = 'NESASimulateInt15';
{$EXTERNALSYM EISAFLAG_NO_IO_MERGE}
EISAFLAG_NO_IO_MERGE = $00000001;
{$EXTERNALSYM EISAFLAG_SLOT_IO_FIRST}
EISAFLAG_SLOT_IO_FIRST = $00000002;
{$EXTERNALSYM EISA_NO_MAX_FUNCTION}
EISA_NO_MAX_FUNCTION = $FF;
{$EXTERNALSYM NUM_EISA_RANGES}
NUM_EISA_RANGES = 4;
{ Driver entries }
{$EXTERNALSYM REGSTR_VAL_DRVDESC}
REGSTR_VAL_DRVDESC = 'DriverDesc'; { value of enum\dev\inst\DRV }
{$EXTERNALSYM REGSTR_VAL_DEVLOADER}
REGSTR_VAL_DEVLOADER = 'DevLoader'; { value of DRV }
{$EXTERNALSYM REGSTR_VAL_STATICVXD}
REGSTR_VAL_STATICVXD = 'StaticVxD'; { value of DRV }
{$EXTERNALSYM REGSTR_VAL_PROPERTIES}
REGSTR_VAL_PROPERTIES = 'Properties'; { value of DRV }
{$EXTERNALSYM REGSTR_VAL_MANUFACTURER}
REGSTR_VAL_MANUFACTURER = 'Manufacturer';
{$EXTERNALSYM REGSTR_VAL_EXISTS}
REGSTR_VAL_EXISTS = 'Exists'; { value of HCC\HW\ENUM\ROOT\dev\inst }
{$EXTERNALSYM REGSTR_VAL_CMENUMFLAGS}
REGSTR_VAL_CMENUMFLAGS = 'CMEnumFlags'; { (binary ULONG) }
{$EXTERNALSYM REGSTR_VAL_CMDRIVFLAGS}
REGSTR_VAL_CMDRIVFLAGS = 'CMDrivFlags'; { (binary ULONG) }
{$EXTERNALSYM REGSTR_VAL_ENUMERATOR}
REGSTR_VAL_ENUMERATOR = 'Enumerator'; { value of DRV }
{$EXTERNALSYM REGSTR_VAL_DEVICEDRIVER}
REGSTR_VAL_DEVICEDRIVER = 'DeviceDriver'; { value of DRV }
{$EXTERNALSYM REGSTR_VAL_PORTNAME}
REGSTR_VAL_PORTNAME = 'PortName'; { VCOMM uses this for it's port names }
{$EXTERNALSYM REGSTR_VAL_INFPATH}
REGSTR_VAL_INFPATH = 'InfPath';
{$EXTERNALSYM REGSTR_VAL_INFSECTION}
REGSTR_VAL_INFSECTION = 'InfSection';
{$EXTERNALSYM REGSTR_VAL_POLLING}
REGSTR_VAL_POLLING = 'Polling'; { SCSI specific }
{$EXTERNALSYM REGSTR_VAL_DONTLOADIFCONFLICT}
REGSTR_VAL_DONTLOADIFCONFLICT = 'DontLoadIfConflict'; { SCSI specific }
{$EXTERNALSYM REGSTR_VAL_PORTSUBCLASS}
REGSTR_VAL_PORTSUBCLASS = 'PortSubClass';
{$EXTERNALSYM REGSTR_VAL_NETCLEAN}
REGSTR_VAL_NETCLEAN = 'NetClean'; { Driver required for NetClean boot }
{$EXTERNALSYM REGSTR_VAL_IDE_NO_SERIALIZE}
REGSTR_VAL_IDE_NO_SERIALIZE = 'IDENoSerialize'; { IDE specific }
{$EXTERNALSYM REGSTR_VAL_NOCMOSORFDPT}
REGSTR_VAL_NOCMOSORFDPT = 'NoCMOSorFDPT'; { IDE specific }
{$EXTERNALSYM REGSTR_VAL_COMVERIFYBASE}
REGSTR_VAL_COMVERIFYBASE = 'COMVerifyBase'; { VCD specific }
{ Driver keys }
{$EXTERNALSYM REGSTR_KEY_OVERRIDE}
REGSTR_KEY_OVERRIDE = 'Override'; { key under the software section }
{ used by CONFIGMG }
{$EXTERNALSYM REGSTR_VAL_CONFIGMG}
REGSTR_VAL_CONFIGMG = 'CONFIGMG'; { Config Manager VxD name }
{$EXTERNALSYM REGSTR_VAL_SYSDM}
REGSTR_VAL_SYSDM = 'SysDM'; { The device installer DLL }
{$EXTERNALSYM REGSTR_VAL_SYSDMFUNC}
REGSTR_VAL_SYSDMFUNC = 'SysDMFunc'; { The device installer DLL function }
{$EXTERNALSYM REGSTR_VAL_PRIVATE}
REGSTR_VAL_PRIVATE = 'Private'; { The private library }
{$EXTERNALSYM REGSTR_VAL_PRIVATEFUNC}
REGSTR_VAL_PRIVATEFUNC = 'PrivateFunc'; { The private library function }
{$EXTERNALSYM REGSTR_VAL_DETECT}
REGSTR_VAL_DETECT = 'Detect'; { The detection library }
{$EXTERNALSYM REGSTR_VAL_DETECTFUNC}
REGSTR_VAL_DETECTFUNC = 'DetectFunc'; { The detection library function }
{$EXTERNALSYM REGSTR_VAL_ASKFORCONFIG}
REGSTR_VAL_ASKFORCONFIG = 'AskForConfig'; { The AskForConfig library }
{$EXTERNALSYM REGSTR_VAL_ASKFORCONFIGFUNC}
REGSTR_VAL_ASKFORCONFIGFUNC = 'AskForConfigFunc'; { The AskForConfig library function }
{$EXTERNALSYM REGSTR_VAL_WAITFORUNDOCK}
REGSTR_VAL_WAITFORUNDOCK = 'WaitForUndock'; { The WaitForUndock library }
{$EXTERNALSYM REGSTR_VAL_WAITFORUNDOCKFUNC}
REGSTR_VAL_WAITFORUNDOCKFUNC = 'WaitForUndockFunc'; { The WaitForUndock library function }
{$EXTERNALSYM REGSTR_VAL_REMOVEROMOKAY}
REGSTR_VAL_REMOVEROMOKAY = 'RemoveRomOkay'; { The RemoveRomOkay library }
{$EXTERNALSYM REGSTR_VAL_REMOVEROMOKAYFUNC}
REGSTR_VAL_REMOVEROMOKAYFUNC = 'RemoveRomOkayFunc'; { The RemoveRomOkay library function }
{ used in IDCONFIGDB }
{$EXTERNALSYM REGSTR_VAL_CURCONFIG}
REGSTR_VAL_CURCONFIG = 'CurrentConfig'; { value of idconfigdb }
{$EXTERNALSYM REGSTR_VAL_FRIENDLYNAME}
REGSTR_VAL_FRIENDLYNAME = 'FriendlyName'; { value of idconfigdb }
{$EXTERNALSYM REGSTR_VAL_CURRENTCONFIG}
REGSTR_VAL_CURRENTCONFIG = 'CurrentConfig'; { value of idconfigdb }
{$EXTERNALSYM REGSTR_VAL_MAP}
REGSTR_VAL_MAP = 'Map'; { value of idconfigdb }
{$EXTERNALSYM REGSTR_VAL_ID}
REGSTR_VAL_ID = 'CurrentID'; { value of idconfigdb }
{$EXTERNALSYM REGSTR_VAL_DOCKED}
REGSTR_VAL_DOCKED = 'CurrentDockedState'; { value of idconfigdb }
{$EXTERNALSYM REGSTR_VAL_CHECKSUM}
REGSTR_VAL_CHECKSUM = 'CurrentChecksum'; { value of idconfigdb }
{$EXTERNALSYM REGSTR_VAL_HWDETECT}
REGSTR_VAL_HWDETECT = 'HardwareDetect'; { value of idconfigdb }
{$EXTERNALSYM REGSTR_VAL_INHIBITRESULTS}
REGSTR_VAL_INHIBITRESULTS = 'InhibitResults'; { value of idconfigdb }
{ used in HKEY_CURRENT_CONFIG }
{$EXTERNALSYM REGSTR_VAL_PROFILEFLAGS}
REGSTR_VAL_PROFILEFLAGS = 'ProfileFlags'; { value of HKEY_CURRENT_CONFIG }
{ used in PCMCIA }
{$EXTERNALSYM REGSTR_KEY_PCMCIA}
REGSTR_KEY_PCMCIA = 'PCMCIA\'; { PCMCIA dev ID prefix }
{$EXTERNALSYM REGSTR_KEY_PCUNKNOWN}
REGSTR_KEY_PCUNKNOWN = 'UNKNOWN_MANUFACTURER'; { PCMCIA dev ID manuf }
{$EXTERNALSYM REGSTR_VAL_PCSSDRIVER}
REGSTR_VAL_PCSSDRIVER = 'Driver'; { value of DRV }
{$EXTERNALSYM REGSTR_KEY_PCMTD}
REGSTR_KEY_PCMTD = 'MTD-'; { MTD dev ID component }
{$EXTERNALSYM REGSTR_VAL_PCMTDRIVER}
REGSTR_VAL_PCMTDRIVER = 'MTD'; { value of Mem Tech DRV }
{ used in hardware\enum\dev\inst by Device Installer }
{$EXTERNALSYM REGSTR_VAL_HARDWAREID}
REGSTR_VAL_HARDWAREID = 'HardwareID'; { value of enum\dev\inst }
{ value names under class brach REGSTR_KEY_CLASS + class name }
{ and for the drivers REGSTR_KEY_CLASS\classname\xxxx }
{$EXTERNALSYM REGSTR_VAL_INSTALLER}
REGSTR_VAL_INSTALLER = 'Installer'; { value of class\name }
{$EXTERNALSYM REGSTR_VAL_INSICON}
REGSTR_VAL_INSICON = 'Icon'; { value of class\name }
{$EXTERNALSYM REGSTR_VAL_ENUMPROPPAGES}
REGSTR_VAL_ENUMPROPPAGES = 'EnumPropPages'; { For Class/Device Properties }
{$EXTERNALSYM REGSTR_VAL_BASICPROPERTIES}
REGSTR_VAL_BASICPROPERTIES = 'BasicProperties'; { For CPL basic Properties }
{$EXTERNALSYM REGSTR_VAL_PRIVATEPROBLEM}
REGSTR_VAL_PRIVATEPROBLEM = 'PrivateProblem'; { For Handling Private Problems }
{ names used for display driver set information }
{$EXTERNALSYM REGSTR_KEY_CURRENT}
REGSTR_KEY_CURRENT = 'Current'; { current mode information }
{$EXTERNALSYM REGSTR_KEY_DEFAULT}
REGSTR_KEY_DEFAULT = 'Default'; { default configuration }
{$EXTERNALSYM REGSTR_KEY_MODES}
REGSTR_KEY_MODES = 'Modes'; { modes subtree }
{$EXTERNALSYM REGSTR_VAL_MODE}
REGSTR_VAL_MODE = 'Mode'; { default mode }
{$EXTERNALSYM REGSTR_VAL_BPP}
REGSTR_VAL_BPP = 'BPP'; { bits per pixel }
{$EXTERNALSYM REGSTR_VAL_HRES}
REGSTR_VAL_HRES = 'HRes'; { horizontal resolution }
{$EXTERNALSYM REGSTR_VAL_VRES}
REGSTR_VAL_VRES = 'VRes'; { vertical resolution }
{$EXTERNALSYM REGSTR_VAL_FONTSIZE}
REGSTR_VAL_FONTSIZE = 'FontSize'; { used in default or override }
{$EXTERNALSYM REGSTR_VAL_DRV}
REGSTR_VAL_DRV = 'drv'; { the driver file }
{$EXTERNALSYM REGSTR_VAL_GRB}
REGSTR_VAL_GRB = 'grb'; { the grabber file }
{$EXTERNALSYM REGSTR_VAL_VDD}
REGSTR_VAL_VDD = 'vdd'; { vdds used here }
{$EXTERNALSYM REGSTR_VAL_VER}
REGSTR_VAL_VER = 'Ver';
{$EXTERNALSYM REGSTR_VAL_MAXRES}
REGSTR_VAL_MAXRES = 'MaxResolution'; { max res for monitors }
{$EXTERNALSYM REGSTR_VAL_DPMS}
REGSTR_VAL_DPMS = 'DPMS'; { DPMS enabled }
{$EXTERNALSYM REGSTR_VAL_RESUMERESET}
REGSTR_VAL_RESUMERESET = 'ResumeReset'; { need reset on resume }
{$EXTERNALSYM REGSTR_VAL_DESCRIPTION}
REGSTR_VAL_DESCRIPTION = 'Description';
{ keys in fontsize tree }
{$EXTERNALSYM REGSTR_KEY_SYSTEM}
REGSTR_KEY_SYSTEM = 'System'; { entries for system.ini }
{$EXTERNALSYM REGSTR_KEY_USER}
REGSTR_KEY_USER = 'User'; { entries for win.ini }
{$EXTERNALSYM REGSTR_VAL_DPI}
REGSTR_VAL_DPI = 'dpi'; { dpi of fontsize }
{ Used by PCIC socket services }
{$EXTERNALSYM REGSTR_VAL_PCICOPTIONS}
REGSTR_VAL_PCICOPTIONS = 'PCICOptions'; { Binary DWORD. IRQ mask in }
{ low word. # skts in high }
{$EXTERNALSYM PCIC_DEFAULT_IRQMASK}
PCIC_DEFAULT_IRQMASK = $4EB8; { Default IRQ masks }
{$EXTERNALSYM PCIC_DEFAULT_IRQMASK_NEC_98}
PCIC_DEFAULT_IRQMASK_NEC_98 = $1468; { Default IRQ masks }
{$EXTERNALSYM PCIC_DEFAULT_NUMSOCKETS}
PCIC_DEFAULT_NUMSOCKETS = 0; { 0 = Automatic detection }
{$EXTERNALSYM REGSTR_VAL_PCICIRQMAP}
REGSTR_VAL_PCICIRQMAP = 'PCICIRQMap'; { Binary 16 byte IRQ map table }
{ names used for control panel entries }
{$EXTERNALSYM REGSTR_PATH_APPEARANCE}
REGSTR_PATH_APPEARANCE = 'Control Panel\Appearance';
{$EXTERNALSYM REGSTR_PATH_LOOKSCHEMES}
REGSTR_PATH_LOOKSCHEMES = 'Control Panel\Appearance\Schemes';
{$EXTERNALSYM REGSTR_VAL_CUSTOMCOLORS}
REGSTR_VAL_CUSTOMCOLORS = 'CustomColors';
{$EXTERNALSYM REGSTR_PATH_SCREENSAVE}
REGSTR_PATH_SCREENSAVE = 'Control Panel\Desktop';
{$EXTERNALSYM REGSTR_VALUE_USESCRPASSWORD}
REGSTR_VALUE_USESCRPASSWORD = 'ScreenSaveUsePassword';
{$EXTERNALSYM REGSTR_VALUE_SCRPASSWORD}
REGSTR_VALUE_SCRPASSWORD = 'ScreenSave_Data';
{$EXTERNALSYM REGSTR_VALUE_LOWPOWERTIMEOUT}
REGSTR_VALUE_LOWPOWERTIMEOUT = 'ScreenSaveLowPowerTimeout';
{$EXTERNALSYM REGSTR_VALUE_POWEROFFTIMEOUT}
REGSTR_VALUE_POWEROFFTIMEOUT = 'ScreenSavePowerOffTimeout';
{$EXTERNALSYM REGSTR_VALUE_LOWPOWERACTIVE}
REGSTR_VALUE_LOWPOWERACTIVE = 'ScreenSaveLowPowerActive';
{$EXTERNALSYM REGSTR_VALUE_POWEROFFACTIVE}
REGSTR_VALUE_POWEROFFACTIVE = 'ScreenSavePowerOffActive';
{ used for Windows applets }
{$EXTERNALSYM REGSTR_PATH_WINDOWSAPPLETS}
REGSTR_PATH_WINDOWSAPPLETS = 'Software\Microsoft\Windows\CurrentVersion\Applets';
{ system tray. Flag values defined in systrap.h }
{$EXTERNALSYM REGSTR_PATH_SYSTRAY}
REGSTR_PATH_SYSTRAY = 'Software\Microsoft\Windows\CurrentVersion\Applets\SysTray';
{$EXTERNALSYM REGSTR_VAL_SYSTRAYSVCS}
REGSTR_VAL_SYSTRAYSVCS = 'Services';
{$EXTERNALSYM REGSTR_VAL_SYSTRAYBATFLAGS}
REGSTR_VAL_SYSTRAYBATFLAGS = 'PowerFlags';
{$EXTERNALSYM REGSTR_VAL_SYSTRAYPCCARDFLAGS}
REGSTR_VAL_SYSTRAYPCCARDFLAGS = 'PCMCIAFlags';
{ Used by system networking components to store per-user values. }
{ All keys here are under HKCU. }
{$EXTERNALSYM REGSTR_PATH_NETWORK_USERSETTINGS}
REGSTR_PATH_NETWORK_USERSETTINGS = 'Network';
{$EXTERNALSYM REGSTR_KEY_NETWORK_PERSISTENT}
REGSTR_KEY_NETWORK_PERSISTENT = '\Persistent';
{$EXTERNALSYM REGSTR_KEY_NETWORK_RECENT}
REGSTR_KEY_NETWORK_RECENT = '\Recent';
{$EXTERNALSYM REGSTR_VAL_REMOTE_PATH}
REGSTR_VAL_REMOTE_PATH = 'RemotePath';
{$EXTERNALSYM REGSTR_VAL_USER_NAME}
REGSTR_VAL_USER_NAME = 'UserName';
{$EXTERNALSYM REGSTR_VAL_PROVIDER_NAME}
REGSTR_VAL_PROVIDER_NAME = 'ProviderName';
{$EXTERNALSYM REGSTR_VAL_CONNECTION_TYPE}
REGSTR_VAL_CONNECTION_TYPE = 'ConnectionType';
{$EXTERNALSYM REGSTR_VAL_UPGRADE}
REGSTR_VAL_UPGRADE = 'Upgrade';
{$EXTERNALSYM REGSTR_KEY_LOGON}
REGSTR_KEY_LOGON = '\Logon';
{$EXTERNALSYM REGSTR_VAL_MUSTBEVALIDATED}
REGSTR_VAL_MUSTBEVALIDATED = 'MustBeValidated';
{$EXTERNALSYM REGSTR_VAL_RUNLOGINSCRIPT}
REGSTR_VAL_RUNLOGINSCRIPT = 'ProcessLoginScript';
{ NetworkProvider entries. These entries are under }
{ REGSTR_PATH_SERVICES\xxx\NetworkProvider }
{$EXTERNALSYM REGSTR_KEY_NETWORKPROVIDER}
REGSTR_KEY_NETWORKPROVIDER = '\NetworkProvider';
{$EXTERNALSYM REGSTR_PATH_NW32NETPROVIDER}
REGSTR_PATH_NW32NETPROVIDER = REGSTR_PATH_SERVICES + '\NWNP32' + REGSTR_KEY_NETWORKPROVIDER;
{$EXTERNALSYM REGSTR_PATH_MS32NETPROVIDER}
REGSTR_PATH_MS32NETPROVIDER = REGSTR_PATH_SERVICES + '\MSNP32' + REGSTR_KEY_NETWORKPROVIDER;
{$EXTERNALSYM REGSTR_VAL_AUTHENT_AGENT}
REGSTR_VAL_AUTHENT_AGENT = 'AuthenticatingAgent';
{ Entries under REGSTR_PATH_REALMODENET }
{$EXTERNALSYM REGSTR_VAL_PREFREDIR}
REGSTR_VAL_PREFREDIR = 'PreferredRedir';
{$EXTERNALSYM REGSTR_VAL_AUTOSTART}
REGSTR_VAL_AUTOSTART = 'AutoStart';
{$EXTERNALSYM REGSTR_VAL_AUTOLOGON}
REGSTR_VAL_AUTOLOGON = 'AutoLogon';
{$EXTERNALSYM REGSTR_VAL_NETCARD}
REGSTR_VAL_NETCARD = 'Netcard';
{$EXTERNALSYM REGSTR_VAL_TRANSPORT}
REGSTR_VAL_TRANSPORT = 'Transport';
{$EXTERNALSYM REGSTR_VAL_DYNAMIC}
REGSTR_VAL_DYNAMIC = 'Dynamic';
{$EXTERNALSYM REGSTR_VAL_TRANSITION}
REGSTR_VAL_TRANSITION = 'Transition';
{$EXTERNALSYM REGSTR_VAL_STATICDRIVE}
REGSTR_VAL_STATICDRIVE = 'StaticDrive';
{$EXTERNALSYM REGSTR_VAL_LOADHI}
REGSTR_VAL_LOADHI = 'LoadHi';
{$EXTERNALSYM REGSTR_VAL_LOADRMDRIVERS}
REGSTR_VAL_LOADRMDRIVERS = 'LoadRMDrivers';
{$EXTERNALSYM REGSTR_VAL_SETUPN}
REGSTR_VAL_SETUPN = 'SetupN';
{$EXTERNALSYM REGSTR_VAL_SETUPNPATH}
REGSTR_VAL_SETUPNPATH = 'SetupNPath';
{ Entries under REGSTR_PATH_CVNETWORK }
{$EXTERNALSYM REGSTR_VAL_WRKGRP_FORCEMAPPING}
REGSTR_VAL_WRKGRP_FORCEMAPPING = 'WrkgrpForceMapping';
{$EXTERNALSYM REGSTR_VAL_WRKGRP_REQUIRED}
REGSTR_VAL_WRKGRP_REQUIRED = 'WrkgrpRequired';
{ NT-compatible place where the name of the currently logged-on user is stored. }
{$EXTERNALSYM REGSTR_PATH_CURRENT_CONTROL_SET}
REGSTR_PATH_CURRENT_CONTROL_SET = 'System\CurrentControlSet\Control';
{$EXTERNALSYM REGSTR_VAL_CURRENT_USER}
REGSTR_VAL_CURRENT_USER = 'Current User';
{ section where password providers are installed (each provider has subkey under this key) }
{$EXTERNALSYM REGSTR_PATH_PWDPROVIDER}
REGSTR_PATH_PWDPROVIDER = 'System\CurrentControlSet\Control\PwdProvider';
{$EXTERNALSYM REGSTR_VAL_PWDPROVIDER_PATH}
REGSTR_VAL_PWDPROVIDER_PATH = 'ProviderPath';
{$EXTERNALSYM REGSTR_VAL_PWDPROVIDER_DESC}
REGSTR_VAL_PWDPROVIDER_DESC = 'Description';
{$EXTERNALSYM REGSTR_VAL_PWDPROVIDER_CHANGEPWD}
REGSTR_VAL_PWDPROVIDER_CHANGEPWD = 'ChangePassword';
{$EXTERNALSYM REGSTR_VAL_PWDPROVIDER_CHANGEPWDHWND}
REGSTR_VAL_PWDPROVIDER_CHANGEPWDHWND = 'ChangePasswordHwnd';
{$EXTERNALSYM REGSTR_VAL_PWDPROVIDER_GETPWDSTATUS}
REGSTR_VAL_PWDPROVIDER_GETPWDSTATUS = 'GetPasswordStatus';
{$EXTERNALSYM REGSTR_VAL_PWDPROVIDER_ISNP}
REGSTR_VAL_PWDPROVIDER_ISNP = 'NetworkProvider';
{$EXTERNALSYM REGSTR_VAL_PWDPROVIDER_CHANGEORDER}
REGSTR_VAL_PWDPROVIDER_CHANGEORDER = 'ChangeOrder';
{ Used by administrator configuration tool and various components who enforce }
{ policies. }
{$EXTERNALSYM REGSTR_PATH_POLICIES}
REGSTR_PATH_POLICIES = 'Software\Microsoft\Windows\CurrentVersion\Policies';
{ used to control remote update of administrator policies }
{$EXTERNALSYM REGSTR_PATH_UPDATE}
REGSTR_PATH_UPDATE = 'System\CurrentControlSet\Control\Update';
{$EXTERNALSYM REGSTR_VALUE_ENABLE}
REGSTR_VALUE_ENABLE = 'Enable';
{$EXTERNALSYM REGSTR_VALUE_VERBOSE}
REGSTR_VALUE_VERBOSE = 'Verbose';
{$EXTERNALSYM REGSTR_VALUE_NETPATH}
REGSTR_VALUE_NETPATH = 'NetworkPath';
{$EXTERNALSYM REGSTR_VALUE_DEFAULTLOC}
REGSTR_VALUE_DEFAULTLOC = 'UseDefaultNetLocation';
{ Entries under REGSTR_PATH_POLICIES }
{$EXTERNALSYM REGSTR_KEY_NETWORK}
REGSTR_KEY_NETWORK = 'Network';
{ REGSTR_KEY_SYSTEM = 'System'; !!! defined above }
{$EXTERNALSYM REGSTR_KEY_PRINTERS}
REGSTR_KEY_PRINTERS = 'Printers';
{$EXTERNALSYM REGSTR_KEY_WINOLDAPP}
REGSTR_KEY_WINOLDAPP = 'WinOldApp';
{ (following are values REG_DWORD, legal values 0 or 1, treat as "0" if value not present) }
{ policies under NETWORK key }
{$EXTERNALSYM REGSTR_VAL_NOFILESHARING}
REGSTR_VAL_NOFILESHARING = 'NoFileSharing'; { "1" prevents server from loading }
{$EXTERNALSYM REGSTR_VAL_NOPRINTSHARING}
REGSTR_VAL_NOPRINTSHARING = 'NoPrintSharing';
{$EXTERNALSYM REGSTR_VAL_NOFILESHARINGCTRL}
REGSTR_VAL_NOFILESHARINGCTRL = 'NoFileSharingControl'; { "1" removes sharing ui }
{$EXTERNALSYM REGSTR_VAL_NOPRINTSHARINGCTRL}
REGSTR_VAL_NOPRINTSHARINGCTRL = 'NoPrintSharingControl';
{$EXTERNALSYM REGSTR_VAL_HIDESHAREPWDS}
REGSTR_VAL_HIDESHAREPWDS = 'HideSharePwds'; { "1" hides share passwords with asterisks }
{$EXTERNALSYM REGSTR_VAL_DISABLEPWDCACHING}
REGSTR_VAL_DISABLEPWDCACHING = 'DisablePwdCaching'; { "1" disables caching }
{$EXTERNALSYM REGSTR_VAL_ALPHANUMPWDS}
REGSTR_VAL_ALPHANUMPWDS = 'AlphanumPwds'; { "1" forces alphanumeric passwords }
{$EXTERNALSYM REGSTR_VAL_NETSETUP_DISABLE}
REGSTR_VAL_NETSETUP_DISABLE = 'NoNetSetup';
{$EXTERNALSYM REGSTR_VAL_NETSETUP_NOCONFIGPAGE}
REGSTR_VAL_NETSETUP_NOCONFIGPAGE = 'NoNetSetupConfigPage';
{$EXTERNALSYM REGSTR_VAL_NETSETUP_NOIDPAGE}
REGSTR_VAL_NETSETUP_NOIDPAGE = 'NoNetSetupIDPage';
{$EXTERNALSYM REGSTR_VAL_NETSETUP_NOSECURITYPAGE}
REGSTR_VAL_NETSETUP_NOSECURITYPAGE = 'NoNetSetupSecurityPage';
{$EXTERNALSYM REGSTR_VAL_SYSTEMCPL_NOVIRTMEMPAGE}
REGSTR_VAL_SYSTEMCPL_NOVIRTMEMPAGE = 'NoVirtMemPage';
{$EXTERNALSYM REGSTR_VAL_SYSTEMCPL_NODEVMGRPAGE}
REGSTR_VAL_SYSTEMCPL_NODEVMGRPAGE = 'NoDevMgrPage';
{$EXTERNALSYM REGSTR_VAL_SYSTEMCPL_NOCONFIGPAGE}
REGSTR_VAL_SYSTEMCPL_NOCONFIGPAGE = 'NoConfigPage';
{$EXTERNALSYM REGSTR_VAL_SYSTEMCPL_NOFILESYSPAGE}
REGSTR_VAL_SYSTEMCPL_NOFILESYSPAGE = 'NoFileSysPage';
{$EXTERNALSYM REGSTR_VAL_DISPCPL_NODISPCPL}
REGSTR_VAL_DISPCPL_NODISPCPL = 'NoDispCPL';
{$EXTERNALSYM REGSTR_VAL_DISPCPL_NOBACKGROUNDPAGE}
REGSTR_VAL_DISPCPL_NOBACKGROUNDPAGE = 'NoDispBackgroundPage';
{$EXTERNALSYM REGSTR_VAL_DISPCPL_NOSCRSAVPAGE}
REGSTR_VAL_DISPCPL_NOSCRSAVPAGE = 'NoDispScrSavPage';
{$EXTERNALSYM REGSTR_VAL_DISPCPL_NOAPPEARANCEPAGE}
REGSTR_VAL_DISPCPL_NOAPPEARANCEPAGE = 'NoDispAppearancePage';
{$EXTERNALSYM REGSTR_VAL_DISPCPL_NOSETTINGSPAGE}
REGSTR_VAL_DISPCPL_NOSETTINGSPAGE = 'NoDispSettingsPage';
{$EXTERNALSYM REGSTR_VAL_SECCPL_NOSECCPL}
REGSTR_VAL_SECCPL_NOSECCPL = 'NoSecCPL';
{$EXTERNALSYM REGSTR_VAL_SECCPL_NOPWDPAGE}
REGSTR_VAL_SECCPL_NOPWDPAGE = 'NoPwdPage';
{$EXTERNALSYM REGSTR_VAL_SECCPL_NOADMINPAGE}
REGSTR_VAL_SECCPL_NOADMINPAGE = 'NoAdminPage';
{$EXTERNALSYM REGSTR_VAL_SECCPL_NOPROFILEPAGE}
REGSTR_VAL_SECCPL_NOPROFILEPAGE = 'NoProfilePage';
{$EXTERNALSYM REGSTR_VAL_PRINTERS_HIDETABS}
REGSTR_VAL_PRINTERS_HIDETABS = 'NoPrinterTabs';
{$EXTERNALSYM REGSTR_VAL_PRINTERS_NODELETE}
REGSTR_VAL_PRINTERS_NODELETE = 'NoDeletePrinter';
{$EXTERNALSYM REGSTR_VAL_PRINTERS_NOADD}
REGSTR_VAL_PRINTERS_NOADD = 'NoAddPrinter';
{$EXTERNALSYM REGSTR_VAL_WINOLDAPP_DISABLED}
REGSTR_VAL_WINOLDAPP_DISABLED = 'Disabled';
{$EXTERNALSYM REGSTR_VAL_WINOLDAPP_NOREALMODE}
REGSTR_VAL_WINOLDAPP_NOREALMODE = 'NoRealMode';
{$EXTERNALSYM REGSTR_VAL_NOENTIRENETWORK}
REGSTR_VAL_NOENTIRENETWORK = 'NoEntireNetwork';
{$EXTERNALSYM REGSTR_VAL_NOWORKGROUPCONTENTS}
REGSTR_VAL_NOWORKGROUPCONTENTS = 'NoWorkgroupContents';
{ REG_DWORD, 0=off, otherwise value is minimum # of chars to allow in password }
{$EXTERNALSYM REGSTR_VAL_MINPWDLEN}
REGSTR_VAL_MINPWDLEN = 'MinPwdLen';
{ REG_DWORD, 0=off, otherwise value is # of days for pwd to expire }
{$EXTERNALSYM REGSTR_VAL_PWDEXPIRATION}
REGSTR_VAL_PWDEXPIRATION = 'PwdExpiration';
{$EXTERNALSYM REGSTR_VAL_WIN31PROVIDER}
REGSTR_VAL_WIN31PROVIDER = 'Win31Provider'; { REG_SZ }
{ policies under SYSTEM key }
{$EXTERNALSYM REGSTR_VAL_DISABLEREGTOOLS}
REGSTR_VAL_DISABLEREGTOOLS = 'DisableRegistryTools';
{$EXTERNALSYM REGSTR_PATH_WINLOGON}
REGSTR_PATH_WINLOGON = 'Software\Microsoft\Windows\CurrentVersion\Winlogon';
{$EXTERNALSYM REGSTR_VAL_LEGALNOTICECAPTION}
REGSTR_VAL_LEGALNOTICECAPTION = 'LegalNoticeCaption'; { REG_SZ }
{$EXTERNALSYM REGSTR_VAL_LEGALNOTICETEXT}
REGSTR_VAL_LEGALNOTICETEXT = 'LegalNoticeText'; { REG_SZ }
{$EXTERNALSYM REGSTR_VAL_RESTRICTRUN}
REGSTR_VAL_RESTRICTRUN = 'RestrictRun';
{ Entries in policy file. (Won't be in local registry, only policy hive) }
{$EXTERNALSYM REGSTR_KEY_POL_USERS}
REGSTR_KEY_POL_USERS = 'Users';
{$EXTERNALSYM REGSTR_KEY_POL_COMPUTERS}
REGSTR_KEY_POL_COMPUTERS = 'Computers';
{$EXTERNALSYM REGSTR_KEY_POL_USERGROUPS}
REGSTR_KEY_POL_USERGROUPS = 'UserGroups';
{$EXTERNALSYM REGSTR_KEY_POL_DEFAULT}
REGSTR_KEY_POL_DEFAULT = '.default';
{$EXTERNALSYM REGSTR_KEY_POL_USERGROUPDATA}
REGSTR_KEY_POL_USERGROUPDATA = 'GroupData\UserGroups\Priority';
{ Entries for time zone information under LOCAL_MACHINE }
{$EXTERNALSYM REGSTR_PATH_TIMEZONE}
REGSTR_PATH_TIMEZONE = 'System\CurrentControlSet\Control\TimeZoneInformation';
{$EXTERNALSYM REGSTR_VAL_TZBIAS}
REGSTR_VAL_TZBIAS = 'Bias';
{$EXTERNALSYM REGSTR_VAL_TZDLTBIAS}
REGSTR_VAL_TZDLTBIAS = 'DaylightBias';
{$EXTERNALSYM REGSTR_VAL_TZSTDBIAS}
REGSTR_VAL_TZSTDBIAS = 'StandardBias';
{$EXTERNALSYM REGSTR_VAL_TZACTBIAS}
REGSTR_VAL_TZACTBIAS = 'ActiveTimeBias';
{$EXTERNALSYM REGSTR_VAL_TZDLTFLAG}
REGSTR_VAL_TZDLTFLAG = 'DaylightFlag';
{$EXTERNALSYM REGSTR_VAL_TZSTDSTART}
REGSTR_VAL_TZSTDSTART = 'StandardStart';
{$EXTERNALSYM REGSTR_VAL_TZDLTSTART}
REGSTR_VAL_TZDLTSTART = 'DaylightStart';
{$EXTERNALSYM REGSTR_VAL_TZDLTNAME}
REGSTR_VAL_TZDLTNAME = 'DaylightName';
{$EXTERNALSYM REGSTR_VAL_TZSTDNAME}
REGSTR_VAL_TZSTDNAME = 'StandardName';
{$EXTERNALSYM REGSTR_VAL_TZNOCHANGESTART}
REGSTR_VAL_TZNOCHANGESTART = 'NoChangeStart';
{$EXTERNALSYM REGSTR_VAL_TZNOCHANGEEND}
REGSTR_VAL_TZNOCHANGEEND = 'NoChangeEnd';
{$EXTERNALSYM REGSTR_VAL_TZNOAUTOTIME}
REGSTR_VAL_TZNOAUTOTIME = 'DisableAutoDaylightTimeSet';
{ Entries for floating point processor existence under LOCAL_MACHINE }
{$EXTERNALSYM REGSTR_PATH_FLOATINGPOINTPROCESSOR}
REGSTR_PATH_FLOATINGPOINTPROCESSOR = 'HARDWARE\DESCRIPTION\System\FloatingPointProcessor';
{$EXTERNALSYM REGSTR_PATH_FLOATINGPOINTPROCESSOR0}
REGSTR_PATH_FLOATINGPOINTPROCESSOR0 = 'HARDWARE\DESCRIPTION\System\FloatingPointProcessor\0';
{ Entries for computer name under LOCAL_MACHINE }
{$EXTERNALSYM REGSTR_PATH_COMPUTRNAME}
REGSTR_PATH_COMPUTRNAME = 'System\CurrentControlSet\Control\ComputerName\ComputerName';
{$EXTERNALSYM REGSTR_VAL_COMPUTRNAME}
REGSTR_VAL_COMPUTRNAME = 'ComputerName';
{ Entry so that we force a reboot on shutdown / single instance dos app }
{$EXTERNALSYM REGSTR_PATH_SHUTDOWN}
REGSTR_PATH_SHUTDOWN = 'System\CurrentControlSet\Control\Shutdown';
{$EXTERNALSYM REGSTR_VAL_FORCEREBOOT}
REGSTR_VAL_FORCEREBOOT = 'ForceReboot';
{$EXTERNALSYM REGSTR_VAL_SETUPPROGRAMRAN}
REGSTR_VAL_SETUPPROGRAMRAN = 'SetupProgramRan';
{$EXTERNALSYM REGSTR_VAL_DOES_POLLING}
REGSTR_VAL_DOES_POLLING = 'PollingSupportNeeded';
{ Entries for known system DLLs under LOCAL_MACHINE }
{ The VAL keys here are the actual DLL names (FOO.DLL) }
{$EXTERNALSYM REGSTR_PATH_KNOWNDLLS}
REGSTR_PATH_KNOWNDLLS = 'System\CurrentControlSet\Control\SessionManager\KnownDLLs';
{$EXTERNALSYM REGSTR_PATH_KNOWN16DLLS}
REGSTR_PATH_KNOWN16DLLS = 'System\CurrentControlSet\Control\SessionManager\Known16DLLs';
{ Entries here for system dlls we need to version check in case overwritten }
{$EXTERNALSYM REGSTR_PATH_CHECKVERDLLS}
REGSTR_PATH_CHECKVERDLLS = 'System\CurrentControlSet\Control\SessionManager\CheckVerDLLs';
{$EXTERNALSYM REGSTR_PATH_WARNVERDLLS}
REGSTR_PATH_WARNVERDLLS = 'System\CurrentControlSet\Control\SessionManager\WarnVerDLLs';
{ Entries here for app ini files we (msgsrv32) need to hack }
{$EXTERNALSYM REGSTR_PATH_HACKINIFILE}
REGSTR_PATH_HACKINIFILE = 'System\CurrentControlSet\Control\SessionManager\HackIniFiles';
{ Keys here for bad applications we want to warn the user about before running }
{$EXTERNALSYM REGSTR_PATH_CHECKBADAPPS}
REGSTR_PATH_CHECKBADAPPS = 'System\CurrentControlSet\Control\SessionManager\CheckBadApps';
{ Keys here for applications we need to patch }
{$EXTERNALSYM REGSTR_PATH_APPPATCH}
REGSTR_PATH_APPPATCH = 'System\CurrentControlSet\Control\SessionManager\AppPatches';
{ Entries for known system VxDs under LOCAL_MACHINE }
{ The VAL keys here are the full path names of VxDs (c:\app\vapp.vxd) }
{ It is suggested that the keynames be the same as the module name of }
{ the VxD. }
{ This section is used to dyna-load VxDs with }
{ CreateFile(\.\vxd_regstr_keyname). }
{$EXTERNALSYM REGSTR_PATH_KNOWNVXDS}
REGSTR_PATH_KNOWNVXDS = 'System\CurrentControlSet\Control\SessionManager\KnownVxDs';
{ Entries for values in uninstaller keys under REGSTR_PATH_UNINSTALL \ appname }
{$EXTERNALSYM REGSTR_VAL_UNINSTALLER_DISPLAYNAME}
REGSTR_VAL_UNINSTALLER_DISPLAYNAME = 'DisplayName';
{$EXTERNALSYM REGSTR_VAL_UNINSTALLER_COMMANDLINE}
REGSTR_VAL_UNINSTALLER_COMMANDLINE = 'UninstallString';
{ Entries for known per user settings: Under HKEY_CURRENT_USER }
{$EXTERNALSYM REGSTR_PATH_DESKTOP}
REGSTR_PATH_DESKTOP = REGSTR_PATH_SCREENSAVE;
{$EXTERNALSYM REGSTR_PATH_MOUSE}
REGSTR_PATH_MOUSE = 'Control Panel\Mouse';
{$EXTERNALSYM REGSTR_PATH_KEYBOARD}
REGSTR_PATH_KEYBOARD = 'Control Panel\Keyboard';
{$EXTERNALSYM REGSTR_PATH_COLORS}
REGSTR_PATH_COLORS = 'Control Panel\Colors';
{$EXTERNALSYM REGSTR_PATH_SOUND}
REGSTR_PATH_SOUND = 'Control Panel\Sound';
{$EXTERNALSYM REGSTR_PATH_METRICS}
REGSTR_PATH_METRICS = 'Control Panel\Desktop\WindowMetrics';
{$EXTERNALSYM REGSTR_PATH_ICONS}
REGSTR_PATH_ICONS = 'Control Panel\Icons';
{$EXTERNALSYM REGSTR_PATH_CURSORS}
REGSTR_PATH_CURSORS = 'Control Panel\Cursors';
{$EXTERNALSYM REGSTR_PATH_CHECKDISK}
REGSTR_PATH_CHECKDISK = 'Software\Microsoft\Windows\CurrentVersion\Applets\Check Drive';
{$EXTERNALSYM REGSTR_PATH_CHECKDISKSET}
REGSTR_PATH_CHECKDISKSET = 'Settings';
{$EXTERNALSYM REGSTR_PATH_CHECKDISKUDRVS}
REGSTR_PATH_CHECKDISKUDRVS = 'NoUnknownDDErrDrvs';
{ Entries under REGSTR_PATH_FAULT }
{$EXTERNALSYM REGSTR_PATH_FAULT}
REGSTR_PATH_FAULT = 'Software\Microsoft\Windows\CurrentVersion\Fault';
{$EXTERNALSYM REGSTR_VAL_FAULT_LOGFILE}
REGSTR_VAL_FAULT_LOGFILE = 'LogFile';
{ Entries under REGSTR_PATH_AEDEBUG }
{$EXTERNALSYM REGSTR_PATH_AEDEBUG}
REGSTR_PATH_AEDEBUG = 'Software\Microsoft\Windows NT\CurrentVersion\AeDebug';
{$EXTERNALSYM REGSTR_VAL_AEDEBUG_DEBUGGER}
REGSTR_VAL_AEDEBUG_DEBUGGER = 'Debugger';
{$EXTERNALSYM REGSTR_VAL_AEDEBUG_AUTO}
REGSTR_VAL_AEDEBUG_AUTO = 'Auto';
{ Entries under REGSTR_PATH_GRPCONV }
{$EXTERNALSYM REGSTR_PATH_GRPCONV}
REGSTR_PATH_GRPCONV = 'Software\Microsoft\Windows\CurrentVersion\GrpConv';
{ Entries under the RegItem key in a shell namespace }
{$EXTERNALSYM REGSTR_VAL_REGITEMDELETEMESSAGE}
REGSTR_VAL_REGITEMDELETEMESSAGE = 'Removal Message';
{ Entries for the Drives Tools page }
{ NOTE that these items are not recorded for removable drives. These }
{ keys record X=DSKTLSYSTEMTIME where X is the drive letter. Since }
{ these tools actually work on the disk in the drive, as opposed to }
{ the drive itself, it is pointless to record them on a removable media }
{ since if a different disk is inserted in the drive, the data is }
{ meaningless. }
{$EXTERNALSYM REGSTR_PATH_LASTCHECK}
REGSTR_PATH_LASTCHECK = 'Software\Microsoft\Windows\CurrentVersion\Explorer\LastCheck';
{$EXTERNALSYM REGSTR_PATH_LASTOPTIMIZE}
REGSTR_PATH_LASTOPTIMIZE = 'Software\Microsoft\Windows\CurrentVersion\Explorer\LastOptimize';
{$EXTERNALSYM REGSTR_PATH_LASTBACKUP}
REGSTR_PATH_LASTBACKUP = 'Software\Microsoft\Windows\CurrentVersion\Explorer\LastBackup';
{ The above 3 keys record with the registry value of the drive letter }
{ a SYSTEMTIME structure }
{ Entries under HKEY_LOCAL_MACHINE for Check Drive specific stuff }
{$EXTERNALSYM REGSTR_PATH_CHKLASTCHECK}
REGSTR_PATH_CHKLASTCHECK = 'Software\Microsoft\Windows\CurrentVersion\Applets\Check Drive\LastCheck';
{$EXTERNALSYM REGSTR_PATH_CHKLASTSURFAN}
REGSTR_PATH_CHKLASTSURFAN = 'Software\Microsoft\Windows\CurrentVersion\Applets\Check Drive\LastSurfaceAnalysis';
{ The above 2 keys record the following binary structure which is }
{ a system time structure with the addition of a result code field. }
{ Note that the time part of REGSTR_PATH_CHKLASTCHECK is effectively }
{ identical to REGSTR_PATH_LASTCHECK under the explorer key }
type
PDSKTLSystemTime = ^TDSKTLSystemTime;
{$EXTERNALSYM _DSKTLSYSTEMTIME}
_DSKTLSYSTEMTIME = packed record
wYear: Word;
wMonth: Word;
wDayOfWeek: Word;
wDay: Word;
wHour: Word;
wMinute: Word;
wSecond: Word;
wMilliseconds: Word;
wResult: Word;
end;
{$EXTERNALSYM DSKTLSYSTEMTIME}
DSKTLSYSTEMTIME = _DSKTLSYSTEMTIME;
TDSKTLSystemTime = _DSKTLSYSTEMTIME;
{ The following are defines for the wResult field }
const
{$EXTERNALSYM DTRESULTOK}
DTRESULTOK = 0; { Operation was successful, no errors }
{$EXTERNALSYM DTRESULTFIX}
DTRESULTFIX = 1; { Operation was successful, errors were found }
{ but all were fixed. }
{$EXTERNALSYM DTRESULTPROB}
DTRESULTPROB = 2; { Operation was not successful or errors }
{ were found and some or all were not fixed. }
{$EXTERNALSYM DTRESULTPART}
DTRESULTPART = 3; { Operation was partially completed but was }
{ terminated either by the user or an error. }
{ Entries for persistent shares }
{$EXTERNALSYM REGSTR_KEY_SHARES}
REGSTR_KEY_SHARES = 'Software\Microsoft\Windows\CurrentVersion\Network\LanMan';
{$EXTERNALSYM REGSTR_VAL_SHARES_FLAGS}
REGSTR_VAL_SHARES_FLAGS = 'Flags';
{$EXTERNALSYM REGSTR_VAL_SHARES_TYPE}
REGSTR_VAL_SHARES_TYPE = 'Type';
{$EXTERNALSYM REGSTR_VAL_SHARES_PATH}
REGSTR_VAL_SHARES_PATH = 'Path';
{$EXTERNALSYM REGSTR_VAL_SHARES_REMARK}
REGSTR_VAL_SHARES_REMARK = 'Remark';
{$EXTERNALSYM REGSTR_VAL_SHARES_RW_PASS}
REGSTR_VAL_SHARES_RW_PASS = 'Parm1';
{$EXTERNALSYM REGSTR_VAL_SHARES_RO_PASS}
REGSTR_VAL_SHARES_RO_PASS = 'Parm2';
{ Entries for printer settings under LOCAL_MACHINE }
{$EXTERNALSYM REGSTR_PATH_PRINT}
REGSTR_PATH_PRINT = 'System\CurrentControlSet\Control\Print';
{$EXTERNALSYM REGSTR_PATH_PRINTERS}
REGSTR_PATH_PRINTERS = 'System\CurrentControlSet\Control\Print\Printers';
{$EXTERNALSYM REGSTR_PATH_PROVIDERS}
REGSTR_PATH_PROVIDERS = 'System\CurrentControlSet\Control\Print\Providers';
{$EXTERNALSYM REGSTR_PATH_MONITORS}
REGSTR_PATH_MONITORS = 'System\CurrentControlSet\Control\Print\Monitors';
{$EXTERNALSYM REGSTR_PATH_ENVIRONMENTS}
REGSTR_PATH_ENVIRONMENTS = 'System\CurrentControlSet\Control\Print\Environments';
{$EXTERNALSYM REGSTR_VAL_START_ON_BOOT}
REGSTR_VAL_START_ON_BOOT = 'StartOnBoot';
{$EXTERNALSYM REGSTR_VAL_PRINTERS_MASK}
REGSTR_VAL_PRINTERS_MASK = 'PrintersMask';
{$EXTERNALSYM REGSTR_VAL_DOS_SPOOL_MASK}
REGSTR_VAL_DOS_SPOOL_MASK = 'DOSSpoolMask';
{$EXTERNALSYM REGSTR_KEY_CURRENT_ENV}
REGSTR_KEY_CURRENT_ENV = '\Windows 4';
{$EXTERNALSYM REGSTR_KEY_DRIVERS}
REGSTR_KEY_DRIVERS = '\Drivers';
{$EXTERNALSYM REGSTR_KEY_PRINT_PROC}
REGSTR_KEY_PRINT_PROC = '\Print Processors';
{ Entries for MultiMedia under HKEY_CURRENT_USER }
{$EXTERNALSYM REGSTR_PATH_EVENTLABELS}
REGSTR_PATH_EVENTLABELS = 'AppEvents\EventLabels';
{$EXTERNALSYM REGSTR_PATH_SCHEMES}
REGSTR_PATH_SCHEMES = 'AppEvents\Schemes';
{$EXTERNALSYM REGSTR_PATH_APPS}
REGSTR_PATH_APPS = REGSTR_PATH_SCHEMES + '\Apps';
{$EXTERNALSYM REGSTR_PATH_APPS_DEFAULT}
REGSTR_PATH_APPS_DEFAULT = REGSTR_PATH_SCHEMES + '\Apps\.Default';
{$EXTERNALSYM REGSTR_PATH_NAMES}
REGSTR_PATH_NAMES = REGSTR_PATH_SCHEMES + '\Names';
{$EXTERNALSYM REGSTR_PATH_MULTIMEDIA}
REGSTR_PATH_MULTIMEDIA = REGSTR_PATH_SETUP + '\Multimedia';
{$EXTERNALSYM REGSTR_PATH_MULTIMEDIA_AUDIO}
REGSTR_PATH_MULTIMEDIA_AUDIO = 'Software\Microsoft\Multimedia\Audio';
{ Entries for MultiMedia under HKEY_LOCAL_MACHINE }
{$EXTERNALSYM REGSTR_PATH_MEDIARESOURCES}
REGSTR_PATH_MEDIARESOURCES = REGSTR_PATH_CURRENT_CONTROL_SET + '\MediaResources';
{$EXTERNALSYM REGSTR_PATH_MEDIAPROPERTIES}
REGSTR_PATH_MEDIAPROPERTIES = REGSTR_PATH_CURRENT_CONTROL_SET + '\MediaProperties';
{$EXTERNALSYM REGSTR_PATH_PRIVATEPROPERTIES}
REGSTR_PATH_PRIVATEPROPERTIES = REGSTR_PATH_MEDIAPROPERTIES + '\PrivateProperties';
{$EXTERNALSYM REGSTR_PATH_PUBLICPROPERTIES}
REGSTR_PATH_PUBLICPROPERTIES = REGSTR_PATH_MEDIAPROPERTIES + '\PublicProperties';
{ joysticks }
{$EXTERNALSYM REGSTR_PATH_JOYOEM}
REGSTR_PATH_JOYOEM = REGSTR_PATH_PRIVATEPROPERTIES + '\Joystick\OEM';
{$EXTERNALSYM REGSTR_PATH_JOYCONFIG}
REGSTR_PATH_JOYCONFIG = REGSTR_PATH_MEDIARESOURCES + '\Joystick';
{$EXTERNALSYM REGSTR_KEY_JOYCURR}
REGSTR_KEY_JOYCURR = 'CurrentJoystickSettings';
{$EXTERNALSYM REGSTR_KEY_JOYSETTINGS}
REGSTR_KEY_JOYSETTINGS = 'JoystickSettings';
{ joystick values found under REGSTR_PATH_JOYCONFIG }
{$EXTERNALSYM REGSTR_VAL_JOYUSERVALUES}
REGSTR_VAL_JOYUSERVALUES = 'JoystickUserValues';
{$EXTERNALSYM REGSTR_VAL_JOYCALLOUT}
REGSTR_VAL_JOYCALLOUT = 'JoystickCallout';
{ joystick values found under REGSTR_KEY_JOYCURR and REGSTR_KEY_JOYSETTINGS }
{$EXTERNALSYM REGSTR_VAL_JOYNCONFIG}
REGSTR_VAL_JOYNCONFIG = 'Joystick%dConfiguration';
{$EXTERNALSYM REGSTR_VAL_JOYNOEMNAME}
REGSTR_VAL_JOYNOEMNAME = 'Joystick%dOEMName';
{$EXTERNALSYM REGSTR_VAL_JOYNOEMCALLOUT}
REGSTR_VAL_JOYNOEMCALLOUT = 'Joystick%dOEMCallout';
{ joystick values found under keys under REGSTR_PATH_JOYOEM }
{$EXTERNALSYM REGSTR_VAL_JOYOEMCALLOUT}
REGSTR_VAL_JOYOEMCALLOUT = 'OEMCallout';
{$EXTERNALSYM REGSTR_VAL_JOYOEMNAME}
REGSTR_VAL_JOYOEMNAME = 'OEMName';
{$EXTERNALSYM REGSTR_VAL_JOYOEMDATA}
REGSTR_VAL_JOYOEMDATA = 'OEMData';
{$EXTERNALSYM REGSTR_VAL_JOYOEMXYLABEL}
REGSTR_VAL_JOYOEMXYLABEL = 'OEMXYLabel';
{$EXTERNALSYM REGSTR_VAL_JOYOEMZLABEL}
REGSTR_VAL_JOYOEMZLABEL = 'OEMZLabel';
{$EXTERNALSYM REGSTR_VAL_JOYOEMRLABEL}
REGSTR_VAL_JOYOEMRLABEL = 'OEMRLabel';
{$EXTERNALSYM REGSTR_VAL_JOYOEMPOVLABEL}
REGSTR_VAL_JOYOEMPOVLABEL = 'OEMPOVLabel';
{$EXTERNALSYM REGSTR_VAL_JOYOEMULABEL}
REGSTR_VAL_JOYOEMULABEL = 'OEMULabel';
{$EXTERNALSYM REGSTR_VAL_JOYOEMVLABEL}
REGSTR_VAL_JOYOEMVLABEL = 'OEMVLabel';
{$EXTERNALSYM REGSTR_VAL_JOYOEMTESTMOVEDESC}
REGSTR_VAL_JOYOEMTESTMOVEDESC = 'OEMTestMoveDesc';
{$EXTERNALSYM REGSTR_VAL_JOYOEMTESTBUTTONDESC}
REGSTR_VAL_JOYOEMTESTBUTTONDESC = 'OEMTestButtonDesc';
{$EXTERNALSYM REGSTR_VAL_JOYOEMTESTMOVECAP}
REGSTR_VAL_JOYOEMTESTMOVECAP = 'OEMTestMoveCap';
{$EXTERNALSYM REGSTR_VAL_JOYOEMTESTBUTTONCAP}
REGSTR_VAL_JOYOEMTESTBUTTONCAP = 'OEMTestButtonCap';
{$EXTERNALSYM REGSTR_VAL_JOYOEMTESTWINCAP}
REGSTR_VAL_JOYOEMTESTWINCAP = 'OEMTestWinCap';
{$EXTERNALSYM REGSTR_VAL_JOYOEMCALCAP}
REGSTR_VAL_JOYOEMCALCAP = 'OEMCalCap';
{$EXTERNALSYM REGSTR_VAL_JOYOEMCALWINCAP}
REGSTR_VAL_JOYOEMCALWINCAP = 'OEMCalWinCap';
{$EXTERNALSYM REGSTR_VAL_JOYOEMCAL1}
REGSTR_VAL_JOYOEMCAL1 = 'OEMCal1';
{$EXTERNALSYM REGSTR_VAL_JOYOEMCAL2}
REGSTR_VAL_JOYOEMCAL2 = 'OEMCal2';
{$EXTERNALSYM REGSTR_VAL_JOYOEMCAL3}
REGSTR_VAL_JOYOEMCAL3 = 'OEMCal3';
{$EXTERNALSYM REGSTR_VAL_JOYOEMCAL4}
REGSTR_VAL_JOYOEMCAL4 = 'OEMCal4';
{$EXTERNALSYM REGSTR_VAL_JOYOEMCAL5}
REGSTR_VAL_JOYOEMCAL5 = 'OEMCal5';
{$EXTERNALSYM REGSTR_VAL_JOYOEMCAL6}
REGSTR_VAL_JOYOEMCAL6 = 'OEMCal6';
{$EXTERNALSYM REGSTR_VAL_JOYOEMCAL7}
REGSTR_VAL_JOYOEMCAL7 = 'OEMCal7';
{$EXTERNALSYM REGSTR_VAL_JOYOEMCAL8}
REGSTR_VAL_JOYOEMCAL8 = 'OEMCal8';
{$EXTERNALSYM REGSTR_VAL_JOYOEMCAL9}
REGSTR_VAL_JOYOEMCAL9 = 'OEMCal9';
{$EXTERNALSYM REGSTR_VAL_JOYOEMCAL10}
REGSTR_VAL_JOYOEMCAL10 = 'OEMCal10';
{$EXTERNALSYM REGSTR_VAL_JOYOEMCAL11}
REGSTR_VAL_JOYOEMCAL11 = 'OEMCal11';
{$EXTERNALSYM REGSTR_VAL_JOYOEMCAL12}
REGSTR_VAL_JOYOEMCAL12 = 'OEMCal12';
implementation
end.
|
unit AccountClassList;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, BaseGridDetail, Data.DB, RzButton,
Vcl.StdCtrls, Vcl.Mask, RzEdit, Vcl.Grids, Vcl.DBGrids, RzDBGrid, RzLabel,
Vcl.ExtCtrls, RzPanel, RzDBEdit, Vcl.DBCtrls;
type
TfrmAccountClassList = class(TfrmBaseGridDetail)
Label2: TLabel;
edClassName: TRzDBEdit;
Label3: TLabel;
mmDescription: TRzDBMemo;
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
protected
function EntryIsValid: boolean; override;
function NewIsAllowed: boolean; override;
function EditIsAllowed: boolean; override;
procedure SearchList; override;
procedure BindToObject; override;
end;
implementation
{$R *.dfm}
{ TfrmAccountClassList }
uses
AccountingAuxData, IFinanceDialogs;
procedure TfrmAccountClassList.BindToObject;
begin
inherited;
end;
function TfrmAccountClassList.EditIsAllowed: boolean;
begin
end;
function TfrmAccountClassList.EntryIsValid: boolean;
var
error: string;
begin
if Trim(edClassName.Text) = '' then error := 'Please enter class name.';
if error <> '' then ShowErrorBox(error);
Result := error = '';
end;
procedure TfrmAccountClassList.FormCreate(Sender: TObject);
begin
dmAccountingAux := TdmAccountingAux.Create(self);
inherited;
end;
procedure TfrmAccountClassList.FormDestroy(Sender: TObject);
begin
inherited;
dmAccountingAux.Free;
end;
function TfrmAccountClassList.NewIsAllowed: boolean;
begin
end;
procedure TfrmAccountClassList.SearchList;
begin
grList.DataSource.DataSet.Locate('acct_class_name',edSearchKey.Text,
[loPartialKey,loCaseInsensitive]);
end;
end.
|
unit ViewF;
interface
uses
Messages, SysUtils, Forms, ExtCtrls, Printers, MainF, Classes, Controls,
Dialogs, StdCtrls, Menus, Windows;
type
TAnsichtForm = class(TForm)
AnsichtFormItemsListBox: TListBox;
AnsichtFormDLabel: TLabel;
AnsichtFormHLabel: TLabel;
AnsichtFormRLabel: TLabel;
AnsichtFormPLabel: TLabel;
MainFormObenBevel: TBevel;
AnsichtFormScrollCheckBox: TCheckBox;
AnsichtFormMainMenu: TMainMenu;
AnsichtFormAnsichtMenuItem: TMenuItem;
AnsichtFormDruckenMenuItem: TMenuItem;
AnichtFormUntenBevel: TBevel;
AnsichtFormPrintDialog: TPrintDialog;
AnsichtFormTextListBox: TListBox;
AnsichtFormTextListBoxTimer: TTimer;
procedure AnsichtFormDruckenMenuItemClick(Sender: TObject);
procedure AnsichtFormItemsListBoxClick(Sender: TObject);
procedure AnsichtFormItemsListBoxKeyPress(Sender: TObject; var Key: Char);
procedure AnsichtFormScrollCheckBoxClick(Sender: TObject);
procedure AnsichtFormTextListBoxClick(Sender: TObject);
procedure AnsichtFormTextListBoxKeyPress(Sender: TObject; var Key: Char);
procedure AnsichtFormTextListBoxTimerTimer(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormShow(Sender: TObject);
private
{ Private-Deklarationen }
procedure ShowValuesForm(AValues : TValues);
public
{ Public-Deklarationen }
LastBreite : Integer;
LastValues : TValues;
PrintValues : Boolean;
end;
var
AnsichtForm: TAnsichtForm;
implementation
uses
ValuesF;
{$R *.DFM}
procedure TAnsichtForm.AnsichtFormDruckenMenuItemClick(Sender: TObject);
var
Index : Integer;
PrintHeight : Integer;
PrintLine : Integer;
Text : TStrings;
begin
try
if AnsichtFormPrintDialog.Execute then
begin
Printer.Canvas.Font.Name := 'Courier New';
ShowValuesForm(LastValues);
try
Text := TStringList.Create;
if (AnsichtFormPrintDialog.PrintRange = prAllPages) then
Text.Assign(AnsichtFormTextListBox.Items)
else
begin
Text.Add(AnsichtFormTextListBox.Items[0]);
Text.Add(AnsichtFormTextListBox.Items[1]);
for Index := 0 to Pred(AnsichtFormTextListBox.Items.Count) do
begin
if (AnsichtFormTextListBox.Selected[Index]) then
begin
if not((Index = 0) or (Index = 1)) then
Text.Add(AnsichtFormTextListBox.Items[Index]);
end;
end;
end;
try
PrintLine := 0;
Printer.Title := '';
if (PrintValues) then
begin
if LastValues.UseDominantGen then
begin
Printer.Title := 'SgDG / ' +
'FdDG = ' + FloatToStr(LastValues.Fitness) + ' / ';
end
else
begin
Printer.Title := 'SgRG / ' +
'FdRG = ' + FloatToStr(LastValues.Fitness) + ' / ';
end;
Printer.Title := Printer.Title + 'HdDG = ' + FloatToStr(LastValues.HowOftenDominant) + ' / ' +
'HdRG = ' + FloatToStr(LastValues.HowOftenRezessiv) + ' / ' +
'SKE = ' + FloatToStr(LastValues.SelektionsKoeffizient);
end;
Printer.BeginDoc;
PrintHeight := Printer.Canvas.TextHeight('AAA') * 2;
Printer.Canvas.TextOut(25, 25 + PrintHeight, Printer.Title);
Inc(PrintHeight, Printer.Canvas.TextHeight(Printer.Title));
PrintHeight := PrintHeight + Printer.Canvas.TextHeight('AAA') * 2;
while (PrintLine < Text.Count) do
begin
if (PrintHeight >= Printer.PageHeight - 50) then
begin
Printer.NewPage;
PrintHeight := Printer.Canvas.TextHeight('AAA') * 2;
Printer.Canvas.TextOut(25, 25 + PrintHeight, Printer.Title);
Inc(PrintHeight, Printer.Canvas.TextHeight(Printer.Title));
PrintHeight := PrintHeight + Printer.Canvas.TextHeight('AAA') * 2;
Printer.Canvas.TextOut(25, 25 + PrintHeight, Text[0]);
Inc(PrintHeight, Printer.Canvas.TextHeight(Text[0]));
Printer.Canvas.TextOut(25, 25 + PrintHeight, Text[1]);
Inc(PrintHeight, Printer.Canvas.TextHeight(Text[1]));
end;
Printer.Canvas.TextOut(25, 25 + PrintHeight, Text[PrintLine]);
Inc(PrintHeight, Printer.Canvas.TextHeight(Text[PrintLine]));
Inc(PrintLine);
end;
finally
Printer.EndDoc;
end;
finally
FreeAndNil(Text);
end;
end;
except
end;
end;
procedure TAnsichtForm.AnsichtFormItemsListBoxClick(Sender: TObject);
begin
try
if AnsichtFormScrollCheckBox.Checked then
AnsichtFormTextListBox.ItemIndex := AnsichtFormItemsListBox.ItemIndex;
except
end;
end;
procedure TAnsichtForm.AnsichtFormItemsListBoxKeyPress(Sender: TObject; var Key: Char);
begin
try
if AnsichtFormScrollCheckBox.Checked then
AnsichtFormTextListBox.ItemIndex := AnsichtFormItemsListBox.ItemIndex;
except
end;
end;
procedure TAnsichtForm.AnsichtFormScrollCheckBoxClick(Sender: TObject);
begin
try
AnsichtFormTextListBox.MultiSelect := not(AnsiChtFormScrollCheckBox.Checked);
except
end;
end;
procedure TAnsichtForm.AnsichtFormTextListBoxClick(Sender: TObject);
begin
try
if AnsichtFormScrollCheckBox.Checked then
AnsichtFormItemsListBox.ItemIndex := AnsichtFormTextListBox.ItemIndex
except
end;
end;
procedure TAnsichtForm.AnsichtFormTextListBoxKeyPress(Sender: TObject; var Key: Char);
begin
try
if AnsichtFormScrollCheckBox.Checked then
AnsichtFormItemsListBox.ItemIndex := AnsichtFormTextListBox.ItemIndex
except
end;
end;
procedure TAnsichtForm.AnsichtFormTextListBoxTimerTimer(Sender: TObject);
begin
try
SendMessage(AnsichtFormTextListBox.Handle, LB_SetHorizontalExtent, Round(Canvas.TextWidth('-') * (LastBreite + 5)), Longint(0));
except
end;
end;
procedure TAnsichtForm.FormCreate(Sender: TObject);
begin
try
DoubleBuffered := true;
except
end;
end;
procedure TAnsichtForm.FormShow(Sender: TObject);
begin
try
AnsichtFormDruckenMenuItem.Enabled := ((LastBreite <= CDruckenBreite) and
(Printer.Printers.Count > - 1));
except
end;
end;
procedure TAnsichtForm.ShowValuesForm(AValues: TValues);
begin
try
ValuesForm.ValuesFormFitnessValueLabel.Caption := FloatToStr(LastValues.Fitness);
ValuesForm.ValuesFormHowOftenDominantValueLabel.Caption := FloatToStr(LastValues.HowOftenDominant);
ValuesForm.ValuesFormHowOftenRezessivValueLabel.Caption := FloatToStr(LastValues.HowOftenRezessiv);
ValuesForm.ValuesFormSelektionsKoeffizientValueLabel.Caption := FloatToStr(LastValues.SelektionsKoeffizient);
if (LastValues.UseDominantGen) then
begin
ValuesForm.ValuesFormFitnessLabel.Caption := 'Fitness des dominanten Gens:';
ValuesForm.ValuesFormSelektionGegenValueLabel.Caption := 'dominante Gen';
end
else
begin
ValuesForm.ValuesFormFitnessLabel.Caption := 'Fitness des rezessiven Gens:';
ValuesForm.ValuesFormSelektionGegenValueLabel.Caption := 'rezessive Gen';
end;
ValuesForm.ShowModal;
except
ValuesForm.Close;
end;
end;
end.
|
unit ULauncherProfileLoader;
interface
uses SysUtils, UFileUtilities, SuperObject, USettingsManager, WinApi.Windows;
type
TAuthenticationDatabase = class
public
Count:Integer;
username, accessToken, uuid, displayName: Array[1..100]of String;
end;
TProfile = class
public
name, gameDir, javaDir, javaArgs, lastVersionId, playerUUID: String;
HasGameDir, HasJavaDir, HasJavaArgs: Boolean;
HasResolution, HasAllowedReleaseTypes: Boolean;
HasLastVersionId, HasPlayerUUID: Boolean;
Width, Height: Integer;
constructor Create(name:String);
end;
TLauncherProfilesLoader = class
public
memory: array[1..1000]of integer;
selectedProfile, clientToken:String;
profiles:array[0..100]of TProfile;
profileCount: Integer;
authenticationDatabase: TAuthenticationDatabase;
constructor Create(lp:string);
function GenerateString:String;
end;
TProfilesManager = class
public
class procedure Load;
class procedure Savesss;
class procedure Add(p:TProfile);
class function Find(name:String):TProfile;
end;
var LPLoader: TLauncherProfilesLoader;
LPLoaded: Boolean;
implementation
function GetGUID:string;
var g:TGUID;
begin
CreateGUID(g);
Result := GUIDToString(g);
Result := Copy(Result, 2, Length(Result) - 2);
end;
function tryGet(j:ISuperObject;field,default:string;var has:Boolean):string;
var jso: ISuperObject;
begin
jso := SOFindField(j, field);
if jso = nil then
begin
has:=false;
exit(default)
end
else
begin
has:=true;
exit(jso.AsString);
end;
end;
constructor TLauncherProfilesLoader.Create(lp:string);
var
jso, pf, pp, res: ISuperObject;
i: Integer; has:Boolean;
item: TSuperObjectIter;
begin
jso := SO(lp);
if jso = nil then
begin
jso := TSuperObject.Create;
jso['selectedProfile'] := SO('');
jso['clientToken'] := SO(GetGUID);
end;
selectedProfile := tryGet(jso, 'selectedProfile', '(Default)', has);
clientToken := tryGet(jso, 'clientToken', GetGUID, has);
authenticationDatabase := TAuthenticationDatabase.Create;
res := SOFindField(jso, 'authenticationDatabase');
if res = nil then
begin
authenticationDatabase.Count := 0;
end
else
begin
i := 0;
if ObjectFindFirst(res, item) then
repeat
pp := item.val;
with authenticationDatabase do
begin
username[i] := pp['username'].AsString;
accessToken[i] := pp['accessToken'].AsString;
uuid[i] := pp['uuid'].AsString;
displayName[i] := pp['displayName'].AsString;
end;
inc(i);
until Not ObjectFindNext(item);
end;
pf := SOFindField(jso, 'profiles');
if pf = nil then
profileCount := 0
else
begin
i := 0;
if ObjectFindFirst(pf, item) then
repeat
pp := item.val;
profiles[i] := TProfile.Create(pp.S['name']);
profiles[i].gameDir := tryGet(pp, 'gameDir', '', profiles[i].HasGameDir);
profiles[i].javaDir := tryGet(pp, 'javaDir', '', profiles[i].HasJavaDir);
profiles[i].javaArgs := tryGet(pp, 'javaArgs', '', profiles[i].HasJavaArgs);
profiles[i].lastVersionId := tryGet(pp, 'lastVersionId', '', profiles[i].HasLastVersionId);
profiles[i].playerUUID := tryGet(pp, 'playerUUID', '', profiles[i].HasPlayerUUID);
res := SOFindField(pp, 'resolution');
if res = nil then
profiles[i].HasResolution := false
else
begin
profiles[i].HasResolution := true;
profiles[i].Width := res['width'].AsInteger;
profiles[i].Height := res['height'].AsInteger;
end;
if SOFindField(pp, 'allowedReleaseTypes') = nil then
profiles[i].HasAllowedReleaseTypes := false
else
profiles[i].HasAllowedReleaseTypes := true;
inc(i);
until Not ObjectFindNext(item);
profileCount := i;
end;
// MessageBox(0, PWideChar(WideString(TlkJSON.GenerateText(jso))), nil, MB_OK);
end;
function TLauncherProfilesLoader.GenerateString:String;
var jso, pro, procontent, resln, auth: ISuperObject;
lst: ISuperobject; s:String;
i: Integer;
begin
jso := TSuperObject.Create;
jso['selectedProfile'] := SO('"'+ParseSeparator(selectedProfile)+'"');
jso['clientToken'] := SO('"'+clientToken+'"');
auth := TSuperObject.Create;
for i := 0 to authenticationDatabase.Count - 1 do
begin
resln := TSuperObject.Create;
with authenticationDatabase do
begin
resln['username'] := SO('"'+username[i]+'"');
resln['accessToken'] := SO('"'+accessToken[i]+'"');
resln['uuid'] := SO('"'+uuid[i]+'"');
resln['displayName'] := SO('"'+displayName[i]+'"');
auth[uuid[i]] := resln;
end;
end;
jso['authenticationDatabase'] := auth;
pro := TSuperObject.Create;
for i := 0 to profileCount - 1 do
begin
procontent := TSuperObject.Create;
procontent['name'] := SO('"'+profiles[i].name+'"');
if profiles[i].HasGameDir then
procontent['gameDir'] := SO('"'+profiles[i].gameDir+'"');
if profiles[i].HasJavaDir then
procontent['javaDir'] := SO('"'+profiles[i].javaDir+'"');
if profiles[i].HasJavaArgs then
procontent['javaArgs'] := SO('"'+profiles[i].javaArgs+'"');
if profiles[i].HasPlayerUUID then
procontent['playerUUID'] := SO('"'+profiles[i].playerUUID+'"');
if profiles[i].HasResolution then
begin
resln := TSuperObject.Create;
resln['width'] := SO(SOString(profiles[i].Width));
resln['height'] := SO(SOString(profiles[i].Height));
procontent['resolution'] := resln;
end;
if profiles[i].HasAllowedReleaseTypes then
begin
lst := SA([]);
lst.AsArray.Add(SO('"snapshot"'));
lst.AsArray.Add(SO('"release"'));
procontent['allowedReleaseTypes'] := lst;
end;
pro[ParseSeparator(profiles[i].name)] := procontent;
end;
jso['profiles'] := pro;
s := jso.AsJSon;
exit(s);
end;
class procedure TProfilesManager.Load;
var j: string;
begin
j := TFileUtilities.ReadToEnd(SMPMinecraftPath + '\launcher_profiles.json');
LPLoader := TLauncherProfilesLoader.Create(j);
LPLoaded := true;
end;
class procedure TProfilesManager.Savesss;
begin
if not LPLoaded then
exit;
TFileUtilities.WriteToFile(SMPMinecraftPath + '\launcher_profiles.json', LPLoader.GenerateString);
end;
class procedure TProfilesManager.Add(p: TProfile);
var
i: Integer;
begin
if p = nil then
exit;
for i := 0 to LPLoader.profileCount-1 do
if LPLoader.profiles[i].name = p.name then
begin
LPLoader.profiles[i] := p;
exit;
end;
LPLoader.profiles[LPLoader.profileCount] := p;
Inc(LPLoader.profileCount);
end;
class function TProfilesManager.Find(name:String):TProfile;
var
i: Integer;
begin
for i := 0 to LPLoader.profileCount - 1 do
if LPLoader.profiles[i].name = name then
exit(LPLoader.profiles[i]);
exit(nil);
end;
constructor TProfile.Create(name:String);
begin
Self.name := name;
Self.HasGameDir := false;
Self.HasJavaDir := false;
Self.HasJavaArgs := false;
Self.HasResolution := false;
Self.HasAllowedReleaseTypes := false;
Self.HasLastVersionId := false;
Self.HasPlayerUUID := false;
end;
end.
|
unit B_ID3V1;
interface
uses
SysUtils, Classes;
type
// some standard definition
PID3V1Rec = ^TID3V1Rec;
TID3V1Rec = packed record
Tag: array[0..2] of Char;
Title: array[0..29] of Char;
Artist: array[0..29] of Char;
Album: array[0..29] of Char;
Year: array[0..3] of Char;
Comment: array[0..29] of Char;
Genre: Byte;
end;
const
//genre.
cID3V1FGenre: array[0..160] of string = ('Blues', 'Classic Rock', 'Country', 'Dance', 'Disco', 'Funk',
'Grunge',
'Hip-Hop',
'Jazz',
'Metal',
'New Age',
'Oldies',
'Other',
'Pop',
'R&B',
'Rap',
'Reggae',
'Rock',
'Techno',
'Industrial',
'Alternative',
'Ska',
'Death Metal',
'Pranks',
'Soundtrack',
'Euro-Techno',
'Ambient',
'Trip-Hop',
'Vocal',
'Jazz+Funk',
'Fusion',
'Trance',
'Classical',
'Instrumental',
'Acid',
'House',
'Game',
'Sound Clip',
'Gospel',
'Noise',
'AlternRock',
'Bass',
'Soul',
'Punk',
'Space',
'Meditative',
'Instrumental Pop',
'Instrumental Rock',
'Ethnic',
'Gothic',
'Darkwave',
'Techno-Industrial',
'Electronic',
'Pop-Folk',
'Eurodance',
'Dream',
'Southern Rock',
'Comedy',
'Cult',
'Gangsta',
'Top 40',
'Christian Rap',
'Pop/Funk',
'Jungle',
'Native American',
'Cabaret',
'New Wave',
'Psychadelic',
'Rave',
'Showtunes',
'Trailer',
'Lo-Fi',
'Tribal',
'Acid Punk',
'Acid Jazz',
'Polka',
'Retro',
'Musical',
'Rock & Roll',
'Hard Rock',
{ WinAmp Genre Codes }
'Folk',
'Folk-Rock',
'National Folk',
'Swing',
'Fast Fusion',
'Bebob',
'Latin',
'Revival',
'Celtic',
'Bluegrass',
'Avantgarde',
'Gothic Rock',
'Progessive Rock',
'Psychedelic Rock',
'Symphonic Rock',
'Slow Rock',
'Big Band',
'Chorus',
'Easy Listening',
'Acoustic',
'Humour',
'Speech',
'Chanson',
'Opera',
'Chamber Music',
'Sonata',
'Symphony',
'Booty Bass',
'Primus',
'Porn Groove',
'Satire',
'Slow Jam',
'Club',
'Tango',
'Samba',
'Folklore',
'Ballad',
'Power Ballad',
'Rhythmic Soul',
'Freestyle',
'Duet',
'Punk Rock',
'Drum Solo',
'A capella',
'Euro-House',
'Dance Hall',
'Неизвестный стиль',
'Неизвестный стиль',
'Неизвестный стиль',
'Неизвестный стиль',
'Неизвестный стиль',
'Неизвестный стиль',
'Неизвестный стиль',
'Неизвестный стиль',
'Неизвестный стиль',
'Неизвестный стиль',
'Неизвестный стиль',
'Неизвестный стиль',
'Неизвестный стиль',
'Неизвестный стиль',
'Неизвестный стиль',
'Неизвестный стиль',
'Неизвестный стиль',
'Неизвестный стиль',
'Неизвестный стиль',
'Неизвестный стиль',
'Неизвестный стиль',
'Неизвестный стиль',
'Неизвестный стиль',
'Неизвестный стиль',
'Неизвестный стиль',
'Неизвестный стиль',
'Неизвестный стиль',
'Неизвестный стиль',//153
'Неизвестный стиль',
'Неизвестный стиль',
'Неизвестный стиль',
'Неизвестный стиль',
'Неизвестный стиль',
'Неизвестный стиль',
'--No info--'); ////put yourself the kind of genre see tag3 list post before
function BASSID3ToID3V1Rec(PC: PChar): TID3V1Rec;
implementation
function BASSID3ToID3V1Rec(PC: PChar): TID3V1Rec;
var
TempID3V1: TID3V1Rec; // only for a better checking
begin
// fill the record with some dummy chars
FillChar(Result, SizeOf(TID3V1Rec) - 1, '?');
// check to see if ther's something to map
if (PC = nil) then Exit;
// convert/copy to the record structure
TempID3V1 := PID3V1Rec(PC)^;
// check to see if it's really a ID3V1 Tag
// else just give the dummy record back
if SameText(TempID3V1.Tag, 'TAG') then Result := TempID3V1;
end;
end.
|
unit IdNNTP;
interface
uses
Classes,
IdException,
IdGlobal,
IdTCPConnection,
IdMessage,
IdMessageClient;
type
TModeType = (mtStream, mtIHAVE, mtReader);
TConnectionResult = (crCanPost, crNoPost, crAuthRequired, crTempUnavailable);
TModeSetResult = (mrCanStream, mrNoStream, mrCanIHAVE, mrNoIHAVE, mrCanPost,
mrNoPost);
TEventStreaming = procedure(const AMesgID: string; var AAccepted: Boolean) of
object;
TNewsTransportEvent = procedure(AMsg: TStringList) of object;
TEventNewsgroupList = procedure(const ANewsgroup: string; const ALow, AHigh:
Cardinal;
const AType: string; var ACanContinue: Boolean) of object;
TEventNewNewsList = procedure(const AMsgID: string; var ACanContinue: Boolean)
of object;
TIdNNTP = class(TIdMessageClient)
protected
FlMsgHigh,
FlMsgLow,
FlMsgNo: Cardinal;
FsMsgID: string;
FlMsgCount: Cardinal;
FNewsAgent: string;
FOnNewsgroupList,
FOnNewGroupsList: TEventNewsgroupList;
FOnNewNewsList: TEventNewNewsList;
fOnSendCheck: TNewsTransportEvent;
fOnSendTakethis: TNewsTransportEvent;
fModeType: TModeType;
fConectionResult: TConnectionResult;
fModeResult: TModeSetResult;
fOnSendIHAVE: TNewsTransportEvent;
FbSetMode: Boolean;
fPassword: string;
fUserId: string;
function ConvertDateTimeDist(ADate: TDateTime; AGMT: boolean;
const ADistributions: string): string;
procedure SetModeType(const AValue: TModeType);
procedure setConnectionResult(const AValue: TConnectionResult);
procedure SetModeResult(const AValue: TModeSetResult);
function Get(const ACmd: string; const AMsgNo: Cardinal; const AMsgID:
string;
AMsg: TIDMessage): Boolean;
function SetArticle(const ACmd: string; const AMsgNo: Cardinal; const
AMsgID: string): Boolean;
procedure ProcessGroupList(const ACmd: string; const AResponse: integer;
const AListEvent: TEventNewsgroupList);
public
constructor Create(AOwner: TComponent); override;
procedure Connect; override;
procedure Disconnect; override;
function GetArticle(const AMsgNo: Cardinal; const AMsgID: string; AMsg:
TIdMessage): Boolean;
function GetBody(const AMsgNo: Cardinal; const AMsgID: string; AMsg:
TIdMessage): Boolean;
function GetHeader(const AMsgNo: Cardinal; const AMsgID: string; AMsg:
TIdMessage): Boolean;
procedure GetNewsgroupList; overload;
procedure GetNewsgroupList(AList: TStrings); overload;
procedure GetNewGroupsList(const ADate: TDateTime; const AGMT: boolean;
const ADistributions: string); overload;
procedure GetNewGroupsList(const ADate: TDateTime; const AGMT: boolean;
const ADistributions: string; AList: TStrings); overload;
procedure GetNewNewsList(const ANewsgroups: string;
const ADate: TDateTime; const AGMT: boolean; ADistributions: string);
overload;
procedure GetNewNewsList(const ANewsgroups: string; const ADate: TDateTime;
const AGMT: boolean; ADistributions: string; AList: TStrings); overload;
procedure GetOverviewFMT(var AResponse: TStringList);
function Next: Boolean;
function Previous: Boolean;
function SelectArticle(const AMsgNo: Cardinal): Boolean;
procedure SelectGroup(const AGroup: string);
procedure Send(AMsg: TidMessage);
procedure SendIHAVE(AMsg: TStringList);
procedure SendCheck(AMsgID: TStringList; var AResponses: TStringList);
function SendCmd(const AOut: string; const AResponse: array of SmallInt):
SmallInt; override;
function SendTakeThis(AMsg: TStringList): string;
procedure SendXHDR(const AHeader: string; const AParam: string; var
AResponse: TStringList);
procedure SendXOVER(const AParm: string; var AResponse: TStringList);
property MsgID: string read fsMsgID;
property MsgNo: Cardinal read FlMsgNo;
property MsgHigh: Cardinal read FlMsgHigh;
property MsgLow: Cardinal read FlMsgLow;
property GreetingResult: TConnectionResult read fConectionResult write
setConnectionResult;
property ModeResult: TModeSetResult read fModeResult write SetModeResult;
property MsgCount: Cardinal read flMsgCount write flMsgCount;
published
property NewsAgent: string read FNewsAgent write FNewsAgent;
property Mode: TModeType read fModeType write SetModeType default mtReader;
property Password: string read fPassword write fPassword;
property UserId: string read fUserId write fUserId;
property SetMode: Boolean read FbSetMode write FbSetMode default True;
property OnSendCheck: TNewsTransportEvent read fOnSendCheck
write fOnSendCheck;
property OnSendIHAVE: TNewsTransportEvent read fOnSendIHAVE
write fOnSendIHAVE;
property OnSendTakeThis: TNewsTransportEvent read fOnSendTakethis
write fOnSendTakethis;
property OnNewsgroupList: TEventNewsgroupList read FOnNewsgroupList
write FOnNewsgroupList;
property OnNewGroupsList: TEventNewsGroupList read FOnNewGroupsList
write FOnNewGroupsList;
property OnNewNewsList: TEventNewNewsList read FOnNewNewsList
write FOnNewNewsList;
property Port default IdPORT_NNTP;
end;
type
EIdNNTPException = class(EIdException);
EIdNNTPNoOnNewGroupsList = class(EIdNNTPException);
EIdNNTPNoOnNewNewsList = class(EIdNNTPException);
EIdNNTPNoOnNewsgroupList = class(EIdNNTPException);
EIdNNTPStringListNotInitialized = class(EIdNNTPException);
EIdNNTPConnectionRefused = class(EIdProtocolReplyError);
procedure ParseXOVER(Aline: string; var AArticleIndex: Cardinal;
var ASubject,
AFrom: string;
var ADate: TDateTime;
var AMsgId,
AReferences: string;
var AByteCount,
ALineCount: Cardinal;
var AExtraData: string);
procedure ParseNewsGroup(ALine: string; var ANewsGroup: string;
var AHi, ALo: Cardinal;
var AStatus: string);
implementation
uses
IdComponent,
IdResourceStrings,
SysUtils;
procedure ParseXOVER(Aline: string; var AArticleIndex: Cardinal;
var ASubject,
AFrom: string;
var ADate: TDateTime;
var AMsgId,
AReferences: string;
var AByteCount,
ALineCount: Cardinal;
var AExtraData: string);
begin
ALine := StringReplace(ALine, #9#8#9, #9, [rfReplaceAll]);
AArticleIndex := StrToCard(Fetch(ALine, #9));
ASubject := Fetch(ALine, #9);
AFrom := Fetch(ALine, #9);
ADate := StrInternetToDateTime(Fetch(Aline, #9));
AMsgId := Fetch(Aline, #9);
AReferences := Fetch(ALine, #9);
AByteCount := StrToCard(Fetch(ALine, #9));
ALineCount := StrToCard(Fetch(ALine, #9));
AExtraData := ALine;
end;
procedure ParseNewsGroup(ALine: string; var ANewsGroup: string;
var AHi, ALo: Cardinal;
var AStatus: string);
begin
ANewsgroup := Fetch(ALine, ' ');
AHi := StrToCard(Fetch(Aline, ' '));
ALo := StrToCard(Fetch(ALine, ' '));
AStatus := ALine;
end;
constructor TIdNNTP.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
Mode := mtReader;
Port := IdPORT_NNTP;
SetMode := True;
end;
function TIdNNTP.SendCmd(const AOut: string; const AResponse: array of
SmallInt): SmallInt;
begin
Result := inherited SendCmd(AOut, []);
if (Result = 480) or (Result = 450) then
begin
inherited SendCmd('AuthInfo User ' + UserID, [381]);
inherited SendCmd('AuthInfo Pass ' + Password, [281]);
Result := inherited SendCmd(AOut, AResponse);
end
else
begin
Result := CheckResponse(Result, AResponse);
end;
end;
procedure TIdNNTP.Connect;
begin
inherited;
try
GetResponse([]);
case ResultNo of
200: GreetingResult := crCanPost;
201: GreetingResult := crNoPost;
400: GreetingResult := crTempUnavailable;
502: raise EIdNNTPConnectionRefused.CreateError(502,
RSNNTPConnectionRefused);
end;
case mode of
mtStream:
begin
SendCmd('mode stream');
if ResultNo <> 203 then
ModeResult := mrNoStream
else
ModeResult := mrCanStream;
end;
mtReader:
begin
SendCmd('mode reader');
if ResultNo <> 200 then
ModeResult := mrNoPost
else
ModeResult := mrCanPost;
end;
end;
except
Disconnect;
raise;
end;
end;
procedure TIdNNTP.Disconnect;
begin
try
if Connected then
WriteLn('Quit');
finally
inherited;
end;
end;
procedure TIdNNTP.GetOverviewFMT(var AResponse: TStringList);
begin
SendCmd('list overview.fmt', 215);
Capture(AResponse);
end;
procedure TIdNNTP.SendXOVER(const AParm: string; var AResponse: TStringList);
begin
SendCmd('xover ' + AParm, 224);
Capture(AResponse);
end;
procedure TIdNNTP.SendXHDR(const AHeader: string; const AParam: string; var
AResponse: TStringList);
begin
SendCmd('XHDR ' + AHeader + ' ' + AParam, 221);
Capture(AResponse);
end;
procedure TIdNNTP.SelectGroup(const AGroup: string);
var
s: string;
begin
SendCmd('Group ' + AGroup, [211]);
s := Copy(CmdResult, 5, Maxint);
FlMsgCount := StrToCard(Fetch(s));
FlMsgLow := StrToCard(Fetch(s));
FlMsgHigh := StrToCard(Fetch(s));
end;
function TIdNNTP.Get(const ACmd: string; const AMsgNo: Cardinal; const AMsgID:
string;
AMsg: TidMessage): Boolean;
begin
Result := SetArticle(ACmd, AMsgNo, AMsgID);
if Result then
begin
AMsg.Clear;
if AnsiSameText(ACmd, 'HEAD') then
begin
if ResultNo in [220, 221] then
begin
ReceiveHeader(AMsg, '.');
end;
end
else
begin
if ResultNo in [220, 221] then
begin
ReceiveHeader(AMsg, '');
end;
if ResultNo in [220, 222] then
ReceiveBody(AMsg);
end;
end;
end;
procedure TIdNNTP.SendIHAVE(AMsg: TStringList);
var
i: Integer;
MsgID: string;
Temp: string;
begin
if not Assigned(FOnSendIHAVE) then
begin
for i := 0 to AMsg.Count - 1 do
if IndyPos('Message-ID', AMsg.Strings[i]) > 0 then
begin
MsgID := AMsg.Strings[i];
Temp := Fetch(MsgID, ':');
Break;
end;
SendCmd('IHAVE ' + MsgID, 335);
for i := 0 to AMsg.Count - 1 do
WriteLn(AMsg[i]);
WriteLn('.');
Temp := Readln;
end;
end;
procedure TIdNNTP.SendCheck(AMsgID: TStringList;
var AResponses: TStringList);
var
i: Integer;
begin
if not Assigned(FOnSendCheck) then
begin
for i := 0 to AMsgID.Count - 1 do
Writeln('CHECK ' + AMsgID.Strings[i]);
for i := 0 to AMsgID.Count - 1 do
begin
if assigned(AResponses) then
AResponses.Add(ReadLn)
else
raise
EIdNNTPStringListNotInitialized.Create(RSNNTPStringListNotInitialized);
end;
end;
end;
function TIdNNTP.SendTakeThis(AMsg: TStringList): string;
var
i: Integer;
MsgID: string;
Temp: string;
begin
if not Assigned(FOnSendTakeThis) then
begin
if (Setmode) and (ModeResult = mrNoStream) then
begin
Mode := mtIHAVE;
SendIHAVE(AMsg);
Exit;
end;
for i := 0 to AMsg.Count - 1 do
if IndyPos('Message-ID', AMsg.Strings[i]) > 0 then
begin
MsgID := AMsg.Strings[i];
Temp := Fetch(MsgID, ':');
Break;
end;
try
Writeln('TAKETHIS ' + MsgID);
for i := 0 to AMsg.Count - 1 do
WriteLn(AMsg[i]);
WriteLn('.');
finally
Result := Readln;
end;
end;
end;
procedure TIdNNTP.Send(AMsg: TidMessage);
begin
SendCmd('Post', 340);
//Header
with AMsg.ExtraHeaders do
begin
Values['Lines'] := IntToStr(AMsg.Body.Count);
Values['X-Newsreader'] := NewsAgent;
end;
SendMsg(AMsg);
inherited;
SendCmd('.', 240);
end;
procedure TIdNNTP.ProcessGroupList(const ACmd: string; const AResponse: integer;
const AListEvent: TEventNewsgroupList);
var
s1, sNewsgroup: string;
lLo, lHi: Cardinal;
sStatus: string;
CanContinue: Boolean;
begin
BeginWork(wmRead, 0);
try
SendCmd(ACmd, AResponse);
s1 := ReadLn;
CanContinue := True;
while (s1 <> '.') and CanContinue do
begin
ParseNewsGroup(s1, sNewsgroup, lHi, lLo, sStatus);
AListEvent(sNewsgroup, lLo, lHi, sStatus, CanContinue);
s1 := ReadLn;
end;
finally
EndWork(wmRead);
end;
end;
procedure TIdNNTP.GetNewsgroupList;
begin
if not Assigned(FOnNewsgroupList) then
raise EIdNNTPNoOnNewsgroupList.Create(RSNNTPNoOnNewsgroupList);
ProcessGroupList('List', 215, FOnNewsgroupList);
end;
procedure TIdNNTP.GetNewGroupsList(const ADate: TDateTime; const AGMT: boolean;
const ADistributions: string);
begin
if not Assigned(FOnNewGroupsList) then
begin
raise EIdNNTPNoOnNewGroupsList.Create(RSNNTPNoOnNewGroupsList);
end;
ProcessGroupList('Newgroups ' + ConvertDateTimeDist(ADate, AGMT,
ADistributions), 231
, FOnNewGroupsList);
end;
procedure TIdNNTP.GetNewNewsList(const ANewsgroups: string;
const ADate: TDateTime; const AGMT: boolean; ADistributions: string);
var
s1: string;
CanContinue: Boolean;
begin
if not Assigned(FOnNewNewsList) then
raise EIdNNTPNoOnNewNewsList.Create(RSNNTPNoOnNewNewsList);
BeginWork(wmRead, 0);
try
SendCmd('Newnews ' + ANewsgroups + ' ' + ConvertDateTimeDist(ADate, AGMT,
ADistributions), 230);
s1 := ReadLn;
CanContinue := True;
while (s1 <> '.') and CanContinue do
begin
FOnNewNewsList(s1, CanContinue);
s1 := ReadLn;
end;
finally
EndWork(wmRead);
end;
end;
function TIdNNTP.GetArticle(const AMsgNo: Cardinal; const AMsgID: string;
AMsg: TidMessage): Boolean;
begin
Result := Get('Article', AMsgNo, AMsgID, AMsg);
end;
function TIdNNTP.GetBody(const AMsgNo: Cardinal; const AMsgID: string;
AMsg: TidMessage): Boolean;
begin
Result := Get('Body', AMsgNo, AMsgID, AMsg);
end;
function TIdNNTP.GetHeader(const AMsgNo: Cardinal; const AMsgID: string;
AMsg: TidMessage): Boolean;
begin
Result := Get('Head', AMsgNo, AMsgID, AMsg);
end;
function TIdNNTP.Next: Boolean;
begin
Result := SetArticle('Next', 0, '');
end;
function TIdNNTP.Previous: Boolean;
begin
Result := SetArticle('Last', 0, '');
end;
function TIdNNTP.SelectArticle(const AMsgNo: Cardinal): Boolean;
begin
Result := SetArticle('Stat', AMsgNo, '');
end;
function TIdNNTP.SetArticle(const ACmd: string; const AMsgNo: Cardinal;
const AMsgID: string): Boolean;
var
s: string;
begin
if AMsgNo >= 1 then
SendCmd(ACmd + ' ' + IntToStr(AMsgNo))
else
if AMsgID <> '' then
SendCmd(ACmd + ' <' + AMsgID + '>')
else
SendCmd(ACmd);
if ResultNo in [220, 221, 222, 223] then
begin
if AMsgID = '' then
begin
s := CmdResult;
Fetch(s, ' ');
flMsgNo := StrToCard(Fetch(s, ' '));
fsMsgID := s;
end;
Result := True;
end
else
if (ResultNo = 421) or (ResultNo = 422)
or (ResultNo = 423) or (ResultNo = 430) then
begin
Result := False;
end
else
begin
raise EidResponseError.Create(CmdResult);
end;
end;
procedure TIdNNTP.SetModeType(const AValue: TModeType);
begin
fModeType := AValue;
end;
procedure TIdNNTP.setConnectionResult(const AValue: TConnectionResult);
begin
fConectionResult := AValue;
end;
procedure TIdNNTP.SetModeResult(const AValue: TModeSetResult);
begin
fModeResult := AValue;
end;
procedure TIdNNTP.GetNewsgroupList(AList: TStrings);
begin
SendCmd('List', 215);
Capture(AList);
end;
procedure TIdNNTP.GetNewGroupsList(const ADate: TDateTime; const AGMT: boolean;
const ADistributions: string; AList: TStrings);
begin
SendCmd('Newgroups ' + ConvertDateTimeDist(ADate, AGMT, ADistributions), 231);
Capture(AList);
end;
procedure TIdNNTP.GetNewNewsList(const ANewsgroups: string; const ADate:
TDateTime;
const AGMT: boolean; ADistributions: string; AList: TStrings);
begin
SendCmd('Newnews ' + ANewsgroups + ' ' + ConvertDateTimeDist(ADate, AGMT,
ADistributions), 230);
Capture(AList);
end;
function TIdNNTP.ConvertDateTimeDist(ADate: TDateTime; AGMT: boolean;
const ADistributions: string): string;
begin
Result := FormatDateTime('yymmdd hhnnss', ADate);
if AGMT then
begin
Result := Result + ' GMT';
end;
if Length(ADistributions) > 0 then
begin
Result := ' <' + ADistributions + '>';
end;
end;
end.
|
program hello(Output);
begin
Writeln('Hello, world! How''s it going?')
end .
|
unit xTCPServer;
interface
uses System.Types,System.Classes, xFunction, system.SysUtils, xTCPServerBase,
xConsts, System.IniFiles, xClientType;
type
TRevStuData = procedure (sIP: string; nPort :Integer;aPacks: TArray<Byte>) of object;
type
TTCPServer = class(TTCPServerBase)
private
FOnRevStuData: TRevStuData;
procedure ReadINI;
procedure WriteINI;
/// <summary>
/// 发送命令
/// </summary>
procedure SendOrder(sIP : string; nPort : Integer; aData : TBytes); overload;
procedure SendOrder(sIP : string; nPort : Integer; nData : Byte); overload;
protected
/// <summary>
/// 接收数据包
/// </summary>
procedure RevPacksData(sIP: string; nPort :Integer;aPacks: TArray<Byte>); override;
public
constructor Create; override;
destructor Destroy; override;
/// <summary>
/// 命令学员登录
/// </summary>
procedure StuLogin(sIP : string = ''; nPort : Integer = 0);
/// <summary>
/// 命令学员准备考试
/// </summary>
procedure StuReady(nTotalCount : Integer; sIP : string = ''; nPort : Integer = 0 );
/// <summary>
/// 发送进度
/// </summary>
procedure SendProgress(nReadyCount, nTotalCount : Integer);
/// <summary>
/// 开始考试
/// </summary>
procedure StartExam(sIP : string = ''; nPort : Integer = 0);
/// <summary>
/// 停止考试
/// </summary>
procedure StopExam(sIP : string = ''; nPort : Integer = 0);
/// <summary>
/// 返回登录结果
/// </summary>
procedure LoginResult(sIP : string; nPort : Integer; bResult : Boolean);
public
/// <summary>
/// 接收到学员机数据包
/// </summary>
property OnRevStuData : TRevStuData read FOnRevStuData write FOnRevStuData;
end;
var
TCPServer : TTCPServer;
implementation
{ TTCPServer }
//function TTCPServer.BuildData(aData: TBytes): TBytes;
//
//var
// nByte, nCode1, nCode2 : Byte;
// i : Integer;
// nFixCodeCount, nIndex : Integer; // 转译字符个数
//
// function IsFixCode(nCode : Integer) : Boolean;
// begin
// Result := nCode in [$7F, $7E];
// Inc(nFixCodeCount);
//
// if Result then
// begin
// nCode1 := $7F;
// if nCode = $7E then
// nCode2 := $01
// else
// nCode2 := $02;
// end;
// end;
//begin
// nByte := 0;
// nFixCodeCount := 0;
//
// for i := 0 to Length(aData) - 1 do
// begin
// IsFixCode(aData[i]); // 计算转译字符个数
// nByte := (nByte + aData[i])and $FF; // 计算校验码
// end;
// IsFixCode(nByte); // 判断校验码是否是转译字符
//
// SetLength(Result, Length(aData) + nFixCodeCount + 2);
// Result[0] := $7E;
// Result[Length(Result)-1] := $7E;
//
// nIndex := 1;
//
// for i := 0 to Length(aData) - 1 do
// begin
// if IsFixCode(aData[i]) then
// begin
// Result[nIndex] := nCode1;
// Result[nIndex+1] := nCode2;
//
// Inc(nIndex, 2);
// end
// else
// begin
// Result[nIndex] := aData[i];
// Inc(nIndex);
// end;
// end;
//end;
constructor TTCPServer.Create;
begin
inherited;
ReadINI;
end;
destructor TTCPServer.Destroy;
begin
WriteINI;
inherited;
end;
procedure TTCPServer.LoginResult(sIP: string; nPort: Integer; bResult: Boolean);
var
aBuf : Tbytes;
begin
SetLength(aBuf, 2);
aBuf[0] := 6;
if bResult then
aBuf[1] := $01
else aBuf[1] := $02;
SendOrder(sIP, nPort, aBuf);
end;
procedure TTCPServer.ReadINI;
begin
with TIniFile.Create(sPubIniFileName) do
begin
ListenPort := ReadInteger('Option', 'ListenPort', 15000);
Free;
end;
end;
procedure TTCPServer.RevPacksData(sIP: string; nPort: Integer;
aPacks: TArray<Byte>);
begin
inherited;
if Assigned(FOnRevStuData) then
begin
FOnRevStuData(sIP, nPort, aPacks);
end;
end;
procedure TTCPServer.SendOrder(sIP: string; nPort: Integer; aData: TBytes);
var
aBuf : TBytes;
begin
aBuf := BuildData(aData);
SendPacksDataTCP(sIP, nPort, aBuf);
end;
procedure TTCPServer.SendOrder(sIP: string; nPort: Integer; nData: Byte);
var
aBuf : Tbytes;
begin
SetLength(aBuf, 1);
aBuf[0] := nData;
SendOrder(sIP, nPort, aBuf);
end;
procedure TTCPServer.SendProgress(nReadyCount, nTotalCount: Integer);
var
aBuf : Tbytes;
begin
SetLength(aBuf, 3);
aBuf[0] := 3;
aBuf[1] := nReadyCount and $FF;
aBuf[2] := nTotalCount and $FF;
SendOrder('', 0, aBuf);
end;
procedure TTCPServer.StartExam(sIP: string; nPort: Integer);
begin
SendOrder(sIP, nPort, 4);
end;
procedure TTCPServer.StopExam(sIP: string; nPort: Integer);
begin
SendOrder(sIP, nPort, 5);
end;
procedure TTCPServer.StuLogin(sIP: string; nPort: Integer);
begin
SendOrder(sIP, nPort, 1);
end;
procedure TTCPServer.StuReady(nTotalCount : Integer;sIP: string; nPort: Integer );
var
aBuf : Tbytes;
begin
SetLength(aBuf, 2);
aBuf[0] := 2;
aBuf[1] := nTotalCount and $FF;
SendOrder(sIP, nPort, aBuf);
end;
procedure TTCPServer.WriteINI;
begin
with TIniFile.Create(sPubIniFileName) do
begin
WriteInteger('Option', 'ListenPort', ListenPort);
Free;
end;
end;
end.
|
unit NetworkFiler;
interface
uses
Classes, IniFiles, Graphics, Dialogs,
MetroBase, StringValidators;
type
//----------------------------------------------------------------------------
// TNetworkFiler is a class with some routines for reading/writing
// a network from/to a .nwk file
//----------------------------------------------------------------------------
TNetworkFiler = class(TObject)
protected
FIniFile: TMemIniFile;
FFileSections: TStringList;
procedure ReadStations(var ANetwork: TNetwork);
// pre: FIniFile contains the description of a network (N, SS, LS), where
// N is the networkname, SS is the stationset and LS is the lineset
// post: ANetwork.GetStationSet = SS
procedure ReadLines(var ANetwork: TNetwork);
// pre: FIniFile contains the description of a network (N, SS, LS), where
// N is the networkname, SS is the stationset and LS is the lineset
// post: ANetwork.GetLineSet = LS
public
// construction/destruction ------------------------------------------------
constructor Create(const AFileName: String);
// pre: True
// post: FIniFile is a copy in the internal memory of the ini-file AFileName
// and
// FFileSections contains the filesections of AFileName
destructor Destroy; override;
// pre: True
// effect: FIniFile and FFileSections are freed
// commands ----------------------------------------------------------------
function LoadNetwork: TNetwork;
// pre: FIniFile contains the description of a network (N, SS, LS), where
// N is the networkname, SS is the stationset and LS is the lineset
// ret: the network (N, SS, LS)
procedure WriteNetwork(ANetwork: TNetwork);
// pre: ANetwork is the network (N, SS, LS), where
// N is the networkname, SS is the stationset and LS is the lineset
// post: The internal representation of ANetwork in FIniFile is written to
// disk
end;
implementation
uses
SysUtils, StrUtils;
{ TNetworkFiler }
constructor TNetworkFiler.Create(const AFileName: string);
begin
FIniFile := TMemIniFile.Create(AFileName);
FFileSections := TStringList.Create;
FIniFile.ReadSections(FFileSections)
end;
destructor TNetworkFiler.Destroy;
begin
FFileSections.Free;
FIniFile.Free;
inherited
end;
function TNetworkFiler.LoadNetwork: TNetwork;
var
VNetwork: TNetwork;
VNetworkName: String;
begin
VNetworkName := FIniFile.ReadString('#Main', 'name', '<unknown>');
VNetwork := TNetwork.CreateEmpty(VNetworkName);
ReadStations(VNetwork);
ReadLines(VNetwork);
Result := VNetwork
end;
procedure TNetworkFiler.ReadLines(var ANetwork: TNetwork);
var
E, I, J, H: Integer;
VSectionName: String;
VLineName, VLineCode: String;
VLine: TLineRW;
VOneWay: Boolean;
VCircular: Boolean;
VLineOptions: TLineOptionS;
VStopCode: String;
VStop: TStationR;
VStops: TStringList;
begin
// filter out line sections (beginning with 'L_') and read their attributes
// and corresponding station lists
for I := 0 to FFileSections.Count - 1 do begin
VSectionName := FFileSections.Strings[I];
if AnSiStartsStr('L_', VSectionName) then begin
VLineCode := AnsiRightStr(VSectionName, Length(VSectionName) - 2);
// read line name
VLineName := FIniFile.ReadString(VSectionName, 'name', '<unknown>');
// read line options
VLineOptions := [];
VOneWay := FIniFile.ReadBool(VSectionName, 'oneway', False);
if VOneWay then VLineOptions := VLineOptions + [loOneWay];
VCircular := FIniFile.ReadBool(VSectionName, 'circular', False);
if VCircular then VLineOptions := VLineOptions + [loCircular];
// create line (with empty stationlist)
VLine := TLineRW.Create(VLineCode, VLineName, VLineOptions);
// read stops from corresponding 'P_' section and add them to line
VStops := TStringList.Create;
FIniFile.ReadSectionValues('P_' + VLineCode, VStops);
for J := 0 to VStops.Count - 1 do begin
E := Pos('=', VStops.Strings[J]);
VStopCode := RightStr(VStops.Strings[J], Length(VStops.Strings[J]) - E);
if ValidStationCode(VStopCode) then begin
with ANetwork.GetStationSet do begin
H := IndexOfCode(VStopCode);
Assert( H <> -1,
Format('TMetroFiler.Readlines: Unknown stop code: %s',
[VStopCode]));
VStop := GetStation(H);
VLine.AddStop(VStop)
end
end
else begin
{skip}
end
end;
ANetwork.AddLine(VLine);
VStops.Free
end
end
end;
procedure TNetworkFiler.ReadStations(var ANetwork: TNetwork);
var
I: Integer;
VSectionName: String;
VStationName, VStationCode: String;
begin
// filter out station sections (beginning with 'S_') and read their name
for I := 0 to FFileSections.Count - 1 do begin
VSectionName := FFileSections.Strings[I];
if AnSiStartsStr('S_', VSectionName) then begin
VStationCode := AnsiRightStr(VSectionName, Length(VSectionName) - 2);
VStationName := FIniFile.ReadString(VSectionName, 'name', '<unknown>');
ANetwork.AddStation(TStationRW.Create(VStationCode, VStationName))
end
end
end;
procedure TNetworkFiler.WriteNetwork(ANetwork: TNetwork);
var
I, J: Integer;
VStation: TStationR;
VLine: TLineR;
begin
FIniFile.Clear;
FIniFile.WriteString('#Main', 'name', ANetwork.GetName);
with ANetwork.GetStationSet do begin
for I := 0 to Count - 1 do begin
VStation := GetStation(I);
FIniFile.WriteString('S_' + VStation.GetCode, 'name',
VStation.GetName)
end
end;
with ANetwork.GetLineSet do begin
for I := 0 to Count - 1 do begin
VLine := GetLine(I);
FIniFile.WriteString('L_' + VLine.GetCode, 'name',
VLine.GetName);
FIniFile.WriteBool('L_' + VLine.GetCode, 'oneway',
VLine.IsOneWay);
FIniFile.WriteBool('L_' + VLine.GetCode, 'circular',
VLine.IsCircular);
for J := 0 to VLine.Count - 1 do begin
FIniFile.WriteString('P_' + VLine.GetCode,
'S' + IntToStr(J),
VLine.Stop(J).GetCode)
end
end
end;
FIniFile.UpdateFile;
end;
end.
|
{*******************************************************}
{ }
{ Delphi Visual Component Library }
{ }
{ Copyright(c) 1995-2011 Embarcadero Technologies, Inc. }
{ }
{*******************************************************}
unit SvrConst;
interface
resourcestring
sWebAppDebugger = 'Web App Debugger';
sStopServer = 'S&top';
sStartServer = 'S&tart';
sCouldNotOpenRegKey = 'Unable to not open registry key: %s';
sUnauthorizedString = '<HTML><HEAD><TITLE>Unauthorized</TITLE></HEAD>' +
'<BODY><H1>Unauthorized</H1>' +
'Proper authorization is required for this area. ' +
'Either your browser does not perform authorization, ' +
'or your authorization has failed.' +
'</BODY></HTML>'#13#10;
sForbiddenString = '<HTML><TITLE>The requested URL is forbidden</TITLE>' + '<BODY>' + '<H1>The requested URL is forbidden</H1>' + '<P>HTTP status code: 403' + '</BODY></HTML>'#13#10;
sNoDirBrowseString = '<HTML><TITLE>Directory browsing is forbidden</TITLE>' + '<BODY>' + '<H1>The requested URL is forbidden</H1>' + '<P>HTTP status code: 403' + '</BODY></HTML>'#13#10;
sBadRequest = '<HTML><TITLE>Invalid HTTP request: Method not allowed for HTTP/1.0</TITLE>' + '<BODY>' + '<H1>Invalid HTTP request: Method not allowed for HTTP/1.0</H1>' + '<P>HTTP status code: 400' + '</BODY></HTML>'#13#10;
sNotFound =
'<TITLE>The requested URL was not found</TITLE>' +
'<BODY>' +
'<H1>The requested URL was not found</H1>' +
'<P>HTTP status code: 404' +
'</BODY>';
sInternalServerError =
'<TITLE>Internal Server Error</TITLE>' +
'<BODY>' +
'<H1>Internal Server Error</H1>' +
'<P>HTTP status code: 500' +
'<P>HTTP error message: %s' +
'</BODY>';
sInvalidActionRegistration = 'Invalid Action registration';
sErrorEvent = 'ERROR';
sResponseEvent = 'RESPONSE';
sEvent = 'Event';
sTime = 'Time';
sDate = 'Date';
sElapsed = 'Elapsed';
sPath = 'Path';
sCode = 'Code';
sContentLength = 'Content Length';
sContentType = 'Content Type';
sThread = 'Thread';
sNoDefaultURL = '(none)';
sLogTab = 'Log(%d)';
sSend = 'Send';
sReceive = 'Receive';
sLogStrTemplate = '%s %s Error: (%d)%s';
UnauthorizedString = '<HTML><HEAD><TITLE>Unauthorized</TITLE></HEAD>' +
'<BODY><H1>Unauthorized</H1>' +
'Proper authorization is required for this area. ' +
'Either your browser does not perform authorization, ' +
'or your authorization has failed.' +
'</BODY></HTML>'#13#10;
ForbiddenString = '<HTML><TITLE>The requested URL is forbidden</TITLE>' + '<BODY>' + '<H1>The requested URL is forbidden</H1>' + '<P>HTTP status code: 403' + '</BODY></HTML>'#13#10;
NoDirBrowseString = '<HTML><TITLE>Directory browsing is forbidden</TITLE>' + '<BODY>' + '<H1>The requested URL is forbidden</H1>' + '<P>HTTP status code: 403' + '</BODY></HTML>'#13#10;
BadRequest = '<HTML><TITLE>Invalid HTTP request: Method not allowed for HTTP/1.0</TITLE>' + '<BODY>' + '<H1>Invalid HTTP request: Method not allowed for HTTP/1.0</H1>' + '<P>HTTP status code: 400' + '</BODY></HTML>'#13#10;
NotFound =
'<TITLE>The requested URL was not found</TITLE>' +
'<BODY>' +
'<H1>The requested URL was not found</H1>' +
'<P>HTTP status code: 404' +
'</BODY>';
DateFormat = 'ddd, dd mmm yyyy hh:mm:ss';
sBuild = 'Build';
sDirHeader = '<HTML><HEAD><TITLE>Directory of %s</TITLE></HEAD>' +
'<BODY><H1>Directory of %0:s</H1>'#13#10;
sDirParent = 'Up to <A HREF="%s">%0:s</A>'#13#10'<UL>';
sDirRoot = 'Up to <A HREF="%s">root directory</A>'#13#10'<UL>';
sDirEntry = '<LI>[ <A HREF="%s">%s</A> ]'#13#10;
sFileEntry = '<LI><A HREF="%s">%s</A> (%d bytes)'#13#10;
sListStart = '<UL>'#13#10;
sDirFooter = '</UL></BODY></HTML>'#13#10;
sBrowserExecFailed = 'Unable to exec file %s';
sBrowserNotFound = 'Unable to find file %s';
implementation
end.
|
unit XERO.Types;
{$INCLUDE 'XERO.inc'}
interface
{ ************************************ }
{ A few predefined types to help out }
{ ************************************ }
type
Pbyte = ^byte;
Pword = ^word;
Pdword = ^dword;
Pint64 = ^int64;
dword = longword;
Pwordarray = ^Twordarray;
Twordarray = array [0..19383] of word;
Pdwordarray = ^Tdwordarray;
Tdwordarray = array [0..8191] of dword;
{$IFNDEF COMPILER12_UP}
RawByteString = AnsiString;
{$ENDIF}
{$IFNDEF COMPILER11_UP}
TBytes = array of Byte;
{$ENDIF ~COMPILER11_UP}
{$IFNDEF SUPPORTS_UINT64}
UInt64 = Int64;
{$ENDIF ~SUPPORTS_UINT64}
type
{$IFNDEF COMPILER16_UP}
NativeUInt = {$IFDEF CPU64} UInt64 {$ELSE} Cardinal {$ENDIF};
{$ENDIF}
PointerToInt = {$IFDEF COMPILER16_UP} PByte {$ELSE} NativeUInt {$ENDIF};
implementation
end.
|
unit ooCalc;
interface
uses
SysUtils, Variants, ComObj;
type TTipooCalc = (ttcError, ttcNone, ttcExcel, ttcOpenOffice);
type TopofCalc = class(TObject)
Document : Variant;
DeskTop : Variant;
Programa : Variant;
Tipoo : TTipooCalc;
FileName : string;
ActiveSheet : Variant;
Visible : boolean;
fVisible : boolean;
function GetIsExcel: boolean;
function GetIsOpenOffice: boolean;
function GetProgLoaded: boolean;
function GetDocLoaded: boolean;
procedure LoadProg;
procedure NewDoc;
procedure CloseDoc;
procedure CloseProg;
constructor CreateTable(MyTipoo: TTipooCalc; MakeVisible: boolean);
procedure LoadDoc;
constructor OpenTable(Name: string; MakeVisible: boolean);
destructor Destroy; override;
function SaveDoc: boolean;
function PrintDoc: boolean;
procedure ShowPrintPreview;
procedure SetVisible(v: boolean);
function GetCountSheets: integer;
function ActivateSheetByIndex(nIndex: integer): boolean;
function ActivateSheetByName(SheetName: string; CaseSensitive: boolean): boolean;
function GetActiveSheetName: string;
procedure SetActiveSheetName(NewName: string);
function IsActiveSheetProtected: boolean;
procedure AddNewSheet(NewName: string);
function GetCellText(row, col: integer): string;
procedure SetCellText(row, col: integer; Txt: string);
function GetCellColor(row, col: integer): longint;
function GetCellTextByName(Range: string): string;
procedure SetCellTextByName(Range: string; Txt: string);
procedure FontSize(row,col:integer;oosize:integer);
procedure Bold(row,col: integer);
procedure ColumnWidth(col, width: integer); //Width in 1/100 of mm.
function FileNameToURL(FileName: string): string;
function ooCreateValue(ooName: string; ooData: variant): variant;
procedure ooDispatch(ooCommand: string; ooParams: variant);
private
public
property IsExcel : boolean read GetIsExcel;
property IsOpenOffice : boolean read GetIsOpenOffice;
property ProgLoaded : boolean read GetProgLoaded;
property DocLoaded : boolean read GetDocLoaded;
property ActiveSheetName : string read GetActiveSheetName;
end;
implementation
//при работе с таблицами, информация о типе документа может принимать следующие состояния:
//данные функции определяет тип приложения
function TopofCalc.GetIsExcel: boolean;
begin
result:= (Tipoo=ttcExcel);
end;
function TopofCalc.GetIsOpenOffice: boolean;
begin
result:= (Tipoo=ttcOpenOffice);
end;
//и произведена ли его загрузка
function TopofCalc.GetProgLoaded: boolean;
begin
result:= not (VarIsEmpty(Programa) or VarIsNull(Programa));
end;
function TopofCalc.GetDocLoaded: boolean;
begin
result:= not (VarIsEmpty(Document) or VarIsNull(Document));
end;
//запуск приложения…
procedure TopofCalc.LoadProg;
begin
if ProgLoaded then CloseProg;
if ((UpperCase(ExtractFileExt(FileName))='.XLS') or
(UpperCase(ExtractFileExt(FileName))='.XLT')) then begin
//Excel...
Programa:= CreateOleObject('Excel.Application');
Programa.Application.EnableEvents:=false;
Programa.displayAlerts:=false;
if ProgLoaded then Tipoo:= ttcExcel;
end;
// Another filetype? Let's go with OpenOffice...
if ((UpperCase(ExtractFileExt(FileName))='.ODS') or
(UpperCase(ExtractFileExt(FileName))='.OTS')) then begin
//OpenOffice.calc...
Programa:= CreateOleObject('com.sun.star.ServiceManager');
if ProgLoaded then Tipoo:= ttcOpenOffice;
end;
//Still no program loaded?
if not ProgLoaded then begin
Tipoo:= ttcError;
raise Exception.create('TopofCalc.create failed, may be no Office is installed?');
end;
end;
//проведя все необходимые проверки, мы можем создать электронную таблицу
procedure TopofCalc.NewDoc;
var ooParams: variant;
begin
if not ProgLoaded
then raise exception.create('No program loaded for the new document.');
if DocLoaded then CloseDoc;
DeskTop:= Unassigned;
if IsExcel then begin
Programa.WorkBooks.Add();
Programa.Visible:= Visible;
Document:= Programa.ActiveWorkBook;
ActiveSheet:= Document.ActiveSheet;
end;
if IsOpenOffice then begin
Desktop:= Programa.CreateInstance('com.sun.star.frame.Desktop');
ooParams:= VarArrayCreate([0, 0], varVariant);
ooParams[0]:= ooCreateValue('Hidden', not Visible);
Document:= Desktop.LoadComponentFromURL('private:factory/scalc', '_blank', 0, ooParams);
ActivateSheetByIndex(1);
end;
end;
//а теперь закрыть таблицу
procedure TopofCalc.CloseDoc;
begin
if DocLoaded then begin
try
if IsOpenOffice then Document.Dispose;
if IsExcel then Document.close;
finally
//Clean up both "pointer"...
Document:= Null;
ActiveSheet:= Null;
end;
end;
end;
//и само приложение
procedure TopofCalc.CloseProg;
begin
if DocLoaded then CloseDoc;
if ProgLoaded then begin
try
if IsExcel then Programa.Quit;
Programa:= Unassigned;
finally end;
end;
Tipoo:= ttcNone;
end;
//вынесем последовательности команд создания таблицы в отдельную процедуру конструктора
constructor TopofCalc.CreateTable(MyTipoo: TTipooCalc; MakeVisible: boolean);
var
i: integer;
IsFirstTry: boolean;
begin
//Close all opened things first...
if DocLoaded then CloseDoc;
if ProgLoaded then CloseProg;
IsFirstTry:= true;
for i:= 1 to 2 do begin
//Try to open OpenOffice...
if (MyTipoo = ttcOpenOffice) or (MyTipoo = ttcNone)then begin
Programa:= CreateOleObject('com.sun.star.ServiceManager');
if ProgLoaded then begin
Tipoo:= ttcOpenOffice;
break;
end else begin
if IsFirstTry then begin
//Try Excel as my second choice
MyTipoo:= ttcExcel;
IsFirstTry:= false;
end else begin
//Both failed!
break;
end;
end;
end;
//Try to open Excel...
if (MyTipoo = ttcExcel) or (MyTipoo = ttcNone) then begin
Programa:= CreateOleObject('Excel.Application');
if ProgLoaded then begin
Tipoo:= ttcExcel;
break;
end else begin
if IsFirstTry then begin
//Try OpenOffice as my second choice
MyTipoo:= ttcOpenOffice;
IsFirstTry:= false;
end else begin
//Both failed!
break;
end;
end;
end;
end;
//Was it able to open any of them?
if Tipoo = ttcNone then begin
Tipoo:= ttcError;
raise exception.create('TopofCalc.create failed, may be no OpenOffice is installed?');
end;
//Add a blank document...
fVisible:= MakeVisible;
NewDoc;
end;
//это – создание таблицы «с нуля». откроем существующую
procedure TopofCalc.LoadDoc;
var ooParams: variant;
begin
if FileName='' then exit;
if not ProgLoaded then LoadProg;
if DocLoaded then CloseDoc;
DeskTop:= Unassigned;
if IsExcel then begin
Document:=Programa.WorkBooks.Add(FileName);
Document.visible:=visible;
Document:= Programa.ActiveWorkBook;
ActiveSheet:= Document.ActiveSheet;
end;
if IsOpenOffice then begin
Desktop:= Programa.CreateInstance('com.sun.star.frame.Desktop');
ooParams:= VarArrayCreate([0, 0], varVariant);
ooParams[0]:= ooCreateValue('Hidden', not Visible);
Document:= Desktop.LoadComponentFromURL(FileNameToURL(FileName), '_blank', 0, ooParams);
ActivateSheetByIndex(1);
end;
if Tipoo=ttcNone then
raise exception.create('File "'+FileName+'" is not loaded. Are you install OpenOffice?');
end;
//опишем еще один конструктор для открытия существующей таблицы
constructor TopofCalc.OpenTable(Name: string; MakeVisible: boolean);
begin
//Store values...
FileName:= Name;
fVisible:= MakeVisible;
//Open program and document...
LoadProg;
LoadDoc;
end;
//кроме того, опишем уничтожение объекта
destructor TopofCalc.Destroy;
begin
CloseDoc;
CloseProg;
inherited;
end;
//по аналогии, опишем сохранение
function TopofCalc.SaveDoc: boolean;
begin
result:= false;
if DocLoaded then begin
if IsExcel then begin
Document.Save;
result:= true;
end;
if IsOpenOffice then begin
Document.Store;
result:= true;
end;
end;
end;
//печать
function TopofCalc.PrintDoc: boolean;
var ooParams: variant;
begin
result:= false;
if DocLoaded then begin
if IsExcel then begin
Document.PrintOut;
result:= true;
end;
if IsOpenOffice then begin
//NOTE: OpenOffice will print all sheets with Printable areas, but if no
//printable areas are defined in the doc, it will print all entire sheets.
//Optional parameters (wait until fully sent to printer)...
ooParams:= VarArrayCreate([0, 0], varVariant);
ooParams[0]:= ooCreateValue('Wait', true);
Document.Print(ooParams);
result:= true;
end;
end;
end;
//и режим предварительного просмотра
procedure TopofCalc.ShowPrintPreview;
begin
if DocLoaded then begin
Visible:= true;
if IsExcel then
Document.PrintOut(,,,true);
if IsOpenOffice then
ooDispatch('.uno:PrintPreview', Unassigned);
end;
end;
//нам также пригодится скрытие/отображение на экране
procedure TopofCalc.SetVisible(v: boolean);
begin
if DocLoaded and (v<>fVisible) then begin
if IsExcel then
Programa.Visible:= v;
if IsOpenOffice then
Document.getCurrentController.getFrame.getContainerWindow.setVisible(v);
fVisible:= v;
end;
end;
//теперь, мы можем получить информацию о таблице.
//Начнем с количества листов
function TopofCalc.GetCountSheets: integer;
begin
result:= 0;
if DocLoaded then begin
if IsExcel then result:= Document.Sheets.count;
if IsOpenOffice then result:= Document.getSheets.GetCount;
end;
end;
//и сделаем один из листов активным.
function TopofCalc.ActivateSheetByIndex(nIndex: integer): boolean;
begin
result:= false;
if DocLoaded then begin
if IsExcel then begin
Document.Sheets[nIndex].activate;
ActiveSheet:= Document.ActiveSheet;
result:= true;
end;
//Index is 1 based in Excel, but OpenOffice uses it 0-based
if IsOpenOffice then begin
ActiveSheet:= Document.getSheets.getByIndex(nIndex-1);
result:= true;
end;
sleep(100); //Asyncronus, so better give it time to make the change
end;
end;
//активным лист можно сделать не только по его индексу, но и по названию
function TopofCalc.ActivateSheetByName(SheetName: string; CaseSensitive: boolean): boolean;
var
OldActiveSheet: variant;
i: integer;
begin
result:= false;
if DocLoaded then begin
if CaseSensitive then begin
//Find the EXACT name...
if IsExcel then begin
Document.Sheets[SheetName].Select;
ActiveSheet:= Document.ActiveSheet;
result:= true;
end;
if IsOpenOffice then begin
ActiveSheet:= Document.getSheets.getByName(SheetName);
result:= true;
end;
end else begin
//Find the Sheet regardless of the case...
OldActiveSheet:= ActiveSheet;
for i:= 1 to GetCountSheets do begin
ActivateSheetByIndex(i);
if UpperCase(ActiveSheetName)=UpperCase(SheetName) then begin
result:= true;
Exit;
end;
end;
//If not found, let the old active sheet active...
ActiveSheet:= OldActiveSheet;
end;
end;
end;
//getByName(string) имеет свойства для чтения и записи
function TopofCalc.GetActiveSheetName: string;
begin
if DocLoaded then begin
if IsExcel then
result:= ActiveSheet.Name;
if IsOpenOffice then
result:= ActiveSheet.GetName;
end;
end;
procedure TopofCalc.SetActiveSheetName(NewName: string);
var ooParams:variant;
begin
if DocLoaded then begin
if IsExcel then
Programa.ActiveSheet.Name:= NewName;
if IsOpenOffice then begin
ActiveSheet.setName(NewName);
//This code always changes the name of "visible" sheet, not active one!
ooParams:= VarArrayCreate([0, 0], varVariant);
ooParams[0]:= ooCreateValue('Name', NewName);
ooDispatch('.uno:RenameTable', ooParams);
end;
end;
end;
//пригодится проверка на защиту листа от записи
function TopofCalc.IsActiveSheetProtected: boolean;
begin
result:= false;
if DocLoaded then begin
if IsExcel then
result:= ActiveSheet.ProtectContents;
if IsOpenOffice then
result:= ActiveSheet.IsProtected;
end;
end;
//добваление листа
procedure TopofCalc.AddNewSheet(NewName: string);
var
ooSheets: variant;
begin
if DocLoaded then begin
if IsExcel then begin
Document.WorkSheets.Add;
Document.ActiveSheet.Name:= NewName;
//Active sheet has move to this new one, so I need to update the var
ActiveSheet:= Document.ActiveSheet;
end;
if IsOpenOffice then begin
ooSheets:= Document.getSheets;
ooSheets.insertNewByName(NewName, 1);
//Redefine active sheet to this new one
ActiveSheet:= ooSheets.getByName(NewName);
end;
end;
end;
//перейдем от листов к ячейкам
//получить значение ячейки
//OpenOffice start at cell (0,0) while Excel at (1,1)
function TopofCalc.GetCellText(row, col: integer): string;
begin
if DocLoaded then begin
if IsExcel then result:= ActiveSheet.Cells[row, col].Formula; //.Text;
if IsOpenOffice then result:= ActiveSheet.getCellByPosition(col-1, row-1).getFormula;
end;
end;
function TopofCalc.GetCellColor(row, col: integer): longint;
begin
result:= 0;
if DocLoaded then begin
if IsExcel then result:= ActiveSheet.Cells[row, col].Interior.ColorIndex;
if IsOpenOffice then result:= ActiveSheet.getCellByPosition(col-1, row-1).CellBackColor;
end;
end;
//установить значение
procedure TopofCalc.SetCellText(row, col: integer; Txt: string);
begin
if DocLoaded then begin
if IsExcel then ActiveSheet.Cells[row, col].Formula:= Txt;
if IsOpenOffice then ActiveSheet.getCellByPosition(col-1, row-1).setFormula(Txt);
end;
end;
//то же самое, но по имени ячейки.
//Обязательно указание номера листа
function TopofCalc.GetCellTextByName(Range: string): string;
var OldActiveSheet: variant;
begin
if DocLoaded then begin
if IsExcel then begin
result:= Programa.Range[Range].Text; //Set 'Formula' but Get 'Text';
end;
if IsOpenOffice then begin
OldActiveSheet:= ActiveSheet;
//If range is in the form 'NewSheet!A1' then first change sheet to 'NewSheet'
if pos('!', Range) > 0 then begin
//Activate the proper sheet...
if not ActivateSheetByName(Copy(Range, 1, pos('!', Range)-1), false) then
raise exception.create('Sheet "'+Copy(Range, 1, pos('!', Range)-1)+
'" not present in the document.');
Range:= Copy(Range, pos('!', Range)+1, 999);
end;
result:= ActiveSheet.getCellRangeByName(Range).getCellByPosition(0,0).getFormula;
ActiveSheet:= OldActiveSheet;
end;
end;
end;
procedure TopofCalc.SetCellTextByName(Range: string; Txt: string);
var OldActiveSheet: variant;
begin
if DocLoaded then begin
if IsExcel then begin
Programa.Range[Range].formula:= Txt;
end;
if IsOpenOffice then begin
OldActiveSheet:= ActiveSheet;
//If range is in the form 'NewSheet!A1' then first change sheet to 'NewSheet'
if pos('!', Range) > 0 then begin
//Activate the proper sheet...
if not ActivateSheetByName(Copy(Range, 1, pos('!', Range)-1), false) then
raise exception.create('Sheet "'+Copy(Range, 1, pos('!', Range)-1)+
'" not present in the document.');
Range:= Copy(Range, pos('!', Range)+1, 999);
end;
ActiveSheet.getCellRangeByName(Range).getCellByPosition(0,0).SetFormula(Txt);
ActiveSheet:= OldActiveSheet;
end;
end;
end;
//а так же – размера шрифта. Можно установить его в шаблоне, а можно прямо в ходе работы программы.
procedure TopofCalc.FontSize(row,col:integer;oosize:integer);
begin
if DocLoaded then begin
if IsExcel then begin
Programa.ActiveSheet.Cells[row,col].Font.Size:=oosize;
end;
if IsOpenOffice then begin
ActiveSheet.getCellByPosition(col-1, row-1).getText.createTextCursor.CharHeight:= oosize;
end;
end;
end;
//сделать шрифт жирным
procedure TopofCalc.Bold(row,col: integer);
const ooBold: integer = 150; //150 = com.sun.star.awt.FontWeight.BOLD
begin
if DocLoaded then begin
if IsExcel then begin
Programa.ActiveSheet.Cells[row,col].Font.Bold;
end;
if IsOpenOffice then begin
ActiveSheet.getCellByPosition(col-1, row-1).getText.createTextCursor.CharWeight:= ooBold;
end;
end;
end;
//изменить ширину столбца
procedure TopofCalc.ColumnWidth(col, width: integer); //Width in 1/100 of mm.
begin
if DocLoaded then begin
if IsExcel then begin
//Excel use the width of '0' as the unit, we do an aproximation: Width '0' = 2 mm.
Programa.ActiveSheet.Cells[col, 1].ColumnWidth:= width/100/3;
end;
if IsOpenOffice then begin
ActiveSheet.getCellByPosition(col-1, 0).getColumns.getByIndex(0).Width:= width;
end;
end;
end;
//в заключение, предлагаю функции, предназначенные именно для OpenOffice
//преобразование имени
//Change 'C:\File.txt' into 'file:///c:/File.txt' (for OpenOffice OpenURL)
function TopofCalc.FileNameToURL(FileName: string): string;
begin
result:= '';
if LowerCase(copy(FileName,1,8))<>'file:///' then
result:= 'file:///';
result:= result + StringReplace(FileName, '\', '/', [rfReplaceAll, rfIgnoreCase]);
end;
//создание объекта
function TopofCalc.ooCreateValue(ooName: string; ooData: variant): variant;
var
ooReflection: variant;
begin
if IsOpenOffice then begin
ooReflection:= Programa.createInstance('com.sun.star.reflection.CoreReflection');
ooReflection.forName('com.sun.star.beans.PropertyValue').createObject(result);
result.Name := ooName;
result.Value:= ooData;
end else begin
raise exception.create('ooValue imposible to create, load OpenOffice first!');
end;
end;
//запуск диспатчера
procedure TopofCalc.ooDispatch(ooCommand: string; ooParams: variant);
var
ooDispatcher, ooFrame: variant;
begin
if DocLoaded and IsOpenOffice then begin
if (VarIsEmpty(ooParams) or VarIsNull(ooParams)) then
ooParams:= VarArrayCreate([0, -1], varVariant);
ooFrame:= Document.getCurrentController.getFrame;
ooDispatcher:= Programa.createInstance('com.sun.star.frame.DispatchHelper');
ooDispatcher.executeDispatch(ooFrame, ooCommand, '', 0, ooParams);
end else begin
raise exception.create('Dispatch imposible, load a OpenOffice doc first!');
end;
end;
end.
|
unit FC.StockChart.UnitTask.BBExpert.Navigator;
interface
{$I Compiler.inc}
uses
SysUtils,Classes, BaseUtils, Serialization, StockChart.Definitions.Units,StockChart.Definitions,
FC.Definitions, FC.Singletons,
FC.StockChart.UnitTask.Base;
implementation
uses
FC.StockChart.UnitTask.BBExpert.NavigatorDialog;
type
//Специальный Unit Task для автоматического подбора размеров грани и длины периода.
//Подюор оусщестьвляется прямым перебором.
TStockUnitTaskBBExpertNavigator = class(TStockUnitTaskBase)
public
function CanApply(const aIndicator: ISCIndicator; out aOperationName: string): boolean; override;
procedure Perform(const aIndicator: ISCIndicator; const aStockChart: IStockChart; const aCurrentPosition: TStockPosition); override;
end;
{ TStockUnitTaskBBExpertNavigator }
function TStockUnitTaskBBExpertNavigator.CanApply(const aIndicator: ISCIndicator; out aOperationName: string): boolean;
begin
result:=Supports(aIndicator,ISCExpertBB);
if result then
aOperationName:='Navigate';
end;
procedure TStockUnitTaskBBExpertNavigator.Perform(const aIndicator: ISCIndicator; const aStockChart: IStockChart; const aCurrentPosition: TStockPosition);
begin
TfmNavigator.Run(aIndicator as ISCExpertBB,aStockChart);
end;
initialization
//Регистрируем Unit Task
StockUnitTaskRegistry.AddUnitTask(TStockUnitTaskBBExpertNavigator.Create);
end.
|
unit RecursoEditFormUn;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
osCUSTOMEDITFRM, Wwintl, Db, DBClient, osClientDataset, ActnList,
StdCtrls, Mask, DBCtrls, Grids, DBGrids, ComCtrls,
wwdbedit, Wwdotdot, Wwdbcomb, Menus, ImgList,
osActionList, ToolWin, Buttons, ExtCtrls, osComboSearch, osUtils,
Wwdbigrd, Wwdbgrid, Wwdbspin, DBActns, acCustomSQLMainDataUn,
System.Actions {$IFDEF VER320} , System.ImageList {$ENDIF};
type
TRecursoEditForm = class(TosCustomEditForm)
AcaoClientDataSet: TosClientDataset;
AcaoDataSource: TDataSource;
TestarAction: TAction;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
NomeEdit: TDBEdit;
DescricaoEdit: TDBMemo;
RecursoClientDataSource: TosClientDataset;
PopupMenu: TPopupMenu;
Novo2: TMenuItem;
Excluir1: TMenuItem;
RecursoClientDataSourceIDRECURSO: TIntegerField;
RecursoClientDataSourceIDTIPORECURSO: TIntegerField;
RecursoClientDataSourceDESCRICAO: TStringField;
RecursoClientDataSourceIDDOMINIO: TIntegerField;
RecursoClientDataSourceNOME: TStringField;
RecursoClientDataSourceFILTERDEFNAME: TStringField;
RecursoClientDataSourceDATACLASSNAME: TStringField;
RecursoClientDataSourceRESCLASSNAME: TStringField;
RecursoClientDataSourceREPORTCLASSNAME: TStringField;
RecursoClientDataSourceINDICEIMAGEM: TIntegerField;
RecursoClientDataSourceNUMORDEM: TIntegerField;
AcaoClientDataSetIDACAO: TIntegerField;
AcaoClientDataSetIDRECURSO: TIntegerField;
AcaoClientDataSetNOME: TStringField;
AcaoClientDataSetNOMECOMPONENTE: TStringField;
AcaoClientDataSetDESCRICAO: TStringField;
AcaoClientDataSetINDICEIMAGEM: TIntegerField;
RecursoClientDataSourceDescricaoDominio: TStringField;
DescricaoDominioCombo: TosComboSearch;
DescricaoTipoRecursoCombo: TosComboSearch;
RecursoClientDataSourceDescricaoTipoRecurso: TStringField;
RecursoClientDataSourceAcaoDataSet: TDataSetField;
PageControl: TPageControl;
ClassesTabSheet: TTabSheet;
AcoesTabSheet: TTabSheet;
AcaoGrid: TwwDBGrid;
Label5: TLabel;
FilterDefNameEdit: TDBEdit;
Label6: TLabel;
DataClassNameEdit: TDBEdit;
Label7: TLabel;
ResClassNameDBEdit: TDBEdit;
Label8: TLabel;
ReportClassNameEdit: TDBEdit;
Label9: TLabel;
NumOrdemSpinEdit: TwwDBSpinEdit;
Label10: TLabel;
ImagemEdit: TDBEdit;
AntibioticoPopupMenu: TPopupMenu;
EditarAcaoMenu: TMenuItem;
InserirAcaoMenu: TMenuItem;
SalvarAcaoMenu: TMenuItem;
CancelarAcaoMenu: TMenuItem;
ExcluirAcaoMenu: TMenuItem;
AcaoActionList: TosActionList;
AcaoEdit: TDataSetEdit;
AcaoInsert: TDataSetInsert;
AcaoPost: TDataSetPost;
AcaoCancel: TDataSetCancel;
AcaoDelete: TDataSetDelete;
DBCheckBox1: TDBCheckBox;
RecursoClientDataSourceHABILITAEDITARTODOS: TStringField;
RecursoClientDataSourceFORCAREEXECUCAOFILTRO: TStringField;
DBCheckBox2: TDBCheckBox;
procedure RecursoClientDataSourceBeforePost(DataSet: TDataSet);
procedure AcaoClientDataSetBeforePost(DataSet: TDataSet);
procedure FormShow(Sender: TObject);
procedure RecursoClientDataSourceAfterApplyUpdates(Sender: TObject;
var OwnerData: OleVariant);
procedure AcaoClientDataSetAfterApplyUpdates(Sender: TObject;
var OwnerData: OleVariant);
private
public
end;
var
RecursoEditForm: TRecursoEditForm;
implementation
uses RecursoDataUn, AdministracaoLookupDataUn;
{$R *.DFM}
procedure TRecursoEditForm.RecursoClientDataSourceBeforePost(DataSet: TDataSet);
begin
inherited;
RecursoData.Validate(DataSet);
end;
procedure TRecursoEditForm.AcaoClientDataSetBeforePost(DataSet: TDataSet);
begin
inherited;
RecursoData.ValidateAcao(DataSet);
end;
procedure TRecursoEditForm.FormShow(Sender: TObject);
var
viewMode: boolean;
begin
inherited;
PageControl.ActivePage := ClassesTabSheet;
acCustomSQlMainData.RefreshTables([tnDominio, tnTipoRecurso]);
viewMode := FormMode=fmView;
if viewMode then
AcaoGrid.KeyOptions := AcaoGrid.KeyOptions-[dgAllowInsert]
else
AcaoGrid.KeyOptions := AcaoGrid.KeyOptions+[dgAllowInsert];
end;
procedure TRecursoEditForm.RecursoClientDataSourceAfterApplyUpdates(Sender: TObject; var OwnerData: OleVariant);
begin
inherited;
if TClientDataSet(Sender).UpdateStatus in [usModified, usInserted, usDeleted] then
acCustomSQLMainData.UpdateVersion(tnRecurso);
end;
procedure TRecursoEditForm.AcaoClientDataSetAfterApplyUpdates(Sender: TObject; var OwnerData: OleVariant);
begin
inherited;
if TClientDataSet(Sender).UpdateStatus in [usModified, usInserted, usDeleted] then
acCustomSQLMainData.UpdateVersion(tnAcao);
end;
initialization
OSRegisterClass(TRecursoEditForm);
end.
|
{*******************************************************}
{ }
{ Delphi Visual Component Library }
{ }
{ Copyright(c) 1995-2011 Embarcadero Technologies, Inc. }
{ }
{*******************************************************}
unit InetDesignResStrs;
interface
resourcestring
// Ports wizard page
sPortsPageInfo = 'Click a field for more information';
sPortsPageTitle = 'Port Number';
sPortsPageDescription = 'Specify the port that will be used by the web application to listen for client requests. ' +
'Use the "Test" button to make sure the port number is not already in use on this computer.';
sHTTPPortInfo = 'HTTP port. Port 80 is the well known HTTP port number used by web servers such as IIS.';
sHTTPSInfo = 'The HTTPS checkbox enables use of the HTTP(Secure) protocol. Port 443 is the well known HTTPS port number used by IIS.';
sPEMFileFilter = 'PEM File(*.pem;*.crt;*.cer)|*.pem|Any file (*.*)|*.*';
sPEMKeyFileFilter = 'PEM File(*.pem;*.crt;*.cer;*.key)|*.pem;*.crt;*.cer;*.key|Any file (*.*)|*.*';
sPEMFileNotFound = 'File "%s" not found';
SPEMOpenFileTitle = 'Open';
// CertFilesPage
sCertFilesPageInfo = 'Click a field for more information';
sCertFilesPageTitle = 'X.509 Certificates';
sCertFilesPageDescription = 'Specify the X.509 certificate and key files that will be used to secure an HTTPS connection. ' +
'After specifying a certificate and key file, use the "Test" button to validate.';
sCertFileInfo = 'Certificate file. This is the public key of your certificate.';
sRootCertFileINfo = 'Root Certificate file. Certificate file identifying a Root Certificate Authority.';
sKeyFileInfo = 'Certificate key file. This is the private key of your certificate.';
sKeyFilePasswordInfo = 'Certficate key password. This is the password used to encrypt the private key.';
sTestCertFilesOK = 'Test succeeded';
sCertFilesTestInfo = 'Click the "Test" button to create a temporary server and client, using the specified certificate and key files.';
sISAPIInfo = 'An ISAPI library integrates with IIS. IIS has support for HTTP and HTTPS.';
sCGIInfo = 'A CGI executable integrates with IIS. ' +
'Note that CGI is typically slower and more difficult to debug than ISAPI.';
sIndyFormInfo = 'A stand-alone WebBroker VCL application is a web server that displays a VCL form. It Supports HTTP using an Indy HTTP server component.';
sIndyConsoleInfo = 'A stand-alone WebBroker console application is a web server that has a text-only user interface. It Supports HTTP using an Indy HTTP server component.';
sWebAppDebugExeInfo = 'A Web App Debugger executable integrate with the Web App Debugger, and support HTTP';
sWebServerPageTitle = 'WebBroker Project Type';
sWebServerPageDescription = 'Select the type of WebBroker project';
sCoClassNameInfo = 'The class name is an identifier that will be used in the URL to connect to a particular Web App Debugger executable.';
implementation
end.
|
unit ncaColorConv;
{
ResourceString: Dario 10/03/13 Achou nada
}
interface
uses Graphics;
type
TRGB = record
R: Integer;
G: Integer;
B: Integer;
end;
type
THLS = record
H: Integer;
L: Integer;
S: Integer;
end;
type
THWB = record
H: Integer;
W: Integer;
B: Integer;
end;
function ColorToRGB(PColor: TColor): TRGB;
function RGBToColor(PR,PG,PB: Integer): TColor;
function RGBToCol(PRGB: TRGB): TColor;
function RGBToHLS(PRGB: TRGB): THLS;
function HLSToRGB(PHLS: THLS): TRGB;
function ColorMin(P1,P2,P3: double): Double;
function ColorMax(P1,P2,P3: double): Double;
function HLSToColor(H,L,S: Integer): TColor;
implementation
function HLSToColor(H,L,S: Integer): TColor;
var
P: THLS;
PRGB : TRGB;
begin
P.H := H;
P.L := L;
P.S := S;
PRGB := HLSToRGB(P);
Result := RGBToCol(PRGB);
end;
function RGBToColor(PR,PG,PB: Integer): TColor;
begin
Result := TColor((PB * 65536) + (PG * 256) + PR);
end;
function ColorToRGB(PColor: TColor): TRGB;
var
i: Integer;
begin
i := PColor;
Result.R := 0;
Result.G := 0;
Result.B := 0;
while i - 65536 >= 0 do begin i := i - 65536; Result.B := Result.B + 1;
end;
while i - 256 >= 0 do begin i := i - 256; Result.G := Result.G + 1; end;
Result.R := i;
end;
function RGBToCol(PRGB: TRGB): TColor;
begin
Result := RGBToColor(PRGB.R,PRGB.G,PRGB.B);
end;
function RGBToHLS(PRGB: TRGB): THLS;
var
LR,LG,LB,LH,LL,LS,LMin,LMax: double;
// LHLS: THLS;
// i: Integer;
begin
LH := 0;
LS := 0;
LR := PRGB.R / 256;
LG := PRGB.G / 256;
LB := PRGB.B / 256;
LMin := ColorMin(LR,LG,LB);
LMax := ColorMax(LR,LG,LB);
LL := (LMax + LMin)/2;
if LMin = LMax then begin
LH := 0;
LS := 0;
Result.H := round(LH * 256);
Result.L := round(LL * 256);
Result.S := round(LS * 256);
exit;
end;
If LL < 0.5 then LS := (LMax - LMin) / (LMax + LMin);
If LL >= 0.5 then LS := (LMax-LMin) / (2.0 - LMax - LMin);
If LR = LMax then LH := (LG - LB)/(LMax - LMin);
If LG = LMax then LH := 2.0 + (LB - LR) / (LMax - LMin);
If LB = LMax then LH := 4.0 + (LR - LG) / (LMax - LMin);
Result.H := round(LH * 42.6);
Result.L := round(LL * 256);
Result.S := round(LS * 256);
end;
function HLSToRGB(PHLS: THLS): TRGB;
var
LR,LG,LB,LH,LL,LS: double;
L1,L2: Double;
begin
L2 := 0;
LH := PHLS.H / 255;
LL := PHLS.L / 255;
LS := PHLS.S / 255;
if LS = 0 then begin
Result.R := PHLS.L;
Result.G := PHLS.L;
Result.B := PHLS.L;
Exit;
end;
If LL < 0.5 then L2 := LL * (1.0 + LS);
If LL >= 0.5 then L2 := LL + LS - LL * LS;
L1 := 2.0 * LL - L2;
LR := LH + 1.0/3.0;
if LR < 0 then LR := LR + 1.0;
if LR > 1 then LR := LR - 1.0;
If 6.0 * LR < 1 then LR := L1+(L2 - L1) * 6.0 * LR
Else if 2.0 * LR < 1 then LR := L2
Else if 3.0*LR < 2 then LR := L1 + (L2 - L1) * ((2.0 / 3.0) - LR) * 6.0
Else LR := L1;
LG := LH;
if LG < 0 then LG := LG + 1.0;
if LG > 1 then LG := LG - 1.0;
If 6.0 * LG < 1 then LG := L1+(L2 - L1) * 6.0 * LG
Else if 2.0*LG < 1 then LG := L2
Else if 3.0*LG < 2 then LG := L1 + (L2 - L1) * ((2.0 / 3.0) - LG) * 6.0
Else LG := L1;
LB := LH - 1.0/3.0;
if LB < 0 then LB := LB + 1.0;
if LB > 1 then LB := LB - 1.0;
If 6.0 * LB < 1 then LB := L1+(L2 - L1) * 6.0 * LB
Else if 2.0*LB < 1 then LB := L2
Else if 3.0*LB < 2 then LB := L1 + (L2 - L1) * ((2.0 / 3.0) - LB) * 6.0
Else LB := L1;
Result.R := round(LR * 255);
Result.G := round(LG * 255);
Result.B := round(LB * 255);
end;
function ColorMax(P1,P2,P3: double): Double;
begin
if (P1 > P2) then begin
if (P1 > P3) then begin
Result := P1;
end else begin
Result := P3;
end;
end else if P2 > P3 then begin
result := P2;
end else result := P3;
end;
function ColorMin(P1,P2,P3: double): Double;
begin
if (P1 < P2) then begin
if (P1 < P3) then begin
Result := P1;
end else begin
Result := P3;
end;
end else if P2 < P3 then begin
result := P2;
end else result := P3;
end;
end.
|
unit WIMGAPI;
interface
uses Windows;
const
WIM_INFO_MARKER = WideChar($FEFF);
GENERIC_EXECUTE = $20000000;
{ dwDesiredAccess }
WIM_GENERIC_READ = GENERIC_READ;
WIM_GENERIC_WRITE = GENERIC_WRITE;
WIM_GENERIC_MOUNT = GENERIC_EXECUTE;
{ dwDisposition }
WIM_CREATE_NEW = CREATE_NEW;
WIM_CREATE_ALWAYS = CREATE_ALWAYS;
WIM_OPEN_EXISTING = OPEN_EXISTING;
WIM_OPEN_ALWAYS = OPEN_ALWAYS;
WIM_COMPRESS_NONE = 0;
WIM_COMPRESS_XPRESS = 1;
WIM_COMPRESS_LZX = 2;
WIM_CREATED_NEW = 0;
WIM_OPENED_EXISTING = 1;
// WIMCreateFile, WIMCaptureImage, WIMApplyImage, WIMMountImageHandle flags:
WIM_FLAG_RESERVED = $00000001;
WIM_FLAG_VERIFY = $00000002;
WIM_FLAG_INDEX = $00000004;
WIM_FLAG_NO_APPLY = $00000008;
WIM_FLAG_NO_DIRACL = $00000010;
WIM_FLAG_NO_FILEACL = $00000020;
WIM_FLAG_SHARE_WRITE = $00000040;
WIM_FLAG_FILEINFO = $00000080;
WIM_FLAG_NO_RP_FIX = $00000100;
WIM_FLAG_MOUNT_READONLY = $00000200;
// WIMGetMountedImageList flags
WIM_MOUNT_FLAG_MOUNTED = $00000001;
WIM_MOUNT_FLAG_MOUNTING = $00000002;
WIM_MOUNT_FLAG_REMOUNTABLE = $00000004;
WIM_MOUNT_FLAG_INVALID = $00000008;
WIM_MOUNT_FLAG_NO_WIM = $00000010;
WIM_MOUNT_FLAG_NO_MOUNTDIR = $00000020;
WIM_MOUNT_FLAG_MOUNTDIR_REPLACED = $00000040;
WIM_MOUNT_FLAG_READWRITE = $00000100;
// WIMCommitImageHandle flags
WIM_COMMIT_FLAG_APPEND = $00000001;
// WIMSetReferenceFile
WIM_REFERENCE_APPEND = $00010000;
WIM_REFERENCE_REPLACE = $00020000;
// WIMExportImage
WIM_EXPORT_ALLOW_DUPLICATES = $00000001;
WIM_EXPORT_ONLY_RESOURCES = $00000002;
WIM_EXPORT_ONLY_METADATA = $00000004;
// WIMRegisterMessageCallback:
INVALID_CALLBACK_VALUE = $FFFFFFFF;
// WIMCopyFile
WIM_COPY_FILE_RETRY = $01000000;
// WIMDeleteImageMounts
WIM_DELETE_MOUNTS_ALL = $00000001;
// WIMMessageCallback Notifications:
WM_APP = $8000; //uses Messages
WIM_MSG = WM_APP + $1476;
WIM_MSG_TEXT = WIM_MSG + 1;
WIM_MSG_PROGRESS = WIM_MSG + 2;
WIM_MSG_PROCESS = WIM_MSG + 3;
WIM_MSG_SCANNING = WIM_MSG + 4;
WIM_MSG_SETRANGE = WIM_MSG + 5;
WIM_MSG_SETPOS = WIM_MSG + 6;
WIM_MSG_STEPIT = WIM_MSG + 7;
WIM_MSG_COMPRESS = WIM_MSG + 8;
WIM_MSG_ERROR = WIM_MSG + 9;
WIM_MSG_ALIGNMENT = WIM_MSG + 10;
WIM_MSG_RETRY = WIM_MSG + 11;
WIM_MSG_SPLIT = WIM_MSG + 12;
WIM_MSG_FILEINFO = WIM_MSG + 13;
WIM_MSG_INFO = WIM_MSG + 14;
WIM_MSG_WARNING = WIM_MSG + 15;
WIM_MSG_CHK_PROCESS = WIM_MSG + 16;
WIM_MSG_WARNING_OBJECTID = WIM_MSG + 17;
WIM_MSG_STALE_MOUNT_DIR = WIM_MSG + 18;
WIM_MSG_STALE_MOUNT_FILE = WIM_MSG + 19;
WIM_MSG_MOUNT_CLEANUP_PROGRESS = WIM_MSG + 20;
WIM_MSG_CLEANUP_SCANNING_DRIVE = WIM_MSG + 21;
WIM_MSG_IMAGE_ALREADY_MOUNTED = WIM_MSG + 22;
WIM_MSG_CLEANUP_UNMOUNTING_IMAGE = WIM_MSG + 23;
WIM_MSG_QUERY_ABORT = WIM_MSG + 24;
// WIMMessageCallback Return codes:
WIM_MSG_SUCCESS = ERROR_SUCCESS;
WIM_MSG_DONE = $FFFFFFF0;
WIM_MSG_SKIP_ERROR = $FFFFFFFE;
WIM_MSG_ABORT_IMAGE = $FFFFFFFF;
// WIM_INFO dwFlags values:
WIM_ATTRIBUTE_NORMAL = $00000000;
WIM_ATTRIBUTE_RESOURCE_ONLY = $00000001;
WIM_ATTRIBUTE_METADATA_ONLY = $00000002;
WIM_ATTRIBUTE_VERIFY_DATA = $00000004;
WIM_ATTRIBUTE_RP_FIX = $00000008;
WIM_ATTRIBUTE_SPANNED = $00000010;
WIM_ATTRIBUTE_READONLY = $00000020;
//MOUNTED_IMAGE_INFO_LEVELS
MountedImageInfoLevel0 = 1;
MountedImageInfoLevel1 = 2;
MountedImageInfoLevelInvalid = 3;
type
PLARGE_INTEGER = ^LARGE_INTEGER;
_WIM_INFO = packed record
WimPath : array[0..MAX_PATH - 1] of WideChar;
Guid : TGUID;
ImageCount : DWORD;
CompressionType: DWORD;
PartNumber : WORD;
TotalParts : WORD;
BootIndex : DWORD;
WimAttributes : DWORD;
WimFlagsAndAttr: DWORD;
end;
WIM_INFO = _WIM_INFO;
LPWIM_INFO = ^WIM_INFO;
PWIM_INFO = ^WIM_INFO;
_WIM_MOUNT_LIST = packed record
WimPath : array[0..MAX_PATH - 1] of WideChar;
MountPath : array[0..MAX_PATH - 1] of WideChar;
ImageIndex : DWORD;
MountedForRW: BOOL;
end;
WIM_MOUNT_LIST = _WIM_MOUNT_LIST;
LPWIM_MOUNT_LIST = ^WIM_MOUNT_LIST;
PWIM_MOUNT_LIST = ^WIM_MOUNT_LIST;
WIM_MOUNT_INFO_LEVEL0 = _WIM_MOUNT_LIST;
PWIM_MOUNT_INFO_LEVEL0 = ^WIM_MOUNT_LIST;
LPWIM_MOUNT_INFO_LEVEL0 = ^WIM_MOUNT_LIST;
_WIM_MOUNT_INFO_LEVEL1 = packed record
WimPath : array[0..MAX_PATH - 1] of WideChar;
MountPath : array[0..MAX_PATH - 1] of WideChar;
ImageIndex: DWORD;
MountFlags: DWORD;
end;
WIM_MOUNT_INFO_LEVEL1 = _WIM_MOUNT_INFO_LEVEL1;
PWIM_MOUNT_INFO_LEVEL1 = ^WIM_MOUNT_INFO_LEVEL1;
LPWIM_MOUNT_INFO_LEVEL1 = ^WIM_MOUNT_INFO_LEVEL1;
_MOUNTED_IMAGE_INFO_LEVELS = DWORD;
MOUNTED_IMAGE_INFO_LEVELS = _MOUNTED_IMAGE_INFO_LEVELS;
type
TWIMCreateFile = function(
pzWimPath: PWideChar;
dwDesiredAccess, dwCreationDisposition, dwFlagsAndAttributes, dwCompressionType: DWORD;
pdwCreationResult: PDWORD
): THandle; stdcall;
TWIMCloseHandle = function(
hObject: THandle
): BOOL; stdcall;
TWIMSetTemporaryPath = function(
hWim: THandle; pszPath: PWideChar
): BOOL; stdcall;
TWIMSetReferenceFile = function(
hWim: THandle;
pszPath: PWideChar;
dwFlags: DWORD
): BOOL; stdcall;
TWIMSplitFile = function(
hWim: THandle;
pszPartPath: PWideChar;
pliPartSize: PLARGE_INTEGER;
dwFlags: DWORD
): BOOL; stdcall;
TWIMExportImage = function(
hImage, hWim: THandle;
dwFlags: DWORD
): BOOL; stdcall;
TWIMDeleteImage = function(
hWim: THandle;
dwImageIndex: DWORD
): BOOL; stdcall;
TWIMGetImageCount = function(
hWim: THandle
): DWORD; stdcall;
TWIMGetAttributes = function(
hWim: THandle;
pWimInfo: PWIM_INFO;
cbWimInfo: DWORD
): BOOL; stdcall;
TWIMSetBootImage = function(
hWim: THandle;
dwImageIndex: DWORD
): BOOL; stdcall;
TWIMCaptureImage = function(
hWim: THandle;
pszPath: PWideChar;
dwCaptureFlags: DWORD
): THandle; stdcall;
TWIMLoadImage = function(
hWim: THandle;
dwImageIndex: DWORD
): THandle; stdcall;
TWIMApplyImage = function(
hImage: THandle;
pszPath: PWideChar;
dwApplyFlags: DWORD
): BOOL; stdcall;
TWIMGetImageInformation = function(
hImage: THandle;
ppvImageInfo: Pointer;
pcbImageInfo: PDWORD
): BOOL; stdcall;
TWIMSetImageInformation = function(
hImage: THandle;
pvImageInfo: Pointer;
cbImageInfo: DWORD
): BOOL; stdcall;
TWIMGetMessageCallbackCount = function(
hWim: THandle
): DWORD; stdcall;
TWIMRegisterMessageCallback = function(
hWim: THandle;
fpMessageProc, pvUserData: Pointer
): DWORD; stdcall;
TWIMUnregisterMessageCallback = function(
hWim: THandle;
fpMessageProc: Pointer
): BOOL; stdcall;
TWIMMessageCallback = function(
dwMessageId: DWORD;
wParam: WPARAM;
lParam: LPARAM;
pvUserData: Pointer
): DWORD; stdcall;
TWIMCopyFile = function(
pszExistingFileName, pszNewFileName: PWideChar;
pProgressRoutine, pvData: Pointer;
pbCancel: PBOOL;
dwCopyFlags: DWORD
): BOOL; stdcall;
TWIMMountImage = function(
pszMountPath, pszWimFileName: PWideChar;
dwImageIndex: DWORD;
pszTempPath: PWideChar
): BOOL; stdcall;
//Neu in Windows 7 WIMGAPI
TWIMMountImageHandle = function(
hImage: THandle;
pszMountPath: PWideChar;
dwMountFlags: DWORD
): BOOL; stdcall;
//Neu in Windows 7 WIMGAPI
TWIMRemountImage = function(
pszMountPath: PWideChar;
dwMountFlags: DWORD
): BOOL; stdcall;
//Neu in Windows 7 WIMGAPI
TWIMCommitImageHandle = function(
hImage: THandle;
dwCommitFlags: DWORD;
phNewImageHandle: PHandle
): BOOL; stdcall;
TWIMUnmountImage = function(
pszMountPath, pszWimFileName: PWideChar;
dwImageIndex: DWORD;
bCommitChanges: BOOL
): BOOL; stdcall;
//Neu in Windows 7 WIMGAPI
TWIMUnmountImageHandle = function(
hImage: THandle;
dwUnmountFlags: DWORD
): BOOL; stdcall;
//VERALTET seit Windows 7 - Ersetzt durch WIMGetMountedImageInfo
TWIMGetMountedImages = function(
pMountList: PWIM_MOUNT_LIST;
pcbMountListLength: PDWORD
): BOOL; stdcall;
//Neu in Windows 7 WIMGAPI
TWIMGetMountedImageInfo = function(
fInfoLevelId: MOUNTED_IMAGE_INFO_LEVELS;
pdwImageCount: PDWORD;
pMountInfo: Pointer;
cbMountInfoLength: DWORD;
pcbReturnLength: PDWORD
): BOOL; stdcall;
//Neu in Windows 7 WIMGAPI
TWIMGetMountedImageInfoFromHandle = function(
hImage: THandle;
fInfoLevelId: MOUNTED_IMAGE_INFO_LEVELS;
pMountInfo: Pointer;
cbMountInfoLength: DWORD;
pcbReturnLength: PDWORD
): BOOL; stdcall;
//Neu in Windows 7 WIMGAPI
TWIMGetMountedImageHandle = function(
pszMountPath: PWideChar;
dwFlags: DWORD;
phWimHandle, phImageHandle: PHandle
): BOOL; stdcall;
//Neu in Windows 7 WIMGAPI
TWIMDeleteImageMounts = function(
dwDeleteFlags: DWORD
): BOOL; stdcall;
//Neu in Windows 7 WIMGAPI
TWIMRegisterLogFile = function(
pszLogFile: PWideChar;
dwFlags: DWORD
): BOOL; stdcall;
//Neu in Windows 7 WIMGAPI
TWIMUnregisterLogFile = function(
pszLogFile: PWideChar
): BOOL; stdcall;
//Neu in Windows 7 WIMGAPI
TWIMExtractImagePath = function(
hImage: THandle;
pszImagePath, pszDestinationPath: PWideChar;
dwExtractFlags: DWORD
): BOOL; stdcall;
TWIMInitFileIOCallbacks = function(
pCallbacks: Pointer
): BOOL; stdcall;
TWIMSetFileIOCallbackTemporaryPath = function(
pszPath: PWideChar
): BOOL; stdcall;
//
// File I/O callback prototypes
//
type
PFILEIOCALLBACK_SESSION = Pointer;
type
FileIOCallbackOpenFile = function(
pszFileName: PWideChar
): PFILEIOCALLBACK_SESSION;
FileIOCallbackCloseFile = function(
hFile: PFILEIOCALLBACK_SESSION
): BOOL;
FileIOCallbackReadFile = function(
hFile: PFILEIOCALLBACK_SESSION;
pBuffer: Pointer;
nNumberOfBytesToRead: DWORD;
pNumberOfBytesRead: LPDWORD;
pOverlapped: POVERLAPPED
): BOOL;
FileIOCallbackSetFilePointer = function(
hFile: PFILEIOCALLBACK_SESSION;
liDistanceToMove: LARGE_INTEGER;
pNewFilePointer: PLARGE_INTEGER;
dwMoveMethod: DWORD
): BOOL;
FileIOCallbackGetFileSize = function(
hFile : THANDLE;
pFileSize: PLARGE_INTEGER
): BOOL;
type
_SFileIOCallbackInfo = packed record
pfnOpenFile : FileIOCallbackOpenFile;
pfnCloseFile : FileIOCallbackCloseFile;
pfnReadFile : FileIOCallbackReadFile;
pfnSetFilePointer: FileIOCallbackSetFilePointer;
pfnGetFileSize : FileIOCallbackGetFileSize;
end;
SFileIOCallbackInfo = _SFileIOCallbackInfo;
const
WIMGAPI_LIBNAME = 'wimgapi.dll';
var
WIMCreateFile: TWIMCreateFile;
WIMCloseHandle: TWIMCloseHandle;
WIMSetTemporaryPath: TWIMSetTemporaryPath;
WIMSetReferenceFile: TWIMSetReferenceFile;
WIMSplitFile: TWIMSplitFile;
WIMExportImage: TWIMExportImage;
WIMDeleteImage: TWIMDeleteImage;
WIMGetImageCount: TWIMGetImageCount;
WIMGetAttributes: TWIMGetAttributes;
WIMSetBootImage: TWIMSetBootImage;
WIMCaptureImage: TWIMCaptureImage;
WIMLoadImage: TWIMLoadImage;
WIMApplyImage: TWIMApplyImage;
WIMGetImageInformation: TWIMGetImageInformation;
WIMSetImageInformation: TWIMSetImageInformation;
WIMGetMessageCallbackCount: TWIMGetMessageCallbackCount;
WIMRegisterMessageCallback: TWIMRegisterMessageCallback;
WIMUnregisterMessageCallback: TWIMUnregisterMessageCallback;
WIMMessageCallback: TWIMMessageCallback;
WIMCopyFile: TWIMCopyFile;
WIMMountImage: TWIMMountImage;
WIMMountImageHandle: TWIMMountImageHandle;
WIMRemountImage: TWIMRemountImage;
WIMCommitImageHandle: TWIMCommitImageHandle;
WIMUnmountImage: TWIMUnmountImage;
WIMUnmountImageHandle: TWIMUnmountImageHandle;
WIMGetMountedImages: TWIMGetMountedImages;
WIMGetMountedImageInfo: TWIMGetMountedImageInfo;
WIMGetMountedImageInfoFromHandle: TWIMGetMountedImageInfoFromHandle;
WIMGetMountedImageHandle: TWIMGetMountedImageHandle;
WIMDeleteImageMounts: TWIMDeleteImageMounts;
WIMRegisterLogFile: TWIMRegisterLogFile;
WIMUnregisterLogFile: TWIMUnregisterLogFile;
WIMExtractImagePath: TWIMExtractImagePath;
WIMInitFileIOCallbacks: TWIMInitFileIOCallbacks;
WIMSetFileIOCallbackTemporaryPath: TWIMSetFileIOCallbackTemporaryPath;
procedure InitWIMGAPI(const APath: String = WIMGAPI_LIBNAME);
function WIMGAPILoaded: Boolean;
implementation
var
hWIMGAPI: THandle;
procedure InitWIMGAPI(const APath: String = WIMGAPI_LIBNAME);
begin
if (hWIMGAPI = 0) then
begin
hWIMGAPI := LoadLibrary(PChar(APath));
if (hWIMGAPI <> 0) then
begin
Pointer(WIMCreateFile) := GetProcAddress(hWIMGAPI, 'WIMCreateFile');
Pointer(WIMCloseHandle) := GetProcAddress(hWIMGAPI, 'WIMCloseHandle');
Pointer(WIMSetTemporaryPath) := GetProcAddress(hWIMGAPI, 'WIMSetTemporaryPath');
Pointer(WIMSetReferenceFile) := GetProcAddress(hWIMGAPI, 'WIMSetReferenceFile');
Pointer(WIMSplitFile) := GetProcAddress(hWIMGAPI, 'WIMSplitFile');
Pointer(WIMExportImage) := GetProcAddress(hWIMGAPI, 'WIMExportImage');
Pointer(WIMDeleteImage) := GetProcAddress(hWIMGAPI, 'WIMDeleteImage');
Pointer(WIMGetImageCount) := GetProcAddress(hWIMGAPI, 'WIMGetImageCount');
Pointer(WIMGetAttributes) := GetProcAddress(hWIMGAPI, 'WIMGetAttributes');
Pointer(WIMSetBootImage) := GetProcAddress(hWIMGAPI, 'WIMSetBootImage');
Pointer(WIMCaptureImage) := GetProcAddress(hWIMGAPI, 'WIMCaptureImage');
Pointer(WIMLoadImage) := GetProcAddress(hWIMGAPI, 'WIMLoadImage');
Pointer(WIMApplyImage) := GetProcAddress(hWIMGAPI, 'WIMApplyImage');
Pointer(WIMGetImageInformation) := GetProcAddress(hWIMGAPI, 'WIMGetImageInformation');
Pointer(WIMSetImageInformation) := GetProcAddress(hWIMGAPI, 'WIMSetImageInformation');
Pointer(WIMGetMessageCallbackCount) := GetProcAddress(hWIMGAPI, 'WIMGetMessageCallbackCount');
Pointer(WIMRegisterMessageCallback) := GetProcAddress(hWIMGAPI, 'WIMRegisterMessageCallback');
Pointer(WIMUnregisterMessageCallback) := GetProcAddress(hWIMGAPI, 'WIMUnregisterMessageCallback');
Pointer(WIMMessageCallback) := GetProcAddress(hWIMGAPI, 'WIMMessageCallback');
Pointer(WIMCopyFile) := GetProcAddress(hWIMGAPI, 'WIMCopyFile');
Pointer(WIMMountImage) := GetProcAddress(hWIMGAPI, 'WIMMountImage');
Pointer(WIMMountImageHandle) := GetProcAddress(hWIMGAPI, 'WIMMountImageHandle');
Pointer(WIMRemountImage) := GetProcAddress(hWIMGAPI, 'WIMRemountImage');
Pointer(WIMCommitImageHandle) := GetProcAddress(hWIMGAPI, 'WIMCommitImageHandle');
Pointer(WIMUnmountImage) := GetProcAddress(hWIMGAPI, 'WIMUnmountImage');
Pointer(WIMUnmountImageHandle) := GetProcAddress(hWIMGAPI, 'WIMUnmountImageHandle');
Pointer(WIMGetMountedImages) := GetProcAddress(hWIMGAPI, 'WIMGetMountedImages');
Pointer(WIMGetMountedImageInfo) := GetProcAddress(hWIMGAPI, 'WIMGetMountedImageInfo');
Pointer(WIMGetMountedImageInfoFromHandle) := GetProcAddress(hWIMGAPI, 'WIMGetMountedImageInfoFromHandle');
Pointer(WIMGetMountedImageHandle) := GetProcAddress(hWIMGAPI, 'WIMGetMountedImageHandle');
Pointer(WIMDeleteImageMounts) := GetProcAddress(hWIMGAPI, 'WIMDeleteImageMounts');
Pointer(WIMRegisterLogFile) := GetProcAddress(hWIMGAPI, 'WIMRegisterLogFile');
Pointer(WIMUnregisterLogFile) := GetProcAddress(hWIMGAPI, 'WIMUnregisterLogFile');
Pointer(WIMExtractImagePath) := GetProcAddress(hWIMGAPI, 'WIMExtractImagePath');
Pointer(WIMInitFileIOCallbacks) := GetProcAddress(hWIMGAPI, 'WIMInitFileIOCallbacks');
Pointer(WIMSetFileIOCallbackTemporaryPath) := GetProcAddress(hWIMGAPI, 'WIMSetFileIOCallbackTemporaryPath');
end;
end;
end;
procedure CloseWIMGAPI;
begin
if (hWIMGAPI <> 0) then
begin
FreeLibrary(hWIMGAPI);
hWIMGAPI := 0;
end;
end;
function WIMGAPILoaded: Boolean;
begin
Result := (hWIMGAPI <> 0);
end;
initialization
hWIMGAPI := 0;
WIMCreateFile := nil;
WIMCloseHandle := nil;
WIMSetTemporaryPath := nil;
WIMSetReferenceFile := nil;
WIMSplitFile := nil;
WIMExportImage := nil;
WIMDeleteImage := nil;
WIMGetImageCount := nil;
WIMGetAttributes := nil;
WIMSetBootImage := nil;
WIMCaptureImage := nil;
WIMLoadImage := nil;
WIMApplyImage := nil;
WIMGetImageInformation := nil;
WIMSetImageInformation := nil;
WIMGetMessageCallbackCount := nil;
WIMRegisterMessageCallback := nil;
WIMUnregisterMessageCallback := nil;
WIMMessageCallback := nil;
WIMCopyFile := nil;
WIMMountImage := nil;
WIMMountImageHandle := nil;
WIMRemountImage := nil;
WIMCommitImageHandle := nil;
WIMUnmountImage := nil;
WIMUnmountImageHandle := nil;
WIMGetMountedImages := nil;
WIMGetMountedImageInfo := nil;
WIMGetMountedImageInfoFromHandle := nil;
WIMGetMountedImageHandle := nil;
WIMDeleteImageMounts := nil;
WIMRegisterLogFile := nil;
WIMUnregisterLogFile := nil;
WIMExtractImagePath := nil;
WIMInitFileIOCallbacks := nil;
WIMSetFileIOCallbackTemporaryPath := nil;
finalization
CloseWIMGAPI;
end.
|
unit Unit1;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls;
type
TSeverity = (seOK, seWarning, seCritical);
TForm1 = class(TForm)
Button1: TButton;
Memo1: TMemo;
cbVerbose: TCheckBox;
LabeledEdit1: TLabeledEdit;
cbWarnChecksumFileMissing: TCheckBox;
cbWarningMissingChecksumFileEntry: TCheckBox;
cbWarnVanishedFile: TCheckBox;
cbWarnChecksumMismatch: TCheckBox;
Label1: TLabel;
RadioGroup1: TRadioGroup;
procedure Button1Click(Sender: TObject);
procedure FormShow(Sender: TObject);
private
CheckSumFileCount: integer;
function CheckDirectory(ADirectory: string; recursive: boolean): TSeverity;
function VerifyChecksumFile(aChecksumFile: string): TSeverity;
function GetChecksumSafe(const filename: string): string;
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
uses
MD5, SFV, Common;
const
DUMMY_FILE = 'DUMMY.$$$';
procedure TForm1.Button1Click(Sender: TObject);
var
sev: TSeverity;
begin
Memo1.Clear;
if not DirectoryExists(LabeledEdit1.Text) then
begin
showmessage('Directory does not exist');
exit;
end;
Application.ProcessMessages;
CheckSumFileCount := 0;
sev := CheckDirectory(LabeledEdit1.Text, true);
Beep;
case sev of
seOK:
showmessage('OK');
seWarning:
showmessage('Warning');
seCritical:
showmessage('Critical');
end;
Caption := Format('Done. Checked %d checksum files.', [CheckSumFileCount]);
end;
function SevMax(a, b: TSeverity): TSeverity;
begin
if Ord(a) > Ord(b) then
Result := a
else
Result := b;
end;
function TForm1.VerifyChecksumFile(aChecksumFile: string): TSeverity;
var
slFile: TStringList;
i: integer;
originalFilename: string;
expectedChecksum: string;
IsFound: boolean;
SR: TSearchRec;
fullfilename: string;
ADirectory: string;
originalFilenameFull: string;
begin
if ExtractFileName(aChecksumFile) <> DUMMY_FILE then
begin
Inc(CheckSumFileCount);
end;
if cbVerbose.Checked then
begin
Form1.Memo1.Lines.Add('Check: ' + aChecksumFile);
end;
Result := seOK;
ADirectory := IncludeTrailingPathDelimiter(ExtractFilePath(aChecksumFile));
try
slFile := TStringList.Create;
try
slFile.CaseSensitive := false;
slFile.OwnsObjects := true;
if radiogroup1.itemindex = 0 then
SFVFileToStringList(aChecksumFile, slFile)
else
MD5FileToStringList(aChecksumFile, slFile);
// TODO: If multiple checksum files => put them together into a single array (beware conflicts!)
// 1. Check existing entries in the checksum file
for i := 0 to slFile.Count - 1 do
begin
originalFilename := slFile.Strings[i];
expectedChecksum := TChecksum(slFile.Objects[i]).checksum;
originalFilenameFull := ADirectory + originalFilename;
if not FileExists(originalFilenameFull) then
begin
if cbWarnVanishedFile.Checked then
begin
Form1.Memo1.Lines.Add('FILE VANISHED: ' + originalFilenameFull);
Result := SevMax(Result, seCritical);
end;
end
else if LowerCase(GetChecksumSafe(originalFilenameFull))
= LowerCase(expectedChecksum) then
begin
if cbVerbose.Checked then
begin
Form1.Memo1.Lines.Add('OK: ' + originalFilenameFull + ' = ' +
expectedChecksum);
end;
Result := SevMax(Result, seOK);
end
else
begin
if cbWarnChecksumMismatch.Checked then
begin
Form1.Memo1.Lines.Add('CHECKSUM MISMATCH: ' + originalFilenameFull +
' <> ' + expectedChecksum);
Result := SevMax(Result, seCritical);
end;
end;
end;
// 2. Checking for entries which are NOT in the checksum file
IsFound := FindFirst(ADirectory + '*', faAnyFile - faDirectory, SR) = 0;
while IsFound do
begin
fullfilename := ADirectory + SR.Name;
if (LowerCase(ExtractFileExt(fullfilename)) <> '.md5') and
(LowerCase(ExtractFileExt(fullfilename)) <> '.sfv') and
(LowerCase(ExtractFileName(fullfilename)) <> 'thumbs.db') then
begin
if slFile.IndexOf(SR.Name) = -1 then //if slFile.Values[SR.Name] = '' then
begin
if ExtractFileName(aChecksumFile) = DUMMY_FILE then
begin
if cbWarnChecksumFileMissing.Checked then
begin
Form1.Memo1.Lines.Add('NEW FILE WITHOUT CHECKSUM FILE: ' +
fullfilename);
Result := SevMax(Result, seWarning);
end;
end
else
begin
if cbWarningMissingChecksumFileEntry.Checked then
begin
Form1.Memo1.Lines.Add('NEW FILE WITHOUT CHECKSUM ENTRY: ' +
fullfilename);
Result := SevMax(Result, seWarning);
end;
end;
end;
end;
IsFound := FindNext(SR) = 0;
end;
FindClose(SR);
finally
slFile.Free;
end;
except
on E: Exception do
begin
Memo1.Lines.Add('Invalid checksum file: ' + aChecksumFile + ' : ' + E.Message);
Result := seCritical;
end;
end;
end;
function TForm1.CheckDirectory(ADirectory: string; recursive: boolean)
: TSeverity;
var
IsFound: boolean;
SR: TSearchRec;
fullfilename: string;
begin
Caption := ADirectory;
Application.ProcessMessages;
if Application.Terminated then Abort;
Result := seOK;
ADirectory := IncludeTrailingPathDelimiter(ADirectory);
// Check checksum files
if radiogroup1.itemindex = 0 then
IsFound := FindFirst(ADirectory + '*.sfv', faAnyFile - faDirectory, SR) = 0
else
IsFound := FindFirst(ADirectory + '*.md5', faAnyFile - faDirectory, SR) = 0;
if not IsFound then
begin
fullfilename := ADirectory + DUMMY_FILE; // virtual "empty" file
Result := SevMax(Result, VerifyChecksumFile(fullfilename));
end
else
begin
while IsFound do
begin
fullfilename := ADirectory + SR.Name;
Caption := fullfilename;
Application.ProcessMessages;
if Application.Terminated then Abort;
Result := SevMax(Result, VerifyChecksumFile(fullfilename));
IsFound := FindNext(SR) = 0;
end;
end;
FindClose(SR);
// Check other dirs
if recursive then
begin
IsFound := FindFirst(ADirectory + '*', faAnyFile, SR) = 0;
while IsFound do
begin
fullfilename := ADirectory + SR.Name;
if DirectoryExists(fullfilename) and (SR.Name <> '.') and (SR.Name <> '..')
then
begin
Result := SevMax(Result, CheckDirectory(fullfilename, recursive));
end;
IsFound := FindNext(SR) = 0;
end;
FindClose(SR);
end;
end;
procedure TForm1.FormShow(Sender: TObject);
begin
if ParamCount >= 1 then
begin
LabeledEdit1.Text := ParamStr(1);
end;
end;
function TForm1.GetChecksumSafe(const filename: string): string;
begin
Caption := filename;
Application.ProcessMessages;
if Application.Terminated then Abort;
try
if radiogroup1.itemindex = 0 then
Result := CalcFileCRC32(filename)
else
Result := md5file(filename);
except
on E: Exception do
begin
Memo1.Lines.Add('Cannot read file ' + filename + ' : ' + E.Message);
Result := 'ERROR';
end;
end;
end;
end.
|
unit ConvertItUnit;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ComCtrls;
type
TForm1 = class(TForm)
ConvTypes: TListBox;
ConvValue: TEdit;
ConvResults: TListBox;
ConvValueIncDec: TUpDown;
ConvFamilies: TTabControl;
StatusBar1: TStatusBar;
procedure FormShow(Sender: TObject);
procedure ConvTypesClick(Sender: TObject);
procedure ConvValueChange(Sender: TObject);
procedure ConvFamiliesChange(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
uses
ConvUtils, StdConvs, EuroConv, StrUtils;
procedure TForm1.FormShow(Sender: TObject);
var
LFamilies: TConvFamilyArray;
I: Integer;
LStrings: TStringList;
begin
ConvFamilies.Tabs.Clear;
LStrings := TStringList.Create;
try
GetConvFamilies(LFamilies);
for I := 0 to Length(LFamilies) - 1 do
LStrings.AddObject(ConvFamilyToDescription(LFamilies[I]), TObject(LFamilies[I]));
LStrings.Sort;
ConvFamilies.Tabs.Assign(LStrings);
ConvFamiliesChange(Sender);
finally
LStrings.Free;
end;
end;
procedure TForm1.ConvFamiliesChange(Sender: TObject);
var
LFamily: TConvFamily;
LTypes: TConvTypeArray;
I: Integer;
begin
LFamily := TConvFamily(ConvFamilies.Tabs.Objects[ConvFamilies.TabIndex]);
with ConvTypes, Items do
begin
BeginUpdate;
Clear;
GetConvTypes(LFamily, LTypes);
for I := 0 to Length(LTypes) - 1 do
AddObject(ConvTypeToDescription(LTypes[I]), TObject(LTypes[I]));
ItemIndex := 0;
EndUpdate;
end;
ConvTypesClick(Sender);
end;
procedure TForm1.ConvTypesClick(Sender: TObject);
begin
ConvValueChange(Sender);
end;
procedure TForm1.ConvValueChange(Sender: TObject);
var
LValue: Double;
LBaseType, LTestType: TConvType;
I: Integer;
begin
with ConvResults, Items do
try
BeginUpdate;
Clear;
try
LValue := StrToFloatDef(ConvValue.Text, 0);
if ConvTypes.ItemIndex <> -1 then
begin
LBaseType := TConvType(ConvTypes.Items.Objects[ConvTypes.ItemIndex]);
for I := 0 to ConvTypes.Items.Count - 1 do
begin
LTestType := TConvType(ConvTypes.Items.Objects[I]);
Add(Format('%n %s', [Convert(LValue, LBaseType, LTestType),
ConvTypeToDescription(LTestType)]));
end;
end
else
Add('No base type');
except
Add('Cannot parse value');
end;
finally
EndUpdate;
end;
end;
end.
|
{----------------------------------------------------------------------------}
{ Written by Nguyen Le Quang Duy }
{ Nguyen Quang Dieu High School, An Giang }
{----------------------------------------------------------------------------}
Program LEM1;
Uses Math;
Const
maxN =10000;
Var
n :SmallInt;
R :Array[1..maxN] of Real;
res :Real;
procedure Enter;
var
i :SmallInt;
begin
Read(n);
for i:=1 to n do Read(R[i]);
end;
function Cal(a,b,c :Real) :Real;
begin
Exit(Arccos((a*a+b*b-c*c)/(2*a*b)));
end;
function Check(k :Real) :Real;
var
i :SmallInt;
corner :Real;
begin
corner:=Cal(R[n]+k,R[1]+k,R[n]+R[1]);
for i:=2 to n do
corner:=corner+Cal(R[i-1]+k,R[i]+k,R[i-1]+R[i]);
Exit(corner);
end;
procedure Solve;
var
i :SmallInt;
left,right,mid,corner :Real;
begin
left:=0; right:=0;
for i:=1 to n do right:=right+R[i];
mid:=(left+right)/2;
while (left<>mid) and (right<>mid) do
begin
corner:=Check(mid);
if (corner=2*pi) then Break;
if (corner>2*pi) then left:=mid else right:=mid;
mid:=(left+right)/2;
end;
res:=mid;
end;
Begin
Assign(Input,''); Reset(Input);
Assign(Output,''); Rewrite(Output);
Enter;
Solve;
Write(res:0:3);
Close(Input); Close(Output);
End. |
{-------------------------------------------------------------------------------
Объектная модель проигрывателя (см. HH5PlayerSDK.dll).
-------------------------------------------------------------------------------}
unit Player.Control;
{$ALIGN ON}
{$MINENUMSIZE 4}
interface
uses Messages, Windows, Forms, Graphics, SysUtils, Controls, Classes, FileCtrl, SyncObjs, Contnrs,
Player.VideoOutput.Base,Player.VideoOutput.AllTypes, Player.AudioOutput.Base,MediaProcessing.Definitions,MediaProcessing.VideoAnalytics.Definitions;
const
CM_IMAGESIZECHANGED = CM_BASE+300;
type
TAudioVolume = 0..100;
TWindowPlayerBase = class;
TWindowPlayerDrawFrameEvent = procedure (Sender: TWindowPlayerBase; aDC: HDC; aDCWidth,aDCHeight: cardinal) of object;
TWindowPlayerBeforeDisplayFrameEvent = procedure (Sender: TWindowPlayerBase; var aFormat: TMediaStreamDataHeader; var aData: pointer; var aDataSize: cardinal; var aInfo: pointer; var aInfoSize: cardinal) of object;
TWindowPlayerVideCanvasResizeEvent = procedure (Sender: TWindowPlayerBase) of object;
TWindowPlayerDblClickEvent = procedure (Sender: TWindowPlayerBase) of object;
TWindowPlayerClickEvent = procedure (Sender: TWindowPlayerBase) of object;
//Плейер совместо с окном для отображения
TWindowPlayerBase = class
private
FControl : TWinControl;
FContainer : TWinControl;
FAudioOutputLock: TCriticalSection;
FAudioEnabled: boolean;
FVideoOutputClass : TPlayerVideoOutputClass;
FAudioOutputClass : TPlayerAudioOutputClass;
FVideoOutput : TPlayerVideoOutput;
FAudioOutput : TPlayerAudioOutput;
FFrameDisplayedCount : integer;
FFrameSoundedCount : integer;
FKeepAspectRatio: Boolean;
FUpdatingBounds: integer;
FResizingVideoOutput: integer;
FProcessFrameLock: TCriticalSection;
FAudioVolume: TAudioVolume;
FOnDrawFrame: TWindowPlayerDrawFrameEvent;
FEnabled: boolean;
FVaLock: TCriticalSection;
FVaObjects: TVaObjectArray;
FVaEvents: TVaEventArray;
FVaFormat: TMediaStreamDataHeader;
FOnBeforeDisplayFrame: TWindowPlayerBeforeDisplayFrameEvent;
FOnVideoCanvasResized: TWindowPlayerVideCanvasResizeEvent;
FOnDblClick: TWindowPlayerDblClickEvent;
FOnClick: TWindowPlayerClickEvent;
procedure Control_CMImageSizeChanged(var Message: TWMNoParams); message CM_IMAGESIZECHANGED;
procedure Control_WMMove(var Message: TWMMove); message WM_MOVE;
procedure Control_WMSize(var Message: TWMSize); message WM_SIZE;
procedure Control_WMDestroy(var Message: TWMDestroy); message WM_DESTROY;
procedure Control_WMCreate(var Message: TWMCreate); message WM_CREATE;
procedure Control_WMDisplayChange(var Message: TWMDisplayChange); message WM_DISPLAYCHANGE;
procedure Control_WMDblClick(var Message: TWMLButtonDblClk); message WM_LBUTTONDBLCLK;
procedure Control_WMLButtonUp(var Message: TWMLButtonUp); message WM_LBUTTONUP;
procedure Control_WndProc(var Message: TMessage);
procedure Container_WndProc(var Message: TMessage);
function GetAudioEnabled: boolean;
procedure SetAudioEnabled(const Value: boolean);
//procedure WaitForImageReady(aTimeout: cardinal);
procedure SetKeepAspectRatio(const Value: Boolean);
function CanKeepAspectRatio:boolean;
procedure SetAudioVolume(const Value: TAudioVolume);
function GetBackgroundColor: TColor;
procedure SetBackgroundColor(const Value: TColor);
procedure SetOnDrawFrame(const Value: TWindowPlayerDrawFrameEvent);
procedure SetEnabled(const Value: boolean);
protected
procedure ApplyAudioVolume;
procedure Reset;
procedure OnControlDestroying; virtual;
procedure OnControlDestroyed; virtual;
procedure OnPlayerOutputDrawFrame(Sender: TPlayerVideoOutput; aDC: HDC; aDCWidth,aDCHeight: cardinal);
procedure OnPlayerOutputImageSizeChanged(Sender: TPlayerVideoOutput);
public
constructor Create(aVideoOutputClass: TPlayerVideoOutputClass; aAudioOutputClass: TPlayerAudioOutputClass; aControlClass: TWinControlClass=nil);
destructor Destroy; override;
procedure ProcessFrame(const aFormat: TMediaStreamDataHeader; aData: pointer; aDataSize: cardinal; aInfo: pointer; aInfoSize: cardinal);
procedure UpdateImage;
procedure UpdateBounds;
// procedure RedrawCurrentVideoFrame;
//Показывает ли что-то сейчас плейер
function IsDisplayingNow: boolean; virtual;
//получение снимков текущего кадра
procedure CaptureCurrentFrame(const aFileName: string); overload;
function CaptureCurrentFrame: TBitmap; overload;
function StatusInfo: string;
property VideoOutput : TPlayerVideoOutput read FVideoOutput;
property AudioOutput : TPlayerAudioOutput read FAudioOutput;
//Реагировать на поступающие данные. Если false, данные игнорируются
//(не выполняется их декодировка и отображение)
property Enabled: boolean read FEnabled write SetEnabled default true;
property VideoCanvas: TWinControl read FControl;
property Control: TWinControl read FContainer;
property AudioEnabled: boolean read GetAudioEnabled write SetAudioEnabled;
property AudioVolume: TAudioVolume read FAudioVolume write SetAudioVolume;
property BackgroundColor : TColor read GetBackgroundColor write SetBackgroundColor;
property KeepAspectRatio: Boolean read FKeepAspectRatio write SetKeepAspectRatio;
property OnDblClick: TWindowPlayerDblClickEvent read FOnDblClick write FOnDblClick;
property OnClick:TWindowPlayerClickEvent read FOnClick write FOnClick;
property OnBeforeDisplayFrame: TWindowPlayerBeforeDisplayFrameEvent read FOnBeforeDisplayFrame write FOnBeforeDisplayFrame;
property OnDrawFrame: TWindowPlayerDrawFrameEvent read FOnDrawFrame write SetOnDrawFrame;
property OnVideoCanvasResized: TWindowPlayerVideCanvasResizeEvent read FOnVideoCanvasResized write FOnVideoCanvasResized;
end;
type
TWindowStreamPlayer = class;
//Класс для проигрывания потокового видео
TWindowStreamPlayer = class (TWindowPlayerBase)
private
procedure Control_WMPaint(var Message: TWMPaint); message WM_PAINT;
function GetSynchronousDisplay: boolean;
procedure SetSynchronousDisplay(const Value: boolean);
public
property SynchronousDisplay : boolean read GetSynchronousDisplay write SetSynchronousDisplay;
end;
//Базовый тип исключений плейера
EHHPlayerException = class (Exception);
implementation
uses uBaseClasses,uTrace;
type
TFriendWinControl=class (TWinControl);
TPlayerWinControl = class(TWinControl)
protected
procedure CreateParams(var Params: TCreateParams); override;
end;
{ TWindowPlayerBase }
constructor TWindowPlayerBase.Create(aVideoOutputClass: TPlayerVideoOutputClass; aAudioOutputClass: TPlayerAudioOutputClass; aControlClass: TWinControlClass);
begin
inherited Create;
if (aVideoOutputClass=nil) then //По умолчанию DirectX
aVideoOutputClass:=TPlayerVideoOutputDirectX;
Assert(aVideoOutputClass<>nil);
FProcessFrameLock:=TCriticalSection.Create;
FEnabled:=true;
FAudioEnabled:=true;
FAudioVolume:=100;
FAudioOutputLock:=TCriticalSection.Create;
FVideoOutputClass:=aVideoOutputClass;
FAudioOutputClass:=aAudioOutputClass;
FVaLock:=TCriticalSection.Create;
if aControlClass=nil then
aControlClass:=TPlayerWinControl;
FContainer:=TPlayerWinControl.Create(nil);
FContainer.WindowProc:=Container_WndProc;
FContainer.Align:=alClient;
FControl:=aControlClass.Create(nil);
FControl.WindowProc:=Control_WndProc;
FControl.Parent:=FContainer;
{$IFNDEF VER130}
TFriendWinControl(FControl).ParentBackground:=false;
{$ENDIF}
FVideoOutput:=FVideoOutputClass.Create(TFriendWinControl(FControl).WindowHandle);
FVideoOutput.WaitOnOutOfBuffer:=false;
FVideoOutput.OnImageSizeChanged:=OnPlayerOutputImageSizeChanged;
if FAudioOutputClass<>nil then
begin
FAudioOutput:=FAudioOutputClass.Create;
end;
BackgroundColor:=clBlack;
end;
destructor TWindowPlayerBase.Destroy;
begin
FreeAndNil(FVideoOutput);
FreeAndNil(FAudioOutput);
FControl.Free;
FControl:=nil; //Не использовать FreeAndNil из-за петли в WindowProc
FContainer.Free;
FContainer:=nil;
inherited;
FreeAndNil(FProcessFrameLock);
FreeAndNil(FAudioOutputLock);
end;
procedure TWindowPlayerBase.UpdateImage;
begin
if FVideoOutput.VideoContextAllocated then
begin
FVideoOutput.UpdateBounds;
FVideoOutput.UpdateImage;
end;
end;
procedure TWindowPlayerBase.Control_CMImageSizeChanged(
var Message: TWMNoParams);
begin
inc(FResizingVideoOutput);
try
UpdateBounds;
finally
dec(FResizingVideoOutput);
end;
end;
procedure TWindowPlayerBase.Control_WMCreate(var Message: TWMCreate);
begin
FVideoOutput.WindowHandle:=TFriendWinControl(FControl).WindowHandle;
Assert(FVideoOutput.WindowHandle<>0);
end;
procedure TWindowPlayerBase.Control_WMDblClick(var Message: TWMLButtonDblClk);
begin
if Assigned(FOnDblClick) then
FOnDblClick(self);
end;
procedure TWindowPlayerBase.Control_WMDestroy(var Message: TWMDestroy);
begin
if FVideoOutput<>nil then //Это нормальная ситуация. При разрушении объекта сначала разрушается VideoOutput
FVideoOutput.WindowHandle:=0;
end;
procedure TWindowPlayerBase.Control_WMDisplayChange(var Message: TWMDisplayChange);
begin
//Пересоздадим контекст рисования
FVideoOutput.DeallocateVideoContext;
end;
procedure TWindowPlayerBase.Control_WMLButtonUp(var Message: TWMLButtonUp);
begin
if Assigned(FOnClick) then
FOnClick(self);
end;
procedure TWindowPlayerBase.Control_WMMove(var Message: TWMMove);
begin
if FUpdatingBounds=0 then
UpdateBounds;
end;
procedure TWindowPlayerBase.Control_WMSize(var Message: TWMSize);
begin
if FUpdatingBounds=0 then
UpdateBounds;
if Assigned(FOnVideoCanvasResized) then
FOnVideoCanvasResized(self);
end;
procedure TWindowPlayerBase.Control_WndProc(var Message: TMessage);
begin
if Message.Msg=WM_DESTROY then
OnControlDestroying;
//Ничего не делаем. Все будет рисовать DirectDraw
if (Message.Msg=WM_ERASEBKGND) and IsDisplayingNow then
begin
DefWindowProc(FControl.Handle,Message.Msg,Message.WParam,Message.LParam);
end
//Ничего не делаем. Все будет рисовать DirectDraw
else if (Message.Msg=WM_PAINT) and IsDisplayingNow then
begin
DefWindowProc(FControl.Handle,Message.Msg,Message.WParam,Message.LParam);
end
else
TFriendWinControl(FControl).WndProc(Message);
Dispatch(Message);
if Message.Msg=WM_DESTROY then
OnControlDestroyed;
end;
procedure TWindowPlayerBase.ProcessFrame(const aFormat: TMediaStreamDataHeader; aData: pointer; aDataSize: cardinal; aInfo: pointer; aInfoSize: cardinal);
var
aFormat2: TMediaStreamDataHeader;
i: Integer;
aStream: TMemoryStreamMediator;
begin
if not FEnabled then
exit;
FProcessFrameLock.Enter; //Защишаемся от вызовы ProcessFrame из разных потоков одновременно
try
if Assigned(FOnBeforeDisplayFrame) then
begin
aFormat2:=aFormat;
FOnBeforeDisplayFrame(self,aFormat2,aData,aDataSize,aInfo,aInfoSize);
end;
if (aData<>nil) and (aDataSize<>0) then
begin
if aFormat.biMediaType=mtVideo then
begin
FVideoOutput.WriteVideoData(aFormat,aData,aDataSize,aInfo,aInfoSize);
inc(FFrameDisplayedCount);
end
else if (aFormat.biMediaType=mtAudio) then
begin
if (FAudioOutput<>nil) and (FAudioEnabled) then
begin
FAudioOutput.WriteAudioData(aFormat,aData,aDataSize,aInfo,aInfoSize);
inc(FFrameSoundedCount);
end;
end
else if (aFormat.biMediaType=mtSysData) and (aFormat.biStreamType=stVideoAnalytics) then
begin
FVaLock.TryEnterOrRaise(10000);
try
aStream:=TMemoryStreamMediator.Create;
try
aStream.Init(aData,aDataSize);
aStream.ReadInteger(i);
SetLength(FVaObjects,i);
for i := 0 to High(FVaObjects) do
FVaObjects[i].Load(aStream);
aStream.ReadInteger(i);
SetLength(FVaEvents,i);
for i := 0 to High(FVaEvents) do
begin
FVaEvents[i].Load(aStream);
TraceLine('DrawAnalytics','Event: '+VaFilterEventNames[FVaEvents[i].type_]);
end;
finally
aStream.Free;
end;
FVaFormat:=aFormat;
finally
FVaLock.Leave;
end;
if not Assigned(FVideoOutput.OnDrawFrameImage) then
FVideoOutput.OnDrawFrameImage:=OnPlayerOutputDrawFrame;
UpdateImage;
end
else
begin
//Assert(false);
end;
end;
finally
FProcessFrameLock.Leave;
end;
end;
procedure TWindowPlayerBase.OnControlDestroying;
begin
end;
procedure TWindowPlayerBase.OnControlDestroyed;
begin
Reset;
end;
function TWindowPlayerBase.GetAudioEnabled: boolean;
begin
result:=FAudioEnabled;
end;
procedure TWindowPlayerBase.SetAudioEnabled(const Value: boolean);
begin
FAudioOutputLock.Enter;
try
FAudioEnabled:=Value;
finally
FAudioOutputLock.Leave;
end;
ApplyAudioVolume;
end;
procedure TWindowPlayerBase.Reset;
begin
FFrameDisplayedCount:=0;
FFrameSoundedCount:=0;
end;
function TWindowPlayerBase.IsDisplayingNow: boolean;
begin
result:=(FVideoOutput<>nil) and (FFrameDisplayedCount>0) and (FVideoOutput.VideoContextAllocated);
end;
procedure TWindowPlayerBase.CaptureCurrentFrame(const aFileName: string);
var
aStream: TFileStream;
begin
aStream:=TFileStream.Create(aFileName,fmCreate);
try
FVideoOutput.CaptureCurrentImageToStreamAsBitmap(aStream);
finally
aStream.Free;
end;
end;
function TWindowPlayerBase.CaptureCurrentFrame: TBitmap;
begin
result:=TBitmap.Create;
try
FVideoOutput.CaptureCurrentImageToBitmap(result);
except
result.Free;
raise;
end;
end;
procedure TWindowPlayerBase.UpdateBounds;
var
aPlayerRatio: Real;
aCanvasRatio: Real;
aNewWidth,aNewHeight: integer;
begin
inc(FUpdatingBounds);
try
if not CanKeepAspectRatio then
begin
FControl.SetBounds(0,0,FContainer.Width,FContainer.Height);
end
else begin
aPlayerRatio := FVideoOutput.VideoWidth / FVideoOutput.VideoHeight;
//Скорее всего, это interlace. Нужно увеличить высоту в 2 раза
if (FVideoOutput.VideoWidth=704) and (FVideoOutput.VideoHeight=288) then
aPlayerRatio:=aPlayerRatio/2;
aCanvasRatio := FContainer.Width / FContainer.Height;
(*if (Round(aPlayerRatio * 100) = Round(aCanvasRatio * 100)) then
begin
//ничего делать не надо
end
else
begin *)
if aPlayerRatio > aCanvasRatio then
begin
aNewWidth:=FContainer.Width;
// уменьшаем высоту
aNewHeight:=Round(FContainer.Width / aPlayerRatio);
end
else begin
// уменьшаем ширину
aNewWidth:=Round(FContainer.Height * aPlayerRatio);
aNewHeight:=FControl.Parent.Height;
end;
FControl.SetBounds((FContainer.Width - aNewWidth) div 2,
(FContainer.Height - aNewHeight) div 2,
aNewWidth,aNewHeight);
end;
if FResizingVideoOutput=0 then
FVideoOutput.UpdateBounds;
if Assigned(FOnVideoCanvasResized) then
FOnVideoCanvasResized(self);
finally
dec(FUpdatingBounds);
end;
end;
function TWindowPlayerBase.CanKeepAspectRatio: boolean;
begin
result:=(FKeepAspectRatio) and
(FVideoOutput<>nil) and
(FControl<>nil) and
(FVideoOutput.VideoWidth<>0) and
(FVideoOutput.VideoHeight<>0) and
(self.FControl.Height>0);
end;
procedure TWindowPlayerBase.SetKeepAspectRatio(const Value: Boolean);
begin
FKeepAspectRatio := Value;
UpdateBounds;
end;
procedure TWindowPlayerBase.Container_WndProc(var Message: TMessage);
//var
// r: TRect;
begin
//07.07.2011 Закомментировал, потому что при изменении размеров остаются неочищенные области
//Не перерисовываем в родителе ту область, которую закрывает плейер
{
if (Message.Msg=WM_ERASEBKGND) and (FControl<>nil) and (FControl.Parent=FContainer) and IsDisplayingNow then
begin
r:=FControl.BoundsRect;
ExcludeClipRect(TWMEraseBkgnd(Message).DC,r.Left,r.Top,r.Right,r.Bottom);
end;
}
TFriendWinControl(FContainer).WndProc(Message);
if Message.Msg=WM_SIZE then
begin
if FUpdatingBounds=0 then
UpdateBounds
end
else if Message.Msg=WM_LBUTTONUP then
begin
if Assigned(FOnClick) then
FOnClick(self);
end;
end;
procedure TWindowPlayerBase.SetAudioVolume(const Value: TAudioVolume);
begin
if FAudioVolume=Value then
exit;
FAudioVolume := Value;
ApplyAudioVolume;
end;
procedure TWindowPlayerBase.ApplyAudioVolume;
begin
if (FAudioOutput<>nil) then
begin
FAudioOutput.Enabled:=FAudioEnabled;
FAudioOutput.Volume:=FAudioVolume;
end;
end;
function TWindowPlayerBase.GetBackgroundColor: TColor;
begin
result:=TFriendWinControl(FControl).Color;
end;
procedure TWindowPlayerBase.SetBackgroundColor(const Value: TColor);
begin
TFriendWinControl(FControl).Color:=Value;
TFriendWinControl(FContainer).Color:=Value;
FVideoOutput.BackgroundColor:=Value;
end;
procedure TWindowPlayerBase.SetEnabled(const Value: boolean);
begin
InterlockedExchange(PInteger(@FEnabled)^,integer(Value));
if not Value then
FVideoOutput.ResetBuffer;
end;
procedure TWindowPlayerBase.SetOnDrawFrame(const Value: TWindowPlayerDrawFrameEvent);
begin
if CompareMem(@TMethod(FOnDrawFrame),@TMethod(Value),sizeof(TMethod)) then
exit;
FOnDrawFrame := Value;
if Assigned(FOnDrawFrame) then
FVideoOutput.OnDrawFrameImage:=OnPlayerOutputDrawFrame
else
FVideoOutput.OnDrawFrameImage:=nil;
end;
function TWindowPlayerBase.StatusInfo: string;
begin
result:=Format('Player Type:%s'#13#10+
'Video'#13#10'%s'#13#10+
'Audio'#13#10'%s'#13#10,
[ClassName,Trim(FVideoOutput.StatusInfo),Trim(FAudioOutput.StatusInfo)]);
end;
procedure DrawVideoAnalytics(aDC:HDC; aDCWidth, aDCHeight: cardinal; const aFormat: TMediaStreamDataHeader; aObjects: TVaObjectArray; aEvents: TVaEventArray);
var
aSvaObject: TVaObject;
aSvaPosition: TVaPosition;
i: Integer;
j: Integer;
kx,ky: double;
aCanvas: TCanvas;
b: boolean;
aObjectRect: TRect;
aObjectPoint: TPoint;
begin
if (Length(aObjects)=0) then
exit;
//kx:=1;//FCurrentResult.frame.Width/FCurrentResult.input_frame.Width;
kx:=aDCWidth/aFormat.VideoWidth;//kx*aDCWidth/FCurrentResult.frame.Width;
//ky:=1;//FCurrentResult.frame.Height/FCurrentResult.input_frame.Height;
ky:=aDCHeight/aFormat.VideoHeight; //ky*aDCHeight/FCurrentResult.frame.Height;
aCanvas:=TCanvas.Create;
try
aCanvas.Handle:=aDC;
try
for i := 0 to High(aObjects) do
begin
aSvaObject:=aobjects[i];
if not aFormat.VideoReversedVertical then
aObjectRect:=Rect(aSvaObject.rect.left,aSvaObject.rect.top,aSvaObject.rect.right,aSvaObject.rect.bottom)
else
aObjectRect:=Rect(aSvaObject.rect.left,aFormat.VideoHeight-aSvaObject.rect.bottom,aSvaObject.rect.right,aFormat.VideoHeight-aSvaObject.rect.top);
b:=true;
aCanvas.Brush.Color:=clWebOrange;
for j := 0 to High(aEvents) do
begin
if (aevents[j].object_id = aSvaObject.id) then
begin
aCanvas.Brush.Color:=clRed;
break;
end;
end;
if not b then
begin
//if FParameters.FiltersVisualizationMode=vafvmHide then
// continue
//else begin
aCanvas.Brush.Color:=clGray;
//end;
end;
aCanvas.FrameRect(
Rect(
Round(aObjectRect.left*kx),
Round(aObjectRect.top*ky),
Round(aObjectRect.right*kx),
Round(aObjectRect.bottom*ky)));
if {FParameters.DrawTrajectory} true then
for j := 0 to High(aSvaObject.trajectory) do
begin
aSvaPosition:=aSvaObject.trajectory[j];
if not aFormat.VideoReversedVertical then
aObjectPoint:=Point(Round(aSvaPosition.point.x*kx),Round(aSvaPosition.point.y*ky))
else
aObjectPoint:=Point(Round(aSvaPosition.point.x*kx),Round((aFormat.VideoHeight-aSvaPosition.point.y)*ky));
aCanvas.Pixels[aObjectPoint.X,aObjectPoint.Y]:=aCanvas.Brush.Color;
end;
(*
if true FParameters.DrawIdentifiers or FParameters.DrawObjectTypes then
begin
s:='';aObjectIdStr:='';aObjectTypeStr:='';
if FParameters.DrawIdentifiers then
s:=IntToStr(aSvaObject.id);
if FParameters.DrawObjectTypes then
begin
case aSvaObject.type_ of
SVA_OBJECT_TYPE_EMPTY: ; // неинициализированный объект - служебный тип (объект такого типа не должен появляться снаружи библиотеки).
SVA_OBJECT_TYPE_STATIC: ; // кандидат в объекты - служебный тип (объект такого типа не должен появляться снаружи библиотеки).
SVA_OBJECT_TYPE_MOVING: aObjectTypeStr:=''; // движущийся объект (основной объект распознавания).
SVA_OBJECT_TYPE_ABANDONED: aObjectTypeStr:='О'; // оставленный предмет.
SVA_OBJECT_TYPE_BIGOBJECT: aObjectTypeStr:='Б'; // большой объект, например, поезд.
SVA_OBJECT_TYPE_INGROWN : ;// объект, который необходимо уничтожить на следующем кадре - служебный тип (объект такого типа не должен появляться снаружи библиотеки).
end;
end;
if aObjectIdStr<>'' then
s:=aObjectIdStr;
if aObjectTypeStr<>'' then
begin
if s<>'' then
s:=s+' ';
s:=s+aObjectTypeStr;
end;
aCanvas.TextOut(Round(aObjectRect.left*kx),Round(aObjectRect.top*ky),s);
end;
*)
end;
for i := 0 to High(aEvents) do
begin
if aEvents[i].type_ in [vaevBLACKOUT,vaevOVEREXPOSURE] then
begin
if aEvents[i].type_=vaevBLACKOUT then
aCanvas.Pen.Color:=clRed
else
aCanvas.Pen.Color:=clWhite;
aCanvas.MoveTo(0,0);
aCanvas.LineTo(aDCWidth,aDCHeight);
aCanvas.MoveTo(aDCWidth,0);
aCanvas.LineTo(0,aDCHeight);
end;
end;
finally
aCanvas.Handle:=0;
end;
finally
aCanvas.Free;
end;
end;
procedure TWindowPlayerBase.OnPlayerOutputDrawFrame(Sender: TPlayerVideoOutput; aDC: HDC;aDCWidth,aDCHeight: cardinal);
begin
FVaLock.TryEnterOrRaise(10000);
try
if Length(FVaObjects)+Length(FVaEvents)>0 then
DrawVideoAnalytics(aDC,aDCWidth,aDCHeight,FVaFormat,FVaObjects,FVaEvents);
finally
FVaLock.Leave;
end;
if Assigned(FOnDrawFrame) then
FOnDrawFrame(self,aDC,aDCWidth,aDCHeight);
end;
procedure TWindowPlayerBase.OnPlayerOutputImageSizeChanged(Sender: TPlayerVideoOutput);
var
aRes: DWORD_PTR;
aThreadId: DWORD;
begin
aThreadId:=GetWindowThreadProcessId(TFriendWinControl(FControl).WindowHandle);
if aThreadId=GetCurrentThreadId then
begin
TFriendWinControl(FControl).Perform(CM_IMAGESIZECHANGED,0,0);
end
else begin
//21.12.2012 Достали взаимные блокировки. Попробуем на свой страх и риск отсылать в PostMessage
if SendMessageTimeout(TFriendWinControl(FControl).WindowHandle,CM_IMAGESIZECHANGED,0,0,SMTO_BLOCK,100,@aRes)=0 then
PostMessage(TFriendWinControl(FControl).WindowHandle,CM_IMAGESIZECHANGED,0,0);
end;
end;
{ TWindowStreamPlayer }
procedure TWindowStreamPlayer.Control_WMPaint(var Message: TWMPaint);
begin
UpdateImage;
end;
function TWindowStreamPlayer.GetSynchronousDisplay: boolean;
begin
result:=FVideoOutput.SynchronousDisplay;
end;
procedure TWindowStreamPlayer.SetSynchronousDisplay(const Value: boolean);
begin
FVideoOutput.SynchronousDisplay:=Value;
end;
{ TPlayerWinControl }
procedure TPlayerWinControl.CreateParams(var Params: TCreateParams);
begin
inherited;
Params.WindowClass.style := Params.WindowClass.style and not (CS_HREDRAW or CS_VREDRAW);
end;
initialization
RegisterCustomTrace('DrawAnalytics','','.voa');
end.
|
{
ID: a2peter1
PROG: friday
LANG: PASCAL
}
{$B-,I-,Q-,R-,S-}
const
problem = 'friday';
month : array[1..12] of byte =
(31,28,31,30,31,30,31,31,30,31,30,31);
var
N,i,j,k : longint;
day : array[0..6] of longint;
function leap(year: longint): boolean;
begin
leap := (year mod 400 = 0) or
((year mod 4 = 0) and (year mod 100 <> 0));
end;{leap}
begin
assign(input,problem + '.in'); reset(input);
assign(output,problem + '.out'); rewrite(output);
readln(N);
for i := 0 to N - 1 do
for j := 1 to 12 do
begin
inc(day[k]);
if (j = 2) and leap(1900 + i) then inc(k);
k := (k + month[j]) mod 7;
end;{for}
for i := 0 to 5 do write(day[i],' ');
writeln(day[6]);
close(output);
end.{main}
|
unit YahtzeeClasses;
{$IFDEF FPC}
{$MODE DELPHI}
{$ENDIF}
{$H+}
interface
uses
Generics.Collections, Classes;
type
TMsgData = array of Byte;
{ TBaseIdentMessage }
TBaseIdentMessage = class
Ident: TGUID;
Data: TMsgData;
constructor Create; virtual;
function Encode: TMsgData; virtual;
procedure Decode(const AData: TMsgData); virtual;
end;
TIdentMessages = TThreadList<TBaseIdentMessage>;
TMsgCategory = (mcSystem, mcText, mcLobby, mcConnect, mcClient, mcServer, mcPlay);
TBaseMessage = class(TBaseIdentMessage)
public
Category: TMsgCategory;
Method: Byte;
Params: TList<AnsiString>;
constructor Create; override;
destructor Destroy; override;
procedure ExtractParams; virtual;
procedure DataFromParams;
function DataToString: AnsiString;
function Encode: TMsgData; override;
procedure Decode(const AData: TMsgData); override;
procedure Assign(AMessage: TBaseMessage);
end;
// TMessages = TThreadList<TMessage>;
TLogKind = (slkError, slkWarning, slkInfo, slkDebug);
TLogMessage = class
Kind: TLogKind;
Message: string;
end;
TLogMessages = TThreadList<TLogMessage>;
TNamedHost = class(TObject)
public
Name: AnsiString;
Host: AnsiString;
Version: AnsiString;
end;
TGameState = (gsWaiting, gsPreparing, gsPlaying, gsPaused, gsFinished);
TPlayerState = (psNone, psIdle, psReady, psPreparing, psWaiting, psPlaying,
psFinished, psWinner);
TDie = 0..6;
TDice = array[0..4] of TDie;
TDieSet = set of 1..5;
TScoreLocation = (slAces, slTwos, slThrees, slFours, slFives, slSixes,
slUpperBonus, slThreeKind, slFourKind, slFullHouse, slSmlStraight,
slLrgStraight, slYahtzee, slChance, slYahtzeeBonus1, slYahtzeeBonus2,
slYahtzeeBonus3);
TScoreLocations = set of TScoreLocation;
TScoreSheet = array[TScoreLocation] of Word;
function DieSetToByte(ADieSet: TDieSet): Byte;
function ByteToDieSet(AByte: Byte): TDieSet;
procedure RollDice(ASet: TDieSet; var ADice: TDice);
function MakeScoreForLocation(ALocation: TScoreLocation; ADice: TDice;
var AUsed: TDieSet): Word;
function IsYahtzee(ADice: TDice): Boolean;
function IsYahtzeeBonus(ASheet: TScoreSheet; var ALocation: TScoreLocation): Boolean;
function YahtzeeBonusStealLocs(ASheet: TScoreSheet; ADice: TDice): TScoreLocations;
function YahtzeeBonusStealScore(ALocation: TScoreLocation; ADice: TDice): Word;
const
VAL_KND_SCOREINVALID = High(Word);
ARR_LIT_NAM_CATEGORY: array[TMsgCategory] of string = (
'system', 'text', 'lobby', 'connect', 'client', 'server', 'play');
VAL_SET_DICEALL: TDieSet = [1..5];
VAL_SET_SCOREUPPER: TScoreLocations = [slAces..slSixes];
VAL_SET_SCORELOWER: TScoreLocations = [slThreeKind..High(TScoreLocation)];
ARR_LIT_NAME_SCORELOC: array[TScoreLocation] of string = (
'Aces (1''s)', 'Twos (2''s)', 'Threes (3''s)', 'Fours (4''s)',
'Fives (5''s)', 'Sixes (6''s)', 'Upper Bonus', '3 of a Kind',
'4 of a Kind', 'Full House', 'SM Straight', 'LG Straight', 'YAHTZEE',
'Chance', 'YAHTZEE Bonus', 'YAHTZEE Bonus', 'YAHTZEE Bonus');
// I think that 2 should be 5 but this is using RFC messages as a template.
// 0 - System
// 00 - Hang up
// 0E - Invalid category
// 0F - Invalid empty
//
// 1 - Text
// 10 - Information
// 11 - Begin
// 12 - More
// 13 - Data
// 14 - Peer
//
// 2 - Lobby
// 20 - Error
// 21 - Join
// 22 - Part
// 23 - List
// 24 - Peer
//
// 3 - Connection
// 30 - Error
// 31 - Identify
//
// 4 - Client
// 40 - Error
// 41 - Identify
// 52 - KeepAlive
//
// 5 - Server
// 50 - Error
// 51 - Identify
// 52 - Challenge
//
// 6 - Play
// 60 - Error
// 61 - Join
// 62 - Part
// 63 - List
// 64 - TextPeer
// 65 - KickPeer
// 66 - StatusGame
// 67 - StatusPeer
// 68 - RollPeer
// 69 - KeepersPeer
// 6A - ScoreQuery
// 6B - ScorePeer
procedure AddLogMessage(const AKind: TLogKind; const AMessage: string);
var
LogMessages: TLogMessages;
implementation
uses
SysUtils;
procedure RollDice(ASet: TDieSet; var ADice: TDice);
var
i: Integer;
begin
for i:= 1 to 5 do
if i in ASet then
ADice[i - 1]:= Random(6) + 1;
end;
procedure AddLogMessage(const AKind: TLogKind; const AMessage: string);
var
lm: TLogMessage;
begin
lm:= TLogMessage.Create;
lm.Kind:= AKind;
lm.Message:= FormatDateTime('hh:nn:ss.zzz ', Now) + AMessage;
UniqueString(lm.Message);
LogMessages.Add(lm);
end;
function DieSetToByte(ADieSet: TDieSet): Byte;
var
i: TDie;
b: Byte;
begin
Result:= 0;
b:= $01;
for i:= 1 to 5 do
begin
if i in ADieSet then
Result:= Result or b;
b:= b shl 1;
end;
end;
function ByteToDieSet(AByte: Byte): TDieSet;
var
i: TDie;
b: Byte;
begin
Result:= [];
b:= $01;
for i:= 1 to 5 do
begin
if (b and AByte) <> 0 then
Include(Result, i);
b:= b shl 1;
end;
end;
function TallyDieScoreFor(ADie: Integer; ADice: TDice; var AUsed: TDieSet): Word;
var
i: Integer;
begin
Result:= 0;
for i:= 0 to 4 do
if ADice[i] = ADie then
begin
Include(AUsed, i + 1);
Inc(Result, ADie);
end;
end;
function TallyAllDieScore(ADice: TDice): Word;
var
i: Integer;
begin
Result:= 0;
for i:= 0 to 4 do
Inc(Result, ADice[i]);
end;
function MakeScoreForLocation(ALocation: TScoreLocation; ADice: TDice;
var AUsed: TDieSet): Word;
function HaveCountDie(ACount: Integer; ADice: TDice; var AUsed: TDieSet): Boolean;
var
i,
j: Integer;
d,
c: Integer;
u: TDieSet;
begin
Result:= False;
for i:= 0 to 4 do
if not ((i + 1) in AUsed) then
begin
d:= ADice[i];
u:= AUsed;
c:= 0;
for j:= 0 to 4 do
if not ((j + 1) in u) then
if d = ADice[j] then
begin
Inc(c);
Include(u, j + 1);
if c = ACount then
Break;
end;
if c = ACount then
begin
Result:= True;
AUsed:= u;
Break;
end;
end;
end;
function TallyDieScoreKind(ACount: Integer; ADice: TDice; var AUsed: TDieSet): Word;
var
i: Integer;
f: Boolean;
begin
Result:= 0;
if ACount > 0 then
begin
f:= False;
for i:= 0 to 4 do
if HaveCountDie(ACount, ADice, AUsed) then
begin
f:= True;
Break;
end;
end
else
f:= True;
if f then
Result:= TallyAllDieScore(ADice);
end;
function FindFullHouse(ADice: TDice; var AUsed: TDieSet): Word;
begin
Result:= 0;
if HaveCountDie(3, ADice, AUsed)
and HaveCountDie(2, ADice, AUsed) then
Result:= 25;
end;
function HaveSequence(AStart, ASize: Integer; ADice: TDice; var AUsed: TDieSet): Boolean;
var
u: TDieSet;
c: Integer;
i,
j: Integer;
d: Integer;
f: Boolean;
begin
Result:= False;
for i:= 0 to 4 do
begin
d:= AStart;
u:= AUsed;
c:= 0;
if not ((i + 1) in AUsed) then
if ADice[i] = d then
begin
f:= True;
Inc(c);
Include(u, i + 1);
Dec(d);
while f do
begin
f:= False;
for j:= 0 to 4 do
if (not ((j + 1) in AUsed))
and (ADice[j] = d) then
begin
Inc(c);
f:= c < ASize;
Dec(d);
Include(u, j + 1);
Break;
end;
end;
if c = ASize then
begin
Result:= True;
AUsed:= u;
Break;
end;
end;
end;
end;
function FindStraight(ASize: Integer; ADice: TDice; var AUsed: TDieSet): Word;
var
i: Integer;
n: Integer;
begin
Result:= 0;
n:= 6 - (6 - ASize);
for i:= 6 downto n do
if HaveSequence(i, ASize, ADice, AUsed) then
begin
if ASize = 5 then
Result:= 40
else
Result:= 30;
Break;
end;
end;
begin
// Result:= 0;
AUsed:= [];
if ALocation in VAL_SET_SCOREUPPER then
Result:= TallyDieScoreFor(Ord(ALocation) + 1, ADice, AUsed)
else
case ALocation of
slThreeKind:
Result:= TallyDieScoreKind(3, ADice, AUsed);
slFourKind:
Result:= TallyDieScoreKind(4, ADice, AUsed);
slFullHouse:
Result:= FindFullHouse(ADice, AUsed);
slSmlStraight:
Result:= FindStraight(4, ADice, AUsed);
slLrgStraight:
Result:= FindStraight(5, ADice, AUsed);
slYahtzee:
if HaveCountDie(5, ADice, AUsed) then
Result:= 50
else
Result:= 0;
slChance:
begin
Result:= TallyAllDieScore(ADice);
AUsed:= VAL_SET_DICEALL;
end;
slYahtzeeBonus1..slYahtzeeBonus3:
if HaveCountDie(5, ADice, AUsed) then
Result:= 100
else
Result:= 0;
else
Result:= VAL_KND_SCOREINVALID;
end;
end;
function IsYahtzee(ADice: TDice): Boolean;
var
i: Integer;
d: Integer;
begin
Result:= True;
d:= ADice[0];
for i:= 1 to 4 do
if ADice[i] <> d then
begin
Result:= False;
Break;
end;
end;
function IsYahtzeeBonus(ASheet: TScoreSheet; var ALocation: TScoreLocation): Boolean;
var
i,
j: TScoreLocation;
begin
Result:= False;
if (ASheet[slYahtzee] <> VAL_KND_SCOREINVALID)
and (ASheet[slYahtzee] <> 0) then
begin
// Result:= True;
j:= slAces;
for i:= slYahtzeeBonus1 to slYahtzeeBonus3 do
if ASheet[i] = VAL_KND_SCOREINVALID then
begin
j:= i;
Break;
end;
Result:= j > slAces;
if Result then
ALocation:= j;
end;
end;
function YahtzeeBonusStealLocs(ASheet: TScoreSheet; ADice: TDice): TScoreLocations;
var
i: TScoreLocation;
begin
Result:= [];
if ASheet[TScoreLocation(ADice[0] - 1)] = VAL_KND_SCOREINVALID then
Result:= [TScoreLocation(ADice[0] - 1)]
else
begin
if ASheet[slThreeKind] = VAL_KND_SCOREINVALID then
Include(Result, slThreeKind);
if ASheet[slFourKind] = VAL_KND_SCOREINVALID then
Include(Result, slFourKind);
if Result = [] then
begin
for i:= slFullHouse to slLrgStraight do
if ASheet[i] = VAL_KND_SCOREINVALID then
Include(Result, i);
if ASheet[slChance] = VAL_KND_SCOREINVALID then
Include(Result, slChance);
end;
end;
if Result = [] then
for i:= slAces to slSixes do
if ASheet[i] = VAL_KND_SCOREINVALID then
Include(Result, i);
end;
function YahtzeeBonusStealScore(ALocation: TScoreLocation; ADice: TDice): Word;
var
u: TDieSet;
begin
u:= [];
if ALocation in [slAces..slSixes] then
Result:= TallyDieScoreFor(Ord(ALocation) + 1, ADice, u)
else if ALocation in [slThreeKind..slFourKind, slChance] then
Result:= TallyAllDieScore(ADice)
else if ALocation = slFullHouse then
Result:= 25
else if ALocation = slSmlStraight then
Result:= 30
else if ALocation = slLrgStraight then
Result:= 40
else
Result:= 0;
end;
{ TBaseIdentMessage }
constructor TBaseIdentMessage.Create;
begin
inherited;
end;
function TBaseIdentMessage.Encode: TMsgData;
begin
Result:= Data;
end;
procedure TBaseIdentMessage.Decode(const AData: TMsgData);
begin
Data:= AData;
end;
{ TMessage }
procedure TBaseMessage.Assign(AMessage: TBaseMessage);
var
i: Integer;
begin
Category:= AMessage.Category;
Method:= AMessage.Method;
SetLength(Data, Length(AMessage.Data));
Move(AMessage.Data[0], Data[0], Length(AMessage.Data));
Params.Clear;
for i:= 0 to AMessage.Params.Count - 1 do
Params.Add(AMessage.Params[i]);
end;
constructor TBaseMessage.Create;
begin
inherited Create;
Params:= TList<AnsiString>.Create;
end;
procedure TBaseMessage.DataFromParams;
var
s: AnsiString;
i: Integer;
begin
s:= AnsiString('');
for i:= 0 to Params.Count - 1 do
begin
s:= s + Params[i];
if i < (Params.Count - 1) then
s:= s + AnsiString(' ');
end;
SetLength(Data, Length(s));
for i:= Low(s) to High(s) do
Data[i - Low(s)]:= Ord(s[i]);
end;
function TBaseMessage.DataToString: AnsiString;
var
i: Integer;
begin
Result:= AnsiString('');
for i:= 0 to High(Data) do
Result:= Result + AnsiChar(Data[i]);
end;
procedure TBaseMessage.Decode(const AData: TMsgData);
var
i: Integer;
c: Byte;
begin
if (Length(AData) > 0)
and (Length(AData) = AData[0] + 1) then
begin
SetLength(Data, Length(AData) - 2);
c:= AData[1] shr 4;
if c in [Ord(Low(TMsgCategory))..Ord(High(TMsgCategory))] then
begin
Category:= TMsgCategory(AData[1] shr 4);
Method:= AData[1] and $0F;
end
else
begin
Category:= mcSystem;
Method:= $0E;
end;
for i:= 2 to High(AData) do
Data[i - 2]:= AData[i]
end
else
begin
SetLength(Data, 0);
Category:= mcSystem;
Method:= $0F;
end;
end;
destructor TBaseMessage.Destroy;
var
s: AnsiString;
begin
with Params do
while Count > 0 do
begin
s:= Items[0];
Delete(0);
end;
Params.Free;
inherited;
end;
function TBaseMessage.Encode: TMsgData;
var
i: Integer;
c: Byte;
begin
SetLength(Result, 2 + Length(Data));
Result[0]:= Length(Data) + 1;
c:= (Ord(Category) shl 4) or (Method and $0F);
Result[1]:= c;
for i:= 0 to High(Data) do
Result[2 + i]:= Data[i];
end;
procedure TBaseMessage.ExtractParams;
var
i: Integer;
s: AnsiString;
begin
with Params do
while Count > 0 do
begin
s:= Items[0];
Delete(0);
s:= AnsiString('');
end;
// Params.Clear;
s:= AnsiString('');
for i:= 0 to High(Data) do
if Data[i] = $20 then
begin
Params.Add(s);
s:= AnsiString('');
end
else
s:= s + AnsiChar(Data[i]);
if Length(s) > 0 then
Params.Add(s);
end;
initialization
LogMessages:= TLogMessages.Create;
finalization
with LogMessages.LockList do
while Count > 0 do
begin
Items[Count - 1].Free;
Delete(Count - 1);
end;
LogMessages.Free;
end.
|
unit BaseListItem;
interface
uses
System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
FMX.Types, FMX.Graphics, FMX.Controls, FMX.Forms, FMX.Dialogs, FMX.StdCtrls,
UI.Base, UI.Standard;
type
TBaseListItemFrame = class(FMX.Forms.TFrame)
private
{ Private declarations }
FItemIndex: Integer;
protected
function GetImageView: TImageView; virtual; abstract;
function GetTextView: TTextView; virtual; abstract;
public
{ Public declarations }
property ItemIndex: Integer read FItemIndex write FItemIndex;
property Image: TImageView read GetImageView;
property Text: TTextView read GetTextView;
end;
TFrame = class(TBaseListItemFrame);
TFrameClass = type of TBaseListItemFrame;
implementation
end.
|
unit MouseDialog;
interface
uses Windows, SysUtils, Classes, Graphics, Forms, Controls, StdCtrls,
Buttons, ExtCtrls, KbdMacro;
type
TMouseForm = class(TForm)
OKBtn: TButton;
CancelBtn: TButton;
Label1: TLabel;
MouseComboBox: TComboBox;
GroupBox1: TGroupBox;
RBWheelUp: TRadioButton;
RBWheelDown: TRadioButton;
RBLeftUp: TRadioButton;
RBMiddleUp: TRadioButton;
RBRightUp: TRadioButton;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
RBLeftDown: TRadioButton;
RBMiddleDown: TRadioButton;
RBRightDown: TRadioButton;
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
private
{ Private declarations }
public
{ Public declarations }
procedure SetMouseAttribs(pMacro: TKeyboardMacro);
procedure InitForm(pMacro: TKeyboardMacro);
end;
implementation
{$R *.dfm}
uses Dialogs;
procedure TMouseForm.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin
if (MouseComboBox.ItemIndex = -1) and (ModalResult = mrOK) then
begin
MessageDlg('Select mouse or cancel dialog.', mtError, [mbOK], 0);
CanClose := False;
end
end;
procedure TMouseForm.InitForm(pMacro: TKeyboardMacro);
begin
if pMacro = nil then
exit;
RBWheelUp.Checked := (pMacro.MouseEvent = Wheel) and (pMacro.Direction = mdUp);
RBWheelDown.Checked := (pMacro.MouseEvent = Wheel) and (pMacro.Direction = mdDown);
RBLeftUp.Checked := (pMacro.MouseEvent = KbdMacro.Left) and (pMacro.Direction = mdUp);
RBLeftDown.Checked := (pMacro.MouseEvent = KbdMacro.Left) and (pMacro.Direction = mdDown);
RBMiddleUp.Checked := (pMacro.MouseEvent = Middle) and (pMacro.Direction = mdUp);
RBMiddleDown.Checked := (pMacro.MouseEvent = Middle) and (pMacro.Direction = mdDown);
RBRightUp.Checked := (pMacro.MouseEvent = Right) and (pMacro.Direction = mdUp);
RBRightDown.Checked := (pMacro.MouseEvent = Right) and (pMacro.Direction = mdDown);
end;
procedure TMouseForm.SetMouseAttribs(pMacro: TKeyboardMacro);
begin
if pMacro = nil then
exit;
if (RBWheelUp.Checked) then
begin
pMacro.MouseEvent := Wheel;
pMacro.Direction := mdUp;
end;
if (RBWheelDown.Checked) then
begin
pMacro.MouseEvent := Wheel;
pMacro.Direction := mdDown;
end;
if (RBLeftUp.Checked) then
begin
pMacro.MouseEvent := KbdMacro.Left;
pMacro.Direction := mdUp;
end;
if (RBLeftDown.Checked) then
begin
pMacro.MouseEvent := KbdMacro.Left;
pMacro.Direction := mdDown;
end;
if (RBMiddleUp.Checked) then
begin
pMacro.MouseEvent := Middle;
pMacro.Direction := mdUp;
end;
if (RBMiddleDown.Checked) then
begin
pMacro.MouseEvent := Middle;
pMacro.Direction := mdDown;
end;
if (RBRightUp.Checked) then
begin
pMacro.MouseEvent := Right;
pMacro.Direction := mdUp;
end;
if (RBRightDown.Checked) then
begin
pMacro.MouseEvent := Right;
pMacro.Direction := mdDown;
end;
end;
end.
|
unit PSC10904;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, Buttons, Db, MemDS, DBAccess, Ora, OraSmart, ExtCtrls, Mask, Func, JPEG,
ComCtrls, OnEditStdCtrl, OnEditBaseCtrl, OnFocusButton, QuickRpt, Qrctrls,
DBCtrls, OnRegistry, OnEditBtnCtrl, OnEditCombo;
type
TFmPSC10904 = class(TForm)
Panel1: TPanel;
PageControl1: TPageControl;
TabSheet1: TTabSheet;
TabSheet2: TTabSheet;
TabSheet3: TTabSheet;
TabSheet4: TTabSheet;
TabSheet5: TTabSheet;
TabSheet6: TTabSheet;
EdEmpno: TOnEdit;
EdKorname: TOnEdit;
EdStocknum: TOnEdit;
EdSeq: TOnEdit;
EdAppdate: TOnMaskEdit;
BB_Close: TOnFocusButton;
Panel2: TPanel;
Image1: TImage;
BT_Print: TOnFocusButton;
TabSheet7: TTabSheet;
Memo1: TMemo;
E_GBPage: TOnComboEdit;
procedure FormActivate(Sender: TObject);
procedure PageControl1Change(Sender: TObject);
procedure BB_CloseClick(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure BT_PrintClick(Sender: TObject);
procedure E_GBPageChange(Sender: TObject);
private
{ Private declarations }
vMessage : String;
public
{ Public declarations }
end;
var
FmPSC10904: TFmPSC10904;
const
SUBKEY : String = 'SOFTWARE\(주) 하나로\NEW종합인사정보시스템';
implementation
uses PSC10901, PSC10905;
{$R *.DFM}
procedure TFmPSC10904.BB_CloseClick(Sender: TObject);
begin
Close;
end;
procedure TFmPSC10904.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Ora_Session.Disconnect;
Action := caFree;
end;
procedure TFmPSC10904.FormActivate(Sender: TObject);
begin
EdEmpno.Text := FM_Main.TMaxDataSet1.FieldByName('empno' ).AsString;
EdKorname.Text := FM_Main.TMaxDataSet1.FieldByName('korname').AsString;
EdStocknum.Text := FM_Main.TMaxDataSet1.FieldByName('stocknum').AsString;
EdSeq.Text := IntToStr(FM_Main.TMaxDataSet1.FieldByName('seq').AsInteger);
EdAppdate.Text := FM_Main.TMaxDataSet1.FieldByName('appdate').AsString;
OraConnect;
PageControl1.SetFocus;
PageControl1.ActivePage := TabSheet1;
PageControl1Change(nil);
end;
procedure TFmPSC10904.PageControl1Change(Sender: TObject);
var
stream : TMemoryStream;
JPEGImage : TJPEGImage;
qq : TOraQuery;
vFileName : String;
vEmpno : String;
vSeq : Integer;
begin
vEmpno := FM_Main.TMaxDataSet1.FieldByName('empno').AsString;
vSeq := FM_Main.TMaxDataSet1.FieldByName('seq').AsInteger;
qq := TOraQuery.Create(nil);
qq.Session := Ora_Session;
try
with qq do
begin
Close;
SQL.Clear;
SQL.Add('select photo ');
SQL.Add(' from Pstock_image ');
SQL.Add(' where empno = :empno ');
SQL.Add(' and seq = :seq ');
SQL.Add(' and gubun = :gubun ');
SQL.Add(' and gbpage = :gbpage ');
ParamByName('empno' ).AsString := vEmpno;
ParamByName('seq' ).AsInteger := vSeq;
ParamByName('gubun' ).AsString := IntToStr(PageControl1.ActivePage.PageIndex);
ParamByName('gbpage' ).AsInteger := StrToInt(E_GBPage.Text);
Open;
vMessage := '';
if PageControl1.ActivePage.PageIndex = 0 then vMessage := '주민등록증'
else if PageControl1.ActivePage.PageIndex = 1 then vMessage := '스톡옵션행사신청서'
else if PageControl1.ActivePage.PageIndex = 2 then vMessage := '스톡옵션부여계약서'
else if PageControl1.ActivePage.PageIndex = 3 then vMessage := '재직증명서'
else if PageControl1.ActivePage.PageIndex = 4 then vMessage := '경력증명서'
else if PageControl1.ActivePage.PageIndex = 5 then vMessage := '질권설정계약서'
else if PageControl1.ActivePage.PageIndex = 6 then vMessage := '급여차감지급의뢰서';
Image1.picture.Graphic := nil;
if RecordCount > 0 then
begin
try
stream := TMemoryStream.Create;
//JPEGImage := TJPEGImage.Create;
TblobField(qq.FieldByName('photo')).SaveToStream(stream);
stream.Position := 0;
//JPEGImage.LoadFromStream(stream);
//그림파일 저장
vFileName := GetKeyValue(HKEY_LOCAL_MACHINE, SUBKEY, 'NewHomeDir') +'\';
vFileName := vFileName + vEmpno +'-'+ IntToStr(vSeq) +'회-'+ vMessage +'-'+ E_GBPage.Text +'page.pdf';
TBlobField(FieldByName('photo')).SaveToFile(vFileName);
//SetStretchBltMode (Image1.Canvas.Handle, STRETCH_HALFTONE);
//if stream.Size <> 0 then Image1.picture.Assign(JPEGImage);
finally
stream.free;
//JPEGImage.Free;
end;
end;
end;
finally
qq.Free;
end;
end;
procedure TFmPSC10904.BT_PrintClick(Sender: TObject);
begin
FM_Print := TFM_Print.Create(Application);
FM_Print.PrintScale := poPrintToFit;
FM_Print.QuickRep1.Preview; //Print;
end;
procedure TFmPSC10904.E_GBPageChange(Sender: TObject);
begin
PageControl1Change(Sender);
end;
end.
|
unit b01_simpanpw;
interface
uses
utilitas;
const
p1 = 197; // angka prima untuk hash1
p2 = 233; // angka prima untuk hash2
m1 = 1000000009; // modulo untuk hash1
m2 = 1000000007; // modulo untuk hash2
{ DEKLARASI FUNGSI DAN PROSEDUR }
function getLength(password: String): Integer;
function hash1(password: String): Int64;
function hash2(password: String): Int64;
function rollHash(password: String): String;
{ IMPLEMENTASI FUNGSI DAN PROSEDUR }
implementation
function getLength(password: String): Integer;
{ DESKRIPSI : Fungsi untuk mencari panjang dari suatu string }
{ PARAMETER : String yang akan dicari panjangnya }
{ RETURN : Panjang string }
{ KAMUS LOKAL }
var
c: char;
panjang: integer = 0;
{ ALGORITMA }
begin
for c in password do
begin
panjang := panjang+1;
end;
getLength := panjang;
end;
function hash1(password: String): Int64;
{ DESKRIPSI : Fungsi hash pertama untuk hash keseluruhan }
{ PARAMETER : String yang akan di hash }
{ RETURN : Hasil hash dalam integer 64-bit }
{ KAMUS LOKAL }
var
hash_val, p_pow: Int64;
c: char;
{ ALGORTIMA }
begin
hash_val := 0;
p_pow := 1;
for c in password do
begin
hash_val := (hash_val + (ord(c)-1)*p_pow) mod m1;
p_pow := (p_pow*p1) mod m1;
end;
hash1 := hash_val;
end;
function hash2(password: String): Int64;
{ DESKRIPSI : Fungsi hash kedua untuk hash keseluruhan }
{ PARAMETER : String yang akan di hash }
{ RETURN : Hasil hash dalam integer 64-bit }
{ KAMUS LOKAL }
var
i: integer;
hash_val, p_pow: Int64;
panjang: integer;
{ ALGORITMA }
begin
hash_val := 0;
p_pow := 1;
panjang := getLength(password);
for i := panjang downto 1 do
begin
hash_val := (hash_val + (ord(password[i]) + 1)*p_pow) mod m2;
p_pow := (p_pow*p2) mod m2;
end;
hash2 := hash_val;
end;
function rollHash(password: String): String;
{ DESKRIPSI : Fungsi rollHash menerima sebuah string dan menggunakan dua hash yang di "konkat" untuk mengurangi kemungkinan collision.
Hasil hash tersebut diubah ke tipe string agar bisa di simpan di array user }
{ PARAMETER : password yang akan di hash }
{ RETURN : hasil hash yang sudah dikonversi ke string untuk disimpan}
var
angka: Int64;
begin
angka := (hash1(password) << 32) or hash2(password); // Hasil dari hash pertama di shift bitwise ke kiri sebanyak 32, dengan 32 bit terakhir digunakan untuk hash kedua
rollHash := Int64ToString(angka);
end;
end.
|
{ Демонстрация описания и вызова функционала Map. }
{ }
{ Функция, формальным параметром которой является }
{ функция, называется функционалом }
{ ----------------------------------------------- }
PROGRAM Primer_9;
{$F+} { Опция компилятора }
Uses CRT;
const N=10;
{ ----------------------------- }
type IA = Array[1..N] of Integer;
F = Function (X: Char) : Char;
F1 = Function (X: Integer): Integer;
p = ^IA; { Тип "указатель на массив" }
{ ---------------------------------------------------- }
var Fun : F;
Fun1 : F1;
g : p; { Указатель на массив }
w : p; { Указатель на массив }
i : Integer;
Slovo: String;
{ ------------------------- }
FUNCTION R (x: Char): Char;
BEGIN
R := UpCase(x);
{ R := Chr(Ord(x)+32); }
END;
{ -------------------------------- }
FUNCTION R1 (x: Integer): Integer;
BEGIN
R1 := x Div 2
END;
{ --------------------------------------- }
FUNCTION Map (G: F; Str: String): String;
{ Моделирование функционала map }
{ ----------------------------- }
var i: Integer;
r: String;
BEGIN
r:='';
For i:=1 to Length(Str) do
r := Concat(r,G(Str[i]));
Map := r
END;
{ ------------------------------- }
FUNCTION Map_1 (G: F1; d: p): p;
{ Моделирование функционала map }
{ ----------------------------- }
var i: Integer;
BEGIN
For i:=1 to N do
d^[i] := G(d^[i]);
Map_1 := d
END;
{ --- }
BEGIN
Randomize;
Write('Элементы массива: ');
For i:=1 to N do
begin g^[i]:=Random(80); Write(g^[i]:2,' ') end;
WriteLn;
w:=Map_1(R1,g);
Write('Результат : ');
For i:=1 to N do Write(w^[i]:2,' ');
WriteLn; WriteLn;
{ ------------- }
Slovo:='';
For i:=1 to 10 do
Slovo := Slovo + Chr(Ord('a')+Random(5));
WriteLn('Слово : ',Slovo);
WriteLn('Результат : ',Map(R,Slovo));
WriteLn;
Repeat until KeyPressed
END.
|
unit NtUtils.Tokens.Query;
interface
{ NOTE: All query/set functions here support pseudo-handles on all OS versions }
uses
Winapi.WinNt, Ntapi.ntseapi, NtUtils.Exceptions, NtUtils.Security.Sid,
NtUtils.Security.Acl, NtUtils.Objects;
// Make sure pseudo-handles are supported for querying
function NtxpExpandPseudoTokenForQuery(out hxToken: IHandle; hToken: THandle;
DesiredAccess: TAccessMask): TNtxStatus;
// Query variable-length token information without race conditions
function NtxQueryToken(hToken: THandle; InfoClass: TTokenInformationClass;
out xMemory: IMemory; StartBufferSize: Cardinal = 0): TNtxStatus;
// Set variable-length token information
function NtxSetToken(hToken: THandle; InfoClass: TTokenInformationClass;
TokenInformation: Pointer; TokenInformationLength: Cardinal): TNtxStatus;
type
NtxToken = class
// Query fixed-size information
class function Query<T>(hToken: THandle;
InfoClass: TTokenInformationClass; out Buffer: T): TNtxStatus; static;
// Set fixed-size information
class function SetInfo<T>(hToken: THandle;
InfoClass: TTokenInformationClass; const Buffer: T): TNtxStatus; static;
end;
// Query a SID (Owner, Primary group, ...)
function NtxQuerySidToken(hToken: THandle; InfoClass: TTokenInformationClass;
out Sid: ISid): TNtxStatus;
// Query a SID and attributes (User, Integrity, ...)
function NtxQueryGroupToken(hToken: THandle; InfoClass: TTokenInformationClass;
out Group: TGroup): TNtxStatus;
// Query groups (Groups, RestrictingSIDs, LogonSIDs, ...)
function NtxQueryGroupsToken(hToken: THandle; InfoClass: TTokenInformationClass;
out Groups: TArray<TGroup>): TNtxStatus;
// Query privileges
function NtxQueryPrivilegesToken(hToken: THandle;
out Privileges: TArray<TPrivilege>): TNtxStatus;
// Query default DACL
function NtxQueryDefaultDaclToken(hToken: THandle; out DefaultDacl: IAcl):
TNtxStatus;
// Set default DACL
function NtxSetDefaultDaclToken(hToken: THandle; DefaultDacl: IAcl): TNtxStatus;
// Query token flags
function NtxQueryFlagsToken(hToken: THandle; out Flags: Cardinal): TNtxStatus;
// Set integrity level of a token
function NtxSetIntegrityToken(hToken: THandle; IntegrityLevel: Cardinal):
TNtxStatus;
implementation
uses
Ntapi.ntstatus, NtUtils.Access.Expected, Ntapi.ntpebteb, NtUtils.Tokens;
function NtxpExpandPseudoTokenForQuery(out hxToken: IHandle; hToken: THandle;
DesiredAccess: TAccessMask): TNtxStatus;
begin
// Pseudo-handles are supported only starting from Win 8 (OS version is 6.2)
// and only for query operations
if (hToken <= MAX_HANDLE) or (RtlGetCurrentPeb.OSMajorVersion > 6) or
((RtlGetCurrentPeb.OSMajorVersion = 6) and
(RtlGetCurrentPeb.OSMinorVersion >= 2)) then
begin
// Not a pseudo-handle or they are supported.
// Capture, but do not close automatically.
Result.Status := STATUS_SUCCESS;
hxToken := TAutoHandle.Capture(hToken);
hxToken.AutoRelease := False;
end
else
begin
// This is a pseudo-handle, and they are not supported, open a real one
Result := NtxOpenPseudoToken(hxToken, hToken, DesiredAccess);
end;
end;
function NtxQueryToken(hToken: THandle; InfoClass: TTokenInformationClass;
out xMemory: IMemory; StartBufferSize: Cardinal = 0): TNtxStatus;
var
hxToken: IHandle;
Buffer: Pointer;
BufferSize, Required: Cardinal;
begin
// Make sure pseudo-handles are supported
if InfoClass = TokenSource then
Result := NtxpExpandPseudoTokenForQuery(hxToken, hToken, TOKEN_QUERY_SOURCE)
else
Result := NtxpExpandPseudoTokenForQuery(hxToken, hToken, TOKEN_QUERY);
if not Result.IsSuccess then
Exit;
Result.Location := 'NtQueryInformationToken';
Result.LastCall.CallType := lcQuerySetCall;
Result.LastCall.InfoClass := Cardinal(InfoClass);
Result.LastCall.InfoClassType := TypeInfo(TTokenInformationClass);
RtlxComputeTokenQueryAccess(Result.LastCall, InfoClass);
BufferSize := StartBufferSize;
repeat
Buffer := AllocMem(BufferSize);
Required := 0;
Result.Status := NtQueryInformationToken(hxToken.Handle, InfoClass, Buffer,
BufferSize, Required);
if not Result.IsSuccess then
begin
FreeMem(Buffer);
Buffer := nil;
end;
until not NtxExpandBuffer(Result, BufferSize, Required);
if Result.IsSuccess then
xMemory := TAutoMemory.Capture(Buffer, BufferSize);
end;
function NtxSetToken(hToken: THandle; InfoClass: TTokenInformationClass;
TokenInformation: Pointer; TokenInformationLength: Cardinal): TNtxStatus;
var
hxToken: IHandle;
DesiredAccess: TAccessMask;
begin
// Always expand pseudo-tokens, they are no good for setting information
if hToken > MAX_HANDLE then
begin
DesiredAccess := TOKEN_ADJUST_DEFAULT;
if InfoClass = TokenSessionId then
DesiredAccess := DesiredAccess or TOKEN_ADJUST_SESSIONID;
// Open a real token
Result := NtxOpenPseudoToken(hxToken, hToken, DesiredAccess);
if not Result.IsSuccess then
Exit;
end
else
begin
// Not a pseudo-handle. Capture, but do not close.
hxToken := TAutoHandle.Capture(hToken);
hxToken.AutoRelease := False;
end;
Result.Location := 'NtSetInformationToken';
Result.LastCall.CallType := lcQuerySetCall;
Result.LastCall.InfoClass := Cardinal(InfoClass);
Result.LastCall.InfoClassType := TypeInfo(TTokenInformationClass);
RtlxComputeTokenSetAccess(Result.LastCall, InfoClass);
Result.Status := NtSetInformationToken(hxToken.Handle, InfoClass,
TokenInformation, TokenInformationLength);
end;
class function NtxToken.Query<T>(hToken: THandle;
InfoClass: TTokenInformationClass; out Buffer: T): TNtxStatus;
var
hxToken: IHandle;
ReturnedBytes: Cardinal;
begin
// Make sure pseudo-handles are supported
if InfoClass = TokenSource then
Result := NtxpExpandPseudoTokenForQuery(hxToken, hToken, TOKEN_QUERY_SOURCE)
else
Result := NtxpExpandPseudoTokenForQuery(hxToken, hToken, TOKEN_QUERY);
if not Result.IsSuccess then
Exit;
Result.Location := 'NtQueryInformationToken';
Result.LastCall.CallType := lcQuerySetCall;
Result.LastCall.InfoClass := Cardinal(InfoClass);
Result.LastCall.InfoClassType := TypeInfo(TTokenInformationClass);
RtlxComputeTokenQueryAccess(Result.LastCall, InfoClass);
Result.Status := NtQueryInformationToken(hxToken.Handle, InfoClass, @Buffer,
SizeOf(Buffer), ReturnedBytes);
end;
class function NtxToken.SetInfo<T>(hToken: THandle;
InfoClass: TTokenInformationClass; const Buffer: T): TNtxStatus;
begin
Result := NtxSetToken(hToken, InfoClass, @Buffer, SizeOf(Buffer));
end;
{ Typed queries }
function NtxQuerySidToken(hToken: THandle; InfoClass: TTokenInformationClass;
out Sid: ISid): TNtxStatus;
var
xMemory: IMemory;
begin
Result := NtxQueryToken(hToken, InfoClass, xMemory, SECURITY_MAX_SID_SIZE);
if Result.IsSuccess then
Result := RtlxCaptureCopySid(PTokenOwner(xMemory).Owner, Sid);
end;
function NtxQueryGroupToken(hToken: THandle; InfoClass: TTokenInformationClass;
out Group: TGroup): TNtxStatus;
var
xMemory: IMemory;
Buffer: PSidAndAttributes; // aka PTokenUser
begin
Result := NtxQueryToken(hToken, InfoClass, xMemory, SECURITY_MAX_SID_SIZE +
SizeOf(Cardinal));
if Result.IsSuccess then
begin
Buffer := xMemory.Address;
Group.Attributes := Buffer.Attributes;
Result := RtlxCaptureCopySid(Buffer.Sid, Group.SecurityIdentifier);
end;
end;
function NtxQueryGroupsToken(hToken: THandle; InfoClass: TTokenInformationClass;
out Groups: TArray<TGroup>): TNtxStatus;
var
xMemory: IMemory;
Buffer: PTokenGroups;
i: Integer;
begin
Result := NtxQueryToken(hToken, InfoClass, xMemory);
if Result.IsSuccess then
begin
Buffer := xMemory.Address;
SetLength(Groups, Buffer.GroupCount);
for i := 0 to High(Groups) do
begin
Groups[i].Attributes := Buffer.Groups{$R-}[i]{$R+}.Attributes;
Result := RtlxCaptureCopySid(Buffer.Groups{$R-}[i]{$R+}.Sid,
Groups[i].SecurityIdentifier);
if not Result.IsSuccess then
Break;
end;
end;
end;
function NtxQueryPrivilegesToken(hToken: THandle; out Privileges:
TArray<TPrivilege>): TNtxStatus;
var
xMemory: IMemory;
Buffer: PTokenPrivileges;
i: Integer;
begin
Result := NtxQueryToken(hToken, TokenPrivileges, xMemory, SizeOf(Integer) +
SizeOf(TLuidAndAttributes) * SE_MAX_WELL_KNOWN_PRIVILEGE);
if Result.IsSuccess then
begin
Buffer := xMemory.Address;
SetLength(Privileges, Buffer.PrivilegeCount);
for i := 0 to High(Privileges) do
Privileges[i] := Buffer.Privileges{$R-}[i]{$R+};
end;
end;
function NtxQueryDefaultDaclToken(hToken: THandle; out DefaultDacl: IAcl):
TNtxStatus;
var
xMemory: IMemory;
Buffer: PTokenDefaultDacl;
begin
Result := NtxQueryToken(hToken, TokenDefaultDacl, xMemory);
if Result.IsSuccess then
begin
Buffer := xMemory.Address;
if Assigned(Buffer.DefaultDacl) then
DefaultDacl := TAcl.CreateCopy(Buffer.DefaultDacl)
else
DefaultDacl := nil;
end;
end;
function NtxSetDefaultDaclToken(hToken: THandle; DefaultDacl: IAcl): TNtxStatus;
var
Dacl: TTokenDefaultDacl;
begin
Dacl.DefaultDacl := DefaultDacl.Acl;
Result := NtxToken.SetInfo(hToken, TokenDefaultDacl, Dacl);
end;
function NtxQueryFlagsToken(hToken: THandle; out Flags: Cardinal): TNtxStatus;
var
xMemory: IMemory;
begin
Result := NtxQueryToken(hToken, TokenAccessInformation, xMemory);
if Result.IsSuccess then
Flags := PTokenAccessInformation(xMemory.Address).Flags;
end;
function NtxSetIntegrityToken(hToken: THandle; IntegrityLevel: Cardinal):
TNtxStatus;
var
LabelSid: ISid;
MandatoryLabel: TSidAndAttributes;
begin
// Prepare SID for integrity level with 1 sub authority: S-1-16-X.
LabelSid := TSid.CreateNew(SECURITY_MANDATORY_LABEL_AUTHORITY, 1,
IntegrityLevel);
MandatoryLabel.Sid := LabelSid.Sid;
MandatoryLabel.Attributes := SE_GROUP_INTEGRITY_ENABLED;
Result := NtxToken.SetInfo(hToken, TokenIntegrityLevel, MandatoryLabel);
end;
end.
|
unit fibCheckSingleLicenseClass;
interface
uses Classes, fibAthlInstanceCounter;
type
TFuncCallback = procedure;
type
TCheckLicense = class{(TComponent)}
private
FAthlInstanceCounter: TAthlInstanceCounter;
FIsValid: boolean;
FInstanceCount: Integer;
FCallBack: TfuncCallBack;
procedure Change(Sender: TObject);
procedure SetCallBack(const Value: TfuncCallBack);
public
property IsValid: boolean read FIsValid;
property InstanceCount: Integer read FInstanceCount;
constructor Create(License: string);
destructor Destroy; override;
property CallBack: TfuncCallBack read FCallBack write SetCallBack;
end;
implementation
uses
{Forms, }SysUtils;
{ TCheckLicense }
function GetHash(Str: string): string;
function ElfHash(const Value: string): Integer;
var
i, x: Integer;
begin
Result := 0;
for i := 1 to Length(Value) do
begin
Result := (Result shl 4) + Ord(Value[i]);
x := Result and $F0000000;
if (x <> 0) then
Result := Result xor (x shr 24);
Result := Result and (not x);
end;
end;
begin
Result := Format('%x', [ElfHash(Str)]);
if Length(Result) > 8 then
Result := copy(Result, 1, 8);
end;
procedure TCheckLicense.Change(Sender: TObject);
begin
FIsValid := FAthlInstanceCounter.CountComputers <= 1;
FInstanceCount := FAthlInstanceCounter.CountComputers;
if Assigned(FCallBack) then FCallBack;
end;
constructor TCheckLicense.Create(License: string);
begin
// inherited Create(Application);
FAthlInstanceCounter := nil;
FIsValid := True;
FInstanceCount := 0;
FCallBack := nil;
begin
FAthlInstanceCounter := TAthlInstanceCounter.Create{(Self)};
with FAthlInstanceCounter do
begin
InstanceName := GetHash(License);
OnChange := Change;
Interval := 5 * 1000;
Active := True;
end;
end;
end;
destructor TCheckLicense.Destroy;
begin
if Assigned(FAthlInstanceCounter) then FAthlInstanceCounter.Free;
inherited;
end;
procedure TCheckLicense.SetCallBack(const Value: TfuncCallBack);
begin
FCallBack := Value;
end;
initialization
// CheckLicense := TCheckLicense.Create('CleverFilter');
finalization
// if Assigned(CheckLicense) then FreeAndNil(CheckLicense);
end.
|
program SinglyLinkedList;
uses
System.SysUtils;
type
PNode = ^TNode;
TNode = Record
Data: Variant;
Next: PNode;
End;
TSinglyLinkedList = Class
private
FHead: PNode;
function AllocNode: Pointer;
procedure FreeNode(var ANode: PNode);
public
property Head: PNode read FHead write FHead;
procedure Append(AValue: Variant);
procedure Remove(AValue: Variant);
procedure Print;
constructor Create; overload;
constructor Create(AHead: PNode); overload;
constructor Create(AHeadValue: Variant); overload;
End;
{ TSinglyLinkedList }
function TSinglyLinkedList.AllocNode: Pointer;
begin
Result:= AllocMem(SizeOf(TNode));
end;
procedure TSinglyLinkedList.FreeNode(var ANode: PNode);
begin
FreeMem(ANode);
ANode:= nil;
end;
procedure TSinglyLinkedList.Append(AValue: Variant);
var
nLast: PNode;
begin
if FHead = nil then
begin
FHead := AllocNode;
FHead.Data:= AValue;
Exit;
end;
nLast:= FHead;
while nLast.Next <> nil do
nLast:= nLast.Next;
if nLast.Next = nil then
begin
nLast.Next := AllocNode;
nLast.Next.Data:= AValue;
end;
end;
procedure TSinglyLinkedList.Remove(AValue: Variant);
var
nLeft, nCurrent: PNode;
begin
nCurrent:= FHead;
nLeft := nil;
while (nCurrent.Next <> nil) and (nCurrent.Data <> AValue) do
begin
nLeft := nCurrent;
nCurrent:= nCurrent.Next;
end;
if nLeft = nil then
FHead:= nCurrent.Next
else
nLeft.Next:= nCurrent.Next;
FreeNode(nCurrent);
end;
procedure TSinglyLinkedList.Print;
var
nAux: PNode;
begin
nAux:= FHead;
if nAux = nil then
Exit;
while (nAux <> nil) do
begin
Writeln('Valor: ', nAux^.Data);
nAux:= nAux.Next;
end;
end;
constructor TSinglyLinkedList.Create;
begin
FHead:= nil;
end;
constructor TSinglyLinkedList.Create(AHead: PNode);
begin
Create;
if AHead <> nil then
begin
FreeNode(FHead);
FHead:= AHead;
end;
end;
constructor TSinglyLinkedList.Create(AHeadValue: Variant);
begin
Create;
FHead := AllocNode;
FHead.Data:= AHeadValue;
end;
var
lList: TSinglyLinkedList;
begin
lList:= TSinglyLinkedList.Create;
lList.Append(1);
lList.Append(4);
lList.Append(2);
lList.Append(3);
Writeln('Lista criada: ');
lList.Print;
Writeln('Removendo valor 4');
lList.Remove(4);
lList.Print;
Readln;
end.
|
// auteur : Djebien Tarik
// date : Mars 2010
// objet : Unité pour Alignement de deux mots.
UNIT U_Edition;
INTERFACE
TYPE
Matrice = array of array of CARDINAL;
function min(x,y,z:CARDINAL): CARDINAL;
function distance_dynamique(u,v:STRING): CARDINAL;
IMPLEMENTATION
// min(x,y,z) renvoie le plus petit élement
// parmi les trois en parametres.
function min(x,y,z:CARDINAL): CARDINAL;
var min1 : CARDINAL;
begin
if ( x >= y ) then
min1:= y
else
min1:= x;
if (min1 >= z) then
min:= z
else
min:= min1;
end{min};
// Calcule la distance d'edition de deux chaines
// de caracteres.
// VERSION DYNAMIQUE.
function distance_dynamique(u,v:STRING): CARDINAL;
var
table : Matrice;
i,j : CARDINAL;
begin
// table indexee par u'first-1..u'last et v'first-1..v'last.
setlength(table,length(u)+1,length(v)+1);
// d(u,e) = |u|
for i:= 0 to length(u) do
table[i,0]:= i;
// d(e,v) = |v|
for j:= 0 to length(v) do
table[0,j]:= j;
// Parcours de la table
// sens de remplissage
for i:= 1 to length(u) do
for j:= 1 to length(v) do
begin
// d(ua,va) = d(u,v)
if (u[i]= v[j]) then
table[i,j]:= table[i-1,j-1]
else
// d(ua,vb) = 1 + min(d(u,v),d(ua,v),d(u,vb))
table[i,j]:= 1 + min(table[i-1,j],table[i,j-1],table[i-1,j-1]);
end;//for
// le resultat est D(u'last,v'last)
distance_dynamique:= table[length(u),length(v)];
end{distance_dynamique};
INITIALIZATION
(* Unité permettant de calculer la distance d' édition entre deux chaines de caractères. *)
FINALIZATION
(* Auteur, Djebien Tarik *)
END {U_Edition}.
|
unit ccbulkdbcore;
interface
uses
sysutils,classes,db,ccbulkinsert;
type
TDatasetReader = class(TCCCustomReader)
public
function getRowCount: integer;override;
function getColCount: integer;override;
function getRowValue(ACol,ARow: integer): string;override;
end;
ICCDataset = interface(IInterface)
procedure OpenQuery(ASQL: string);
procedure ExecuteNonQuery(ASQL: string);
//function Dataset: TDataSet;
procedure setDataset(ADataset: TDataSet);
function getDataset: TDataSet;
end;
TCCDataset = class(TInterfacedObject, ICCDataset)
protected
FDataset: TDataSet;
procedure setDataset(ADataset: TDataSet);
function getDataset: TDataSet;
public
procedure OpenQuery(ASQL: string); virtual;
procedure ExecuteNonQuery(ASQL: string); virtual;
property Dataset: TDataSet read getDataset write setDataset;
end;
implementation
{ TDatasetReader }
function TDatasetReader.getColCount: integer;
begin
inherited;
result := TDataSet(getObject).FieldCount;
end;
function TDatasetReader.getRowCount: integer;
begin
inherited;
result := TDataSet(getObject).RecordCount;
end;
function TDatasetReader.getRowValue(ACol, ARow: integer): string;
var
ActiveRecNo, Distance: Integer;
Dataset: TDataSet;
begin
Dataset := TDataSet(getObject);
ActiveRecNo := DataSet.RecNo;
if (ARow <> ActiveRecNo) then
begin
DataSet.DisableControls;
try
Distance := ARow - ActiveRecNo;
DataSet.MoveBy(Distance);
finally
DataSet.EnableControls;
end;
end;
Result := Dataset.Fields[ACol].AsString;
end;
{ TCCDataset }
procedure TCCDataset.ExecuteNonQuery(ASQL: string);
begin
end;
function TCCDataset.getDataset: TDataSet;
begin
Result := FDataset;
end;
procedure TCCDataset.OpenQuery(ASQL: string);
begin
end;
procedure TCCDataset.setDataset(ADataset: TDataSet);
begin
FDataset := ADataset;
end;
end.
|
unit Kafka.Classes;
interface
uses
System.SysUtils, System.Classes, System.Generics.Collections, System.Threading, System.SyncObjs,
Kafka.Interfaces,
Kafka.Types,
Kafka.Helper,
Kafka.Lib;
const
ConsumerPollTimeout = 100;
type
TConsumerMessageHandlerProc = reference to procedure(const Msg: prd_kafka_message_t);
TKafkaConsumerThreadBase = class(TThread)
protected
FKafkaHandle: prd_kafka_t;
FConfiguration: prd_kafka_conf_t;
FHandler: TConsumerMessageHandlerProc;
FTopics: TArray<String>;
FPartitions: TArray<Integer>;
FBrokers: String;
FConsumedCount: Int64;
procedure DoSetup; virtual; abstract;
procedure DoExecute; virtual; abstract;
procedure DoCleanUp; virtual; abstract;
procedure Execute; override;
public
constructor Create(const Configuration: prd_kafka_conf_t; const Handler: TConsumerMessageHandlerProc; const Brokers: String; const Topics: TArray<String>; const Partitions: TArray<Integer>);
end;
TKafkaConsumerThreadClass = class of TKafkaConsumerThreadBase;
TKafkaConsumerThread = class(TKafkaConsumerThreadBase)
protected
procedure DoSetup; override;
procedure DoExecute; override;
procedure DoCleanUp; override;
public
destructor Destroy; override;
end;
TKafkaConsumer = class(TInterfacedObject, IKafkaConsumer)
private
function GetConsumedCount: Int64;
protected
FThread: TKafkaConsumerThreadBase;
procedure DoNeedConsumerThreadClass(out Value: TKafkaConsumerThreadClass); virtual;
public
constructor Create(const Configuration: prd_kafka_conf_t; const Handler: TConsumerMessageHandlerProc; const Brokers: String; const Topics: TArray<String>; const Partitions: TArray<Integer>);
destructor Destroy; override;
function GetConsumerThreadClass: TKafkaConsumerThreadClass;
property ConsumedCount: Int64 read GetConsumedCount;
end;
TKafkaProducer = class(TInterfacedObject, IKafkaProducer)
private
FProducedCount: Int64;
function GetKafkaHandle: prd_kafka_t;
function GetProducedCount: Int64;
protected
FKafkaHandle: prd_kafka_t;
FConfiguration: prd_kafka_conf_t;
public
constructor Create(const ConfigurationKeys, ConfigurationValues: TArray<String>); overload;
constructor Create(const Configuration: prd_kafka_conf_t); overload;
destructor Destroy; override;
function Produce(const Topic: String; const Payload: Pointer; const PayloadLength: NativeUInt; const Key: Pointer = nil; const KeyLen: NativeUInt = 0; const Partition: Int32 = RD_KAFKA_PARTITION_UA; const MsgFlags: Integer = RD_KAFKA_MSG_F_COPY; const MsgOpaque: Pointer = nil): Integer; overload;
function Produce(const Topic: String; const Payloads: TArray<Pointer>; const PayloadLengths: TArray<Integer>; const Key: Pointer = nil; const KeyLen: NativeUInt = 0; const Partition: Int32 = RD_KAFKA_PARTITION_UA; const MsgFlags: Integer = RD_KAFKA_MSG_F_COPY; const MsgOpaque: Pointer = nil): Integer; overload;
function Produce(const Topic: String; const Payload: String; const Key: String; const Partition: Int32 = RD_KAFKA_PARTITION_UA; const MsgFlags: Integer = RD_KAFKA_MSG_F_COPY; const MsgOpaque: Pointer = nil): Integer; overload;
function Produce(const Topic: String; const Payload: String; const Key: String; const Encoding: TEncoding; const Partition: Int32 = RD_KAFKA_PARTITION_UA; const MsgFlags: Integer = RD_KAFKA_MSG_F_COPY; const MsgOpaque: Pointer = nil): Integer; overload;
function Produce(const Topic: String; const Payloads: TArray<String>; const Key: String; const Partition: Int32 = RD_KAFKA_PARTITION_UA; const MsgFlags: Integer = RD_KAFKA_MSG_F_COPY; const MsgOpaque: Pointer = nil): Integer; overload;
function Produce(const Topic: String; const Payloads: TArray<String>; const Key: String; const Encoding: TEncoding; const Partition: Int32 = RD_KAFKA_PARTITION_UA; const MsgFlags: Integer = RD_KAFKA_MSG_F_COPY; const MsgOpaque: Pointer = nil): Integer; overload;
property ProducedCount: Int64 read GetProducedCount;
property KafkaHandle: prd_kafka_t read GetKafkaHandle;
end;
implementation
resourcestring
StrBrokersCouldNotBe = 'Brokers could not be added';
{ TKafkaConsumerThread }
destructor TKafkaConsumerThread.Destroy;
begin
inherited;
end;
procedure TKafkaConsumerThread.DoCleanUp;
begin
if FKafkaHandle <> nil then
begin
(*rd_kafka_commit(
FKafkaHandle,
Msg,
1);*)
TKafkaHelper.ConsumerClose(FKafkaHandle);
TKafkaHelper.DestroyHandle(FKafkaHandle);
end;
end;
procedure TKafkaConsumerThread.DoExecute;
var
Msg: prd_kafka_message_t;
begin
Msg := rd_kafka_consumer_poll(FKafkaHandle, ConsumerPollTimeout);
if Msg <> nil then
try
if (Msg.err <> RD_KAFKA_RESP_ERR__PARTITION_EOF) and
(Assigned(FHandler)) then
begin
TInterlocked.Increment(FConsumedCount);
try
FHandler(Msg);
(*rd_kafka_commit_message(
FKafkaHandle,
Msg,
0);*)
except
on e: Exception do
begin
TKafkaHelper.Log('Exception in message callback - ' + e.Message, TKafkaLogType.kltError);
end;
end;
end;
finally
rd_kafka_message_destroy(Msg);
end;
end;
procedure TKafkaConsumerThread.DoSetup;
var
i: Integer;
TopicList: prd_kafka_topic_partition_list_t;
begin
FKafkaHandle := TKafkaHelper.NewConsumer(FConfiguration);
if rd_kafka_brokers_add(FKafkaHandle, PAnsiChar(AnsiString(FBrokers))) = 0 then
begin
raise EKafkaError.Create(StrBrokersCouldNotBe);
end;
rd_kafka_poll_set_consumer(FKafkaHandle);
TopicList := rd_kafka_topic_partition_list_new(0);
for i := Low(FTopics) to High(FTopics) do
begin
rd_kafka_topic_partition_list_add(
TopicList,
PAnsiChar(AnsiString(FTopics[i])),
FPartitions[i]);
end;
rd_kafka_assign(
FKafkaHandle,
TopicList);
end;
{ TKafkaConsumerThreadBase }
constructor TKafkaConsumerThreadBase.Create(const Configuration: prd_kafka_conf_t; const Handler: TConsumerMessageHandlerProc; const Brokers: String;
const Topics: TArray<String>; const Partitions: TArray<Integer>);
begin
inherited Create(True);
FreeOnTerminate := True;
FConfiguration := Configuration;
FHandler := Handler;
FBrokers := Brokers;
FTopics := Topics;
FPartitions := Partitions;
end;
procedure TKafkaConsumerThreadBase.Execute;
begin
try
DoSetup;
try
while not Terminated do
begin
DoExecute;
end;
finally
DoCleanUp;
end;
except
on e: Exception do
begin
TKafkaHelper.Log(format('Critical exception: %s', [e.Message]), TKafkaLogType.kltError);
end;
end;
end;
{ TKafkaProducer }
constructor TKafkaProducer.Create(const ConfigurationKeys, ConfigurationValues: TArray<String>);
var
Configuration: prd_kafka_conf_t;
begin
Configuration := TKafkaHelper.NewConfiguration(
ConfigurationKeys,
ConfigurationValues);
Create(Configuration);
end;
constructor TKafkaProducer.Create(const Configuration: prd_kafka_conf_t);
begin
FKafkaHandle := TKafkaHelper.NewProducer(Configuration);
end;
destructor TKafkaProducer.Destroy;
begin
rd_kafka_destroy(FKafkaHandle);
inherited;
end;
function TKafkaProducer.GetKafkaHandle: prd_kafka_t;
begin
Result := FKafkaHandle;
end;
function TKafkaProducer.GetProducedCount: Int64;
begin
TInterlocked.Exchange(Result, FProducedCount);
end;
function TKafkaProducer.Produce(const Topic: String; const Payload: String; const Key: String; const Partition: Int32; const MsgFlags: Integer;
const MsgOpaque: Pointer): Integer;
begin
Result := Produce(
Topic,
Payload,
Key,
TEncoding.UTF8,
Partition,
MsgFlags,
MsgOpaque);
end;
function TKafkaProducer.Produce(const Topic: String; const Payload: Pointer; const PayloadLength: NativeUInt; const Key: Pointer; const KeyLen: NativeUInt;
const Partition: Int32; const MsgFlags: Integer; const MsgOpaque: Pointer): Integer;
var
KTopic: prd_kafka_topic_t;
begin
KTopic := TKafkaHelper.NewTopic(
FKafkaHandle,
Topic,
nil);
try
Result := TKafkaHelper.Produce(
KTopic,
Payload,
PayloadLength,
Key,
KeyLen,
Partition,
MsgFlags,
MsgOpaque);
TInterlocked.Increment(FProducedCount);
finally
rd_kafka_topic_destroy(KTopic);
end;
end;
function TKafkaProducer.Produce(const Topic: String; const Payloads: TArray<Pointer>; const PayloadLengths: TArray<Integer>; const Key: Pointer; const KeyLen: NativeUInt;
const Partition: Int32; const MsgFlags: Integer; const MsgOpaque: Pointer): Integer;
var
KTopic: prd_kafka_topic_t;
begin
KTopic := TKafkaHelper.NewTopic(
FKafkaHandle,
Topic,
nil);
try
Result := TKafkaHelper.Produce(
KTopic,
Payloads,
PayloadLengths,
Key,
KeyLen,
Partition,
MsgFlags,
MsgOpaque);
TInterlocked.Add(FProducedCount, Length(Payloads));
finally
rd_kafka_topic_destroy(KTopic);
end;
end;
function TKafkaProducer.Produce(const Topic: String; const Payloads: TArray<String>; const Key: String; const Partition: Int32;
const MsgFlags: Integer; const MsgOpaque: Pointer): Integer;
begin
Result := Produce(
Topic,
Payloads,
Key,
TEncoding.UTF8,
Partition,
MsgFlags,
MsgOpaque);
end;
function TKafkaProducer.Produce(const Topic: String; const Payloads: TArray<String>; const Key: String; const Encoding: TEncoding; const Partition: Int32;
const MsgFlags: Integer; const MsgOpaque: Pointer): Integer;
var
KTopic: prd_kafka_topic_t;
begin
KTopic := TKafkaHelper.NewTopic(
FKafkaHandle,
Topic,
nil);
try
Result := TKafkaHelper.Produce(
KTopic,
Payloads,
Key,
Encoding,
Partition,
MsgFlags,
MsgOpaque);
TInterlocked.Add(FProducedCount, Length(Payloads));
finally
rd_kafka_topic_destroy(KTopic);
end;
end;
function TKafkaProducer.Produce(const Topic, Payload, Key: String; const Encoding: TEncoding; const Partition: Int32; const MsgFlags: Integer;
const MsgOpaque: Pointer): Integer;
var
KTopic: prd_kafka_topic_t;
begin
KTopic := TKafkaHelper.NewTopic(
FKafkaHandle,
Topic,
nil);
try
Result := TKafkaHelper.Produce(
KTopic,
Payload,
Key,
Encoding,
Partition,
MsgFlags,
MsgOpaque);
TInterlocked.Increment(FProducedCount);
finally
rd_kafka_topic_destroy(KTopic);
end;
end;
{ TKafkaConsumer }
constructor TKafkaConsumer.Create(const Configuration: prd_kafka_conf_t; const Handler: TConsumerMessageHandlerProc; const Brokers: String; const Topics: TArray<String>; const Partitions: TArray<Integer>);
begin
FThread := GetConsumerThreadClass.Create(
Configuration,
Handler,
Brokers,
Topics,
Partitions);
FThread.FreeOnTerminate := True;
FThread.Start;
end;
destructor TKafkaConsumer.Destroy;
begin
FThread.Terminate;
inherited;
end;
procedure TKafkaConsumer.DoNeedConsumerThreadClass(out Value: TKafkaConsumerThreadClass);
begin
Value := TKafkaConsumerThread;
end;
function TKafkaConsumer.GetConsumedCount: Int64;
begin
TInterlocked.Exchange(Result, FThread.FConsumedCount);
end;
function TKafkaConsumer.GetConsumerThreadClass: TKafkaConsumerThreadClass;
begin
DoNeedConsumerThreadClass(Result);
end;
end.
|
{*******************************************************}
{ }
{ Delphi Visual Component Library }
{ }
{ Copyright(c) 1995-2018 Embarcadero Technologies, Inc. }
{ All rights reserved }
{ }
{*******************************************************}
unit IEConst;
interface
resourcestring
sCannotInsertAtCurrentPosition = 'Element cannot be inserted at the current position';
sElementCreateError = 'Error creating element: %0:s (%1:s)';
sFlowLayout = 'The page you are working on is in flow layout mode, and ' +
'objects will be arranged top-to-bottom as in a word processing document.'#13#10#13#10 +
'To use absolute (x and y) positioning, change the pageLayout property of the DOCUMENT to GridLayout';
sFlowLayoutFixed = 'The page you are working on is in flow layout mode, and ' +
'objects will be arranged top-to-bottom as in a word processing document.';
sGridLayout = 'The page you are working on is in grid layout mode, and ' +
'objects will be arranged using absolute (x and y) coordinates.'#13#10#13#10 +
'To use flow layout (top to bottom, as in a word processing document), change the pageLayout property of the DOCUMENT to FlowLayout';
sAttachToNilElement = 'Attempting to attach behavior on a nil element';
sFactoryPropertyNotAssigned = '%s Factory property is not assigned';
sMultiSelectNotEnabled = 'Multiselect is not enabled';
sFinishPosNotSet = '%s.FinishPos must be set before calling FindText';
sNoSearchStringSpecified = 'No search string specified';
sSetPointerError = 'Both StartPos and FinishPos must be set before calling InsertElement';
sStartPosNotSet = 'StartPos must be set before calling InsertText';
sPointersNotSetError = 'StartPos, FinishPos and InsertPos must be set before calling Copy';
sMarkupServicesNotAvailable = 'IMarkupServices not available';
sMarkupServices2NotAvailable = 'IMarkupServices2 not available';
sCallingFindNextBeforeFind = 'Find must be called prior to calling FindNext';
sFindBehaviorFoundTwoBehaviors = 'Two behaviors (%s, %s) found for one URL (%s)';
sMarkupServicesUnavailable = 'No markup services available';
sMarkupServicesPointerError = 'StartPos, FinishPos and InsertPos must be set before calling Move';
sErrorCreatingBehavior = '%s.CreateBehavior failed with error: %s';
sNoPageLoaded = 'No page loaded';
sNilProvider = 'Cannot register a nil provider';
sInvalidServiceProviderGUID = 'Invalid service provider GUID';
sClassSinkingError = '%s only supports sinking of method calls!';
sWebBrowserNotAssigned = '%s.WebBrowser property not assigned';
sEditDesignerNoPageLoaded = 'Cannot activate an edit designer (%s) when there is no active document';
sChildWindowsAlreadyHooked = 'Attempting to hook child windows twice';
sSaveCurrentFile = 'Save the current file?';
implementation
end.
|
//
// This unit is part of the GLScene Project, http://glscene.org
//
{
FileNMF - NormalMapper vector file format loading/saving structures
Notes:
NormalMapper can be found at http://www.ati.com/developer/tools.html
History:
16/10/08 - UweR - Compatibility fix for Delphi 2009
14/05/2003 - SG - Creation
}
unit FileNMF;
interface
uses
Classes, GLVectorGeometry;
const
NMF_HEADER_TAG = 'NMF ';
NMF_TRIANGLE_TAG = 'TRIS';
type
TNmHeader = record
hdr : array[0..3] of AnsiChar;
size : cardinal;
end;
TNmRawTriangle = record
vert,
norm : array[0..2] of TAffineVector;
texCoord : array[0..2] of TTexPoint;
end;
TFileNMF = class
public
FileHeader,
TrisHeader : TNmHeader;
NumTris : Integer;
RawTriangles : array of TNmRawTriangle;
procedure LoadFromStream(Stream : TStream);
procedure SaveToStream(Stream : TStream);
end;
implementation
procedure TFileNMF.LoadFromStream(Stream : TStream);
var
Done : Boolean;
begin
Stream.Read(FileHeader, SizeOf(TNmHeader));
if FileHeader.hdr<>NMF_HEADER_TAG then exit;
Done:=False;
while not Done do begin
Stream.Read(TrisHeader, SizeOf(TNmHeader));
if TrisHeader.hdr=NMF_TRIANGLE_TAG then begin
Stream.Read(NumTris, SizeOf(NumTris));
if NumTris<0 then exit;
SetLength(RawTriangles,NumTris);
Stream.Read(RawTriangles[0],SizeOf(TNmRawTriangle)*NumTris);
Done:=True;
end;
end;
end;
procedure TFileNMF.SaveToStream(Stream : TStream);
begin
NumTris:=Length(RawTriangles);
TrisHeader.hdr:=NMF_TRIANGLE_TAG;
TrisHeader.size:=SizeOf(TNmRawTriangle)*NumTris+SizeOf(FileHeader);
FileHeader.hdr:=NMF_HEADER_TAG;
FileHeader.size:=TrisHeader.size+SizeOf(TrisHeader);
Stream.Write(FileHeader, SizeOf(TNmHeader));
Stream.Write(TrisHeader, SizeOf(TNmHeader));
NumTris:=Length(RawTriangles);
Stream.Write(NumTris, SizeOf(NumTris));
Stream.Write(RawTriangles[0], SizeOf(TNmRawTriangle)*NumTris);
end;
end. |
{*******************************************************}
{ }
{ Translation of winerror.h }
{ }
{ Copyright (c) 2001, Eventree Systems }
{ }
{ Translator: Eventree Systems }
{ }
{*******************************************************}
unit winerror;
interface
{
/************************************************************************
* *
* winerror.h -- error code definitions for the Win32 API functions *
* *
* Copyright (c) 1991-1999, Microsoft Corp. All rights reserved. *
* *
************************************************************************/
}
//
// Values are 32 bit values layed out as follows:
//
// 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
// +---+-+-+-----------------------+-------------------------------+
// |Sev|C|R| Facility | Code |
// +---+-+-+-----------------------+-------------------------------+
//
// where
//
// Sev - is the severity code
//
// 00 - Success
// 01 - Informational
// 10 - Warning
// 11 - Error
//
// C - is the Customer code flag
//
// R - is a reserved bit
//
// Facility - is the facility code
//
// Code - is the facility's status code
//
//
// Define the facility codes
//
const
FACILITY_WINDOWS = 8;
FACILITY_URT = 19;
FACILITY_STORAGE = 3;
FACILITY_SSPI = 9;
FACILITY_SCARD = 16;
FACILITY_SETUPAPI = 15;
FACILITY_SECURITY = 9;
FACILITY_RPC = 1;
FACILITY_WIN32 = 7;
FACILITY_CONTROL = 10;
FACILITY_NULL = 0;
FACILITY_MSMQ = 14;
FACILITY_MEDIASERVER = 13;
FACILITY_INTERNET = 12;
FACILITY_ITF = 4;
FACILITY_DISPATCH = 2;
FACILITY_COMPLUS = 17;
FACILITY_CERT = 11;
FACILITY_ACS = 20;
FACILITY_AAF = 18;
//
// Define the severity codes
//
//
// MessageId: ERROR_SUCCESS
//
// MessageText:
//
// The operation completed successfully.
//
const
ERROR_SUCCESS = 0;
NO_ERROR = 0; // dderror
SEC_E_OK = 0;
//
// MessageId: ERROR_INVALID_FUNCTION
//
// MessageText:
//
// Incorrect function.
//
ERROR_INVALID_FUNCTION = 1; // dderror
//
// MessageId: ERROR_FILE_NOT_FOUND
//
// MessageText:
//
// The system cannot find the file specified.
//
ERROR_FILE_NOT_FOUND = 2;
//
// MessageId: ERROR_PATH_NOT_FOUND
//
// MessageText:
//
// The system cannot find the path specified.
//
ERROR_PATH_NOT_FOUND = 3;
//
// MessageId: ERROR_TOO_MANY_OPEN_FILES
//
// MessageText:
//
// The system cannot open the file.
//
ERROR_TOO_MANY_OPEN_FILES = 4;
//
// MessageId: ERROR_ACCESS_DENIED
//
// MessageText:
//
// Access is denied.
//
ERROR_ACCESS_DENIED = 5;
//
// MessageId: ERROR_INVALID_HANDLE
//
// MessageText:
//
// The handle is invalid.
//
ERROR_INVALID_HANDLE = 6;
//
// MessageId: ERROR_ARENA_TRASHED
//
// MessageText:
//
// The storage control blocks were destroyed.
//
ERROR_ARENA_TRASHED = 7;
//
// MessageId: ERROR_NOT_ENOUGH_MEMORY
//
// MessageText:
//
// Not enough storage is available to process this command.
//
ERROR_NOT_ENOUGH_MEMORY = 8; // dderror
//
// MessageId: ERROR_INVALID_BLOCK
//
// MessageText:
//
// The storage control block address is invalid.
//
ERROR_INVALID_BLOCK = 9;
//
// MessageId: ERROR_BAD_ENVIRONMENT
//
// MessageText:
//
// The environment is incorrect.
//
ERROR_BAD_ENVIRONMENT = 10;
//
// MessageId: ERROR_BAD_FORMAT
//
// MessageText:
//
// An attempt was made to load a program with an incorrect format.
//
ERROR_BAD_FORMAT = 11;
//
// MessageId: ERROR_INVALID_ACCESS
//
// MessageText:
//
// The access code is invalid.
//
ERROR_INVALID_ACCESS = 12;
//
// MessageId: ERROR_INVALID_DATA
//
// MessageText:
//
// The data is invalid.
//
ERROR_INVALID_DATA = 13;
//
// MessageId: ERROR_OUTOFMEMORY
//
// MessageText:
//
// Not enough storage is available to complete this operation.
//
ERROR_OUTOFMEMORY = 14;
//
// MessageId: ERROR_INVALID_DRIVE
//
// MessageText:
//
// The system cannot find the drive specified.
//
ERROR_INVALID_DRIVE = 15;
//
// MessageId: ERROR_CURRENT_DIRECTORY
//
// MessageText:
//
// The directory cannot be removed.
//
ERROR_CURRENT_DIRECTORY = 16;
//
// MessageId: ERROR_NOT_SAME_DEVICE
//
// MessageText:
//
// The system cannot move the file to a different disk drive.
//
ERROR_NOT_SAME_DEVICE = 17;
//
// MessageId: ERROR_NO_MORE_FILES
//
// MessageText:
//
// There are no more files.
//
ERROR_NO_MORE_FILES = 18;
//
// MessageId: ERROR_WRITE_PROTECT
//
// MessageText:
//
// The media is write protected.
//
ERROR_WRITE_PROTECT = 19;
//
// MessageId: ERROR_BAD_UNIT
//
// MessageText:
//
// The system cannot find the device specified.
//
ERROR_BAD_UNIT = 20;
//
// MessageId: ERROR_NOT_READY
//
// MessageText:
//
// The device is not ready.
//
ERROR_NOT_READY = 21;
//
// MessageId: ERROR_BAD_COMMAND
//
// MessageText:
//
// The device does not recognize the command.
//
ERROR_BAD_COMMAND = 22;
//
// MessageId: ERROR_CRC
//
// MessageText:
//
// Data error (cyclic redundancy check).
//
ERROR_CRC = 23;
//
// MessageId: ERROR_BAD_LENGTH
//
// MessageText:
//
// The program issued a command but the command length is incorrect.
//
ERROR_BAD_LENGTH = 24;
//
// MessageId: ERROR_SEEK
//
// MessageText:
//
// The drive cannot locate a specific area or track on the disk.
//
ERROR_SEEK = 25;
//
// MessageId: ERROR_NOT_DOS_DISK
//
// MessageText:
//
// The specified disk or diskette cannot be accessed.
//
ERROR_NOT_DOS_DISK = 26;
//
// MessageId: ERROR_SECTOR_NOT_FOUND
//
// MessageText:
//
// The drive cannot find the sector requested.
//
ERROR_SECTOR_NOT_FOUND = 27;
//
// MessageId: ERROR_OUT_OF_PAPER
//
// MessageText:
//
// The printer is out of paper.
//
ERROR_OUT_OF_PAPER = 28;
//
// MessageId: ERROR_WRITE_FAULT
//
// MessageText:
//
// The system cannot write to the specified device.
//
ERROR_WRITE_FAULT = 29;
//
// MessageId: ERROR_READ_FAULT
//
// MessageText:
//
// The system cannot read from the specified device.
//
ERROR_READ_FAULT = 30;
//
// MessageId: ERROR_GEN_FAILURE
//
// MessageText:
//
// A device attached to the system is not functioning.
//
ERROR_GEN_FAILURE = 31;
//
// MessageId: ERROR_SHARING_VIOLATION
//
// MessageText:
//
// The process cannot access the file because it is being used by another process.
//
ERROR_SHARING_VIOLATION = 32;
//
// MessageId: ERROR_LOCK_VIOLATION
//
// MessageText:
//
// The process cannot access the file because another process has locked a portion of the file.
//
ERROR_LOCK_VIOLATION = 33;
//
// MessageId: ERROR_WRONG_DISK
//
// MessageText:
//
// The wrong diskette is in the drive.
// Insert %2 (Volume Serial Number: %3)
// into drive %1.
//
ERROR_WRONG_DISK = 34;
//
// MessageId: ERROR_SHARING_BUFFER_EXCEEDED
//
// MessageText:
//
// Too many files opened for sharing.
//
ERROR_SHARING_BUFFER_EXCEEDED = 36;
//
// MessageId: ERROR_HANDLE_EOF
//
// MessageText:
//
// Reached the end of the file.
//
ERROR_HANDLE_EOF = 38;
//
// MessageId: ERROR_HANDLE_DISK_FULL
//
// MessageText:
//
// The disk is full.
//
ERROR_HANDLE_DISK_FULL = 39;
//
// MessageId: ERROR_NOT_SUPPORTED
//
// MessageText:
//
// The network request is not supported.
//
ERROR_NOT_SUPPORTED = 50;
//
// MessageId: ERROR_REM_NOT_LIST
//
// MessageText:
//
// The remote computer is not available.
//
ERROR_REM_NOT_LIST = 51;
//
// MessageId: ERROR_DUP_NAME
//
// MessageText:
//
// A duplicate name exists on the network.
//
ERROR_DUP_NAME = 52;
//
// MessageId: ERROR_BAD_NETPATH
//
// MessageText:
//
// The network path was not found.
//
ERROR_BAD_NETPATH = 53;
//
// MessageId: ERROR_NETWORK_BUSY
//
// MessageText:
//
// The network is busy.
//
ERROR_NETWORK_BUSY = 54;
//
// MessageId: ERROR_DEV_NOT_EXIST
//
// MessageText:
//
// The specified network resource or device is no longer available.
//
ERROR_DEV_NOT_EXIST = 55; // dderror
//
// MessageId: ERROR_TOO_MANY_CMDS
//
// MessageText:
//
// The network BIOS command limit has been reached.
//
ERROR_TOO_MANY_CMDS = 56;
//
// MessageId: ERROR_ADAP_HDW_ERR
//
// MessageText:
//
// A network adapter hardware error occurred.
//
ERROR_ADAP_HDW_ERR = 57;
//
// MessageId: ERROR_BAD_NET_RESP
//
// MessageText:
//
// The specified server cannot perform the requested operation.
//
ERROR_BAD_NET_RESP = 58;
//
// MessageId: ERROR_UNEXP_NET_ERR
//
// MessageText:
//
// An unexpected network error occurred.
//
ERROR_UNEXP_NET_ERR = 59;
//
// MessageId: ERROR_BAD_REM_ADAP
//
// MessageText:
//
// The remote adapter is not compatible.
//
ERROR_BAD_REM_ADAP = 60;
//
// MessageId: ERROR_PRINTQ_FULL
//
// MessageText:
//
// The printer queue is full.
//
ERROR_PRINTQ_FULL = 61;
//
// MessageId: ERROR_NO_SPOOL_SPACE
//
// MessageText:
//
// Space to store the file waiting to be printed is not available on the server.
//
ERROR_NO_SPOOL_SPACE = 62;
//
// MessageId: ERROR_PRINT_CANCELLED
//
// MessageText:
//
// Your file waiting to be printed was deleted.
//
ERROR_PRINT_CANCELLED = 63;
//
// MessageId: ERROR_NETNAME_DELETED
//
// MessageText:
//
// The specified network name is no longer available.
//
ERROR_NETNAME_DELETED = 64;
//
// MessageId: ERROR_NETWORK_ACCESS_DENIED
//
// MessageText:
//
// Network access is denied.
//
ERROR_NETWORK_ACCESS_DENIED = 65;
//
// MessageId: ERROR_BAD_DEV_TYPE
//
// MessageText:
//
// The network resource type is not correct.
//
ERROR_BAD_DEV_TYPE = 66;
//
// MessageId: ERROR_BAD_NET_NAME
//
// MessageText:
//
// The network name cannot be found.
//
ERROR_BAD_NET_NAME = 67;
//
// MessageId: ERROR_TOO_MANY_NAMES
//
// MessageText:
//
// The name limit for the local computer network adapter card was exceeded.
//
ERROR_TOO_MANY_NAMES = 68;
//
// MessageId: ERROR_TOO_MANY_SESS
//
// MessageText:
//
// The network BIOS session limit was exceeded.
//
ERROR_TOO_MANY_SESS = 69;
//
// MessageId: ERROR_SHARING_PAUSED
//
// MessageText:
//
// The remote server has been paused or is in the process of being started.
//
ERROR_SHARING_PAUSED = 70;
//
// MessageId: ERROR_REQ_NOT_ACCEP
//
// MessageText:
//
// No more connections can be made to this remote computer at this time because there are already as many connections as the computer can accept.
//
ERROR_REQ_NOT_ACCEP = 71;
//
// MessageId: ERROR_REDIR_PAUSED
//
// MessageText:
//
// The specified printer or disk device has been paused.
//
ERROR_REDIR_PAUSED = 72;
//
// MessageId: ERROR_FILE_EXISTS
//
// MessageText:
//
// The file exists.
//
ERROR_FILE_EXISTS = 80;
//
// MessageId: ERROR_CANNOT_MAKE
//
// MessageText:
//
// The directory or file cannot be created.
//
ERROR_CANNOT_MAKE = 82;
//
// MessageId: ERROR_FAIL_I24
//
// MessageText:
//
// Fail on INT 24.
//
ERROR_FAIL_I24 = 83;
//
// MessageId: ERROR_OUT_OF_STRUCTURES
//
// MessageText:
//
// Storage to process this request is not available.
//
ERROR_OUT_OF_STRUCTURES = 84;
//
// MessageId: ERROR_ALREADY_ASSIGNED
//
// MessageText:
//
// The local device name is already in use.
//
ERROR_ALREADY_ASSIGNED = 85;
//
// MessageId: ERROR_INVALID_PASSWORD
//
// MessageText:
//
// The specified network password is not correct.
//
ERROR_INVALID_PASSWORD = 86;
//
// MessageId: ERROR_INVALID_PARAMETER
//
// MessageText:
//
// The parameter is incorrect.
//
ERROR_INVALID_PARAMETER = 87; // dderror
//
// MessageId: ERROR_NET_WRITE_FAULT
//
// MessageText:
//
// A write fault occurred on the network.
//
ERROR_NET_WRITE_FAULT = 88;
//
// MessageId: ERROR_NO_PROC_SLOTS
//
// MessageText:
//
// The system cannot start another process at this time.
//
ERROR_NO_PROC_SLOTS = 89;
//
// MessageId: ERROR_TOO_MANY_SEMAPHORES
//
// MessageText:
//
// Cannot create another system semaphore.
//
ERROR_TOO_MANY_SEMAPHORES = 100;
//
// MessageId: ERROR_EXCL_SEM_ALREADY_OWNED
//
// MessageText:
//
// The exclusive semaphore is owned by another process.
//
ERROR_EXCL_SEM_ALREADY_OWNED = 101;
//
// MessageId: ERROR_SEM_IS_SET
//
// MessageText:
//
// The semaphore is set and cannot be closed.
//
ERROR_SEM_IS_SET = 102;
//
// MessageId: ERROR_TOO_MANY_SEM_REQUESTS
//
// MessageText:
//
// The semaphore cannot be set again.
//
ERROR_TOO_MANY_SEM_REQUESTS = 103;
//
// MessageId: ERROR_INVALID_AT_INTERRUPT_TIME
//
// MessageText:
//
// Cannot request exclusive semaphores at interrupt time.
//
ERROR_INVALID_AT_INTERRUPT_TIME = 104;
//
// MessageId: ERROR_SEM_OWNER_DIED
//
// MessageText:
//
// The previous ownership of this semaphore has ended.
//
ERROR_SEM_OWNER_DIED = 105;
//
// MessageId: ERROR_SEM_USER_LIMIT
//
// MessageText:
//
// Insert the diskette for drive %1.
//
ERROR_SEM_USER_LIMIT = 106;
//
// MessageId: ERROR_DISK_CHANGE
//
// MessageText:
//
// The program stopped because an alternate diskette was not inserted.
//
ERROR_DISK_CHANGE = 107;
//
// MessageId: ERROR_DRIVE_LOCKED
//
// MessageText:
//
// The disk is in use or locked by
// another process.
//
ERROR_DRIVE_LOCKED = 108;
//
// MessageId: ERROR_BROKEN_PIPE
//
// MessageText:
//
// The pipe has been ended.
//
ERROR_BROKEN_PIPE = 109;
//
// MessageId: ERROR_OPEN_FAILED
//
// MessageText:
//
// The system cannot open the
// device or file specified.
//
ERROR_OPEN_FAILED = 110;
//
// MessageId: ERROR_BUFFER_OVERFLOW
//
// MessageText:
//
// The file name is too long.
//
ERROR_BUFFER_OVERFLOW = 111;
//
// MessageId: ERROR_DISK_FULL
//
// MessageText:
//
// There is not enough space on the disk.
//
ERROR_DISK_FULL = 112;
//
// MessageId: ERROR_NO_MORE_SEARCH_HANDLES
//
// MessageText:
//
// No more internal file identifiers available.
//
ERROR_NO_MORE_SEARCH_HANDLES = 113;
//
// MessageId: ERROR_INVALID_TARGET_HANDLE
//
// MessageText:
//
// The target internal file identifier is incorrect.
//
ERROR_INVALID_TARGET_HANDLE = 114;
//
// MessageId: ERROR_INVALID_CATEGORY
//
// MessageText:
//
// The IOCTL call made by the application program is not correct.
//
ERROR_INVALID_CATEGORY = 117;
//
// MessageId: ERROR_INVALID_VERIFY_SWITCH
//
// MessageText:
//
// The verify-on-write switch parameter value is not correct.
//
ERROR_INVALID_VERIFY_SWITCH = 118;
//
// MessageId: ERROR_BAD_DRIVER_LEVEL
//
// MessageText:
//
// The system does not support the command requested.
//
ERROR_BAD_DRIVER_LEVEL = 119;
//
// MessageId: ERROR_CALL_NOT_IMPLEMENTED
//
// MessageText:
//
// This function is not supported on this system.
//
ERROR_CALL_NOT_IMPLEMENTED = 120;
//
// MessageId: ERROR_SEM_TIMEOUT
//
// MessageText:
//
// The semaphore timeout period has expired.
//
ERROR_SEM_TIMEOUT = 121;
//
// MessageId: ERROR_INSUFFICIENT_BUFFER
//
// MessageText:
//
// The data area passed to a system call is too small.
//
ERROR_INSUFFICIENT_BUFFER = 122; // dderror
//
// MessageId: ERROR_INVALID_NAME
//
// MessageText:
//
// The filename, directory name, or volume label syntax is incorrect.
//
ERROR_INVALID_NAME = 123; // dderror
//
// MessageId: ERROR_INVALID_LEVEL
//
// MessageText:
//
// The system call level is not correct.
//
ERROR_INVALID_LEVEL = 124;
//
// MessageId: ERROR_NO_VOLUME_LABEL
//
// MessageText:
//
// The disk has no volume label.
//
ERROR_NO_VOLUME_LABEL = 125;
//
// MessageId: ERROR_MOD_NOT_FOUND
//
// MessageText:
//
// The specified module could not be found.
//
ERROR_MOD_NOT_FOUND = 126;
//
// MessageId: ERROR_PROC_NOT_FOUND
//
// MessageText:
//
// The specified procedure could not be found.
//
ERROR_PROC_NOT_FOUND = 127;
//
// MessageId: ERROR_WAIT_NO_CHILDREN
//
// MessageText:
//
// There are no child processes to wait for.
//
ERROR_WAIT_NO_CHILDREN = 128;
//
// MessageId: ERROR_CHILD_NOT_COMPLETE
//
// MessageText:
//
// The %1 application cannot be run in Win32 mode.
//
ERROR_CHILD_NOT_COMPLETE = 129;
//
// MessageId: ERROR_DIRECT_ACCESS_HANDLE
//
// MessageText:
//
// Attempt to use a file handle to an open disk partition for an operation other than raw disk I/O.
//
ERROR_DIRECT_ACCESS_HANDLE = 130;
//
// MessageId: ERROR_NEGATIVE_SEEK
//
// MessageText:
//
// An attempt was made to move the file pointer before the beginning of the file.
//
ERROR_NEGATIVE_SEEK = 131;
//
// MessageId: ERROR_SEEK_ON_DEVICE
//
// MessageText:
//
// The file pointer cannot be set on the specified device or file.
//
ERROR_SEEK_ON_DEVICE = 132;
//
// MessageId: ERROR_IS_JOIN_TARGET
//
// MessageText:
//
// A JOIN or SUBST command cannot be used for a drive that contains previously joined drives.
//
ERROR_IS_JOIN_TARGET = 133;
//
// MessageId: ERROR_IS_JOINED
//
// MessageText:
//
// An attempt was made to use a JOIN or SUBST command on a drive that has already been joined.
//
ERROR_IS_JOINED = 134;
//
// MessageId: ERROR_IS_SUBSTED
//
// MessageText:
//
// An attempt was made to use a JOIN or SUBST command on a drive that has already been substituted.
//
ERROR_IS_SUBSTED = 135;
//
// MessageId: ERROR_NOT_JOINED
//
// MessageText:
//
// The system tried to delete the JOIN of a drive that is not joined.
//
ERROR_NOT_JOINED = 136;
//
// MessageId: ERROR_NOT_SUBSTED
//
// MessageText:
//
// The system tried to delete the substitution of a drive that is not substituted.
//
ERROR_NOT_SUBSTED = 137;
//
// MessageId: ERROR_JOIN_TO_JOIN
//
// MessageText:
//
// The system tried to join a drive to a directory on a joined drive.
//
ERROR_JOIN_TO_JOIN = 138;
//
// MessageId: ERROR_SUBST_TO_SUBST
//
// MessageText:
//
// The system tried to substitute a drive to a directory on a substituted drive.
//
ERROR_SUBST_TO_SUBST = 139;
//
// MessageId: ERROR_JOIN_TO_SUBST
//
// MessageText:
//
// The system tried to join a drive to a directory on a substituted drive.
//
ERROR_JOIN_TO_SUBST = 140;
//
// MessageId: ERROR_SUBST_TO_JOIN
//
// MessageText:
//
// The system tried to SUBST a drive to a directory on a joined drive.
//
ERROR_SUBST_TO_JOIN = 141;
//
// MessageId: ERROR_BUSY_DRIVE
//
// MessageText:
//
// The system cannot perform a JOIN or SUBST at this time.
//
ERROR_BUSY_DRIVE = 142;
//
// MessageId: ERROR_SAME_DRIVE
//
// MessageText:
//
// The system cannot join or substitute a drive to or for a directory on the same drive.
//
ERROR_SAME_DRIVE = 143;
//
// MessageId: ERROR_DIR_NOT_ROOT
//
// MessageText:
//
// The directory is not a subdirectory of the root directory.
//
ERROR_DIR_NOT_ROOT = 144;
//
// MessageId: ERROR_DIR_NOT_EMPTY
//
// MessageText:
//
// The directory is not empty.
//
ERROR_DIR_NOT_EMPTY = 145;
//
// MessageId: ERROR_IS_SUBST_PATH
//
// MessageText:
//
// The path specified is being used in a substitute.
//
ERROR_IS_SUBST_PATH = 146;
//
// MessageId: ERROR_IS_JOIN_PATH
//
// MessageText:
//
// Not enough resources are available to process this command.
//
ERROR_IS_JOIN_PATH = 147;
//
// MessageId: ERROR_PATH_BUSY
//
// MessageText:
//
// The path specified cannot be used at this time.
//
ERROR_PATH_BUSY = 148;
//
// MessageId: ERROR_IS_SUBST_TARGET
//
// MessageText:
//
// An attempt was made to join or substitute a drive for which a directory on the drive is the target of a previous substitute.
//
ERROR_IS_SUBST_TARGET = 149;
//
// MessageId: ERROR_SYSTEM_TRACE
//
// MessageText:
//
// System trace information was not specified in your CONFIG.SYS file, or tracing is disallowed.
//
ERROR_SYSTEM_TRACE = 150;
//
// MessageId: ERROR_INVALID_EVENT_COUNT
//
// MessageText:
//
// The number of specified semaphore events for DosMuxSemWait is not correct.
//
ERROR_INVALID_EVENT_COUNT = 151;
//
// MessageId: ERROR_TOO_MANY_MUXWAITERS
//
// MessageText:
//
// DosMuxSemWait did not execute; too many semaphores are already set.
//
ERROR_TOO_MANY_MUXWAITERS = 152;
//
// MessageId: ERROR_INVALID_LIST_FORMAT
//
// MessageText:
//
// The DosMuxSemWait list is not correct.
//
ERROR_INVALID_LIST_FORMAT = 153;
//
// MessageId: ERROR_LABEL_TOO_LONG
//
// MessageText:
//
// The volume label you entered exceeds the label character
// limit of the target file system.
//
ERROR_LABEL_TOO_LONG = 154;
//
// MessageId: ERROR_TOO_MANY_TCBS
//
// MessageText:
//
// Cannot create another thread.
//
ERROR_TOO_MANY_TCBS = 155;
//
// MessageId: ERROR_SIGNAL_REFUSED
//
// MessageText:
//
// The recipient process has refused the signal.
//
ERROR_SIGNAL_REFUSED = 156;
//
// MessageId: ERROR_DISCARDED
//
// MessageText:
//
// The segment is already discarded and cannot be locked.
//
ERROR_DISCARDED = 157;
//
// MessageId: ERROR_NOT_LOCKED
//
// MessageText:
//
// The segment is already unlocked.
//
ERROR_NOT_LOCKED = 158;
//
// MessageId: ERROR_BAD_THREADID_ADDR
//
// MessageText:
//
// The address for the thread ID is not correct.
//
ERROR_BAD_THREADID_ADDR = 159;
//
// MessageId: ERROR_BAD_ARGUMENTS
//
// MessageText:
//
// The argument string passed to DosExecPgm is not correct.
//
ERROR_BAD_ARGUMENTS = 160;
//
// MessageId: ERROR_BAD_PATHNAME
//
// MessageText:
//
// The specified path is invalid.
//
ERROR_BAD_PATHNAME = 161;
//
// MessageId: ERROR_SIGNAL_PENDING
//
// MessageText:
//
// A signal is already pending.
//
ERROR_SIGNAL_PENDING = 162;
//
// MessageId: ERROR_MAX_THRDS_REACHED
//
// MessageText:
//
// No more threads can be created in the system.
//
ERROR_MAX_THRDS_REACHED = 164;
//
// MessageId: ERROR_LOCK_FAILED
//
// MessageText:
//
// Unable to lock a region of a file.
//
ERROR_LOCK_FAILED = 167;
//
// MessageId: ERROR_BUSY
//
// MessageText:
//
// The requested resource is in use.
//
ERROR_BUSY = 170;
//
// MessageId: ERROR_CANCEL_VIOLATION
//
// MessageText:
//
// A lock request was not outstanding for the supplied cancel region.
//
ERROR_CANCEL_VIOLATION = 173;
//
// MessageId: ERROR_ATOMIC_LOCKS_NOT_SUPPORTED
//
// MessageText:
//
// The file system does not support atomic changes to the lock type.
//
ERROR_ATOMIC_LOCKS_NOT_SUPPORTED = 174;
//
// MessageId: ERROR_INVALID_SEGMENT_NUMBER
//
// MessageText:
//
// The system detected a segment number that was not correct.
//
ERROR_INVALID_SEGMENT_NUMBER = 180;
//
// MessageId: ERROR_INVALID_ORDINAL
//
// MessageText:
//
// The operating system cannot run %1.
//
ERROR_INVALID_ORDINAL = 182;
//
// MessageId: ERROR_ALREADY_EXISTS
//
// MessageText:
//
// Cannot create a file when that file already exists.
//
ERROR_ALREADY_EXISTS = 183;
//
// MessageId: ERROR_INVALID_FLAG_NUMBER
//
// MessageText:
//
// The flag passed is not correct.
//
ERROR_INVALID_FLAG_NUMBER = 186;
//
// MessageId: ERROR_SEM_NOT_FOUND
//
// MessageText:
//
// The specified system semaphore name was not found.
//
ERROR_SEM_NOT_FOUND = 187;
//
// MessageId: ERROR_INVALID_STARTING_CODESEG
//
// MessageText:
//
// The operating system cannot run %1.
//
ERROR_INVALID_STARTING_CODESEG = 188;
//
// MessageId: ERROR_INVALID_STACKSEG
//
// MessageText:
//
// The operating system cannot run %1.
//
ERROR_INVALID_STACKSEG = 189;
//
// MessageId: ERROR_INVALID_MODULETYPE
//
// MessageText:
//
// The operating system cannot run %1.
//
ERROR_INVALID_MODULETYPE = 190;
//
// MessageId: ERROR_INVALID_EXE_SIGNATURE
//
// MessageText:
//
// Cannot run %1 in Win32 mode.
//
ERROR_INVALID_EXE_SIGNATURE = 191;
//
// MessageId: ERROR_EXE_MARKED_INVALID
//
// MessageText:
//
// The operating system cannot run %1.
//
ERROR_EXE_MARKED_INVALID = 192;
//
// MessageId: ERROR_BAD_EXE_FORMAT
//
// MessageText:
//
// %1 is not a valid Win32 application.
//
ERROR_BAD_EXE_FORMAT = 193;
//
// MessageId: ERROR_ITERATED_DATA_EXCEEDS_64k
//
// MessageText:
//
// The operating system cannot run %1.
//
ERROR_ITERATED_DATA_EXCEEDS_64k = 194;
//
// MessageId: ERROR_INVALID_MINALLOCSIZE
//
// MessageText:
//
// The operating system cannot run %1.
//
ERROR_INVALID_MINALLOCSIZE = 195;
//
// MessageId: ERROR_DYNLINK_FROM_INVALID_RING
//
// MessageText:
//
// The operating system cannot run this application program.
//
ERROR_DYNLINK_FROM_INVALID_RING = 196;
//
// MessageId: ERROR_IOPL_NOT_ENABLED
//
// MessageText:
//
// The operating system is not presently configured to run this application.
//
ERROR_IOPL_NOT_ENABLED = 197;
//
// MessageId: ERROR_INVALID_SEGDPL
//
// MessageText:
//
// The operating system cannot run %1.
//
ERROR_INVALID_SEGDPL = 198;
//
// MessageId: ERROR_AUTODATASEG_EXCEEDS_64k
//
// MessageText:
//
// The operating system cannot run this application program.
//
ERROR_AUTODATASEG_EXCEEDS_64k = 199;
//
// MessageId: ERROR_RING2SEG_MUST_BE_MOVABLE
//
// MessageText:
//
// The code segment cannot be greater than or equal to 64K.
//
ERROR_RING2SEG_MUST_BE_MOVABLE = 200;
//
// MessageId: ERROR_RELOC_CHAIN_XEEDS_SEGLIM
//
// MessageText:
//
// The operating system cannot run %1.
//
ERROR_RELOC_CHAIN_XEEDS_SEGLIM = 201;
//
// MessageId: ERROR_INFLOOP_IN_RELOC_CHAIN
//
// MessageText:
//
// The operating system cannot run %1.
//
ERROR_INFLOOP_IN_RELOC_CHAIN = 202;
//
// MessageId: ERROR_ENVVAR_NOT_FOUND
//
// MessageText:
//
// The system could not find the environment
// option that was entered.
//
ERROR_ENVVAR_NOT_FOUND = 203;
//
// MessageId: ERROR_NO_SIGNAL_SENT
//
// MessageText:
//
// No process in the command subtree has a
// signal handler.
//
ERROR_NO_SIGNAL_SENT = 205;
//
// MessageId: ERROR_FILENAME_EXCED_RANGE
//
// MessageText:
//
// The filename or extension is too long.
//
ERROR_FILENAME_EXCED_RANGE = 206;
//
// MessageId: ERROR_RING2_STACK_IN_USE
//
// MessageText:
//
// The ring 2 stack is in use.
//
ERROR_RING2_STACK_IN_USE = 207;
//
// MessageId: ERROR_META_EXPANSION_TOO_LONG
//
// MessageText:
//
// The global filename characters, * or ?, are entered incorrectly or too many global filename characters are specified.
//
ERROR_META_EXPANSION_TOO_LONG = 208;
//
// MessageId: ERROR_INVALID_SIGNAL_NUMBER
//
// MessageText:
//
// The signal being posted is not correct.
//
ERROR_INVALID_SIGNAL_NUMBER = 209;
//
// MessageId: ERROR_THREAD_1_INACTIVE
//
// MessageText:
//
// The signal handler cannot be set.
//
ERROR_THREAD_1_INACTIVE = 210;
//
// MessageId: ERROR_LOCKED
//
// MessageText:
//
// The segment is locked and cannot be reallocated.
//
ERROR_LOCKED = 212;
//
// MessageId: ERROR_TOO_MANY_MODULES
//
// MessageText:
//
// Too many dynamic-link modules are attached to this program or dynamic-link module.
//
ERROR_TOO_MANY_MODULES = 214;
//
// MessageId: ERROR_NESTING_NOT_ALLOWED
//
// MessageText:
//
// Cannot nest calls to LoadModule.
//
ERROR_NESTING_NOT_ALLOWED = 215;
//
// MessageId: ERROR_EXE_MACHINE_TYPE_MISMATCH
//
// MessageText:
//
// The image file %1 is valid, but is for a machine type other than the current machine.
//
ERROR_EXE_MACHINE_TYPE_MISMATCH = 216;
//
// MessageId: ERROR_BAD_PIPE
//
// MessageText:
//
// The pipe state is invalid.
//
ERROR_BAD_PIPE = 230;
//
// MessageId: ERROR_PIPE_BUSY
//
// MessageText:
//
// All pipe instances are busy.
//
ERROR_PIPE_BUSY = 231;
//
// MessageId: ERROR_NO_DATA
//
// MessageText:
//
// The pipe is being closed.
//
ERROR_NO_DATA = 232;
//
// MessageId: ERROR_PIPE_NOT_CONNECTED
//
// MessageText:
//
// No process is on the other end of the pipe.
//
ERROR_PIPE_NOT_CONNECTED = 233;
//
// MessageId: ERROR_MORE_DATA
//
// MessageText:
//
// More data is available.
//
ERROR_MORE_DATA = 234; // dderror
//
// MessageId: ERROR_VC_DISCONNECTED
//
// MessageText:
//
// The session was canceled.
//
ERROR_VC_DISCONNECTED = 240;
//
// MessageId: ERROR_INVALID_EA_NAME
//
// MessageText:
//
// The specified extended attribute name was invalid.
//
ERROR_INVALID_EA_NAME = 254;
//
// MessageId: ERROR_EA_LIST_INCONSISTENT
//
// MessageText:
//
// The extended attributes are inconsistent.
//
ERROR_EA_LIST_INCONSISTENT = 255;
//
// MessageId: WAIT_TIMEOUT
//
// MessageText:
//
// The wait operation timed out.
//
WAIT_TIMEOUT = 258;
//
// MessageId: ERROR_NO_MORE_ITEMS
//
// MessageText:
//
// No more data is available.
//
ERROR_NO_MORE_ITEMS = 259;
//
// MessageId: ERROR_CANNOT_COPY
//
// MessageText:
//
// The copy functions cannot be used.
//
ERROR_CANNOT_COPY = 266;
//
// MessageId: ERROR_DIRECTORY
//
// MessageText:
//
// The directory name is invalid.
//
ERROR_DIRECTORY = 267;
//
// MessageId: ERROR_EAS_DIDNT_FIT
//
// MessageText:
//
// The extended attributes did not fit in the buffer.
//
ERROR_EAS_DIDNT_FIT = 275;
//
// MessageId: ERROR_EA_FILE_CORRUPT
//
// MessageText:
//
// The extended attribute file on the mounted file system is corrupt.
//
ERROR_EA_FILE_CORRUPT = 276;
//
// MessageId: ERROR_EA_TABLE_FULL
//
// MessageText:
//
// The extended attribute table file is full.
//
ERROR_EA_TABLE_FULL = 277;
//
// MessageId: ERROR_INVALID_EA_HANDLE
//
// MessageText:
//
// The specified extended attribute handle is invalid.
//
ERROR_INVALID_EA_HANDLE = 278;
//
// MessageId: ERROR_EAS_NOT_SUPPORTED
//
// MessageText:
//
// The mounted file system does not support extended attributes.
//
ERROR_EAS_NOT_SUPPORTED = 282;
//
// MessageId: ERROR_NOT_OWNER
//
// MessageText:
//
// Attempt to release mutex not owned by caller.
//
ERROR_NOT_OWNER = 288;
//
// MessageId: ERROR_TOO_MANY_POSTS
//
// MessageText:
//
// Too many posts were made to a semaphore.
//
ERROR_TOO_MANY_POSTS = 298;
//
// MessageId: ERROR_PARTIAL_COPY
//
// MessageText:
//
// Only part of a ReadProcessMemory or WriteProcessMemory request was completed.
//
ERROR_PARTIAL_COPY = 299;
//
// MessageId: ERROR_OPLOCK_NOT_GRANTED
//
// MessageText:
//
// The oplock request is denied.
//
ERROR_OPLOCK_NOT_GRANTED = 300;
//
// MessageId: ERROR_INVALID_OPLOCK_PROTOCOL
//
// MessageText:
//
// An invalid oplock acknowledgment was received by the system.
//
ERROR_INVALID_OPLOCK_PROTOCOL = 301;
//
// MessageId: ERROR_MR_MID_NOT_FOUND
//
// MessageText:
//
// The system cannot find message text for message number 0x%1 in the message file for %2.
//
ERROR_MR_MID_NOT_FOUND = 317;
//
// MessageId: ERROR_INVALID_ADDRESS
//
// MessageText:
//
// Attempt to access invalid address.
//
ERROR_INVALID_ADDRESS = 487;
//
// MessageId: ERROR_ARITHMETIC_OVERFLOW
//
// MessageText:
//
// Arithmetic result exceeded 32 bits.
//
ERROR_ARITHMETIC_OVERFLOW = 534;
//
// MessageId: ERROR_PIPE_CONNECTED
//
// MessageText:
//
// There is a process on other end of the pipe.
//
ERROR_PIPE_CONNECTED = 535;
//
// MessageId: ERROR_PIPE_LISTENING
//
// MessageText:
//
// Waiting for a process to open the other end of the pipe.
//
ERROR_PIPE_LISTENING = 536;
//
// MessageId: ERROR_EA_ACCESS_DENIED
//
// MessageText:
//
// Access to the extended attribute was denied.
//
ERROR_EA_ACCESS_DENIED = 994;
//
// MessageId: ERROR_OPERATION_ABORTED
//
// MessageText:
//
// The I/O operation has been aborted because of either a thread exit or an application request.
//
ERROR_OPERATION_ABORTED = 995;
//
// MessageId: ERROR_IO_INCOMPLETE
//
// MessageText:
//
// Overlapped I/O event is not in a signaled state.
//
ERROR_IO_INCOMPLETE = 996;
//
// MessageId: ERROR_IO_PENDING
//
// MessageText:
//
// Overlapped I/O operation is in progress.
//
ERROR_IO_PENDING = 997; // dderror
//
// MessageId: ERROR_NOACCESS
//
// MessageText:
//
// Invalid access to memory location.
//
ERROR_NOACCESS = 998;
//
// MessageId: ERROR_SWAPERROR
//
// MessageText:
//
// Error performing inpage operation.
//
ERROR_SWAPERROR = 999;
//
// MessageId: ERROR_STACK_OVERFLOW
//
// MessageText:
//
// Recursion too deep; the stack overflowed.
//
ERROR_STACK_OVERFLOW = 1001;
//
// MessageId: ERROR_INVALID_MESSAGE
//
// MessageText:
//
// The window cannot act on the sent message.
//
ERROR_INVALID_MESSAGE = 1002;
//
// MessageId: ERROR_CAN_NOT_COMPLETE
//
// MessageText:
//
// Cannot complete this function.
//
ERROR_CAN_NOT_COMPLETE = 1003;
//
// MessageId: ERROR_INVALID_FLAGS
//
// MessageText:
//
// Invalid flags.
//
ERROR_INVALID_FLAGS = 1004;
//
// MessageId: ERROR_UNRECOGNIZED_VOLUME
//
// MessageText:
//
// The volume does not contain a recognized file system.
// Please make sure that all required file system drivers are loaded and that the volume is not corrupted.
//
ERROR_UNRECOGNIZED_VOLUME = 1005;
//
// MessageId: ERROR_FILE_INVALID
//
// MessageText:
//
// The volume for a file has been externally altered so that the opened file is no longer valid.
//
ERROR_FILE_INVALID = 1006;
//
// MessageId: ERROR_FULLSCREEN_MODE
//
// MessageText:
//
// The requested operation cannot be performed in full-screen mode.
//
ERROR_FULLSCREEN_MODE = 1007;
//
// MessageId: ERROR_NO_TOKEN
//
// MessageText:
//
// An attempt was made to reference a token that does not exist.
//
ERROR_NO_TOKEN = 1008;
//
// MessageId: ERROR_BADDB
//
// MessageText:
//
// The configuration registry database is corrupt.
//
ERROR_BADDB = 1009;
//
// MessageId: ERROR_BADKEY
//
// MessageText:
//
// The configuration registry key is invalid.
//
ERROR_BADKEY = 1010;
//
// MessageId: ERROR_CANTOPEN
//
// MessageText:
//
// The configuration registry key could not be opened.
//
ERROR_CANTOPEN = 1011;
//
// MessageId: ERROR_CANTREAD
//
// MessageText:
//
// The configuration registry key could not be read.
//
ERROR_CANTREAD = 1012;
//
// MessageId: ERROR_CANTWRITE
//
// MessageText:
//
// The configuration registry key could not be written.
//
ERROR_CANTWRITE = 1013;
//
// MessageId: ERROR_REGISTRY_RECOVERED
//
// MessageText:
//
// One of the files in the registry database had to be recovered by use of a log or alternate copy. The recovery was successful.
//
ERROR_REGISTRY_RECOVERED = 1014;
//
// MessageId: ERROR_REGISTRY_CORRUPT
//
// MessageText:
//
// The registry is corrupted. The structure of one of the files containing registry data is corrupted, or the system's memory image of the file is corrupted, or the file could not be recovered because the alternate copy or log was absent or corrupted.
//
ERROR_REGISTRY_CORRUPT = 1015;
//
// MessageId: ERROR_REGISTRY_IO_FAILED
//
// MessageText:
//
// An I/O operation initiated by the registry failed unrecoverably. The registry could not read in, or write out, or flush, one of the files that contain the system's image of the registry.
//
ERROR_REGISTRY_IO_FAILED = 1016;
//
// MessageId: ERROR_NOT_REGISTRY_FILE
//
// MessageText:
//
// The system has attempted to load or restore a file into the registry, but the specified file is not in a registry file format.
//
ERROR_NOT_REGISTRY_FILE = 1017;
//
// MessageId: ERROR_KEY_DELETED
//
// MessageText:
//
// Illegal operation attempted on a registry key that has been marked for deletion.
//
ERROR_KEY_DELETED = 1018;
//
// MessageId: ERROR_NO_LOG_SPACE
//
// MessageText:
//
// System could not allocate the required space in a registry log.
//
ERROR_NO_LOG_SPACE = 1019;
//
// MessageId: ERROR_KEY_HAS_CHILDREN
//
// MessageText:
//
// Cannot create a symbolic link in a registry key that already has subkeys or values.
//
ERROR_KEY_HAS_CHILDREN = 1020;
//
// MessageId: ERROR_CHILD_MUST_BE_VOLATILE
//
// MessageText:
//
// Cannot create a stable subkey under a volatile parent key.
//
ERROR_CHILD_MUST_BE_VOLATILE = 1021;
//
// MessageId: ERROR_NOTIFY_ENUM_DIR
//
// MessageText:
//
// A notify change request is being completed and the information is not being returned in the caller's buffer. The caller now needs to enumerate the files to find the changes.
//
ERROR_NOTIFY_ENUM_DIR = 1022;
//
// MessageId: ERROR_DEPENDENT_SERVICES_RUNNING
//
// MessageText:
//
// A stop control has been sent to a service that other running services are dependent on.
//
ERROR_DEPENDENT_SERVICES_RUNNING = 1051;
//
// MessageId: ERROR_INVALID_SERVICE_CONTROL
//
// MessageText:
//
// The requested control is not valid for this service.
//
ERROR_INVALID_SERVICE_CONTROL = 1052;
//
// MessageId: ERROR_SERVICE_REQUEST_TIMEOUT
//
// MessageText:
//
// The service did not respond to the start or control request in a timely fashion.
//
ERROR_SERVICE_REQUEST_TIMEOUT = 1053;
//
// MessageId: ERROR_SERVICE_NO_THREAD
//
// MessageText:
//
// A thread could not be created for the service.
//
ERROR_SERVICE_NO_THREAD = 1054;
//
// MessageId: ERROR_SERVICE_DATABASE_LOCKED
//
// MessageText:
//
// The service database is locked.
//
ERROR_SERVICE_DATABASE_LOCKED = 1055;
//
// MessageId: ERROR_SERVICE_ALREADY_RUNNING
//
// MessageText:
//
// An instance of the service is already running.
//
ERROR_SERVICE_ALREADY_RUNNING = 1056;
//
// MessageId: ERROR_INVALID_SERVICE_ACCOUNT
//
// MessageText:
//
// The account name is invalid or does not exist, or the password is invalid for the account name specified.
//
ERROR_INVALID_SERVICE_ACCOUNT = 1057;
//
// MessageId: ERROR_SERVICE_DISABLED
//
// MessageText:
//
// The service cannot be started, either because it is disabled or because it has no enabled devices associated with it.
//
ERROR_SERVICE_DISABLED = 1058;
//
// MessageId: ERROR_CIRCULAR_DEPENDENCY
//
// MessageText:
//
// Circular service dependency was specified.
//
ERROR_CIRCULAR_DEPENDENCY = 1059;
//
// MessageId: ERROR_SERVICE_DOES_NOT_EXIST
//
// MessageText:
//
// The specified service does not exist as an installed service.
//
ERROR_SERVICE_DOES_NOT_EXIST = 1060;
//
// MessageId: ERROR_SERVICE_CANNOT_ACCEPT_CTRL
//
// MessageText:
//
// The service cannot accept control messages at this time.
//
ERROR_SERVICE_CANNOT_ACCEPT_CTRL = 1061;
//
// MessageId: ERROR_SERVICE_NOT_ACTIVE
//
// MessageText:
//
// The service has not been started.
//
ERROR_SERVICE_NOT_ACTIVE = 1062;
//
// MessageId: ERROR_FAILED_SERVICE_CONTROLLER_CONNECT
//
// MessageText:
//
// The service process could not connect to the service controller.
//
ERROR_FAILED_SERVICE_CONTROLLER_CONNECT = 1063;
//
// MessageId: ERROR_EXCEPTION_IN_SERVICE
//
// MessageText:
//
// An exception occurred in the service when handling the control request.
//
ERROR_EXCEPTION_IN_SERVICE = 1064;
//
// MessageId: ERROR_DATABASE_DOES_NOT_EXIST
//
// MessageText:
//
// The database specified does not exist.
//
ERROR_DATABASE_DOES_NOT_EXIST = 1065;
//
// MessageId: ERROR_SERVICE_SPECIFIC_ERROR
//
// MessageText:
//
// The service has returned a service-specific error code.
//
ERROR_SERVICE_SPECIFIC_ERROR = 1066;
//
// MessageId: ERROR_PROCESS_ABORTED
//
// MessageText:
//
// The process terminated unexpectedly.
//
ERROR_PROCESS_ABORTED = 1067;
//
// MessageId: ERROR_SERVICE_DEPENDENCY_FAIL
//
// MessageText:
//
// The dependency service or group failed to start.
//
ERROR_SERVICE_DEPENDENCY_FAIL = 1068;
//
// MessageId: ERROR_SERVICE_LOGON_FAILED
//
// MessageText:
//
// The service did not start due to a logon failure.
//
ERROR_SERVICE_LOGON_FAILED = 1069;
//
// MessageId: ERROR_SERVICE_START_HANG
//
// MessageText:
//
// After starting, the service hung in a start-pending state.
//
ERROR_SERVICE_START_HANG = 1070;
//
// MessageId: ERROR_INVALID_SERVICE_LOCK
//
// MessageText:
//
// The specified service database lock is invalid.
//
ERROR_INVALID_SERVICE_LOCK = 1071;
//
// MessageId: ERROR_SERVICE_MARKED_FOR_DELETE
//
// MessageText:
//
// The specified service has been marked for deletion.
//
ERROR_SERVICE_MARKED_FOR_DELETE = 1072;
//
// MessageId: ERROR_SERVICE_EXISTS
//
// MessageText:
//
// The specified service already exists.
//
ERROR_SERVICE_EXISTS = 1073;
//
// MessageId: ERROR_ALREADY_RUNNING_LKG
//
// MessageText:
//
// The system is currently running with the last-known-good configuration.
//
ERROR_ALREADY_RUNNING_LKG = 1074;
//
// MessageId: ERROR_SERVICE_DEPENDENCY_DELETED
//
// MessageText:
//
// The dependency service does not exist or has been marked for deletion.
//
ERROR_SERVICE_DEPENDENCY_DELETED = 1075;
//
// MessageId: ERROR_BOOT_ALREADY_ACCEPTED
//
// MessageText:
//
// The current boot has already been accepted for use as the last-known-good control set.
//
ERROR_BOOT_ALREADY_ACCEPTED = 1076;
//
// MessageId: ERROR_SERVICE_NEVER_STARTED
//
// MessageText:
//
// No attempts to start the service have been made since the last boot.
//
ERROR_SERVICE_NEVER_STARTED = 1077;
//
// MessageId: ERROR_DUPLICATE_SERVICE_NAME
//
// MessageText:
//
// The name is already in use as either a service name or a service display name.
//
ERROR_DUPLICATE_SERVICE_NAME = 1078;
//
// MessageId: ERROR_DIFFERENT_SERVICE_ACCOUNT
//
// MessageText:
//
// The account specified for this service is different from the account specified for other services running in the same process.
//
ERROR_DIFFERENT_SERVICE_ACCOUNT = 1079;
//
// MessageId: ERROR_CANNOT_DETECT_DRIVER_FAILURE
//
// MessageText:
//
// Failure actions can only be set for Win32 services, not for drivers.
//
ERROR_CANNOT_DETECT_DRIVER_FAILURE = 1080;
//
// MessageId: ERROR_CANNOT_DETECT_PROCESS_ABORT
//
// MessageText:
//
// This service runs in the same process as the service control manager.
// Therefore, the service control manager cannot take action if this service's process terminates unexpectedly.
//
ERROR_CANNOT_DETECT_PROCESS_ABORT = 1081;
//
// MessageId: ERROR_NO_RECOVERY_PROGRAM
//
// MessageText:
//
// No recovery program has been configured for this service.
//
ERROR_NO_RECOVERY_PROGRAM = 1082;
//
// MessageId: ERROR_SERVICE_NOT_IN_EXE
//
// MessageText:
//
// The executable program that this service is configured to run in does not implement the service.
//
ERROR_SERVICE_NOT_IN_EXE = 1083;
//
// MessageId: ERROR_END_OF_MEDIA
//
// MessageText:
//
// The physical end of the tape has been reached.
//
ERROR_END_OF_MEDIA = 1100;
//
// MessageId: ERROR_FILEMARK_DETECTED
//
// MessageText:
//
// A tape access reached a filemark.
//
ERROR_FILEMARK_DETECTED = 1101;
//
// MessageId: ERROR_BEGINNING_OF_MEDIA
//
// MessageText:
//
// The beginning of the tape or a partition was encountered.
//
ERROR_BEGINNING_OF_MEDIA = 1102;
//
// MessageId: ERROR_SETMARK_DETECTED
//
// MessageText:
//
// A tape access reached the end of a set of files.
//
ERROR_SETMARK_DETECTED = 1103;
//
// MessageId: ERROR_NO_DATA_DETECTED
//
// MessageText:
//
// No more data is on the tape.
//
ERROR_NO_DATA_DETECTED = 1104;
//
// MessageId: ERROR_PARTITION_FAILURE
//
// MessageText:
//
// Tape could not be partitioned.
//
ERROR_PARTITION_FAILURE = 1105;
//
// MessageId: ERROR_INVALID_BLOCK_LENGTH
//
// MessageText:
//
// When accessing a new tape of a multivolume partition, the current block size is incorrect.
//
ERROR_INVALID_BLOCK_LENGTH = 1106;
//
// MessageId: ERROR_DEVICE_NOT_PARTITIONED
//
// MessageText:
//
// Tape partition information could not be found when loading a tape.
//
ERROR_DEVICE_NOT_PARTITIONED = 1107;
//
// MessageId: ERROR_UNABLE_TO_LOCK_MEDIA
//
// MessageText:
//
// Unable to lock the media eject mechanism.
//
ERROR_UNABLE_TO_LOCK_MEDIA = 1108;
//
// MessageId: ERROR_UNABLE_TO_UNLOAD_MEDIA
//
// MessageText:
//
// Unable to unload the media.
//
ERROR_UNABLE_TO_UNLOAD_MEDIA = 1109;
//
// MessageId: ERROR_MEDIA_CHANGED
//
// MessageText:
//
// The media in the drive may have changed.
//
ERROR_MEDIA_CHANGED = 1110;
//
// MessageId: ERROR_BUS_RESET
//
// MessageText:
//
// The I/O bus was reset.
//
ERROR_BUS_RESET = 1111;
//
// MessageId: ERROR_NO_MEDIA_IN_DRIVE
//
// MessageText:
//
// No media in drive.
//
ERROR_NO_MEDIA_IN_DRIVE = 1112;
//
// MessageId: ERROR_NO_UNICODE_TRANSLATION
//
// MessageText:
//
// No mapping for the Unicode character exists in the target multi-byte code page.
//
ERROR_NO_UNICODE_TRANSLATION = 1113;
//
// MessageId: ERROR_DLL_INIT_FAILED
//
// MessageText:
//
// A dynamic link library (DLL) initialization routine failed.
//
ERROR_DLL_INIT_FAILED = 1114;
//
// MessageId: ERROR_SHUTDOWN_IN_PROGRESS
//
// MessageText:
//
// A system shutdown is in progress.
//
ERROR_SHUTDOWN_IN_PROGRESS = 1115;
//
// MessageId: ERROR_NO_SHUTDOWN_IN_PROGRESS
//
// MessageText:
//
// Unable to abort the system shutdown because no shutdown was in progress.
//
ERROR_NO_SHUTDOWN_IN_PROGRESS = 1116;
//
// MessageId: ERROR_IO_DEVICE
//
// MessageText:
//
// The request could not be performed because of an I/O device error.
//
ERROR_IO_DEVICE = 1117;
//
// MessageId: ERROR_SERIAL_NO_DEVICE
//
// MessageText:
//
// No serial device was successfully initialized. The serial driver will unload.
//
ERROR_SERIAL_NO_DEVICE = 1118;
//
// MessageId: ERROR_IRQ_BUSY
//
// MessageText:
//
// Unable to open a device that was sharing an interrupt request (IRQ) with other devices. At least one other device that uses that IRQ was already opened.
//
ERROR_IRQ_BUSY = 1119;
//
// MessageId: ERROR_MORE_WRITES
//
// MessageText:
//
// A serial I/O operation was completed by another write to the serial port.
// (The IOCTL_SERIAL_XOFF_COUNTER reached zero.)
//
ERROR_MORE_WRITES = 1120;
//
// MessageId: ERROR_COUNTER_TIMEOUT
//
// MessageText:
//
// A serial I/O operation completed because the timeout period expired.
// (The IOCTL_SERIAL_XOFF_COUNTER did not reach zero.)
//
ERROR_COUNTER_TIMEOUT = 1121;
//
// MessageId: ERROR_FLOPPY_ID_MARK_NOT_FOUND
//
// MessageText:
//
// No ID address mark was found on the floppy disk.
//
ERROR_FLOPPY_ID_MARK_NOT_FOUND = 1122;
//
// MessageId: ERROR_FLOPPY_WRONG_CYLINDER
//
// MessageText:
//
// Mismatch between the floppy disk sector ID field and the floppy disk controller track address.
//
ERROR_FLOPPY_WRONG_CYLINDER = 1123;
//
// MessageId: ERROR_FLOPPY_UNKNOWN_ERROR
//
// MessageText:
//
// The floppy disk controller reported an error that is not recognized by the floppy disk driver.
//
ERROR_FLOPPY_UNKNOWN_ERROR = 1124;
//
// MessageId: ERROR_FLOPPY_BAD_REGISTERS
//
// MessageText:
//
// The floppy disk controller returned inconsistent results in its registers.
//
ERROR_FLOPPY_BAD_REGISTERS = 1125;
//
// MessageId: ERROR_DISK_RECALIBRATE_FAILED
//
// MessageText:
//
// While accessing the hard disk, a recalibrate operation failed, even after retries.
//
ERROR_DISK_RECALIBRATE_FAILED = 1126;
//
// MessageId: ERROR_DISK_OPERATION_FAILED
//
// MessageText:
//
// While accessing the hard disk, a disk operation failed even after retries.
//
ERROR_DISK_OPERATION_FAILED = 1127;
//
// MessageId: ERROR_DISK_RESET_FAILED
//
// MessageText:
//
// While accessing the hard disk, a disk controller reset was needed, but even that failed.
//
ERROR_DISK_RESET_FAILED = 1128;
//
// MessageId: ERROR_EOM_OVERFLOW
//
// MessageText:
//
// Physical end of tape encountered.
//
ERROR_EOM_OVERFLOW = 1129;
//
// MessageId: ERROR_NOT_ENOUGH_SERVER_MEMORY
//
// MessageText:
//
// Not enough server storage is available to process this command.
//
ERROR_NOT_ENOUGH_SERVER_MEMORY = 1130;
//
// MessageId: ERROR_POSSIBLE_DEADLOCK
//
// MessageText:
//
// A potential deadlock condition has been detected.
//
ERROR_POSSIBLE_DEADLOCK = 1131;
//
// MessageId: ERROR_MAPPED_ALIGNMENT
//
// MessageText:
//
// The base address or the file offset specified does not have the proper alignment.
//
ERROR_MAPPED_ALIGNMENT = 1132;
//
// MessageId: ERROR_SET_POWER_STATE_VETOED
//
// MessageText:
//
// An attempt to change the system power state was vetoed by another application or driver.
//
ERROR_SET_POWER_STATE_VETOED = 1140;
//
// MessageId: ERROR_SET_POWER_STATE_FAILED
//
// MessageText:
//
// The system BIOS failed an attempt to change the system power state.
//
ERROR_SET_POWER_STATE_FAILED = 1141;
//
// MessageId: ERROR_TOO_MANY_LINKS
//
// MessageText:
//
// An attempt was made to create more links on a file than the file system supports.
//
ERROR_TOO_MANY_LINKS = 1142;
//
// MessageId: ERROR_OLD_WIN_VERSION
//
// MessageText:
//
// The specified program requires a newer version of Windows.
//
ERROR_OLD_WIN_VERSION = 1150;
//
// MessageId: ERROR_APP_WRONG_OS
//
// MessageText:
//
// The specified program is not a Windows or MS-DOS program.
//
ERROR_APP_WRONG_OS = 1151;
//
// MessageId: ERROR_SINGLE_INSTANCE_APP
//
// MessageText:
//
// Cannot start more than one instance of the specified program.
//
ERROR_SINGLE_INSTANCE_APP = 1152;
//
// MessageId: ERROR_RMODE_APP
//
// MessageText:
//
// The specified program was written for an earlier version of Windows.
//
ERROR_RMODE_APP = 1153;
//
// MessageId: ERROR_INVALID_DLL
//
// MessageText:
//
// One of the library files needed to run this application is damaged.
//
ERROR_INVALID_DLL = 1154;
//
// MessageId: ERROR_NO_ASSOCIATION
//
// MessageText:
//
// No application is associated with the specified file for this operation.
//
ERROR_NO_ASSOCIATION = 1155;
//
// MessageId: ERROR_DDE_FAIL
//
// MessageText:
//
// An error occurred in sending the command to the application.
//
ERROR_DDE_FAIL = 1156;
//
// MessageId: ERROR_DLL_NOT_FOUND
//
// MessageText:
//
// One of the library files needed to run this application cannot be found.
//
ERROR_DLL_NOT_FOUND = 1157;
//
// MessageId: ERROR_NO_MORE_USER_HANDLES
//
// MessageText:
//
// The current process has used all of its system allowance of handles for Window Manager objects.
//
ERROR_NO_MORE_USER_HANDLES = 1158;
//
// MessageId: ERROR_MESSAGE_SYNC_ONLY
//
// MessageText:
//
// The message can be used only with synchronous operations.
//
ERROR_MESSAGE_SYNC_ONLY = 1159;
//
// MessageId: ERROR_SOURCE_ELEMENT_EMPTY
//
// MessageText:
//
// The indicated source element has no media.
//
ERROR_SOURCE_ELEMENT_EMPTY = 1160;
//
// MessageId: ERROR_DESTINATION_ELEMENT_FULL
//
// MessageText:
//
// The indicated destination element already contains media.
//
ERROR_DESTINATION_ELEMENT_FULL = 1161;
//
// MessageId: ERROR_ILLEGAL_ELEMENT_ADDRESS
//
// MessageText:
//
// The indicated element does not exist.
//
ERROR_ILLEGAL_ELEMENT_ADDRESS = 1162;
//
// MessageId: ERROR_MAGAZINE_NOT_PRESENT
//
// MessageText:
//
// The indicated element is part of a magazine that is not present.
//
ERROR_MAGAZINE_NOT_PRESENT = 1163;
//
// MessageId: ERROR_DEVICE_REINITIALIZATION_NEEDED
//
// MessageText:
//
// The indicated device requires reinitialization due to hardware errors.
//
ERROR_DEVICE_REINITIALIZATION_NEEDED = 1164; // dderror
//
// MessageId: ERROR_DEVICE_REQUIRES_CLEANING
//
// MessageText:
//
// The device has indicated that cleaning is required before further operations are attempted.
//
ERROR_DEVICE_REQUIRES_CLEANING = 1165;
//
// MessageId: ERROR_DEVICE_DOOR_OPEN
//
// MessageText:
//
// The device has indicated that its door is open.
//
ERROR_DEVICE_DOOR_OPEN = 1166;
//
// MessageId: ERROR_DEVICE_NOT_CONNECTED
//
// MessageText:
//
// The device is not connected.
//
ERROR_DEVICE_NOT_CONNECTED = 1167;
//
// MessageId: ERROR_NOT_FOUND
//
// MessageText:
//
// Element not found.
//
ERROR_NOT_FOUND = 1168;
//
// MessageId: ERROR_NO_MATCH
//
// MessageText:
//
// There was no match for the specified key in the index.
//
ERROR_NO_MATCH = 1169;
//
// MessageId: ERROR_SET_NOT_FOUND
//
// MessageText:
//
// The property set specified does not exist on the object.
//
ERROR_SET_NOT_FOUND = 1170;
//
// MessageId: ERROR_POINT_NOT_FOUND
//
// MessageText:
//
// The point passed to GetMouseMovePoints is not in the buffer.
//
ERROR_POINT_NOT_FOUND = 1171;
//
// MessageId: ERROR_NO_TRACKING_SERVICE
//
// MessageText:
//
// The tracking (workstation) service is not running.
//
ERROR_NO_TRACKING_SERVICE = 1172;
//
// MessageId: ERROR_NO_VOLUME_ID
//
// MessageText:
//
// The Volume ID could not be found.
//
ERROR_NO_VOLUME_ID = 1173;
//
// MessageId: ERROR_UNABLE_TO_REMOVE_REPLACED
//
// MessageText:
//
// Unable to remove the file to be replaced.
//
ERROR_UNABLE_TO_REMOVE_REPLACED = 1175;
//
// MessageId: ERROR_UNABLE_TO_MOVE_REPLACEMENT
//
// MessageText:
//
// Unable to move the replacement file to the file to be replaced. The file to be replaced has retained its original name.
//
ERROR_UNABLE_TO_MOVE_REPLACEMENT = 1176;
//
// MessageId: ERROR_UNABLE_TO_MOVE_REPLACEMENT_2
//
// MessageText:
//
// Unable to move the replacement file to the file to be replaced. The file to be replaced has been renamed using the backup name.
//
ERROR_UNABLE_TO_MOVE_REPLACEMENT_2 = 1177;
//
// MessageId: ERROR_JOURNAL_DELETE_IN_PROGRESS
//
// MessageText:
//
// The volume change journal is being deleted.
//
ERROR_JOURNAL_DELETE_IN_PROGRESS = 1178;
//
// MessageId: ERROR_JOURNAL_NOT_ACTIVE
//
// MessageText:
//
// The volume change journal service is not active.
//
ERROR_JOURNAL_NOT_ACTIVE = 1179;
//
// MessageId: ERROR_POTENTIAL_FILE_FOUND
//
// MessageText:
//
// A file was found, but it may not be the correct file.
//
ERROR_POTENTIAL_FILE_FOUND = 1180;
//
// MessageId: ERROR_JOURNAL_ENTRY_DELETED
//
// MessageText:
//
// The journal entry has been deleted from the journal.
//
ERROR_JOURNAL_ENTRY_DELETED = 1181;
//
// MessageId: ERROR_BAD_DEVICE
//
// MessageText:
//
// The specified device name is invalid.
//
ERROR_BAD_DEVICE = 1200;
//
// MessageId: ERROR_CONNECTION_UNAVAIL
//
// MessageText:
//
// The device is not currently connected but it is a remembered connection.
//
ERROR_CONNECTION_UNAVAIL = 1201;
//
// MessageId: ERROR_DEVICE_ALREADY_REMEMBERED
//
// MessageText:
//
// An attempt was made to remember a device that had previously been remembered.
//
ERROR_DEVICE_ALREADY_REMEMBERED = 1202;
//
// MessageId: ERROR_NO_NET_OR_BAD_PATH
//
// MessageText:
//
// No network provider accepted the given network path.
//
ERROR_NO_NET_OR_BAD_PATH = 1203;
//
// MessageId: ERROR_BAD_PROVIDER
//
// MessageText:
//
// The specified network provider name is invalid.
//
ERROR_BAD_PROVIDER = 1204;
//
// MessageId: ERROR_CANNOT_OPEN_PROFILE
//
// MessageText:
//
// Unable to open the network connection profile.
//
ERROR_CANNOT_OPEN_PROFILE = 1205;
//
// MessageId: ERROR_BAD_PROFILE
//
// MessageText:
//
// The network connection profile is corrupted.
//
ERROR_BAD_PROFILE = 1206;
//
// MessageId: ERROR_NOT_CONTAINER
//
// MessageText:
//
// Cannot enumerate a noncontainer.
//
ERROR_NOT_CONTAINER = 1207;
//
// MessageId: ERROR_EXTENDED_ERROR
//
// MessageText:
//
// An extended error has occurred.
//
ERROR_EXTENDED_ERROR = 1208;
//
// MessageId: ERROR_INVALID_GROUPNAME
//
// MessageText:
//
// The format of the specified group name is invalid.
//
ERROR_INVALID_GROUPNAME = 1209;
//
// MessageId: ERROR_INVALID_COMPUTERNAME
//
// MessageText:
//
// The format of the specified computer name is invalid.
//
ERROR_INVALID_COMPUTERNAME = 1210;
//
// MessageId: ERROR_INVALID_EVENTNAME
//
// MessageText:
//
// The format of the specified event name is invalid.
//
ERROR_INVALID_EVENTNAME = 1211;
//
// MessageId: ERROR_INVALID_DOMAINNAME
//
// MessageText:
//
// The format of the specified domain name is invalid.
//
ERROR_INVALID_DOMAINNAME = 1212;
//
// MessageId: ERROR_INVALID_SERVICENAME
//
// MessageText:
//
// The format of the specified service name is invalid.
//
ERROR_INVALID_SERVICENAME = 1213;
//
// MessageId: ERROR_INVALID_NETNAME
//
// MessageText:
//
// The format of the specified network name is invalid.
//
ERROR_INVALID_NETNAME = 1214;
//
// MessageId: ERROR_INVALID_SHARENAME
//
// MessageText:
//
// The format of the specified share name is invalid.
//
ERROR_INVALID_SHARENAME = 1215;
//
// MessageId: ERROR_INVALID_PASSWORDNAME
//
// MessageText:
//
// The format of the specified password is invalid.
//
ERROR_INVALID_PASSWORDNAME = 1216;
//
// MessageId: ERROR_INVALID_MESSAGENAME
//
// MessageText:
//
// The format of the specified message name is invalid.
//
ERROR_INVALID_MESSAGENAME = 1217;
//
// MessageId: ERROR_INVALID_MESSAGEDEST
//
// MessageText:
//
// The format of the specified message destination is invalid.
//
ERROR_INVALID_MESSAGEDEST = 1218;
//
// MessageId: ERROR_SESSION_CREDENTIAL_CONFLICT
//
// MessageText:
//
// The credentials supplied conflict with an existing set of credentials.
//
ERROR_SESSION_CREDENTIAL_CONFLICT = 1219;
//
// MessageId: ERROR_REMOTE_SESSION_LIMIT_EXCEEDED
//
// MessageText:
//
// An attempt was made to establish a session to a network server, but there are already too many sessions established to that server.
//
ERROR_REMOTE_SESSION_LIMIT_EXCEEDED = 1220;
//
// MessageId: ERROR_DUP_DOMAINNAME
//
// MessageText:
//
// The workgroup or domain name is already in use by another computer on the network.
//
ERROR_DUP_DOMAINNAME = 1221;
//
// MessageId: ERROR_NO_NETWORK
//
// MessageText:
//
// The network is not present or not started.
//
ERROR_NO_NETWORK = 1222;
//
// MessageId: ERROR_CANCELLED
//
// MessageText:
//
// The operation was canceled by the user.
//
ERROR_CANCELLED = 1223;
//
// MessageId: ERROR_USER_MAPPED_FILE
//
// MessageText:
//
// The requested operation cannot be performed on a file with a user-mapped section open.
//
ERROR_USER_MAPPED_FILE = 1224;
//
// MessageId: ERROR_CONNECTION_REFUSED
//
// MessageText:
//
// The remote system refused the network connection.
//
ERROR_CONNECTION_REFUSED = 1225;
//
// MessageId: ERROR_GRACEFUL_DISCONNECT
//
// MessageText:
//
// The network connection was gracefully closed.
//
ERROR_GRACEFUL_DISCONNECT = 1226;
//
// MessageId: ERROR_ADDRESS_ALREADY_ASSOCIATED
//
// MessageText:
//
// The network transport endpoint already has an address associated with it.
//
ERROR_ADDRESS_ALREADY_ASSOCIATED = 1227;
//
// MessageId: ERROR_ADDRESS_NOT_ASSOCIATED
//
// MessageText:
//
// An address has not yet been associated with the network endpoint.
//
ERROR_ADDRESS_NOT_ASSOCIATED = 1228;
//
// MessageId: ERROR_CONNECTION_INVALID
//
// MessageText:
//
// An operation was attempted on a nonexistent network connection.
//
ERROR_CONNECTION_INVALID = 1229;
//
// MessageId: ERROR_CONNECTION_ACTIVE
//
// MessageText:
//
// An invalid operation was attempted on an active network connection.
//
ERROR_CONNECTION_ACTIVE = 1230;
//
// MessageId: ERROR_NETWORK_UNREACHABLE
//
// MessageText:
//
// The network location cannot be reached. For information about network troubleshooting, see Windows Help.
//
ERROR_NETWORK_UNREACHABLE = 1231;
//
// MessageId: ERROR_HOST_UNREACHABLE
//
// MessageText:
//
// The network location cannot be reached. For information about network troubleshooting, see Windows Help.
//
ERROR_HOST_UNREACHABLE = 1232;
//
// MessageId: ERROR_PROTOCOL_UNREACHABLE
//
// MessageText:
//
// The network location cannot be reached. For information about network troubleshooting, see Windows Help.
//
ERROR_PROTOCOL_UNREACHABLE = 1233;
//
// MessageId: ERROR_PORT_UNREACHABLE
//
// MessageText:
//
// No service is operating at the destination network endpoint on the remote system.
//
ERROR_PORT_UNREACHABLE = 1234;
//
// MessageId: ERROR_REQUEST_ABORTED
//
// MessageText:
//
// The request was aborted.
//
ERROR_REQUEST_ABORTED = 1235;
//
// MessageId: ERROR_CONNECTION_ABORTED
//
// MessageText:
//
// The network connection was aborted by the local system.
//
ERROR_CONNECTION_ABORTED = 1236;
//
// MessageId: ERROR_RETRY
//
// MessageText:
//
// The operation could not be completed. A retry should be performed.
//
ERROR_RETRY = 1237;
//
// MessageId: ERROR_CONNECTION_COUNT_LIMIT
//
// MessageText:
//
// A connection to the server could not be made because the limit on the number of concurrent connections for this account has been reached.
//
ERROR_CONNECTION_COUNT_LIMIT = 1238;
//
// MessageId: ERROR_LOGIN_TIME_RESTRICTION
//
// MessageText:
//
// Attempting to log in during an unauthorized time of day for this account.
//
ERROR_LOGIN_TIME_RESTRICTION = 1239;
//
// MessageId: ERROR_LOGIN_WKSTA_RESTRICTION
//
// MessageText:
//
// The account is not authorized to log in from this station.
//
ERROR_LOGIN_WKSTA_RESTRICTION = 1240;
//
// MessageId: ERROR_INCORRECT_ADDRESS
//
// MessageText:
//
// The network address could not be used for the operation requested.
//
ERROR_INCORRECT_ADDRESS = 1241;
//
// MessageId: ERROR_ALREADY_REGISTERED
//
// MessageText:
//
// The service is already registered.
//
ERROR_ALREADY_REGISTERED = 1242;
//
// MessageId: ERROR_SERVICE_NOT_FOUND
//
// MessageText:
//
// The specified service does not exist.
//
ERROR_SERVICE_NOT_FOUND = 1243;
//
// MessageId: ERROR_NOT_AUTHENTICATED
//
// MessageText:
//
// The operation being requested was not performed because the user has not been authenticated.
//
ERROR_NOT_AUTHENTICATED = 1244;
//
// MessageId: ERROR_NOT_LOGGED_ON
//
// MessageText:
//
// The operation being requested was not performed because the user has not logged on to the network.
// The specified service does not exist.
//
ERROR_NOT_LOGGED_ON = 1245;
//
// MessageId: ERROR_CONTINUE
//
// MessageText:
//
// Continue with work in progress.
//
ERROR_CONTINUE = 1246; // dderror
//
// MessageId: ERROR_ALREADY_INITIALIZED
//
// MessageText:
//
// An attempt was made to perform an initialization operation when initialization has already been completed.
//
ERROR_ALREADY_INITIALIZED = 1247;
//
// MessageId: ERROR_NO_MORE_DEVICES
//
// MessageText:
//
// No more local devices.
//
ERROR_NO_MORE_DEVICES = 1248; // dderror
//
// MessageId: ERROR_NO_SUCH_SITE
//
// MessageText:
//
// The specified site does not exist.
//
ERROR_NO_SUCH_SITE = 1249;
//
// MessageId: ERROR_DOMAIN_CONTROLLER_EXISTS
//
// MessageText:
//
// A domain controller with the specified name already exists.
//
ERROR_DOMAIN_CONTROLLER_EXISTS = 1250;
//
// MessageId: ERROR_ONLY_IF_CONNECTED
//
// MessageText:
//
// This operation is supported only when you are connected to the server.
//
ERROR_ONLY_IF_CONNECTED = 1251;
//
// MessageId: ERROR_OVERRIDE_NOCHANGES
//
// MessageText:
//
// The group policy framework should call the extension even if there are no changes.
//
ERROR_OVERRIDE_NOCHANGES = 1252;
//
// MessageId: ERROR_BAD_USER_PROFILE
//
// MessageText:
//
// The specified user does not have a valid profile.
//
ERROR_BAD_USER_PROFILE = 1253;
//
// MessageId: ERROR_NOT_SUPPORTED_ON_SBS
//
// MessageText:
//
// This operation is not supported on a Microsoft Small Business Server
//
ERROR_NOT_SUPPORTED_ON_SBS = 1254;
///////////////////////////
// //
// Security Status Codes //
// //
///////////////////////////
//
// MessageId: ERROR_NOT_ALL_ASSIGNED
//
// MessageText:
//
// Not all privileges referenced are assigned to the caller.
//
ERROR_NOT_ALL_ASSIGNED = 1300;
//
// MessageId: ERROR_SOME_NOT_MAPPED
//
// MessageText:
//
// Some mapping between account names and security IDs was not done.
//
ERROR_SOME_NOT_MAPPED = 1301;
//
// MessageId: ERROR_NO_QUOTAS_FOR_ACCOUNT
//
// MessageText:
//
// No system quota limits are specifically set for this account.
//
ERROR_NO_QUOTAS_FOR_ACCOUNT = 1302;
//
// MessageId: ERROR_LOCAL_USER_SESSION_KEY
//
// MessageText:
//
// No encryption key is available. A well-known encryption key was returned.
//
ERROR_LOCAL_USER_SESSION_KEY = 1303;
//
// MessageId: ERROR_NULL_LM_PASSWORD
//
// MessageText:
//
// The password is too complex to be converted to a LAN Manager password. The LAN Manager password returned is a NULL string.
//
ERROR_NULL_LM_PASSWORD = 1304;
//
// MessageId: ERROR_UNKNOWN_REVISION
//
// MessageText:
//
// The revision level is unknown.
//
ERROR_UNKNOWN_REVISION = 1305;
//
// MessageId: ERROR_REVISION_MISMATCH
//
// MessageText:
//
// Indicates two revision levels are incompatible.
//
ERROR_REVISION_MISMATCH = 1306;
//
// MessageId: ERROR_INVALID_OWNER
//
// MessageText:
//
// This security ID may not be assigned as the owner of this object.
//
ERROR_INVALID_OWNER = 1307;
//
// MessageId: ERROR_INVALID_PRIMARY_GROUP
//
// MessageText:
//
// This security ID may not be assigned as the primary group of an object.
//
ERROR_INVALID_PRIMARY_GROUP = 1308;
//
// MessageId: ERROR_NO_IMPERSONATION_TOKEN
//
// MessageText:
//
// An attempt has been made to operate on an impersonation token by a thread that is not currently impersonating a client.
//
ERROR_NO_IMPERSONATION_TOKEN = 1309;
//
// MessageId: ERROR_CANT_DISABLE_MANDATORY
//
// MessageText:
//
// The group may not be disabled.
//
ERROR_CANT_DISABLE_MANDATORY = 1310;
//
// MessageId: ERROR_NO_LOGON_SERVERS
//
// MessageText:
//
// There are currently no logon servers available to service the logon request.
//
ERROR_NO_LOGON_SERVERS = 1311;
//
// MessageId: ERROR_NO_SUCH_LOGON_SESSION
//
// MessageText:
//
// A specified logon session does not exist. It may already have been terminated.
//
ERROR_NO_SUCH_LOGON_SESSION = 1312;
//
// MessageId: ERROR_NO_SUCH_PRIVILEGE
//
// MessageText:
//
// A specified privilege does not exist.
//
ERROR_NO_SUCH_PRIVILEGE = 1313;
//
// MessageId: ERROR_PRIVILEGE_NOT_HELD
//
// MessageText:
//
// A required privilege is not held by the client.
//
ERROR_PRIVILEGE_NOT_HELD = 1314;
//
// MessageId: ERROR_INVALID_ACCOUNT_NAME
//
// MessageText:
//
// The name provided is not a properly formed account name.
//
ERROR_INVALID_ACCOUNT_NAME = 1315;
//
// MessageId: ERROR_USER_EXISTS
//
// MessageText:
//
// The specified user already exists.
//
ERROR_USER_EXISTS = 1316;
//
// MessageId: ERROR_NO_SUCH_USER
//
// MessageText:
//
// The specified user does not exist.
//
ERROR_NO_SUCH_USER = 1317;
//
// MessageId: ERROR_GROUP_EXISTS
//
// MessageText:
//
// The specified group already exists.
//
ERROR_GROUP_EXISTS = 1318;
//
// MessageId: ERROR_NO_SUCH_GROUP
//
// MessageText:
//
// The specified group does not exist.
//
ERROR_NO_SUCH_GROUP = 1319;
//
// MessageId: ERROR_MEMBER_IN_GROUP
//
// MessageText:
//
// Either the specified user account is already a member of the specified group, or the specified group cannot be deleted because it contains a member.
//
ERROR_MEMBER_IN_GROUP = 1320;
//
// MessageId: ERROR_MEMBER_NOT_IN_GROUP
//
// MessageText:
//
// The specified user account is not a member of the specified group account.
//
ERROR_MEMBER_NOT_IN_GROUP = 1321;
//
// MessageId: ERROR_LAST_ADMIN
//
// MessageText:
//
// The last remaining administration account cannot be disabled or deleted.
//
ERROR_LAST_ADMIN = 1322;
//
// MessageId: ERROR_WRONG_PASSWORD
//
// MessageText:
//
// Unable to update the password. The value provided as the current password is incorrect.
//
ERROR_WRONG_PASSWORD = 1323;
//
// MessageId: ERROR_ILL_FORMED_PASSWORD
//
// MessageText:
//
// Unable to update the password. The value provided for the new password contains values that are not allowed in passwords.
//
ERROR_ILL_FORMED_PASSWORD = 1324;
//
// MessageId: ERROR_PASSWORD_RESTRICTION
//
// MessageText:
//
// Unable to update the password. The value provided for the new password does not meet the length, complexity, or history requirement of the domain.
//
ERROR_PASSWORD_RESTRICTION = 1325;
//
// MessageId: ERROR_LOGON_FAILURE
//
// MessageText:
//
// Logon failure: unknown user name or bad password.
//
ERROR_LOGON_FAILURE = 1326;
//
// MessageId: ERROR_ACCOUNT_RESTRICTION
//
// MessageText:
//
// Logon failure: user account restriction.
//
ERROR_ACCOUNT_RESTRICTION = 1327;
//
// MessageId: ERROR_INVALID_LOGON_HOURS
//
// MessageText:
//
// Logon failure: account logon time restriction violation.
//
ERROR_INVALID_LOGON_HOURS = 1328;
//
// MessageId: ERROR_INVALID_WORKSTATION
//
// MessageText:
//
// Logon failure: user not allowed to log on to this computer.
//
ERROR_INVALID_WORKSTATION = 1329;
//
// MessageId: ERROR_PASSWORD_EXPIRED
//
// MessageText:
//
// Logon failure: the specified account password has expired.
//
ERROR_PASSWORD_EXPIRED = 1330;
//
// MessageId: ERROR_ACCOUNT_DISABLED
//
// MessageText:
//
// Logon failure: account currently disabled.
//
ERROR_ACCOUNT_DISABLED = 1331;
//
// MessageId: ERROR_NONE_MAPPED
//
// MessageText:
//
// No mapping between account names and security IDs was done.
//
ERROR_NONE_MAPPED = 1332;
//
// MessageId: ERROR_TOO_MANY_LUIDS_REQUESTED
//
// MessageText:
//
// Too many local user identifiers (LUIDs) were requested at one time.
//
ERROR_TOO_MANY_LUIDS_REQUESTED = 1333;
//
// MessageId: ERROR_LUIDS_EXHAUSTED
//
// MessageText:
//
// No more local user identifiers (LUIDs) are available.
//
ERROR_LUIDS_EXHAUSTED = 1334;
//
// MessageId: ERROR_INVALID_SUB_AUTHORITY
//
// MessageText:
//
// The subauthority part of a security ID is invalid for this particular use.
//
ERROR_INVALID_SUB_AUTHORITY = 1335;
//
// MessageId: ERROR_INVALID_ACL
//
// MessageText:
//
// The access control list (ACL) structure is invalid.
//
ERROR_INVALID_ACL = 1336;
//
// MessageId: ERROR_INVALID_SID
//
// MessageText:
//
// The security ID structure is invalid.
//
ERROR_INVALID_SID = 1337;
//
// MessageId: ERROR_INVALID_SECURITY_DESCR
//
// MessageText:
//
// The security descriptor structure is invalid.
//
ERROR_INVALID_SECURITY_DESCR = 1338;
//
// MessageId: ERROR_BAD_INHERITANCE_ACL
//
// MessageText:
//
// The inherited access control list (ACL) or access control entry (ACE) could not be built.
//
ERROR_BAD_INHERITANCE_ACL = 1340;
//
// MessageId: ERROR_SERVER_DISABLED
//
// MessageText:
//
// The server is currently disabled.
//
ERROR_SERVER_DISABLED = 1341;
//
// MessageId: ERROR_SERVER_NOT_DISABLED
//
// MessageText:
//
// The server is currently enabled.
//
ERROR_SERVER_NOT_DISABLED = 1342;
//
// MessageId: ERROR_INVALID_ID_AUTHORITY
//
// MessageText:
//
// The value provided was an invalid value for an identifier authority.
//
ERROR_INVALID_ID_AUTHORITY = 1343;
//
// MessageId: ERROR_ALLOTTED_SPACE_EXCEEDED
//
// MessageText:
//
// No more memory is available for security information updates.
//
ERROR_ALLOTTED_SPACE_EXCEEDED = 1344;
//
// MessageId: ERROR_INVALID_GROUP_ATTRIBUTES
//
// MessageText:
//
// The specified attributes are invalid, or incompatible with the attributes for the group as a whole.
//
ERROR_INVALID_GROUP_ATTRIBUTES = 1345;
//
// MessageId: ERROR_BAD_IMPERSONATION_LEVEL
//
// MessageText:
//
// Either a required impersonation level was not provided, or the provided impersonation level is invalid.
//
ERROR_BAD_IMPERSONATION_LEVEL = 1346;
//
// MessageId: ERROR_CANT_OPEN_ANONYMOUS
//
// MessageText:
//
// Cannot open an anonymous level security token.
//
ERROR_CANT_OPEN_ANONYMOUS = 1347;
//
// MessageId: ERROR_BAD_VALIDATION_CLASS
//
// MessageText:
//
// The validation information class requested was invalid.
//
ERROR_BAD_VALIDATION_CLASS = 1348;
//
// MessageId: ERROR_BAD_TOKEN_TYPE
//
// MessageText:
//
// The type of the token is inappropriate for its attempted use.
//
ERROR_BAD_TOKEN_TYPE = 1349;
//
// MessageId: ERROR_NO_SECURITY_ON_OBJECT
//
// MessageText:
//
// Unable to perform a security operation on an object that has no associated security.
//
ERROR_NO_SECURITY_ON_OBJECT = 1350;
//
// MessageId: ERROR_CANT_ACCESS_DOMAIN_INFO
//
// MessageText:
//
// Configuration information could not be read from the domain controller, either because the machine is unavailable, or access has been denied.
//
ERROR_CANT_ACCESS_DOMAIN_INFO = 1351;
//
// MessageId: ERROR_INVALID_SERVER_STATE
//
// MessageText:
//
// The security account manager (SAM) or local security authority (LSA) server was in the wrong state to perform the security operation.
//
ERROR_INVALID_SERVER_STATE = 1352;
//
// MessageId: ERROR_INVALID_DOMAIN_STATE
//
// MessageText:
//
// The domain was in the wrong state to perform the security operation.
//
ERROR_INVALID_DOMAIN_STATE = 1353;
//
// MessageId: ERROR_INVALID_DOMAIN_ROLE
//
// MessageText:
//
// This operation is only allowed for the Primary Domain Controller of the domain.
//
ERROR_INVALID_DOMAIN_ROLE = 1354;
//
// MessageId: ERROR_NO_SUCH_DOMAIN
//
// MessageText:
//
// The specified domain either does not exist or could not be contacted.
//
ERROR_NO_SUCH_DOMAIN = 1355;
//
// MessageId: ERROR_DOMAIN_EXISTS
//
// MessageText:
//
// The specified domain already exists.
//
ERROR_DOMAIN_EXISTS = 1356;
//
// MessageId: ERROR_DOMAIN_LIMIT_EXCEEDED
//
// MessageText:
//
// An attempt was made to exceed the limit on the number of domains per server.
//
ERROR_DOMAIN_LIMIT_EXCEEDED = 1357;
//
// MessageId: ERROR_INTERNAL_DB_CORRUPTION
//
// MessageText:
//
// Unable to complete the requested operation because of either a catastrophic media failure or a data structure corruption on the disk.
//
ERROR_INTERNAL_DB_CORRUPTION = 1358;
//
// MessageId: ERROR_INTERNAL_ERROR
//
// MessageText:
//
// An internal error occurred.
//
ERROR_INTERNAL_ERROR = 1359;
//
// MessageId: ERROR_GENERIC_NOT_MAPPED
//
// MessageText:
//
// Generic access types were contained in an access mask which should already be mapped to nongeneric types.
//
ERROR_GENERIC_NOT_MAPPED = 1360;
//
// MessageId: ERROR_BAD_DESCRIPTOR_FORMAT
//
// MessageText:
//
// A security descriptor is not in the right format (absolute or self-relative).
//
ERROR_BAD_DESCRIPTOR_FORMAT = 1361;
//
// MessageId: ERROR_NOT_LOGON_PROCESS
//
// MessageText:
//
// The requested action is restricted for use by logon processes only. The calling process has not registered as a logon process.
//
ERROR_NOT_LOGON_PROCESS = 1362;
//
// MessageId: ERROR_LOGON_SESSION_EXISTS
//
// MessageText:
//
// Cannot start a new logon session with an ID that is already in use.
//
ERROR_LOGON_SESSION_EXISTS = 1363;
//
// MessageId: ERROR_NO_SUCH_PACKAGE
//
// MessageText:
//
// A specified authentication package is unknown.
//
ERROR_NO_SUCH_PACKAGE = 1364;
//
// MessageId: ERROR_BAD_LOGON_SESSION_STATE
//
// MessageText:
//
// The logon session is not in a state that is consistent with the requested operation.
//
ERROR_BAD_LOGON_SESSION_STATE = 1365;
//
// MessageId: ERROR_LOGON_SESSION_COLLISION
//
// MessageText:
//
// The logon session ID is already in use.
//
ERROR_LOGON_SESSION_COLLISION = 1366;
//
// MessageId: ERROR_INVALID_LOGON_TYPE
//
// MessageText:
//
// A logon request contained an invalid logon type value.
//
ERROR_INVALID_LOGON_TYPE = 1367;
//
// MessageId: ERROR_CANNOT_IMPERSONATE
//
// MessageText:
//
// Unable to impersonate using a named pipe until data has been read from that pipe.
//
ERROR_CANNOT_IMPERSONATE = 1368;
//
// MessageId: ERROR_RXACT_INVALID_STATE
//
// MessageText:
//
// The transaction state of a registry subtree is incompatible with the requested operation.
//
ERROR_RXACT_INVALID_STATE = 1369;
//
// MessageId: ERROR_RXACT_COMMIT_FAILURE
//
// MessageText:
//
// An internal security database corruption has been encountered.
//
ERROR_RXACT_COMMIT_FAILURE = 1370;
//
// MessageId: ERROR_SPECIAL_ACCOUNT
//
// MessageText:
//
// Cannot perform this operation on built-in accounts.
//
ERROR_SPECIAL_ACCOUNT = 1371;
//
// MessageId: ERROR_SPECIAL_GROUP
//
// MessageText:
//
// Cannot perform this operation on this built-in special group.
//
ERROR_SPECIAL_GROUP = 1372;
//
// MessageId: ERROR_SPECIAL_USER
//
// MessageText:
//
// Cannot perform this operation on this built-in special user.
//
ERROR_SPECIAL_USER = 1373;
//
// MessageId: ERROR_MEMBERS_PRIMARY_GROUP
//
// MessageText:
//
// The user cannot be removed from a group because the group is currently the user's primary group.
//
ERROR_MEMBERS_PRIMARY_GROUP = 1374;
//
// MessageId: ERROR_TOKEN_ALREADY_IN_USE
//
// MessageText:
//
// The token is already in use as a primary token.
//
ERROR_TOKEN_ALREADY_IN_USE = 1375;
//
// MessageId: ERROR_NO_SUCH_ALIAS
//
// MessageText:
//
// The specified local group does not exist.
//
ERROR_NO_SUCH_ALIAS = 1376;
//
// MessageId: ERROR_MEMBER_NOT_IN_ALIAS
//
// MessageText:
//
// The specified account name is not a member of the local group.
//
ERROR_MEMBER_NOT_IN_ALIAS = 1377;
//
// MessageId: ERROR_MEMBER_IN_ALIAS
//
// MessageText:
//
// The specified account name is already a member of the local group.
//
ERROR_MEMBER_IN_ALIAS = 1378;
//
// MessageId: ERROR_ALIAS_EXISTS
//
// MessageText:
//
// The specified local group already exists.
//
ERROR_ALIAS_EXISTS = 1379;
//
// MessageId: ERROR_LOGON_NOT_GRANTED
//
// MessageText:
//
// Logon failure: the user has not been granted the requested logon type at this computer.
//
ERROR_LOGON_NOT_GRANTED = 1380;
//
// MessageId: ERROR_TOO_MANY_SECRETS
//
// MessageText:
//
// The maximum number of secrets that may be stored in a single system has been exceeded.
//
ERROR_TOO_MANY_SECRETS = 1381;
//
// MessageId: ERROR_SECRET_TOO_LONG
//
// MessageText:
//
// The length of a secret exceeds the maximum length allowed.
//
ERROR_SECRET_TOO_LONG = 1382;
//
// MessageId: ERROR_INTERNAL_DB_ERROR
//
// MessageText:
//
// The local security authority database contains an internal inconsistency.
//
ERROR_INTERNAL_DB_ERROR = 1383;
//
// MessageId: ERROR_TOO_MANY_CONTEXT_IDS
//
// MessageText:
//
// During a logon attempt, the user's security context accumulated too many security IDs.
//
ERROR_TOO_MANY_CONTEXT_IDS = 1384;
//
// MessageId: ERROR_LOGON_TYPE_NOT_GRANTED
//
// MessageText:
//
// Logon failure: the user has not been granted the requested logon type at this computer.
//
ERROR_LOGON_TYPE_NOT_GRANTED = 1385;
//
// MessageId: ERROR_NT_CROSS_ENCRYPTION_REQUIRED
//
// MessageText:
//
// A cross-encrypted password is necessary to change a user password.
//
ERROR_NT_CROSS_ENCRYPTION_REQUIRED = 1386;
//
// MessageId: ERROR_NO_SUCH_MEMBER
//
// MessageText:
//
// A member could not be added to or removed from the local group because the member does not exist.
//
ERROR_NO_SUCH_MEMBER = 1387;
//
// MessageId: ERROR_INVALID_MEMBER
//
// MessageText:
//
// A new member could not be added to a local group because the member has the wrong account type.
//
ERROR_INVALID_MEMBER = 1388;
//
// MessageId: ERROR_TOO_MANY_SIDS
//
// MessageText:
//
// Too many security IDs have been specified.
//
ERROR_TOO_MANY_SIDS = 1389;
//
// MessageId: ERROR_LM_CROSS_ENCRYPTION_REQUIRED
//
// MessageText:
//
// A cross-encrypted password is necessary to change this user password.
//
ERROR_LM_CROSS_ENCRYPTION_REQUIRED = 1390;
//
// MessageId: ERROR_NO_INHERITANCE
//
// MessageText:
//
// Indicates an ACL contains no inheritable components.
//
ERROR_NO_INHERITANCE = 1391;
//
// MessageId: ERROR_FILE_CORRUPT
//
// MessageText:
//
// The file or directory is corrupted and unreadable.
//
ERROR_FILE_CORRUPT = 1392;
//
// MessageId: ERROR_DISK_CORRUPT
//
// MessageText:
//
// The disk structure is corrupted and unreadable.
//
ERROR_DISK_CORRUPT = 1393;
//
// MessageId: ERROR_NO_USER_SESSION_KEY
//
// MessageText:
//
// There is no user session key for the specified logon session.
//
ERROR_NO_USER_SESSION_KEY = 1394;
//
// MessageId: ERROR_LICENSE_QUOTA_EXCEEDED
//
// MessageText:
//
// The service being accessed is licensed for a particular number of connections.
// No more connections can be made to the service at this time because there are already as many connections as the service can accept.
//
ERROR_LICENSE_QUOTA_EXCEEDED = 1395;
//
// MessageId: ERROR_WRONG_TARGET_NAME
//
// MessageText:
//
// Logon Failure: The target account name is incorrect.
//
ERROR_WRONG_TARGET_NAME = 1396;
//
// MessageId: ERROR_MUTUAL_AUTH_FAILED
//
// MessageText:
//
// Mutual Authentication failed. The server's password is out of date at the domain controller.
//
ERROR_MUTUAL_AUTH_FAILED = 1397;
//
// MessageId: ERROR_TIME_SKEW
//
// MessageText:
//
// There is a time difference between the client and server.
//
ERROR_TIME_SKEW = 1398;
// End of security error codes
///////////////////////////
// //
// WinUser Error Codes //
// //
///////////////////////////
//
// MessageId: ERROR_INVALID_WINDOW_HANDLE
//
// MessageText:
//
// Invalid window handle.
//
ERROR_INVALID_WINDOW_HANDLE = 1400;
//
// MessageId: ERROR_INVALID_MENU_HANDLE
//
// MessageText:
//
// Invalid menu handle.
//
ERROR_INVALID_MENU_HANDLE = 1401;
//
// MessageId: ERROR_INVALID_CURSOR_HANDLE
//
// MessageText:
//
// Invalid cursor handle.
//
ERROR_INVALID_CURSOR_HANDLE = 1402;
//
// MessageId: ERROR_INVALID_ACCEL_HANDLE
//
// MessageText:
//
// Invalid accelerator table handle.
//
ERROR_INVALID_ACCEL_HANDLE = 1403;
//
// MessageId: ERROR_INVALID_HOOK_HANDLE
//
// MessageText:
//
// Invalid hook handle.
//
ERROR_INVALID_HOOK_HANDLE = 1404;
//
// MessageId: ERROR_INVALID_DWP_HANDLE
//
// MessageText:
//
// Invalid handle to a multiple-window position structure.
//
ERROR_INVALID_DWP_HANDLE = 1405;
//
// MessageId: ERROR_TLW_WITH_WSCHILD
//
// MessageText:
//
// Cannot create a top-level child window.
//
ERROR_TLW_WITH_WSCHILD = 1406;
//
// MessageId: ERROR_CANNOT_FIND_WND_CLASS
//
// MessageText:
//
// Cannot find window class.
//
ERROR_CANNOT_FIND_WND_CLASS = 1407;
//
// MessageId: ERROR_WINDOW_OF_OTHER_THREAD
//
// MessageText:
//
// Invalid window; it belongs to other thread.
//
ERROR_WINDOW_OF_OTHER_THREAD = 1408;
//
// MessageId: ERROR_HOTKEY_ALREADY_REGISTERED
//
// MessageText:
//
// Hot key is already registered.
//
ERROR_HOTKEY_ALREADY_REGISTERED = 1409;
//
// MessageId: ERROR_CLASS_ALREADY_EXISTS
//
// MessageText:
//
// Class already exists.
//
ERROR_CLASS_ALREADY_EXISTS = 1410;
//
// MessageId: ERROR_CLASS_DOES_NOT_EXIST
//
// MessageText:
//
// Class does not exist.
//
ERROR_CLASS_DOES_NOT_EXIST = 1411;
//
// MessageId: ERROR_CLASS_HAS_WINDOWS
//
// MessageText:
//
// Class still has open windows.
//
ERROR_CLASS_HAS_WINDOWS = 1412;
//
// MessageId: ERROR_INVALID_INDEX
//
// MessageText:
//
// Invalid index.
//
ERROR_INVALID_INDEX = 1413;
//
// MessageId: ERROR_INVALID_ICON_HANDLE
//
// MessageText:
//
// Invalid icon handle.
//
ERROR_INVALID_ICON_HANDLE = 1414;
//
// MessageId: ERROR_PRIVATE_DIALOG_INDEX
//
// MessageText:
//
// Using private DIALOG window words.
//
ERROR_PRIVATE_DIALOG_INDEX = 1415;
//
// MessageId: ERROR_LISTBOX_ID_NOT_FOUND
//
// MessageText:
//
// The list box identifier was not found.
//
ERROR_LISTBOX_ID_NOT_FOUND = 1416;
//
// MessageId: ERROR_NO_WILDCARD_CHARACTERS
//
// MessageText:
//
// No wildcards were found.
//
ERROR_NO_WILDCARD_CHARACTERS = 1417;
//
// MessageId: ERROR_CLIPBOARD_NOT_OPEN
//
// MessageText:
//
// Thread does not have a clipboard open.
//
ERROR_CLIPBOARD_NOT_OPEN = 1418;
//
// MessageId: ERROR_HOTKEY_NOT_REGISTERED
//
// MessageText:
//
// Hot key is not registered.
//
ERROR_HOTKEY_NOT_REGISTERED = 1419;
//
// MessageId: ERROR_WINDOW_NOT_DIALOG
//
// MessageText:
//
// The window is not a valid dialog window.
//
ERROR_WINDOW_NOT_DIALOG = 1420;
//
// MessageId: ERROR_CONTROL_ID_NOT_FOUND
//
// MessageText:
//
// Control ID not found.
//
ERROR_CONTROL_ID_NOT_FOUND = 1421;
//
// MessageId: ERROR_INVALID_COMBOBOX_MESSAGE
//
// MessageText:
//
// Invalid message for a combo box because it does not have an edit control.
//
ERROR_INVALID_COMBOBOX_MESSAGE = 1422;
//
// MessageId: ERROR_WINDOW_NOT_COMBOBOX
//
// MessageText:
//
// The window is not a combo box.
//
ERROR_WINDOW_NOT_COMBOBOX = 1423;
//
// MessageId: ERROR_INVALID_EDIT_HEIGHT
//
// MessageText:
//
// Height must be less than 256.
//
ERROR_INVALID_EDIT_HEIGHT = 1424;
//
// MessageId: ERROR_DC_NOT_FOUND
//
// MessageText:
//
// Invalid device context (DC) handle.
//
ERROR_DC_NOT_FOUND = 1425;
//
// MessageId: ERROR_INVALID_HOOK_FILTER
//
// MessageText:
//
// Invalid hook procedure type.
//
ERROR_INVALID_HOOK_FILTER = 1426;
//
// MessageId: ERROR_INVALID_FILTER_PROC
//
// MessageText:
//
// Invalid hook procedure.
//
ERROR_INVALID_FILTER_PROC = 1427;
//
// MessageId: ERROR_HOOK_NEEDS_HMOD
//
// MessageText:
//
// Cannot set nonlocal hook without a module handle.
//
ERROR_HOOK_NEEDS_HMOD = 1428;
//
// MessageId: ERROR_GLOBAL_ONLY_HOOK
//
// MessageText:
//
// This hook procedure can only be set globally.
//
ERROR_GLOBAL_ONLY_HOOK = 1429;
//
// MessageId: ERROR_JOURNAL_HOOK_SET
//
// MessageText:
//
// The journal hook procedure is already installed.
//
ERROR_JOURNAL_HOOK_SET = 1430;
//
// MessageId: ERROR_HOOK_NOT_INSTALLED
//
// MessageText:
//
// The hook procedure is not installed.
//
ERROR_HOOK_NOT_INSTALLED = 1431;
//
// MessageId: ERROR_INVALID_LB_MESSAGE
//
// MessageText:
//
// Invalid message for single-selection list box.
//
ERROR_INVALID_LB_MESSAGE = 1432;
//
// MessageId: ERROR_SETCOUNT_ON_BAD_LB
//
// MessageText:
//
// LB_SETCOUNT sent to non-lazy list box.
//
ERROR_SETCOUNT_ON_BAD_LB = 1433;
//
// MessageId: ERROR_LB_WITHOUT_TABSTOPS
//
// MessageText:
//
// This list box does not support tab stops.
//
ERROR_LB_WITHOUT_TABSTOPS = 1434;
//
// MessageId: ERROR_DESTROY_OBJECT_OF_OTHER_THREAD
//
// MessageText:
//
// Cannot destroy object created by another thread.
//
ERROR_DESTROY_OBJECT_OF_OTHER_THREAD = 1435;
//
// MessageId: ERROR_CHILD_WINDOW_MENU
//
// MessageText:
//
// Child windows cannot have menus.
//
ERROR_CHILD_WINDOW_MENU = 1436;
//
// MessageId: ERROR_NO_SYSTEM_MENU
//
// MessageText:
//
// The window does not have a system menu.
//
ERROR_NO_SYSTEM_MENU = 1437;
//
// MessageId: ERROR_INVALID_MSGBOX_STYLE
//
// MessageText:
//
// Invalid message box style.
//
ERROR_INVALID_MSGBOX_STYLE = 1438;
//
// MessageId: ERROR_INVALID_SPI_VALUE
//
// MessageText:
//
// Invalid system-wide (SPI_* ) parameter.
//
ERROR_INVALID_SPI_VALUE = 1439;
//
// MessageId: ERROR_SCREEN_ALREADY_LOCKED
//
// MessageText:
//
// Screen already locked.
//
ERROR_SCREEN_ALREADY_LOCKED = 1440;
//
// MessageId: ERROR_HWNDS_HAVE_DIFF_PARENT
//
// MessageText:
//
// All handles to windows in a multiple-window position structure must have the same parent.
//
ERROR_HWNDS_HAVE_DIFF_PARENT = 1441;
//
// MessageId: ERROR_NOT_CHILD_WINDOW
//
// MessageText:
//
// The window is not a child window.
//
ERROR_NOT_CHILD_WINDOW = 1442;
//
// MessageId: ERROR_INVALID_GW_COMMAND
//
// MessageText:
//
// Invalid GW_* command.
//
ERROR_INVALID_GW_COMMAND = 1443;
//
// MessageId: ERROR_INVALID_THREAD_ID
//
// MessageText:
//
// Invalid thread identifier.
//
ERROR_INVALID_THREAD_ID = 1444;
//
// MessageId: ERROR_NON_MDICHILD_WINDOW
//
// MessageText:
//
// Cannot process a message from a window that is not a multiple document interface (MDI) window.
//
ERROR_NON_MDICHILD_WINDOW = 1445;
//
// MessageId: ERROR_POPUP_ALREADY_ACTIVE
//
// MessageText:
//
// Popup menu already active.
//
ERROR_POPUP_ALREADY_ACTIVE = 1446;
//
// MessageId: ERROR_NO_SCROLLBARS
//
// MessageText:
//
// The window does not have scroll bars.
//
ERROR_NO_SCROLLBARS = 1447;
//
// MessageId: ERROR_INVALID_SCROLLBAR_RANGE
//
// MessageText:
//
// Scroll bar range cannot be greater than MAXLONG.
//
ERROR_INVALID_SCROLLBAR_RANGE = 1448;
//
// MessageId: ERROR_INVALID_SHOWWIN_COMMAND
//
// MessageText:
//
// Cannot show or remove the window in the way specified.
//
ERROR_INVALID_SHOWWIN_COMMAND = 1449;
//
// MessageId: ERROR_NO_SYSTEM_RESOURCES
//
// MessageText:
//
// Insufficient system resources exist to complete the requested service.
//
ERROR_NO_SYSTEM_RESOURCES = 1450;
//
// MessageId: ERROR_NONPAGED_SYSTEM_RESOURCES
//
// MessageText:
//
// Insufficient system resources exist to complete the requested service.
//
ERROR_NONPAGED_SYSTEM_RESOURCES = 1451;
//
// MessageId: ERROR_PAGED_SYSTEM_RESOURCES
//
// MessageText:
//
// Insufficient system resources exist to complete the requested service.
//
ERROR_PAGED_SYSTEM_RESOURCES = 1452;
//
// MessageId: ERROR_WORKING_SET_QUOTA
//
// MessageText:
//
// Insufficient quota to complete the requested service.
//
ERROR_WORKING_SET_QUOTA = 1453;
//
// MessageId: ERROR_PAGEFILE_QUOTA
//
// MessageText:
//
// Insufficient quota to complete the requested service.
//
ERROR_PAGEFILE_QUOTA = 1454;
//
// MessageId: ERROR_COMMITMENT_LIMIT
//
// MessageText:
//
// The paging file is too small for this operation to complete.
//
ERROR_COMMITMENT_LIMIT = 1455;
//
// MessageId: ERROR_MENU_ITEM_NOT_FOUND
//
// MessageText:
//
// A menu item was not found.
//
ERROR_MENU_ITEM_NOT_FOUND = 1456;
//
// MessageId: ERROR_INVALID_KEYBOARD_HANDLE
//
// MessageText:
//
// Invalid keyboard layout handle.
//
ERROR_INVALID_KEYBOARD_HANDLE = 1457;
//
// MessageId: ERROR_HOOK_TYPE_NOT_ALLOWED
//
// MessageText:
//
// Hook type not allowed.
//
ERROR_HOOK_TYPE_NOT_ALLOWED = 1458;
//
// MessageId: ERROR_REQUIRES_INTERACTIVE_WINDOWSTATION
//
// MessageText:
//
// This operation requires an interactive window station.
//
ERROR_REQUIRES_INTERACTIVE_WINDOWSTATION = 1459;
//
// MessageId: ERROR_TIMEOUT
//
// MessageText:
//
// This operation returned because the timeout period expired.
//
ERROR_TIMEOUT = 1460;
//
// MessageId: ERROR_INVALID_MONITOR_HANDLE
//
// MessageText:
//
// Invalid monitor handle.
//
ERROR_INVALID_MONITOR_HANDLE = 1461;
// End of WinUser error codes
///////////////////////////
// //
// Eventlog Status Codes //
// //
///////////////////////////
//
// MessageId: ERROR_EVENTLOG_FILE_CORRUPT
//
// MessageText:
//
// The event log file is corrupted.
//
ERROR_EVENTLOG_FILE_CORRUPT = 1500;
//
// MessageId: ERROR_EVENTLOG_CANT_START
//
// MessageText:
//
// No event log file could be opened, so the event logging service did not start.
//
ERROR_EVENTLOG_CANT_START = 1501;
//
// MessageId: ERROR_LOG_FILE_FULL
//
// MessageText:
//
// The event log file is full.
//
ERROR_LOG_FILE_FULL = 1502;
//
// MessageId: ERROR_EVENTLOG_FILE_CHANGED
//
// MessageText:
//
// The event log file has changed between read operations.
//
ERROR_EVENTLOG_FILE_CHANGED = 1503;
// End of eventlog error codes
///////////////////////////
// //
// MSI Error Codes //
// //
///////////////////////////
//
// MessageId: ERROR_INSTALL_SERVICE_FAILURE
//
// MessageText:
//
// The Windows Installer service could not be accessed. Contact your support personnel to verify that the Windows Installer service is properly registered.
//
ERROR_INSTALL_SERVICE_FAILURE = 1601;
//
// MessageId: ERROR_INSTALL_USEREXIT
//
// MessageText:
//
// User cancelled installation.
//
ERROR_INSTALL_USEREXIT = 1602;
//
// MessageId: ERROR_INSTALL_FAILURE
//
// MessageText:
//
// Fatal error during installation.
//
ERROR_INSTALL_FAILURE = 1603;
//
// MessageId: ERROR_INSTALL_SUSPEND
//
// MessageText:
//
// Installation suspended, incomplete.
//
ERROR_INSTALL_SUSPEND = 1604;
//
// MessageId: ERROR_UNKNOWN_PRODUCT
//
// MessageText:
//
// This action is only valid for products that are currently installed.
//
ERROR_UNKNOWN_PRODUCT = 1605;
//
// MessageId: ERROR_UNKNOWN_FEATURE
//
// MessageText:
//
// Feature ID not registered.
//
ERROR_UNKNOWN_FEATURE = 1606;
//
// MessageId: ERROR_UNKNOWN_COMPONENT
//
// MessageText:
//
// Component ID not registered.
//
ERROR_UNKNOWN_COMPONENT = 1607;
//
// MessageId: ERROR_UNKNOWN_PROPERTY
//
// MessageText:
//
// Unknown property.
//
ERROR_UNKNOWN_PROPERTY = 1608;
//
// MessageId: ERROR_INVALID_HANDLE_STATE
//
// MessageText:
//
// Handle is in an invalid state.
//
ERROR_INVALID_HANDLE_STATE = 1609;
//
// MessageId: ERROR_BAD_CONFIGURATION
//
// MessageText:
//
// The configuration data for this product is corrupt. Contact your support personnel.
//
ERROR_BAD_CONFIGURATION = 1610;
//
// MessageId: ERROR_INDEX_ABSENT
//
// MessageText:
//
// Component qualifier not present.
//
ERROR_INDEX_ABSENT = 1611;
//
// MessageId: ERROR_INSTALL_SOURCE_ABSENT
//
// MessageText:
//
// The installation source for this product is not available. Verify that the source exists and that you can access it.
//
ERROR_INSTALL_SOURCE_ABSENT = 1612;
//
// MessageId: ERROR_INSTALL_PACKAGE_VERSION
//
// MessageText:
//
// This installation package cannot be installed by the Windows Installer service. You must install a Windows service pack that contains a newer version of the Windows Installer service.
//
ERROR_INSTALL_PACKAGE_VERSION = 1613;
//
// MessageId: ERROR_PRODUCT_UNINSTALLED
//
// MessageText:
//
// Product is uninstalled.
//
ERROR_PRODUCT_UNINSTALLED = 1614;
//
// MessageId: ERROR_BAD_QUERY_SYNTAX
//
// MessageText:
//
// SQL query syntax invalid or unsupported.
//
ERROR_BAD_QUERY_SYNTAX = 1615;
//
// MessageId: ERROR_INVALID_FIELD
//
// MessageText:
//
// Record field does not exist.
//
ERROR_INVALID_FIELD = 1616;
//
// MessageId: ERROR_DEVICE_REMOVED
//
// MessageText:
//
// The device has been removed.
//
ERROR_DEVICE_REMOVED = 1617;
//
// MessageId: ERROR_INSTALL_ALREADY_RUNNING
//
// MessageText:
//
// Another installation is already in progress. Complete that installation before proceeding with this install.
//
ERROR_INSTALL_ALREADY_RUNNING = 1618;
//
// MessageId: ERROR_INSTALL_PACKAGE_OPEN_FAILED
//
// MessageText:
//
// This installation package could not be opened. Verify that the package exists and that you can access it, or contact the application vendor to verify that this is a valid Windows Installer package.
//
ERROR_INSTALL_PACKAGE_OPEN_FAILED = 1619;
//
// MessageId: ERROR_INSTALL_PACKAGE_INVALID
//
// MessageText:
//
// This installation package could not be opened. Contact the application vendor to verify that this is a valid Windows Installer package.
//
ERROR_INSTALL_PACKAGE_INVALID = 1620;
//
// MessageId: ERROR_INSTALL_UI_FAILURE
//
// MessageText:
//
// There was an error starting the Windows Installer service user interface. Contact your support personnel.
//
ERROR_INSTALL_UI_FAILURE = 1621;
//
// MessageId: ERROR_INSTALL_LOG_FAILURE
//
// MessageText:
//
// Error opening installation log file. Verify that the specified log file location exists and that you can write to it.
//
ERROR_INSTALL_LOG_FAILURE = 1622;
//
// MessageId: ERROR_INSTALL_LANGUAGE_UNSUPPORTED
//
// MessageText:
//
// The language of this installation package is not supported by your system.
//
ERROR_INSTALL_LANGUAGE_UNSUPPORTED = 1623;
//
// MessageId: ERROR_INSTALL_TRANSFORM_FAILURE
//
// MessageText:
//
// Error applying transforms. Verify that the specified transform paths are valid.
//
ERROR_INSTALL_TRANSFORM_FAILURE = 1624;
//
// MessageId: ERROR_INSTALL_PACKAGE_REJECTED
//
// MessageText:
//
// This installation is forbidden by system policy. Contact your system administrator.
//
ERROR_INSTALL_PACKAGE_REJECTED = 1625;
//
// MessageId: ERROR_FUNCTION_NOT_CALLED
//
// MessageText:
//
// Function could not be executed.
//
ERROR_FUNCTION_NOT_CALLED = 1626;
//
// MessageId: ERROR_FUNCTION_FAILED
//
// MessageText:
//
// Function failed during execution.
//
ERROR_FUNCTION_FAILED = 1627;
//
// MessageId: ERROR_INVALID_TABLE
//
// MessageText:
//
// Invalid or unknown table specified.
//
ERROR_INVALID_TABLE = 1628;
//
// MessageId: ERROR_DATATYPE_MISMATCH
//
// MessageText:
//
// Data supplied is of wrong type.
//
ERROR_DATATYPE_MISMATCH = 1629;
//
// MessageId: ERROR_UNSUPPORTED_TYPE
//
// MessageText:
//
// Data of this type is not supported.
//
ERROR_UNSUPPORTED_TYPE = 1630;
//
// MessageId: ERROR_CREATE_FAILED
//
// MessageText:
//
// The Windows Installer service failed to start. Contact your support personnel.
//
ERROR_CREATE_FAILED = 1631;
//
// MessageId: ERROR_INSTALL_TEMP_UNWRITABLE
//
// MessageText:
//
// The temp folder is either full or inaccessible. Verify that the temp folder exists and that you can write to it.
//
ERROR_INSTALL_TEMP_UNWRITABLE = 1632;
//
// MessageId: ERROR_INSTALL_PLATFORM_UNSUPPORTED
//
// MessageText:
//
// This installation package is not supported by this processor type. Contact your product vendor.
//
ERROR_INSTALL_PLATFORM_UNSUPPORTED = 1633;
//
// MessageId: ERROR_INSTALL_NOTUSED
//
// MessageText:
//
// Component not used on this computer.
//
ERROR_INSTALL_NOTUSED = 1634;
//
// MessageId: ERROR_PATCH_PACKAGE_OPEN_FAILED
//
// MessageText:
//
// This patch package could not be opened. Verify that the patch package exists and that you can access it, or contact the application vendor to verify that this is a valid Windows Installer patch package.
//
ERROR_PATCH_PACKAGE_OPEN_FAILED = 1635;
//
// MessageId: ERROR_PATCH_PACKAGE_INVALID
//
// MessageText:
//
// This patch package could not be opened. Contact the application vendor to verify that this is a valid Windows Installer patch package.
//
ERROR_PATCH_PACKAGE_INVALID = 1636;
//
// MessageId: ERROR_PATCH_PACKAGE_UNSUPPORTED
//
// MessageText:
//
// This patch package cannot be processed by the Windows Installer service. You must install a Windows service pack that contains a newer version of the Windows Installer service.
//
ERROR_PATCH_PACKAGE_UNSUPPORTED = 1637;
//
// MessageId: ERROR_PRODUCT_VERSION
//
// MessageText:
//
// Another version of this product is already installed. Installation of this version cannot continue. To configure or remove the existing version of this product, use Add/Remove Programs on the Control Panel.
//
ERROR_PRODUCT_VERSION = 1638;
//
// MessageId: ERROR_INVALID_COMMAND_LINE
//
// MessageText:
//
// Invalid command line argument. Consult the Windows Installer SDK for detailed command line help.
//
ERROR_INVALID_COMMAND_LINE = 1639;
//
// MessageId: ERROR_INSTALL_REMOTE_DISALLOWED
//
// MessageText:
//
// Only administrators have permission to add, remove, or configure server software during a Terminal services remote session. If you want to install or configure software on the server, contact your network administrator.
//
ERROR_INSTALL_REMOTE_DISALLOWED = 1640;
//
// MessageId: ERROR_SUCCESS_REBOOT_INITIATED
//
// MessageText:
//
// The requested operation completed successfully. The system will be restarted so the changes can take effect.
//
ERROR_SUCCESS_REBOOT_INITIATED = 1641;
//
// MessageId: ERROR_PATCH_TARGET_NOT_FOUND
//
// MessageText:
//
// The upgrade patch cannot be installed by the Windows Installer service because the program to be upgraded may be missing, or the upgrade patch may update a different version of the program. Verify that the program to be upgraded exists on your computer and that you have the correct upgrade patch.
//
ERROR_PATCH_TARGET_NOT_FOUND = 1642;
// End of MSI error codes
///////////////////////////
// //
// RPC Status Codes //
// //
///////////////////////////
//
// MessageId: RPC_S_INVALID_STRING_BINDING
//
// MessageText:
//
// The string binding is invalid.
//
RPC_S_INVALID_STRING_BINDING = 1700;
//
// MessageId: RPC_S_WRONG_KIND_OF_BINDING
//
// MessageText:
//
// The binding handle is not the correct type.
//
RPC_S_WRONG_KIND_OF_BINDING = 1701;
//
// MessageId: RPC_S_INVALID_BINDING
//
// MessageText:
//
// The binding handle is invalid.
//
RPC_S_INVALID_BINDING = 1702;
//
// MessageId: RPC_S_PROTSEQ_NOT_SUPPORTED
//
// MessageText:
//
// The RPC protocol sequence is not supported.
//
RPC_S_PROTSEQ_NOT_SUPPORTED = 1703;
//
// MessageId: RPC_S_INVALID_RPC_PROTSEQ
//
// MessageText:
//
// The RPC protocol sequence is invalid.
//
RPC_S_INVALID_RPC_PROTSEQ = 1704;
//
// MessageId: RPC_S_INVALID_STRING_UUID
//
// MessageText:
//
// The string universal unique identifier (UUID) is invalid.
//
RPC_S_INVALID_STRING_UUID = 1705;
//
// MessageId: RPC_S_INVALID_ENDPOINT_FORMAT
//
// MessageText:
//
// The endpoint format is invalid.
//
RPC_S_INVALID_ENDPOINT_FORMAT = 1706;
//
// MessageId: RPC_S_INVALID_NET_ADDR
//
// MessageText:
//
// The network address is invalid.
//
RPC_S_INVALID_NET_ADDR = 1707;
//
// MessageId: RPC_S_NO_ENDPOINT_FOUND
//
// MessageText:
//
// No endpoint was found.
//
RPC_S_NO_ENDPOINT_FOUND = 1708;
//
// MessageId: RPC_S_INVALID_TIMEOUT
//
// MessageText:
//
// The timeout value is invalid.
//
RPC_S_INVALID_TIMEOUT = 1709;
//
// MessageId: RPC_S_OBJECT_NOT_FOUND
//
// MessageText:
//
// The object universal unique identifier (UUID) was not found.
//
RPC_S_OBJECT_NOT_FOUND = 1710;
//
// MessageId: RPC_S_ALREADY_REGISTERED
//
// MessageText:
//
// The object universal unique identifier (UUID) has already been registered.
//
RPC_S_ALREADY_REGISTERED = 1711;
//
// MessageId: RPC_S_TYPE_ALREADY_REGISTERED
//
// MessageText:
//
// The type universal unique identifier (UUID) has already been registered.
//
RPC_S_TYPE_ALREADY_REGISTERED = 1712;
//
// MessageId: RPC_S_ALREADY_LISTENING
//
// MessageText:
//
// The RPC server is already listening.
//
RPC_S_ALREADY_LISTENING = 1713;
//
// MessageId: RPC_S_NO_PROTSEQS_REGISTERED
//
// MessageText:
//
// No protocol sequences have been registered.
//
RPC_S_NO_PROTSEQS_REGISTERED = 1714;
//
// MessageId: RPC_S_NOT_LISTENING
//
// MessageText:
//
// The RPC server is not listening.
//
RPC_S_NOT_LISTENING = 1715;
//
// MessageId: RPC_S_UNKNOWN_MGR_TYPE
//
// MessageText:
//
// The manager type is unknown.
//
RPC_S_UNKNOWN_MGR_TYPE = 1716;
//
// MessageId: RPC_S_UNKNOWN_IF
//
// MessageText:
//
// The interface is unknown.
//
RPC_S_UNKNOWN_IF = 1717;
//
// MessageId: RPC_S_NO_BINDINGS
//
// MessageText:
//
// There are no bindings.
//
RPC_S_NO_BINDINGS = 1718;
//
// MessageId: RPC_S_NO_PROTSEQS
//
// MessageText:
//
// There are no protocol sequences.
//
RPC_S_NO_PROTSEQS = 1719;
//
// MessageId: RPC_S_CANT_CREATE_ENDPOINT
//
// MessageText:
//
// The endpoint cannot be created.
//
RPC_S_CANT_CREATE_ENDPOINT = 1720;
//
// MessageId: RPC_S_OUT_OF_RESOURCES
//
// MessageText:
//
// Not enough resources are available to complete this operation.
//
RPC_S_OUT_OF_RESOURCES = 1721;
//
// MessageId: RPC_S_SERVER_UNAVAILABLE
//
// MessageText:
//
// The RPC server is unavailable.
//
RPC_S_SERVER_UNAVAILABLE = 1722;
//
// MessageId: RPC_S_SERVER_TOO_BUSY
//
// MessageText:
//
// The RPC server is too busy to complete this operation.
//
RPC_S_SERVER_TOO_BUSY = 1723;
//
// MessageId: RPC_S_INVALID_NETWORK_OPTIONS
//
// MessageText:
//
// The network options are invalid.
//
RPC_S_INVALID_NETWORK_OPTIONS = 1724;
//
// MessageId: RPC_S_NO_CALL_ACTIVE
//
// MessageText:
//
// There are no remote procedure calls active on this thread.
//
RPC_S_NO_CALL_ACTIVE = 1725;
//
// MessageId: RPC_S_CALL_FAILED
//
// MessageText:
//
// The remote procedure call failed.
//
RPC_S_CALL_FAILED = 1726;
//
// MessageId: RPC_S_CALL_FAILED_DNE
//
// MessageText:
//
// The remote procedure call failed and did not execute.
//
RPC_S_CALL_FAILED_DNE = 1727;
//
// MessageId: RPC_S_PROTOCOL_ERROR
//
// MessageText:
//
// A remote procedure call (RPC) protocol error occurred.
//
RPC_S_PROTOCOL_ERROR = 1728;
//
// MessageId: RPC_S_UNSUPPORTED_TRANS_SYN
//
// MessageText:
//
// The transfer syntax is not supported by the RPC server.
//
RPC_S_UNSUPPORTED_TRANS_SYN = 1730;
//
// MessageId: RPC_S_UNSUPPORTED_TYPE
//
// MessageText:
//
// The universal unique identifier (UUID) type is not supported.
//
RPC_S_UNSUPPORTED_TYPE = 1732;
//
// MessageId: RPC_S_INVALID_TAG
//
// MessageText:
//
// The tag is invalid.
//
RPC_S_INVALID_TAG = 1733;
//
// MessageId: RPC_S_INVALID_BOUND
//
// MessageText:
//
// The array bounds are invalid.
//
RPC_S_INVALID_BOUND = 1734;
//
// MessageId: RPC_S_NO_ENTRY_NAME
//
// MessageText:
//
// The binding does not contain an entry name.
//
RPC_S_NO_ENTRY_NAME = 1735;
//
// MessageId: RPC_S_INVALID_NAME_SYNTAX
//
// MessageText:
//
// The name syntax is invalid.
//
RPC_S_INVALID_NAME_SYNTAX = 1736;
//
// MessageId: RPC_S_UNSUPPORTED_NAME_SYNTAX
//
// MessageText:
//
// The name syntax is not supported.
//
RPC_S_UNSUPPORTED_NAME_SYNTAX = 1737;
//
// MessageId: RPC_S_UUID_NO_ADDRESS
//
// MessageText:
//
// No network address is available to use to construct a universal unique identifier (UUID).
//
RPC_S_UUID_NO_ADDRESS = 1739;
//
// MessageId: RPC_S_DUPLICATE_ENDPOINT
//
// MessageText:
//
// The endpoint is a duplicate.
//
RPC_S_DUPLICATE_ENDPOINT = 1740;
//
// MessageId: RPC_S_UNKNOWN_AUTHN_TYPE
//
// MessageText:
//
// The authentication type is unknown.
//
RPC_S_UNKNOWN_AUTHN_TYPE = 1741;
//
// MessageId: RPC_S_MAX_CALLS_TOO_SMALL
//
// MessageText:
//
// The maximum number of calls is too small.
//
RPC_S_MAX_CALLS_TOO_SMALL = 1742;
//
// MessageId: RPC_S_STRING_TOO_LONG
//
// MessageText:
//
// The string is too long.
//
RPC_S_STRING_TOO_LONG = 1743;
//
// MessageId: RPC_S_PROTSEQ_NOT_FOUND
//
// MessageText:
//
// The RPC protocol sequence was not found.
//
RPC_S_PROTSEQ_NOT_FOUND = 1744;
//
// MessageId: RPC_S_PROCNUM_OUT_OF_RANGE
//
// MessageText:
//
// The procedure number is out of range.
//
RPC_S_PROCNUM_OUT_OF_RANGE = 1745;
//
// MessageId: RPC_S_BINDING_HAS_NO_AUTH
//
// MessageText:
//
// The binding does not contain any authentication information.
//
RPC_S_BINDING_HAS_NO_AUTH = 1746;
//
// MessageId: RPC_S_UNKNOWN_AUTHN_SERVICE
//
// MessageText:
//
// The authentication service is unknown.
//
RPC_S_UNKNOWN_AUTHN_SERVICE = 1747;
//
// MessageId: RPC_S_UNKNOWN_AUTHN_LEVEL
//
// MessageText:
//
// The authentication level is unknown.
//
RPC_S_UNKNOWN_AUTHN_LEVEL = 1748;
//
// MessageId: RPC_S_INVALID_AUTH_IDENTITY
//
// MessageText:
//
// The security context is invalid.
//
RPC_S_INVALID_AUTH_IDENTITY = 1749;
//
// MessageId: RPC_S_UNKNOWN_AUTHZ_SERVICE
//
// MessageText:
//
// The authorization service is unknown.
//
RPC_S_UNKNOWN_AUTHZ_SERVICE = 1750;
//
// MessageId: EPT_S_INVALID_ENTRY
//
// MessageText:
//
// The entry is invalid.
//
EPT_S_INVALID_ENTRY = 1751;
//
// MessageId: EPT_S_CANT_PERFORM_OP
//
// MessageText:
//
// The server endpoint cannot perform the operation.
//
EPT_S_CANT_PERFORM_OP = 1752;
//
// MessageId: EPT_S_NOT_REGISTERED
//
// MessageText:
//
// There are no more endpoints available from the endpoint mapper.
//
EPT_S_NOT_REGISTERED = 1753;
//
// MessageId: RPC_S_NOTHING_TO_EXPORT
//
// MessageText:
//
// No interfaces have been exported.
//
RPC_S_NOTHING_TO_EXPORT = 1754;
//
// MessageId: RPC_S_INCOMPLETE_NAME
//
// MessageText:
//
// The entry name is incomplete.
//
RPC_S_INCOMPLETE_NAME = 1755;
//
// MessageId: RPC_S_INVALID_VERS_OPTION
//
// MessageText:
//
// The version option is invalid.
//
RPC_S_INVALID_VERS_OPTION = 1756;
//
// MessageId: RPC_S_NO_MORE_MEMBERS
//
// MessageText:
//
// There are no more members.
//
RPC_S_NO_MORE_MEMBERS = 1757;
//
// MessageId: RPC_S_NOT_ALL_OBJS_UNEXPORTED
//
// MessageText:
//
// There is nothing to unexport.
//
RPC_S_NOT_ALL_OBJS_UNEXPORTED = 1758;
//
// MessageId: RPC_S_INTERFACE_NOT_FOUND
//
// MessageText:
//
// The interface was not found.
//
RPC_S_INTERFACE_NOT_FOUND = 1759;
//
// MessageId: RPC_S_ENTRY_ALREADY_EXISTS
//
// MessageText:
//
// The entry already exists.
//
RPC_S_ENTRY_ALREADY_EXISTS = 1760;
//
// MessageId: RPC_S_ENTRY_NOT_FOUND
//
// MessageText:
//
// The entry is not found.
//
RPC_S_ENTRY_NOT_FOUND = 1761;
//
// MessageId: RPC_S_NAME_SERVICE_UNAVAILABLE
//
// MessageText:
//
// The name service is unavailable.
//
RPC_S_NAME_SERVICE_UNAVAILABLE = 1762;
//
// MessageId: RPC_S_INVALID_NAF_ID
//
// MessageText:
//
// The network address family is invalid.
//
RPC_S_INVALID_NAF_ID = 1763;
//
// MessageId: RPC_S_CANNOT_SUPPORT
//
// MessageText:
//
// The requested operation is not supported.
//
RPC_S_CANNOT_SUPPORT = 1764;
//
// MessageId: RPC_S_NO_CONTEXT_AVAILABLE
//
// MessageText:
//
// No security context is available to allow impersonation.
//
RPC_S_NO_CONTEXT_AVAILABLE = 1765;
//
// MessageId: RPC_S_INTERNAL_ERROR
//
// MessageText:
//
// An internal error occurred in a remote procedure call (RPC).
//
RPC_S_INTERNAL_ERROR = 1766;
//
// MessageId: RPC_S_ZERO_DIVIDE
//
// MessageText:
//
// The RPC server attempted an integer division by zero.
//
RPC_S_ZERO_DIVIDE = 1767;
//
// MessageId: RPC_S_ADDRESS_ERROR
//
// MessageText:
//
// An addressing error occurred in the RPC server.
//
RPC_S_ADDRESS_ERROR = 1768;
//
// MessageId: RPC_S_FP_DIV_ZERO
//
// MessageText:
//
// A floating-point operation at the RPC server caused a division by zero.
//
RPC_S_FP_DIV_ZERO = 1769;
//
// MessageId: RPC_S_FP_UNDERFLOW
//
// MessageText:
//
// A floating-point underflow occurred at the RPC server.
//
RPC_S_FP_UNDERFLOW = 1770;
//
// MessageId: RPC_S_FP_OVERFLOW
//
// MessageText:
//
// A floating-point overflow occurred at the RPC server.
//
RPC_S_FP_OVERFLOW = 1771;
//
// MessageId: RPC_X_NO_MORE_ENTRIES
//
// MessageText:
//
// The list of RPC servers available for the binding of auto handles has been exhausted.
//
RPC_X_NO_MORE_ENTRIES = 1772;
//
// MessageId: RPC_X_SS_CHAR_TRANS_OPEN_FAIL
//
// MessageText:
//
// Unable to open the character translation table file.
//
RPC_X_SS_CHAR_TRANS_OPEN_FAIL = 1773;
//
// MessageId: RPC_X_SS_CHAR_TRANS_SHORT_FILE
//
// MessageText:
//
// The file containing the character translation table has fewer than 512 bytes.
//
RPC_X_SS_CHAR_TRANS_SHORT_FILE = 1774;
//
// MessageId: RPC_X_SS_IN_NULL_CONTEXT
//
// MessageText:
//
// A null context handle was passed from the client to the host during a remote procedure call.
//
RPC_X_SS_IN_NULL_CONTEXT = 1775;
//
// MessageId: RPC_X_SS_CONTEXT_DAMAGED
//
// MessageText:
//
// The context handle changed during a remote procedure call.
//
RPC_X_SS_CONTEXT_DAMAGED = 1777;
//
// MessageId: RPC_X_SS_HANDLES_MISMATCH
//
// MessageText:
//
// The binding handles passed to a remote procedure call do not match.
//
RPC_X_SS_HANDLES_MISMATCH = 1778;
//
// MessageId: RPC_X_SS_CANNOT_GET_CALL_HANDLE
//
// MessageText:
//
// The stub is unable to get the remote procedure call handle.
//
RPC_X_SS_CANNOT_GET_CALL_HANDLE = 1779;
//
// MessageId: RPC_X_NULL_REF_POINTER
//
// MessageText:
//
// A null reference pointer was passed to the stub.
//
RPC_X_NULL_REF_POINTER = 1780;
//
// MessageId: RPC_X_ENUM_VALUE_OUT_OF_RANGE
//
// MessageText:
//
// The enumeration value is out of range.
//
RPC_X_ENUM_VALUE_OUT_OF_RANGE = 1781;
//
// MessageId: RPC_X_BYTE_COUNT_TOO_SMALL
//
// MessageText:
//
// The byte count is too small.
//
RPC_X_BYTE_COUNT_TOO_SMALL = 1782;
//
// MessageId: RPC_X_BAD_STUB_DATA
//
// MessageText:
//
// The stub received bad data.
//
RPC_X_BAD_STUB_DATA = 1783;
//
// MessageId: ERROR_INVALID_USER_BUFFER
//
// MessageText:
//
// The supplied user buffer is not valid for the requested operation.
//
ERROR_INVALID_USER_BUFFER = 1784;
//
// MessageId: ERROR_UNRECOGNIZED_MEDIA
//
// MessageText:
//
// The disk media is not recognized. It may not be formatted.
//
ERROR_UNRECOGNIZED_MEDIA = 1785;
//
// MessageId: ERROR_NO_TRUST_LSA_SECRET
//
// MessageText:
//
// The workstation does not have a trust secret.
//
ERROR_NO_TRUST_LSA_SECRET = 1786;
//
// MessageId: ERROR_NO_TRUST_SAM_ACCOUNT
//
// MessageText:
//
// The security database on the server does not have a computer account for this workstation trust relationship.
//
ERROR_NO_TRUST_SAM_ACCOUNT = 1787;
//
// MessageId: ERROR_TRUSTED_DOMAIN_FAILURE
//
// MessageText:
//
// The trust relationship between the primary domain and the trusted domain failed.
//
ERROR_TRUSTED_DOMAIN_FAILURE = 1788;
//
// MessageId: ERROR_TRUSTED_RELATIONSHIP_FAILURE
//
// MessageText:
//
// The trust relationship between this workstation and the primary domain failed.
//
ERROR_TRUSTED_RELATIONSHIP_FAILURE = 1789;
//
// MessageId: ERROR_TRUST_FAILURE
//
// MessageText:
//
// The network logon failed.
//
ERROR_TRUST_FAILURE = 1790;
//
// MessageId: RPC_S_CALL_IN_PROGRESS
//
// MessageText:
//
// A remote procedure call is already in progress for this thread.
//
RPC_S_CALL_IN_PROGRESS = 1791;
//
// MessageId: ERROR_NETLOGON_NOT_STARTED
//
// MessageText:
//
// An attempt was made to logon, but the network logon service was not started.
//
ERROR_NETLOGON_NOT_STARTED = 1792;
//
// MessageId: ERROR_ACCOUNT_EXPIRED
//
// MessageText:
//
// The user's account has expired.
//
ERROR_ACCOUNT_EXPIRED = 1793;
//
// MessageId: ERROR_REDIRECTOR_HAS_OPEN_HANDLES
//
// MessageText:
//
// The redirector is in use and cannot be unloaded.
//
ERROR_REDIRECTOR_HAS_OPEN_HANDLES = 1794;
//
// MessageId: ERROR_PRINTER_DRIVER_ALREADY_INSTALLED
//
// MessageText:
//
// The specified printer driver is already installed.
//
ERROR_PRINTER_DRIVER_ALREADY_INSTALLED = 1795;
//
// MessageId: ERROR_UNKNOWN_PORT
//
// MessageText:
//
// The specified port is unknown.
//
ERROR_UNKNOWN_PORT = 1796;
//
// MessageId: ERROR_UNKNOWN_PRINTER_DRIVER
//
// MessageText:
//
// The printer driver is unknown.
//
ERROR_UNKNOWN_PRINTER_DRIVER = 1797;
//
// MessageId: ERROR_UNKNOWN_PRINTPROCESSOR
//
// MessageText:
//
// The print processor is unknown.
//
ERROR_UNKNOWN_PRINTPROCESSOR = 1798;
//
// MessageId: ERROR_INVALID_SEPARATOR_FILE
//
// MessageText:
//
// The specified separator file is invalid.
//
ERROR_INVALID_SEPARATOR_FILE = 1799;
//
// MessageId: ERROR_INVALID_PRIORITY
//
// MessageText:
//
// The specified priority is invalid.
//
ERROR_INVALID_PRIORITY = 1800;
//
// MessageId: ERROR_INVALID_PRINTER_NAME
//
// MessageText:
//
// The printer name is invalid.
//
ERROR_INVALID_PRINTER_NAME = 1801;
//
// MessageId: ERROR_PRINTER_ALREADY_EXISTS
//
// MessageText:
//
// The printer already exists.
//
ERROR_PRINTER_ALREADY_EXISTS = 1802;
//
// MessageId: ERROR_INVALID_PRINTER_COMMAND
//
// MessageText:
//
// The printer command is invalid.
//
ERROR_INVALID_PRINTER_COMMAND = 1803;
//
// MessageId: ERROR_INVALID_DATATYPE
//
// MessageText:
//
// The specified datatype is invalid.
//
ERROR_INVALID_DATATYPE = 1804;
//
// MessageId: ERROR_INVALID_ENVIRONMENT
//
// MessageText:
//
// The environment specified is invalid.
//
ERROR_INVALID_ENVIRONMENT = 1805;
//
// MessageId: RPC_S_NO_MORE_BINDINGS
//
// MessageText:
//
// There are no more bindings.
//
RPC_S_NO_MORE_BINDINGS = 1806;
//
// MessageId: ERROR_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT
//
// MessageText:
//
// The account used is an interdomain trust account. Use your global user account or local user account to access this server.
//
ERROR_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT = 1807;
//
// MessageId: ERROR_NOLOGON_WORKSTATION_TRUST_ACCOUNT
//
// MessageText:
//
// The account used is a computer account. Use your global user account or local user account to access this server.
//
ERROR_NOLOGON_WORKSTATION_TRUST_ACCOUNT = 1808;
//
// MessageId: ERROR_NOLOGON_SERVER_TRUST_ACCOUNT
//
// MessageText:
//
// The account used is a server trust account. Use your global user account or local user account to access this server.
//
ERROR_NOLOGON_SERVER_TRUST_ACCOUNT = 1809;
//
// MessageId: ERROR_DOMAIN_TRUST_INCONSISTENT
//
// MessageText:
//
// The name or security ID (SID) of the domain specified is inconsistent with the trust information for that domain.
//
ERROR_DOMAIN_TRUST_INCONSISTENT = 1810;
//
// MessageId: ERROR_SERVER_HAS_OPEN_HANDLES
//
// MessageText:
//
// The server is in use and cannot be unloaded.
//
ERROR_SERVER_HAS_OPEN_HANDLES = 1811;
//
// MessageId: ERROR_RESOURCE_DATA_NOT_FOUND
//
// MessageText:
//
// The specified image file did not contain a resource section.
//
ERROR_RESOURCE_DATA_NOT_FOUND = 1812;
//
// MessageId: ERROR_RESOURCE_TYPE_NOT_FOUND
//
// MessageText:
//
// The specified resource type cannot be found in the image file.
//
ERROR_RESOURCE_TYPE_NOT_FOUND = 1813;
//
// MessageId: ERROR_RESOURCE_NAME_NOT_FOUND
//
// MessageText:
//
// The specified resource name cannot be found in the image file.
//
ERROR_RESOURCE_NAME_NOT_FOUND = 1814;
//
// MessageId: ERROR_RESOURCE_LANG_NOT_FOUND
//
// MessageText:
//
// The specified resource language ID cannot be found in the image file.
//
ERROR_RESOURCE_LANG_NOT_FOUND = 1815;
//
// MessageId: ERROR_NOT_ENOUGH_QUOTA
//
// MessageText:
//
// Not enough quota is available to process this command.
//
ERROR_NOT_ENOUGH_QUOTA = 1816;
//
// MessageId: RPC_S_NO_INTERFACES
//
// MessageText:
//
// No interfaces have been registered.
//
RPC_S_NO_INTERFACES = 1817;
//
// MessageId: RPC_S_CALL_CANCELLED
//
// MessageText:
//
// The remote procedure call was cancelled.
//
RPC_S_CALL_CANCELLED = 1818;
//
// MessageId: RPC_S_BINDING_INCOMPLETE
//
// MessageText:
//
// The binding handle does not contain all required information.
//
RPC_S_BINDING_INCOMPLETE = 1819;
//
// MessageId: RPC_S_COMM_FAILURE
//
// MessageText:
//
// A communications failure occurred during a remote procedure call.
//
RPC_S_COMM_FAILURE = 1820;
//
// MessageId: RPC_S_UNSUPPORTED_AUTHN_LEVEL
//
// MessageText:
//
// The requested authentication level is not supported.
//
RPC_S_UNSUPPORTED_AUTHN_LEVEL = 1821;
//
// MessageId: RPC_S_NO_PRINC_NAME
//
// MessageText:
//
// No principal name registered.
//
RPC_S_NO_PRINC_NAME = 1822;
//
// MessageId: RPC_S_NOT_RPC_ERROR
//
// MessageText:
//
// The error specified is not a valid Windows RPC error code.
//
RPC_S_NOT_RPC_ERROR = 1823;
//
// MessageId: RPC_S_UUID_LOCAL_ONLY
//
// MessageText:
//
// A UUID that is valid only on this computer has been allocated.
//
RPC_S_UUID_LOCAL_ONLY = 1824;
//
// MessageId: RPC_S_SEC_PKG_ERROR
//
// MessageText:
//
// A security package specific error occurred.
//
RPC_S_SEC_PKG_ERROR = 1825;
//
// MessageId: RPC_S_NOT_CANCELLED
//
// MessageText:
//
// Thread is not canceled.
//
RPC_S_NOT_CANCELLED = 1826;
//
// MessageId: RPC_X_INVALID_ES_ACTION
//
// MessageText:
//
// Invalid operation on the encoding/decoding handle.
//
RPC_X_INVALID_ES_ACTION = 1827;
//
// MessageId: RPC_X_WRONG_ES_VERSION
//
// MessageText:
//
// Incompatible version of the serializing package.
//
RPC_X_WRONG_ES_VERSION = 1828;
//
// MessageId: RPC_X_WRONG_STUB_VERSION
//
// MessageText:
//
// Incompatible version of the RPC stub.
//
RPC_X_WRONG_STUB_VERSION = 1829;
//
// MessageId: RPC_X_INVALID_PIPE_OBJECT
//
// MessageText:
//
// The RPC pipe object is invalid or corrupted.
//
RPC_X_INVALID_PIPE_OBJECT = 1830;
//
// MessageId: RPC_X_WRONG_PIPE_ORDER
//
// MessageText:
//
// An invalid operation was attempted on an RPC pipe object.
//
RPC_X_WRONG_PIPE_ORDER = 1831;
//
// MessageId: RPC_X_WRONG_PIPE_VERSION
//
// MessageText:
//
// Unsupported RPC pipe version.
//
RPC_X_WRONG_PIPE_VERSION = 1832;
//
// MessageId: RPC_S_GROUP_MEMBER_NOT_FOUND
//
// MessageText:
//
// The group member was not found.
//
RPC_S_GROUP_MEMBER_NOT_FOUND = 1898;
//
// MessageId: EPT_S_CANT_CREATE
//
// MessageText:
//
// The endpoint mapper database entry could not be created.
//
EPT_S_CANT_CREATE = 1899;
//
// MessageId: RPC_S_INVALID_OBJECT
//
// MessageText:
//
// The object universal unique identifier (UUID) is the nil UUID.
//
RPC_S_INVALID_OBJECT = 1900;
//
// MessageId: ERROR_INVALID_TIME
//
// MessageText:
//
// The specified time is invalid.
//
ERROR_INVALID_TIME = 1901;
//
// MessageId: ERROR_INVALID_FORM_NAME
//
// MessageText:
//
// The specified form name is invalid.
//
ERROR_INVALID_FORM_NAME = 1902;
//
// MessageId: ERROR_INVALID_FORM_SIZE
//
// MessageText:
//
// The specified form size is invalid.
//
ERROR_INVALID_FORM_SIZE = 1903;
//
// MessageId: ERROR_ALREADY_WAITING
//
// MessageText:
//
// The specified printer handle is already being waited on
//
ERROR_ALREADY_WAITING = 1904;
//
// MessageId: ERROR_PRINTER_DELETED
//
// MessageText:
//
// The specified printer has been deleted.
//
ERROR_PRINTER_DELETED = 1905;
//
// MessageId: ERROR_INVALID_PRINTER_STATE
//
// MessageText:
//
// The state of the printer is invalid.
//
ERROR_INVALID_PRINTER_STATE = 1906;
//
// MessageId: ERROR_PASSWORD_MUST_CHANGE
//
// MessageText:
//
// The user's password must be changed before logging on the first time.
//
ERROR_PASSWORD_MUST_CHANGE = 1907;
//
// MessageId: ERROR_DOMAIN_CONTROLLER_NOT_FOUND
//
// MessageText:
//
// Could not find the domain controller for this domain.
//
ERROR_DOMAIN_CONTROLLER_NOT_FOUND = 1908;
//
// MessageId: ERROR_ACCOUNT_LOCKED_OUT
//
// MessageText:
//
// The referenced account is currently locked out and may not be logged on to.
//
ERROR_ACCOUNT_LOCKED_OUT = 1909;
//
// MessageId: OR_INVALID_OXID
//
// MessageText:
//
// The object exporter specified was not found.
//
OR_INVALID_OXID = 1910;
//
// MessageId: OR_INVALID_OID
//
// MessageText:
//
// The object specified was not found.
//
OR_INVALID_OID = 1911;
//
// MessageId: OR_INVALID_SET
//
// MessageText:
//
// The object resolver set specified was not found.
//
OR_INVALID_SET = 1912;
//
// MessageId: RPC_S_SEND_INCOMPLETE
//
// MessageText:
//
// Some data remains to be sent in the request buffer.
//
RPC_S_SEND_INCOMPLETE = 1913;
//
// MessageId: RPC_S_INVALID_ASYNC_HANDLE
//
// MessageText:
//
// Invalid asynchronous remote procedure call handle.
//
RPC_S_INVALID_ASYNC_HANDLE = 1914;
//
// MessageId: RPC_S_INVALID_ASYNC_CALL
//
// MessageText:
//
// Invalid asynchronous RPC call handle for this operation.
//
RPC_S_INVALID_ASYNC_CALL = 1915;
//
// MessageId: RPC_X_PIPE_CLOSED
//
// MessageText:
//
// The RPC pipe object has already been closed.
//
RPC_X_PIPE_CLOSED = 1916;
//
// MessageId: RPC_X_PIPE_DISCIPLINE_ERROR
//
// MessageText:
//
// The RPC call completed before all pipes were processed.
//
RPC_X_PIPE_DISCIPLINE_ERROR = 1917;
//
// MessageId: RPC_X_PIPE_EMPTY
//
// MessageText:
//
// No more data is available from the RPC pipe.
//
RPC_X_PIPE_EMPTY = 1918;
//
// MessageId: ERROR_NO_SITENAME
//
// MessageText:
//
// No site name is available for this machine.
//
ERROR_NO_SITENAME = 1919;
//
// MessageId: ERROR_CANT_ACCESS_FILE
//
// MessageText:
//
// The file can not be accessed by the system.
//
ERROR_CANT_ACCESS_FILE = 1920;
//
// MessageId: ERROR_CANT_RESOLVE_FILENAME
//
// MessageText:
//
// The name of the file cannot be resolved by the system.
//
ERROR_CANT_RESOLVE_FILENAME = 1921;
//
// MessageId: RPC_S_ENTRY_TYPE_MISMATCH
//
// MessageText:
//
// The entry is not of the expected type.
//
RPC_S_ENTRY_TYPE_MISMATCH = 1922;
//
// MessageId: RPC_S_NOT_ALL_OBJS_EXPORTED
//
// MessageText:
//
// Not all object UUIDs could be exported to the specified entry.
//
RPC_S_NOT_ALL_OBJS_EXPORTED = 1923;
//
// MessageId: RPC_S_INTERFACE_NOT_EXPORTED
//
// MessageText:
//
// Interface could not be exported to the specified entry.
//
RPC_S_INTERFACE_NOT_EXPORTED = 1924;
//
// MessageId: RPC_S_PROFILE_NOT_ADDED
//
// MessageText:
//
// The specified profile entry could not be added.
//
RPC_S_PROFILE_NOT_ADDED = 1925;
//
// MessageId: RPC_S_PRF_ELT_NOT_ADDED
//
// MessageText:
//
// The specified profile element could not be added.
//
RPC_S_PRF_ELT_NOT_ADDED = 1926;
//
// MessageId: RPC_S_PRF_ELT_NOT_REMOVED
//
// MessageText:
//
// The specified profile element could not be removed.
//
RPC_S_PRF_ELT_NOT_REMOVED = 1927;
//
// MessageId: RPC_S_GRP_ELT_NOT_ADDED
//
// MessageText:
//
// The group element could not be added.
//
RPC_S_GRP_ELT_NOT_ADDED = 1928;
//
// MessageId: RPC_S_GRP_ELT_NOT_REMOVED
//
// MessageText:
//
// The group element could not be removed.
//
RPC_S_GRP_ELT_NOT_REMOVED = 1929;
//
// MessageId: ERROR_NO_BROWSER_SERVERS_FOUND
//
// MessageText:
//
// The list of servers for this workgroup is not currently available
//
ERROR_NO_BROWSER_SERVERS_FOUND = 6118;
///////////////////////////
// //
// OpenGL Error Code //
// //
///////////////////////////
//
// MessageId: ERROR_INVALID_PIXEL_FORMAT
//
// MessageText:
//
// The pixel format is invalid.
//
ERROR_INVALID_PIXEL_FORMAT = 2000;
//
// MessageId: ERROR_BAD_DRIVER
//
// MessageText:
//
// The specified driver is invalid.
//
ERROR_BAD_DRIVER = 2001;
//
// MessageId: ERROR_INVALID_WINDOW_STYLE
//
// MessageText:
//
// The window style or class attribute is invalid for this operation.
//
ERROR_INVALID_WINDOW_STYLE = 2002;
//
// MessageId: ERROR_METAFILE_NOT_SUPPORTED
//
// MessageText:
//
// The requested metafile operation is not supported.
//
ERROR_METAFILE_NOT_SUPPORTED = 2003;
//
// MessageId: ERROR_TRANSFORM_NOT_SUPPORTED
//
// MessageText:
//
// The requested transformation operation is not supported.
//
ERROR_TRANSFORM_NOT_SUPPORTED = 2004;
//
// MessageId: ERROR_CLIPPING_NOT_SUPPORTED
//
// MessageText:
//
// The requested clipping operation is not supported.
//
ERROR_CLIPPING_NOT_SUPPORTED = 2005;
// End of OpenGL error codes
///////////////////////////////////////////
// //
// Image Color Management Error Code //
// //
///////////////////////////////////////////
//
// MessageId: ERROR_INVALID_CMM
//
// MessageText:
//
// The specified color management module is invalid.
//
ERROR_INVALID_CMM = 2010;
//
// MessageId: ERROR_INVALID_PROFILE
//
// MessageText:
//
// The specified color profile is invalid.
//
ERROR_INVALID_PROFILE = 2011;
//
// MessageId: ERROR_TAG_NOT_FOUND
//
// MessageText:
//
// The specified tag was not found.
//
ERROR_TAG_NOT_FOUND = 2012;
//
// MessageId: ERROR_TAG_NOT_PRESENT
//
// MessageText:
//
// A required tag is not present.
//
ERROR_TAG_NOT_PRESENT = 2013;
//
// MessageId: ERROR_DUPLICATE_TAG
//
// MessageText:
//
// The specified tag is already present.
//
ERROR_DUPLICATE_TAG = 2014;
//
// MessageId: ERROR_PROFILE_NOT_ASSOCIATED_WITH_DEVICE
//
// MessageText:
//
// The specified color profile is not associated with any device.
//
ERROR_PROFILE_NOT_ASSOCIATED_WITH_DEVICE = 2015;
//
// MessageId: ERROR_PROFILE_NOT_FOUND
//
// MessageText:
//
// The specified color profile was not found.
//
ERROR_PROFILE_NOT_FOUND = 2016;
//
// MessageId: ERROR_INVALID_COLORSPACE
//
// MessageText:
//
// The specified color space is invalid.
//
ERROR_INVALID_COLORSPACE = 2017;
//
// MessageId: ERROR_ICM_NOT_ENABLED
//
// MessageText:
//
// Image Color Management is not enabled.
//
ERROR_ICM_NOT_ENABLED = 2018;
//
// MessageId: ERROR_DELETING_ICM_XFORM
//
// MessageText:
//
// There was an error while deleting the color transform.
//
ERROR_DELETING_ICM_XFORM = 2019;
//
// MessageId: ERROR_INVALID_TRANSFORM
//
// MessageText:
//
// The specified color transform is invalid.
//
ERROR_INVALID_TRANSFORM = 2020;
//
// MessageId: ERROR_COLORSPACE_MISMATCH
//
// MessageText:
//
// The specified transform does not match the bitmap's color space.
//
ERROR_COLORSPACE_MISMATCH = 2021;
//
// MessageId: ERROR_INVALID_COLORINDEX
//
// MessageText:
//
// The specified named color index is not present in the profile.
//
ERROR_INVALID_COLORINDEX = 2022;
///////////////////////////
// //
// Winnet32 Status Codes //
// //
///////////////////////////
//
// MessageId: ERROR_CONNECTED_OTHER_PASSWORD
//
// MessageText:
//
// The network connection was made successfully, but the user had to be prompted for a password other than the one originally specified.
//
ERROR_CONNECTED_OTHER_PASSWORD = 2108;
//
// MessageId: ERROR_BAD_USERNAME
//
// MessageText:
//
// The specified username is invalid.
//
ERROR_BAD_USERNAME = 2202;
//
// MessageId: ERROR_NOT_CONNECTED
//
// MessageText:
//
// This network connection does not exist.
//
ERROR_NOT_CONNECTED = 2250;
//
// MessageId: ERROR_OPEN_FILES
//
// MessageText:
//
// This network connection has files open or requests pending.
//
ERROR_OPEN_FILES = 2401;
//
// MessageId: ERROR_ACTIVE_CONNECTIONS
//
// MessageText:
//
// Active connections still exist.
//
ERROR_ACTIVE_CONNECTIONS = 2402;
//
// MessageId: ERROR_DEVICE_IN_USE
//
// MessageText:
//
// The device is in use by an active process and cannot be disconnected.
//
ERROR_DEVICE_IN_USE = 2404;
////////////////////////////////////
// //
// Win32 Spooler Error Codes //
// //
////////////////////////////////////
//
// MessageId: ERROR_UNKNOWN_PRINT_MONITOR
//
// MessageText:
//
// The specified print monitor is unknown.
//
ERROR_UNKNOWN_PRINT_MONITOR = 3000;
//
// MessageId: ERROR_PRINTER_DRIVER_IN_USE
//
// MessageText:
//
// The specified printer driver is currently in use.
//
ERROR_PRINTER_DRIVER_IN_USE = 3001;
//
// MessageId: ERROR_SPOOL_FILE_NOT_FOUND
//
// MessageText:
//
// The spool file was not found.
//
ERROR_SPOOL_FILE_NOT_FOUND = 3002;
//
// MessageId: ERROR_SPL_NO_STARTDOC
//
// MessageText:
//
// A StartDocPrinter call was not issued.
//
ERROR_SPL_NO_STARTDOC = 3003;
//
// MessageId: ERROR_SPL_NO_ADDJOB
//
// MessageText:
//
// An AddJob call was not issued.
//
ERROR_SPL_NO_ADDJOB = 3004;
//
// MessageId: ERROR_PRINT_PROCESSOR_ALREADY_INSTALLED
//
// MessageText:
//
// The specified print processor has already been installed.
//
ERROR_PRINT_PROCESSOR_ALREADY_INSTALLED = 3005;
//
// MessageId: ERROR_PRINT_MONITOR_ALREADY_INSTALLED
//
// MessageText:
//
// The specified print monitor has already been installed.
//
ERROR_PRINT_MONITOR_ALREADY_INSTALLED = 3006;
//
// MessageId: ERROR_INVALID_PRINT_MONITOR
//
// MessageText:
//
// The specified print monitor does not have the required functions.
//
ERROR_INVALID_PRINT_MONITOR = 3007;
//
// MessageId: ERROR_PRINT_MONITOR_IN_USE
//
// MessageText:
//
// The specified print monitor is currently in use.
//
ERROR_PRINT_MONITOR_IN_USE = 3008;
//
// MessageId: ERROR_PRINTER_HAS_JOBS_QUEUED
//
// MessageText:
//
// The requested operation is not allowed when there are jobs queued to the printer.
//
ERROR_PRINTER_HAS_JOBS_QUEUED = 3009;
//
// MessageId: ERROR_SUCCESS_REBOOT_REQUIRED
//
// MessageText:
//
// The requested operation is successful. Changes will not be effective until the system is rebooted.
//
ERROR_SUCCESS_REBOOT_REQUIRED = 3010;
//
// MessageId: ERROR_SUCCESS_RESTART_REQUIRED
//
// MessageText:
//
// The requested operation is successful. Changes will not be effective until the service is restarted.
//
ERROR_SUCCESS_RESTART_REQUIRED = 3011;
//
// MessageId: ERROR_PRINTER_NOT_FOUND
//
// MessageText:
//
// No printers were found.
//
ERROR_PRINTER_NOT_FOUND = 3012;
////////////////////////////////////
// //
// Wins Error Codes //
// //
////////////////////////////////////
//
// MessageId: ERROR_WINS_INTERNAL
//
// MessageText:
//
// WINS encountered an error while processing the command.
//
ERROR_WINS_INTERNAL = 4000;
//
// MessageId: ERROR_CAN_NOT_DEL_LOCAL_WINS
//
// MessageText:
//
// The local WINS can not be deleted.
//
ERROR_CAN_NOT_DEL_LOCAL_WINS = 4001;
//
// MessageId: ERROR_STATIC_INIT
//
// MessageText:
//
// The importation from the file failed.
//
ERROR_STATIC_INIT = 4002;
//
// MessageId: ERROR_INC_BACKUP
//
// MessageText:
//
// The backup failed. Was a full backup done before?
//
ERROR_INC_BACKUP = 4003;
//
// MessageId: ERROR_FULL_BACKUP
//
// MessageText:
//
// The backup failed. Check the directory to which you are backing the database.
//
ERROR_FULL_BACKUP = 4004;
//
// MessageId: ERROR_REC_NON_EXISTENT
//
// MessageText:
//
// The name does not exist in the WINS database.
//
ERROR_REC_NON_EXISTENT = 4005;
//
// MessageId: ERROR_RPL_NOT_ALLOWED
//
// MessageText:
//
// Replication with a nonconfigured partner is not allowed.
//
ERROR_RPL_NOT_ALLOWED = 4006;
////////////////////////////////////
// //
// DHCP Error Codes //
// //
////////////////////////////////////
//
// MessageId: ERROR_DHCP_ADDRESS_CONFLICT
//
// MessageText:
//
// The DHCP client has obtained an IP address that is already in use on the network. The local interface will be disabled until the DHCP client can obtain a new address.
//
ERROR_DHCP_ADDRESS_CONFLICT = 4100;
////////////////////////////////////
// //
// WMI Error Codes //
// //
////////////////////////////////////
//
// MessageId: ERROR_WMI_GUID_NOT_FOUND
//
// MessageText:
//
// The GUID passed was not recognized as valid by a WMI data provider.
//
ERROR_WMI_GUID_NOT_FOUND = 4200;
//
// MessageId: ERROR_WMI_INSTANCE_NOT_FOUND
//
// MessageText:
//
// The instance name passed was not recognized as valid by a WMI data provider.
//
ERROR_WMI_INSTANCE_NOT_FOUND = 4201;
//
// MessageId: ERROR_WMI_ITEMID_NOT_FOUND
//
// MessageText:
//
// The data item ID passed was not recognized as valid by a WMI data provider.
//
ERROR_WMI_ITEMID_NOT_FOUND = 4202;
//
// MessageId: ERROR_WMI_TRY_AGAIN
//
// MessageText:
//
// The WMI request could not be completed and should be retried.
//
ERROR_WMI_TRY_AGAIN = 4203;
//
// MessageId: ERROR_WMI_DP_NOT_FOUND
//
// MessageText:
//
// The WMI data provider could not be located.
//
ERROR_WMI_DP_NOT_FOUND = 4204;
//
// MessageId: ERROR_WMI_UNRESOLVED_INSTANCE_REF
//
// MessageText:
//
// The WMI data provider references an instance set that has not been registered.
//
ERROR_WMI_UNRESOLVED_INSTANCE_REF = 4205;
//
// MessageId: ERROR_WMI_ALREADY_ENABLED
//
// MessageText:
//
// The WMI data block or event notification has already been enabled.
//
ERROR_WMI_ALREADY_ENABLED = 4206;
//
// MessageId: ERROR_WMI_GUID_DISCONNECTED
//
// MessageText:
//
// The WMI data block is no longer available.
//
ERROR_WMI_GUID_DISCONNECTED = 4207;
//
// MessageId: ERROR_WMI_SERVER_UNAVAILABLE
//
// MessageText:
//
// The WMI data service is not available.
//
ERROR_WMI_SERVER_UNAVAILABLE = 4208;
//
// MessageId: ERROR_WMI_DP_FAILED
//
// MessageText:
//
// The WMI data provider failed to carry out the request.
//
ERROR_WMI_DP_FAILED = 4209;
//
// MessageId: ERROR_WMI_INVALID_MOF
//
// MessageText:
//
// The WMI MOF information is not valid.
//
ERROR_WMI_INVALID_MOF = 4210;
//
// MessageId: ERROR_WMI_INVALID_REGINFO
//
// MessageText:
//
// The WMI registration information is not valid.
//
ERROR_WMI_INVALID_REGINFO = 4211;
//
// MessageId: ERROR_WMI_ALREADY_DISABLED
//
// MessageText:
//
// The WMI data block or event notification has already been disabled.
//
ERROR_WMI_ALREADY_DISABLED = 4212;
//
// MessageId: ERROR_WMI_READ_ONLY
//
// MessageText:
//
// The WMI data item or data block is read only.
//
ERROR_WMI_READ_ONLY = 4213;
//
// MessageId: ERROR_WMI_SET_FAILURE
//
// MessageText:
//
// The WMI data item or data block could not be changed.
//
ERROR_WMI_SET_FAILURE = 4214;
//////////////////////////////////////////
// //
// NT Media Services (RSM) Error Codes //
// //
//////////////////////////////////////////
//
// MessageId: ERROR_INVALID_MEDIA
//
// MessageText:
//
// The media identifier does not represent a valid medium.
//
ERROR_INVALID_MEDIA = 4300;
//
// MessageId: ERROR_INVALID_LIBRARY
//
// MessageText:
//
// The library identifier does not represent a valid library.
//
ERROR_INVALID_LIBRARY = 4301;
//
// MessageId: ERROR_INVALID_MEDIA_POOL
//
// MessageText:
//
// The media pool identifier does not represent a valid media pool.
//
ERROR_INVALID_MEDIA_POOL = 4302;
//
// MessageId: ERROR_DRIVE_MEDIA_MISMATCH
//
// MessageText:
//
// The drive and medium are not compatible or exist in different libraries.
//
ERROR_DRIVE_MEDIA_MISMATCH = 4303;
//
// MessageId: ERROR_MEDIA_OFFLINE
//
// MessageText:
//
// The medium currently exists in an offline library and must be online to perform this operation.
//
ERROR_MEDIA_OFFLINE = 4304;
//
// MessageId: ERROR_LIBRARY_OFFLINE
//
// MessageText:
//
// The operation cannot be performed on an offline library.
//
ERROR_LIBRARY_OFFLINE = 4305;
//
// MessageId: ERROR_EMPTY
//
// MessageText:
//
// The library, drive, or media pool is empty.
//
ERROR_EMPTY = 4306;
//
// MessageId: ERROR_NOT_EMPTY
//
// MessageText:
//
// The library, drive, or media pool must be empty to perform this operation.
//
ERROR_NOT_EMPTY = 4307;
//
// MessageId: ERROR_MEDIA_UNAVAILABLE
//
// MessageText:
//
// No media is currently available in this media pool or library.
//
ERROR_MEDIA_UNAVAILABLE = 4308;
//
// MessageId: ERROR_RESOURCE_DISABLED
//
// MessageText:
//
// A resource required for this operation is disabled.
//
ERROR_RESOURCE_DISABLED = 4309;
//
// MessageId: ERROR_INVALID_CLEANER
//
// MessageText:
//
// The media identifier does not represent a valid cleaner.
//
ERROR_INVALID_CLEANER = 4310;
//
// MessageId: ERROR_UNABLE_TO_CLEAN
//
// MessageText:
//
// The drive cannot be cleaned or does not support cleaning.
//
ERROR_UNABLE_TO_CLEAN = 4311;
//
// MessageId: ERROR_OBJECT_NOT_FOUND
//
// MessageText:
//
// The object identifier does not represent a valid object.
//
ERROR_OBJECT_NOT_FOUND = 4312;
//
// MessageId: ERROR_DATABASE_FAILURE
//
// MessageText:
//
// Unable to read from or write to the database.
//
ERROR_DATABASE_FAILURE = 4313;
//
// MessageId: ERROR_DATABASE_FULL
//
// MessageText:
//
// The database is full.
//
ERROR_DATABASE_FULL = 4314;
//
// MessageId: ERROR_MEDIA_INCOMPATIBLE
//
// MessageText:
//
// The medium is not compatible with the device or media pool.
//
ERROR_MEDIA_INCOMPATIBLE = 4315;
//
// MessageId: ERROR_RESOURCE_NOT_PRESENT
//
// MessageText:
//
// The resource required for this operation does not exist.
//
ERROR_RESOURCE_NOT_PRESENT = 4316;
//
// MessageId: ERROR_INVALID_OPERATION
//
// MessageText:
//
// The operation identifier is not valid.
//
ERROR_INVALID_OPERATION = 4317;
//
// MessageId: ERROR_MEDIA_NOT_AVAILABLE
//
// MessageText:
//
// The media is not mounted or ready for use.
//
ERROR_MEDIA_NOT_AVAILABLE = 4318;
//
// MessageId: ERROR_DEVICE_NOT_AVAILABLE
//
// MessageText:
//
// The device is not ready for use.
//
ERROR_DEVICE_NOT_AVAILABLE = 4319;
//
// MessageId: ERROR_REQUEST_REFUSED
//
// MessageText:
//
// The operator or administrator has refused the request.
//
ERROR_REQUEST_REFUSED = 4320;
//
// MessageId: ERROR_INVALID_DRIVE_OBJECT
//
// MessageText:
//
// The drive identifier does not represent a valid drive.
//
ERROR_INVALID_DRIVE_OBJECT = 4321;
//
// MessageId: ERROR_LIBRARY_FULL
//
// MessageText:
//
// Library is full. No slot is available for use.
//
ERROR_LIBRARY_FULL = 4322;
//
// MessageId: ERROR_MEDIUM_NOT_ACCESSIBLE
//
// MessageText:
//
// The transport cannot access the medium.
//
ERROR_MEDIUM_NOT_ACCESSIBLE = 4323;
//
// MessageId: ERROR_UNABLE_TO_LOAD_MEDIUM
//
// MessageText:
//
// Unable to load the medium into the drive.
//
ERROR_UNABLE_TO_LOAD_MEDIUM = 4324;
//
// MessageId: ERROR_UNABLE_TO_INVENTORY_DRIVE
//
// MessageText:
//
// Unable to retrieve the drive status.
//
ERROR_UNABLE_TO_INVENTORY_DRIVE = 4325;
//
// MessageId: ERROR_UNABLE_TO_INVENTORY_SLOT
//
// MessageText:
//
// Unable to retrieve the slot status.
//
ERROR_UNABLE_TO_INVENTORY_SLOT = 4326;
//
// MessageId: ERROR_UNABLE_TO_INVENTORY_TRANSPORT
//
// MessageText:
//
// Unable to retrieve status about the transport.
//
ERROR_UNABLE_TO_INVENTORY_TRANSPORT = 4327;
//
// MessageId: ERROR_TRANSPORT_FULL
//
// MessageText:
//
// Cannot use the transport because it is already in use.
//
ERROR_TRANSPORT_FULL = 4328;
//
// MessageId: ERROR_CONTROLLING_IEPORT
//
// MessageText:
//
// Unable to open or close the inject/eject port.
//
ERROR_CONTROLLING_IEPORT = 4329;
//
// MessageId: ERROR_UNABLE_TO_EJECT_MOUNTED_MEDIA
//
// MessageText:
//
// Unable to eject the medium because it is in a drive.
//
ERROR_UNABLE_TO_EJECT_MOUNTED_MEDIA = 4330;
//
// MessageId: ERROR_CLEANER_SLOT_SET
//
// MessageText:
//
// A cleaner slot is already reserved.
//
ERROR_CLEANER_SLOT_SET = 4331;
//
// MessageId: ERROR_CLEANER_SLOT_NOT_SET
//
// MessageText:
//
// A cleaner slot is not reserved.
//
ERROR_CLEANER_SLOT_NOT_SET = 4332;
//
// MessageId: ERROR_CLEANER_CARTRIDGE_SPENT
//
// MessageText:
//
// The cleaner cartridge has performed the maximum number of drive cleanings.
//
ERROR_CLEANER_CARTRIDGE_SPENT = 4333;
//
// MessageId: ERROR_UNEXPECTED_OMID
//
// MessageText:
//
// Unexpected on-medium identifier.
//
ERROR_UNEXPECTED_OMID = 4334;
//
// MessageId: ERROR_CANT_DELETE_LAST_ITEM
//
// MessageText:
//
// The last remaining item in this group or resource cannot be deleted.
//
ERROR_CANT_DELETE_LAST_ITEM = 4335;
//
// MessageId: ERROR_MESSAGE_EXCEEDS_MAX_SIZE
//
// MessageText:
//
// The message provided exceeds the maximum size allowed for this parameter.
//
ERROR_MESSAGE_EXCEEDS_MAX_SIZE = 4336;
//
// MessageId: ERROR_VOLUME_CONTAINS_SYS_FILES
//
// MessageText:
//
// The volume contains system or paging files.
//
ERROR_VOLUME_CONTAINS_SYS_FILES = 4337;
//
// MessageId: ERROR_INDIGENOUS_TYPE
//
// MessageText:
//
// The media type cannot be removed from this library since at least one drive in the library reports it can support this media type.
//
ERROR_INDIGENOUS_TYPE = 4338;
//
// MessageId: ERROR_NO_SUPPORTING_DRIVES
//
// MessageText:
//
// This offline media cannot be mounted on this system since no enabled drives are present which can be used.
//
ERROR_NO_SUPPORTING_DRIVES = 4339;
////////////////////////////////////////////
// //
// NT Remote Storage Service Error Codes //
// //
////////////////////////////////////////////
//
// MessageId: ERROR_FILE_OFFLINE
//
// MessageText:
//
// The remote storage service was not able to recall the file.
//
ERROR_FILE_OFFLINE = 4350;
//
// MessageId: ERROR_REMOTE_STORAGE_NOT_ACTIVE
//
// MessageText:
//
// The remote storage service is not operational at this time.
//
ERROR_REMOTE_STORAGE_NOT_ACTIVE = 4351;
//
// MessageId: ERROR_REMOTE_STORAGE_MEDIA_ERROR
//
// MessageText:
//
// The remote storage service encountered a media error.
//
ERROR_REMOTE_STORAGE_MEDIA_ERROR = 4352;
////////////////////////////////////////////
// //
// NT Reparse Points Error Codes //
// //
////////////////////////////////////////////
//
// MessageId: ERROR_NOT_A_REPARSE_POINT
//
// MessageText:
//
// The file or directory is not a reparse point.
//
ERROR_NOT_A_REPARSE_POINT = 4390;
//
// MessageId: ERROR_REPARSE_ATTRIBUTE_CONFLICT
//
// MessageText:
//
// The reparse point attribute cannot be set because it conflicts with an existing attribute.
//
ERROR_REPARSE_ATTRIBUTE_CONFLICT = 4391;
//
// MessageId: ERROR_INVALID_REPARSE_DATA
//
// MessageText:
//
// The data present in the reparse point buffer is invalid.
//
ERROR_INVALID_REPARSE_DATA = 4392;
//
// MessageId: ERROR_REPARSE_TAG_INVALID
//
// MessageText:
//
// The tag present in the reparse point buffer is invalid.
//
ERROR_REPARSE_TAG_INVALID = 4393;
//
// MessageId: ERROR_REPARSE_TAG_MISMATCH
//
// MessageText:
//
// There is a mismatch between the tag specified in the request and the tag present in the reparse point.
//
//
ERROR_REPARSE_TAG_MISMATCH = 4394;
////////////////////////////////////////////
// //
// NT Single Instance Store Error Codes //
// //
////////////////////////////////////////////
//
// MessageId: ERROR_VOLUME_NOT_SIS_ENABLED
//
// MessageText:
//
// Single Instance Storage is not available on this volume.
//
ERROR_VOLUME_NOT_SIS_ENABLED = 4500;
////////////////////////////////////
// //
// Cluster Error Codes //
// //
////////////////////////////////////
//
// MessageId: ERROR_DEPENDENT_RESOURCE_EXISTS
//
// MessageText:
//
// The cluster resource cannot be moved to another group because other resources are dependent on it.
//
ERROR_DEPENDENT_RESOURCE_EXISTS = 5001;
//
// MessageId: ERROR_DEPENDENCY_NOT_FOUND
//
// MessageText:
//
// The cluster resource dependency cannot be found.
//
ERROR_DEPENDENCY_NOT_FOUND = 5002;
//
// MessageId: ERROR_DEPENDENCY_ALREADY_EXISTS
//
// MessageText:
//
// The cluster resource cannot be made dependent on the specified resource because it is already dependent.
//
ERROR_DEPENDENCY_ALREADY_EXISTS = 5003;
//
// MessageId: ERROR_RESOURCE_NOT_ONLINE
//
// MessageText:
//
// The cluster resource is not online.
//
ERROR_RESOURCE_NOT_ONLINE = 5004;
//
// MessageId: ERROR_HOST_NODE_NOT_AVAILABLE
//
// MessageText:
//
// A cluster node is not available for this operation.
//
ERROR_HOST_NODE_NOT_AVAILABLE = 5005;
//
// MessageId: ERROR_RESOURCE_NOT_AVAILABLE
//
// MessageText:
//
// The cluster resource is not available.
//
ERROR_RESOURCE_NOT_AVAILABLE = 5006;
//
// MessageId: ERROR_RESOURCE_NOT_FOUND
//
// MessageText:
//
// The cluster resource could not be found.
//
ERROR_RESOURCE_NOT_FOUND = 5007;
//
// MessageId: ERROR_SHUTDOWN_CLUSTER
//
// MessageText:
//
// The cluster is being shut down.
//
ERROR_SHUTDOWN_CLUSTER = 5008;
//
// MessageId: ERROR_CANT_EVICT_ACTIVE_NODE
//
// MessageText:
//
// A cluster node cannot be evicted from the cluster while it is online.
//
ERROR_CANT_EVICT_ACTIVE_NODE = 5009;
//
// MessageId: ERROR_OBJECT_ALREADY_EXISTS
//
// MessageText:
//
// The object already exists.
//
ERROR_OBJECT_ALREADY_EXISTS = 5010;
//
// MessageId: ERROR_OBJECT_IN_LIST
//
// MessageText:
//
// The object is already in the list.
//
ERROR_OBJECT_IN_LIST = 5011;
//
// MessageId: ERROR_GROUP_NOT_AVAILABLE
//
// MessageText:
//
// The cluster group is not available for any new requests.
//
ERROR_GROUP_NOT_AVAILABLE = 5012;
//
// MessageId: ERROR_GROUP_NOT_FOUND
//
// MessageText:
//
// The cluster group could not be found.
//
ERROR_GROUP_NOT_FOUND = 5013;
//
// MessageId: ERROR_GROUP_NOT_ONLINE
//
// MessageText:
//
// The operation could not be completed because the cluster group is not online.
//
ERROR_GROUP_NOT_ONLINE = 5014;
//
// MessageId: ERROR_HOST_NODE_NOT_RESOURCE_OWNER
//
// MessageText:
//
// The cluster node is not the owner of the resource.
//
ERROR_HOST_NODE_NOT_RESOURCE_OWNER = 5015;
//
// MessageId: ERROR_HOST_NODE_NOT_GROUP_OWNER
//
// MessageText:
//
// The cluster node is not the owner of the group.
//
ERROR_HOST_NODE_NOT_GROUP_OWNER = 5016;
//
// MessageId: ERROR_RESMON_CREATE_FAILED
//
// MessageText:
//
// The cluster resource could not be created in the specified resource monitor.
//
ERROR_RESMON_CREATE_FAILED = 5017;
//
// MessageId: ERROR_RESMON_ONLINE_FAILED
//
// MessageText:
//
// The cluster resource could not be brought online by the resource monitor.
//
ERROR_RESMON_ONLINE_FAILED = 5018;
//
// MessageId: ERROR_RESOURCE_ONLINE
//
// MessageText:
//
// The operation could not be completed because the cluster resource is online.
//
ERROR_RESOURCE_ONLINE = 5019;
//
// MessageId: ERROR_QUORUM_RESOURCE
//
// MessageText:
//
// The cluster resource could not be deleted or brought offline because it is the quorum resource.
//
ERROR_QUORUM_RESOURCE = 5020;
//
// MessageId: ERROR_NOT_QUORUM_CAPABLE
//
// MessageText:
//
// The cluster could not make the specified resource a quorum resource because it is not capable of being a quorum resource.
//
ERROR_NOT_QUORUM_CAPABLE = 5021;
//
// MessageId: ERROR_CLUSTER_SHUTTING_DOWN
//
// MessageText:
//
// The cluster software is shutting down.
//
ERROR_CLUSTER_SHUTTING_DOWN = 5022;
//
// MessageId: ERROR_INVALID_STATE
//
// MessageText:
//
// The group or resource is not in the correct state to perform the requested operation.
//
ERROR_INVALID_STATE = 5023;
//
// MessageId: ERROR_RESOURCE_PROPERTIES_STORED
//
// MessageText:
//
// The properties were stored but not all changes will take effect until the next time the resource is brought online.
//
ERROR_RESOURCE_PROPERTIES_STORED = 5024;
//
// MessageId: ERROR_NOT_QUORUM_CLASS
//
// MessageText:
//
// The cluster could not make the specified resource a quorum resource because it does not belong to a shared storage class.
//
ERROR_NOT_QUORUM_CLASS = 5025;
//
// MessageId: ERROR_CORE_RESOURCE
//
// MessageText:
//
// The cluster resource could not be deleted since it is a core resource.
//
ERROR_CORE_RESOURCE = 5026;
//
// MessageId: ERROR_QUORUM_RESOURCE_ONLINE_FAILED
//
// MessageText:
//
// The quorum resource failed to come online.
//
ERROR_QUORUM_RESOURCE_ONLINE_FAILED = 5027;
//
// MessageId: ERROR_QUORUMLOG_OPEN_FAILED
//
// MessageText:
//
// The quorum log could not be created or mounted successfully.
//
ERROR_QUORUMLOG_OPEN_FAILED = 5028;
//
// MessageId: ERROR_CLUSTERLOG_CORRUPT
//
// MessageText:
//
// The cluster log is corrupt.
//
ERROR_CLUSTERLOG_CORRUPT = 5029;
//
// MessageId: ERROR_CLUSTERLOG_RECORD_EXCEEDS_MAXSIZE
//
// MessageText:
//
// The record could not be written to the cluster log since it exceeds the maximum size.
//
ERROR_CLUSTERLOG_RECORD_EXCEEDS_MAXSIZE = 5030;
//
// MessageId: ERROR_CLUSTERLOG_EXCEEDS_MAXSIZE
//
// MessageText:
//
// The cluster log exceeds its maximum size.
//
ERROR_CLUSTERLOG_EXCEEDS_MAXSIZE = 5031;
//
// MessageId: ERROR_CLUSTERLOG_CHKPOINT_NOT_FOUND
//
// MessageText:
//
// No checkpoint record was found in the cluster log.
//
ERROR_CLUSTERLOG_CHKPOINT_NOT_FOUND = 5032;
//
// MessageId: ERROR_CLUSTERLOG_NOT_ENOUGH_SPACE
//
// MessageText:
//
// The minimum required disk space needed for logging is not available.
//
ERROR_CLUSTERLOG_NOT_ENOUGH_SPACE = 5033;
//
// MessageId: ERROR_QUORUM_OWNER_ALIVE
//
// MessageText:
//
// The cluster node failed to take control of the quorum resource because the resource is owned by another active node.
//
ERROR_QUORUM_OWNER_ALIVE = 5034;
//
// MessageId: ERROR_NETWORK_NOT_AVAILABLE
//
// MessageText:
//
// A cluster network is not available for this operation.
//
ERROR_NETWORK_NOT_AVAILABLE = 5035;
//
// MessageId: ERROR_NODE_NOT_AVAILABLE
//
// MessageText:
//
// A cluster node is not available for this operation.
//
ERROR_NODE_NOT_AVAILABLE = 5036;
//
// MessageId: ERROR_ALL_NODES_NOT_AVAILABLE
//
// MessageText:
//
// All cluster nodes must be running to perform this operation.
//
ERROR_ALL_NODES_NOT_AVAILABLE = 5037;
//
// MessageId: ERROR_RESOURCE_FAILED
//
// MessageText:
//
// A cluster resource failed.
//
ERROR_RESOURCE_FAILED = 5038;
//
// MessageId: ERROR_CLUSTER_INVALID_NODE
//
// MessageText:
//
// The cluster node is not valid.
//
ERROR_CLUSTER_INVALID_NODE = 5039;
//
// MessageId: ERROR_CLUSTER_NODE_EXISTS
//
// MessageText:
//
// The cluster node already exists.
//
ERROR_CLUSTER_NODE_EXISTS = 5040;
//
// MessageId: ERROR_CLUSTER_JOIN_IN_PROGRESS
//
// MessageText:
//
// A node is in the process of joining the cluster.
//
ERROR_CLUSTER_JOIN_IN_PROGRESS = 5041;
//
// MessageId: ERROR_CLUSTER_NODE_NOT_FOUND
//
// MessageText:
//
// The cluster node was not found.
//
ERROR_CLUSTER_NODE_NOT_FOUND = 5042;
//
// MessageId: ERROR_CLUSTER_LOCAL_NODE_NOT_FOUND
//
// MessageText:
//
// The cluster local node information was not found.
//
ERROR_CLUSTER_LOCAL_NODE_NOT_FOUND = 5043;
//
// MessageId: ERROR_CLUSTER_NETWORK_EXISTS
//
// MessageText:
//
// The cluster network already exists.
//
ERROR_CLUSTER_NETWORK_EXISTS = 5044;
//
// MessageId: ERROR_CLUSTER_NETWORK_NOT_FOUND
//
// MessageText:
//
// The cluster network was not found.
//
ERROR_CLUSTER_NETWORK_NOT_FOUND = 5045;
//
// MessageId: ERROR_CLUSTER_NETINTERFACE_EXISTS
//
// MessageText:
//
// The cluster network interface already exists.
//
ERROR_CLUSTER_NETINTERFACE_EXISTS = 5046;
//
// MessageId: ERROR_CLUSTER_NETINTERFACE_NOT_FOUND
//
// MessageText:
//
// The cluster network interface was not found.
//
ERROR_CLUSTER_NETINTERFACE_NOT_FOUND = 5047;
//
// MessageId: ERROR_CLUSTER_INVALID_REQUEST
//
// MessageText:
//
// The cluster request is not valid for this object.
//
ERROR_CLUSTER_INVALID_REQUEST = 5048;
//
// MessageId: ERROR_CLUSTER_INVALID_NETWORK_PROVIDER
//
// MessageText:
//
// The cluster network provider is not valid.
//
ERROR_CLUSTER_INVALID_NETWORK_PROVIDER = 5049;
//
// MessageId: ERROR_CLUSTER_NODE_DOWN
//
// MessageText:
//
// The cluster node is down.
//
ERROR_CLUSTER_NODE_DOWN = 5050;
//
// MessageId: ERROR_CLUSTER_NODE_UNREACHABLE
//
// MessageText:
//
// The cluster node is not reachable.
//
ERROR_CLUSTER_NODE_UNREACHABLE = 5051;
//
// MessageId: ERROR_CLUSTER_NODE_NOT_MEMBER
//
// MessageText:
//
// The cluster node is not a member of the cluster.
//
ERROR_CLUSTER_NODE_NOT_MEMBER = 5052;
//
// MessageId: ERROR_CLUSTER_JOIN_NOT_IN_PROGRESS
//
// MessageText:
//
// A cluster join operation is not in progress.
//
ERROR_CLUSTER_JOIN_NOT_IN_PROGRESS = 5053;
//
// MessageId: ERROR_CLUSTER_INVALID_NETWORK
//
// MessageText:
//
// The cluster network is not valid.
//
ERROR_CLUSTER_INVALID_NETWORK = 5054;
//
// MessageId: ERROR_CLUSTER_NODE_UP
//
// MessageText:
//
// The cluster node is up.
//
ERROR_CLUSTER_NODE_UP = 5056;
//
// MessageId: ERROR_CLUSTER_IPADDR_IN_USE
//
// MessageText:
//
// The cluster IP address is already in use.
//
ERROR_CLUSTER_IPADDR_IN_USE = 5057;
//
// MessageId: ERROR_CLUSTER_NODE_NOT_PAUSED
//
// MessageText:
//
// The cluster node is not paused.
//
ERROR_CLUSTER_NODE_NOT_PAUSED = 5058;
//
// MessageId: ERROR_CLUSTER_NO_SECURITY_CONTEXT
//
// MessageText:
//
// No cluster security context is available.
//
ERROR_CLUSTER_NO_SECURITY_CONTEXT = 5059;
//
// MessageId: ERROR_CLUSTER_NETWORK_NOT_INTERNAL
//
// MessageText:
//
// The cluster network is not configured for internal cluster communication.
//
ERROR_CLUSTER_NETWORK_NOT_INTERNAL = 5060;
//
// MessageId: ERROR_CLUSTER_NODE_ALREADY_UP
//
// MessageText:
//
// The cluster node is already up.
//
ERROR_CLUSTER_NODE_ALREADY_UP = 5061;
//
// MessageId: ERROR_CLUSTER_NODE_ALREADY_DOWN
//
// MessageText:
//
// The cluster node is already down.
//
ERROR_CLUSTER_NODE_ALREADY_DOWN = 5062;
//
// MessageId: ERROR_CLUSTER_NETWORK_ALREADY_ONLINE
//
// MessageText:
//
// The cluster network is already online.
//
ERROR_CLUSTER_NETWORK_ALREADY_ONLINE = 5063;
//
// MessageId: ERROR_CLUSTER_NETWORK_ALREADY_OFFLINE
//
// MessageText:
//
// The cluster network is already offline.
//
ERROR_CLUSTER_NETWORK_ALREADY_OFFLINE = 5064;
//
// MessageId: ERROR_CLUSTER_NODE_ALREADY_MEMBER
//
// MessageText:
//
// The cluster node is already a member of the cluster.
//
ERROR_CLUSTER_NODE_ALREADY_MEMBER = 5065;
//
// MessageId: ERROR_CLUSTER_LAST_INTERNAL_NETWORK
//
// MessageText:
//
// The cluster network is the only one configured for internal cluster communication between two or more active cluster nodes. The internal communication capability cannot be removed from the network.
//
ERROR_CLUSTER_LAST_INTERNAL_NETWORK = 5066;
//
// MessageId: ERROR_CLUSTER_NETWORK_HAS_DEPENDENTS
//
// MessageText:
//
// One or more cluster resources depend on the network to provide service to clients. The client access capability cannot be removed from the network.
//
ERROR_CLUSTER_NETWORK_HAS_DEPENDENTS = 5067;
//
// MessageId: ERROR_INVALID_OPERATION_ON_QUORUM
//
// MessageText:
//
// This operation cannot be performed on the cluster resource as it the quorum resource. You may not bring the quorum resource offline or modify its possible owners list.
//
ERROR_INVALID_OPERATION_ON_QUORUM = 5068;
//
// MessageId: ERROR_DEPENDENCY_NOT_ALLOWED
//
// MessageText:
//
// The cluster quorum resource is not allowed to have any dependencies.
//
ERROR_DEPENDENCY_NOT_ALLOWED = 5069;
//
// MessageId: ERROR_CLUSTER_NODE_PAUSED
//
// MessageText:
//
// The cluster node is paused.
//
ERROR_CLUSTER_NODE_PAUSED = 5070;
//
// MessageId: ERROR_NODE_CANT_HOST_RESOURCE
//
// MessageText:
//
// The cluster resource cannot be brought online. The owner node cannot run this resource.
//
ERROR_NODE_CANT_HOST_RESOURCE = 5071;
//
// MessageId: ERROR_CLUSTER_NODE_NOT_READY
//
// MessageText:
//
// The cluster node is not ready to perform the requested operation.
//
ERROR_CLUSTER_NODE_NOT_READY = 5072;
//
// MessageId: ERROR_CLUSTER_NODE_SHUTTING_DOWN
//
// MessageText:
//
// The cluster node is shutting down.
//
ERROR_CLUSTER_NODE_SHUTTING_DOWN = 5073;
//
// MessageId: ERROR_CLUSTER_JOIN_ABORTED
//
// MessageText:
//
// The cluster join operation was aborted.
//
ERROR_CLUSTER_JOIN_ABORTED = 5074;
//
// MessageId: ERROR_CLUSTER_INCOMPATIBLE_VERSIONS
//
// MessageText:
//
// The cluster join operation failed due to incompatible software versions between the joining node and its sponsor.
//
ERROR_CLUSTER_INCOMPATIBLE_VERSIONS = 5075;
//
// MessageId: ERROR_CLUSTER_MAXNUM_OF_RESOURCES_EXCEEDED
//
// MessageText:
//
// This resource cannot be created because the cluster has reached the limit on the number of resources it can monitor.
//
ERROR_CLUSTER_MAXNUM_OF_RESOURCES_EXCEEDED = 5076;
//
// MessageId: ERROR_CLUSTER_SYSTEM_CONFIG_CHANGED
//
// MessageText:
//
// The system configuration changed during the cluster join or form operation. The join or form operation was aborted.
//
ERROR_CLUSTER_SYSTEM_CONFIG_CHANGED = 5077;
//
// MessageId: ERROR_CLUSTER_RESOURCE_TYPE_NOT_FOUND
//
// MessageText:
//
// The specified resource type was not found.
//
ERROR_CLUSTER_RESOURCE_TYPE_NOT_FOUND = 5078;
//
// MessageId: ERROR_CLUSTER_RESTYPE_NOT_SUPPORTED
//
// MessageText:
//
// The specified node does not support a resource of this type. This may be due to version inconsistencies or due to the absence of the resource DLL on this node.
//
ERROR_CLUSTER_RESTYPE_NOT_SUPPORTED = 5079;
//
// MessageId: ERROR_CLUSTER_RESNAME_NOT_FOUND
//
// MessageText:
//
// The specified resource name is not supported by this resource DLL. This may be due to a bad (or changed) name supplied to the resource DLL.
//
ERROR_CLUSTER_RESNAME_NOT_FOUND = 5080;
//
// MessageId: ERROR_CLUSTER_NO_RPC_PACKAGES_REGISTERED
//
// MessageText:
//
// No authentication package could be registered with the RPC server.
//
ERROR_CLUSTER_NO_RPC_PACKAGES_REGISTERED = 5081;
//
// MessageId: ERROR_CLUSTER_OWNER_NOT_IN_PREFLIST
//
// MessageText:
//
// You cannot bring the group online because the owner of the group is not in the preferred list for the group. To change the owner node for the group, move the group.
//
ERROR_CLUSTER_OWNER_NOT_IN_PREFLIST = 5082;
//
// MessageId: ERROR_CLUSTER_DATABASE_SEQMISMATCH
//
// MessageText:
//
// The join operation failed because the cluster database sequence number has changed or is incompatible with the locker node. This may happen during a join operation if the cluster database was changing during the join.
//
ERROR_CLUSTER_DATABASE_SEQMISMATCH = 5083;
//
// MessageId: ERROR_RESMON_INVALID_STATE
//
// MessageText:
//
// The resource monitor will not allow the fail operation to be performed while the resource is in its current state. This may happen if the resource is in a pending state.
//
ERROR_RESMON_INVALID_STATE = 5084;
//
// MessageId: ERROR_CLUSTER_GUM_NOT_LOCKER
//
// MessageText:
//
// A non locker code got a request to reserve the lock for making global updates.
//
ERROR_CLUSTER_GUM_NOT_LOCKER = 5085;
//
// MessageId: ERROR_QUORUM_DISK_NOT_FOUND
//
// MessageText:
//
// The quorum disk could not be located by the cluster service.
//
ERROR_QUORUM_DISK_NOT_FOUND = 5086;
//
// MessageId: ERROR_DATABASE_BACKUP_CORRUPT
//
// MessageText:
//
// The backed up cluster database is possibly corrupt.
//
ERROR_DATABASE_BACKUP_CORRUPT = 5087;
//
// MessageId: ERROR_CLUSTER_NODE_ALREADY_HAS_DFS_ROOT
//
// MessageText:
//
// A DFS root already exists in this cluster node.
//
ERROR_CLUSTER_NODE_ALREADY_HAS_DFS_ROOT = 5088;
//
// MessageId: ERROR_RESOURCE_PROPERTY_UNCHANGEABLE
//
// MessageText:
//
// An attempt to modify a resource property failed because it conflicts with another existing property.
//
ERROR_RESOURCE_PROPERTY_UNCHANGEABLE = 5089;
////////////////////////////////////
// //
// EFS Error Codes //
// //
////////////////////////////////////
//
// MessageId: ERROR_ENCRYPTION_FAILED
//
// MessageText:
//
// The specified file could not be encrypted.
//
ERROR_ENCRYPTION_FAILED = 6000;
//
// MessageId: ERROR_DECRYPTION_FAILED
//
// MessageText:
//
// The specified file could not be decrypted.
//
ERROR_DECRYPTION_FAILED = 6001;
//
// MessageId: ERROR_FILE_ENCRYPTED
//
// MessageText:
//
// The specified file is encrypted and the user does not have the ability to decrypt it.
//
ERROR_FILE_ENCRYPTED = 6002;
//
// MessageId: ERROR_NO_RECOVERY_POLICY
//
// MessageText:
//
// There is no valid encryption recovery policy configured for this system.
//
ERROR_NO_RECOVERY_POLICY = 6003;
//
// MessageId: ERROR_NO_EFS
//
// MessageText:
//
// The required encryption driver is not loaded for this system.
//
ERROR_NO_EFS = 6004;
//
// MessageId: ERROR_WRONG_EFS
//
// MessageText:
//
// The file was encrypted with a different encryption driver than is currently loaded.
//
ERROR_WRONG_EFS = 6005;
//
// MessageId: ERROR_NO_USER_KEYS
//
// MessageText:
//
// There are no EFS keys defined for the user.
//
ERROR_NO_USER_KEYS = 6006;
//
// MessageId: ERROR_FILE_NOT_ENCRYPTED
//
// MessageText:
//
// The specified file is not encrypted.
//
ERROR_FILE_NOT_ENCRYPTED = 6007;
//
// MessageId: ERROR_NOT_EXPORT_FORMAT
//
// MessageText:
//
// The specified file is not in the defined EFS export format.
//
ERROR_NOT_EXPORT_FORMAT = 6008;
//
// MessageId: ERROR_FILE_READ_ONLY
//
// MessageText:
//
// The specified file is read only.
//
ERROR_FILE_READ_ONLY = 6009;
//
// MessageId: ERROR_DIR_EFS_DISALLOWED
//
// MessageText:
//
// The directory has been disabled for encryption.
//
ERROR_DIR_EFS_DISALLOWED = 6010;
//
// MessageId: ERROR_EFS_SERVER_NOT_TRUSTED
//
// MessageText:
//
// The server is not trusted for remote encryption operation.
//
ERROR_EFS_SERVER_NOT_TRUSTED = 6011;
//////////////////////////////////////////////////////////////////
// //
// Task Scheduler Error Codes that NET START must understand //
// //
//////////////////////////////////////////////////////////////////
//
// MessageId: SCHED_E_SERVICE_NOT_LOCALSYSTEM
//
// MessageText:
//
// The Task Scheduler service must be configured to run in the System account to function properly. Individual tasks may be configured to run in other accounts.
//
SCHED_E_SERVICE_NOT_LOCALSYSTEM = 6200;
////////////////////////////////////
// //
// Terminal Server Error Codes //
// //
////////////////////////////////////
//
// MessageId: ERROR_CTX_WINSTATION_NAME_INVALID
//
// MessageText:
//
// The specified session name is invalid.
//
ERROR_CTX_WINSTATION_NAME_INVALID = 7001;
//
// MessageId: ERROR_CTX_INVALID_PD
//
// MessageText:
//
// The specified protocol driver is invalid.
//
ERROR_CTX_INVALID_PD = 7002;
//
// MessageId: ERROR_CTX_PD_NOT_FOUND
//
// MessageText:
//
// The specified protocol driver was not found in the system path.
//
ERROR_CTX_PD_NOT_FOUND = 7003;
//
// MessageId: ERROR_CTX_WD_NOT_FOUND
//
// MessageText:
//
// The specified terminal connection driver was not found in the system path.
//
ERROR_CTX_WD_NOT_FOUND = 7004;
//
// MessageId: ERROR_CTX_CANNOT_MAKE_EVENTLOG_ENTRY
//
// MessageText:
//
// A registry key for event logging could not be created for this session.
//
ERROR_CTX_CANNOT_MAKE_EVENTLOG_ENTRY = 7005;
//
// MessageId: ERROR_CTX_SERVICE_NAME_COLLISION
//
// MessageText:
//
// A service with the same name already exists on the system.
//
ERROR_CTX_SERVICE_NAME_COLLISION = 7006;
//
// MessageId: ERROR_CTX_CLOSE_PENDING
//
// MessageText:
//
// A close operation is pending on the session.
//
ERROR_CTX_CLOSE_PENDING = 7007;
//
// MessageId: ERROR_CTX_NO_OUTBUF
//
// MessageText:
//
// There are no free output buffers available.
//
ERROR_CTX_NO_OUTBUF = 7008;
//
// MessageId: ERROR_CTX_MODEM_INF_NOT_FOUND
//
// MessageText:
//
// The MODEM.INF file was not found.
//
ERROR_CTX_MODEM_INF_NOT_FOUND = 7009;
//
// MessageId: ERROR_CTX_INVALID_MODEMNAME
//
// MessageText:
//
// The modem name was not found in MODEM.INF.
//
ERROR_CTX_INVALID_MODEMNAME = 7010;
//
// MessageId: ERROR_CTX_MODEM_RESPONSE_ERROR
//
// MessageText:
//
// The modem did not accept the command sent to it. Verify that the configured modem name matches the attached modem.
//
ERROR_CTX_MODEM_RESPONSE_ERROR = 7011;
//
// MessageId: ERROR_CTX_MODEM_RESPONSE_TIMEOUT
//
// MessageText:
//
// The modem did not respond to the command sent to it. Verify that the modem is properly cabled and powered on.
//
ERROR_CTX_MODEM_RESPONSE_TIMEOUT = 7012;
//
// MessageId: ERROR_CTX_MODEM_RESPONSE_NO_CARRIER
//
// MessageText:
//
// Carrier detect has failed or carrier has been dropped due to disconnect.
//
ERROR_CTX_MODEM_RESPONSE_NO_CARRIER = 7013;
//
// MessageId: ERROR_CTX_MODEM_RESPONSE_NO_DIALTONE
//
// MessageText:
//
// Dial tone not detected within the required time. Verify that the phone cable is properly attached and functional.
//
ERROR_CTX_MODEM_RESPONSE_NO_DIALTONE = 7014;
//
// MessageId: ERROR_CTX_MODEM_RESPONSE_BUSY
//
// MessageText:
//
// Busy signal detected at remote site on callback.
//
ERROR_CTX_MODEM_RESPONSE_BUSY = 7015;
//
// MessageId: ERROR_CTX_MODEM_RESPONSE_VOICE
//
// MessageText:
//
// Voice detected at remote site on callback.
//
ERROR_CTX_MODEM_RESPONSE_VOICE = 7016;
//
// MessageId: ERROR_CTX_TD_ERROR
//
// MessageText:
//
// Transport driver error
//
ERROR_CTX_TD_ERROR = 7017;
//
// MessageId: ERROR_CTX_WINSTATION_NOT_FOUND
//
// MessageText:
//
// The specified session cannot be found.
//
ERROR_CTX_WINSTATION_NOT_FOUND = 7022;
//
// MessageId: ERROR_CTX_WINSTATION_ALREADY_EXISTS
//
// MessageText:
//
// The specified session name is already in use.
//
ERROR_CTX_WINSTATION_ALREADY_EXISTS = 7023;
//
// MessageId: ERROR_CTX_WINSTATION_BUSY
//
// MessageText:
//
// The requested operation cannot be completed because the terminal connection is currently busy processing a connect, disconnect, reset, or delete operation.
//
ERROR_CTX_WINSTATION_BUSY = 7024;
//
// MessageId: ERROR_CTX_BAD_VIDEO_MODE
//
// MessageText:
//
// An attempt has been made to connect to a session whose video mode is not supported by the current client.
//
ERROR_CTX_BAD_VIDEO_MODE = 7025;
//
// MessageId: ERROR_CTX_GRAPHICS_INVALID
//
// MessageText:
//
// The application attempted to enable DOS graphics mode.
// DOS graphics mode is not supported.
//
ERROR_CTX_GRAPHICS_INVALID = 7035;
//
// MessageId: ERROR_CTX_LOGON_DISABLED
//
// MessageText:
//
// Your interactive logon privilege has been disabled.
// Please contact your administrator.
//
ERROR_CTX_LOGON_DISABLED = 7037;
//
// MessageId: ERROR_CTX_NOT_CONSOLE
//
// MessageText:
//
// The requested operation can be performed only on the system console.
// This is most often the result of a driver or system DLL requiring direct console access.
//
ERROR_CTX_NOT_CONSOLE = 7038;
//
// MessageId: ERROR_CTX_CLIENT_QUERY_TIMEOUT
//
// MessageText:
//
// The client failed to respond to the server connect message.
//
ERROR_CTX_CLIENT_QUERY_TIMEOUT = 7040;
//
// MessageId: ERROR_CTX_CONSOLE_DISCONNECT
//
// MessageText:
//
// Disconnecting the console session is not supported.
//
ERROR_CTX_CONSOLE_DISCONNECT = 7041;
//
// MessageId: ERROR_CTX_CONSOLE_CONNECT
//
// MessageText:
//
// Reconnecting a disconnected session to the console is not supported.
//
ERROR_CTX_CONSOLE_CONNECT = 7042;
//
// MessageId: ERROR_CTX_SHADOW_DENIED
//
// MessageText:
//
// The request to control another session remotely was denied.
//
ERROR_CTX_SHADOW_DENIED = 7044;
//
// MessageId: ERROR_CTX_WINSTATION_ACCESS_DENIED
//
// MessageText:
//
// The requested session access is denied.
//
ERROR_CTX_WINSTATION_ACCESS_DENIED = 7045;
//
// MessageId: ERROR_CTX_INVALID_WD
//
// MessageText:
//
// The specified terminal connection driver is invalid.
//
ERROR_CTX_INVALID_WD = 7049;
//
// MessageId: ERROR_CTX_SHADOW_INVALID
//
// MessageText:
//
// The requested session cannot be controlled remotely.
// This may be because the session is disconnected or does not currently have a user logged on. Also, you cannot control a session remotely from the system console or control the system console remotely. And you cannot remote control your own current session.
//
ERROR_CTX_SHADOW_INVALID = 7050;
//
// MessageId: ERROR_CTX_SHADOW_DISABLED
//
// MessageText:
//
// The requested session is not configured to allow remote control.
//
ERROR_CTX_SHADOW_DISABLED = 7051;
//
// MessageId: ERROR_CTX_CLIENT_LICENSE_IN_USE
//
// MessageText:
//
// Your request to connect to this Terminal Server has been rejected. Your Terminal Server client license number is currently being used by another user.
// Please call your system administrator to obtain a new copy of the Terminal Server client with a valid, unique license number.
//
ERROR_CTX_CLIENT_LICENSE_IN_USE = 7052;
//
// MessageId: ERROR_CTX_CLIENT_LICENSE_NOT_SET
//
// MessageText:
//
// Your request to connect to this Terminal Server has been rejected. Your Terminal Server client license number has not been entered for this copy of the Terminal Server client.
// Please call your system administrator for help in entering a valid, unique license number for this Terminal Server client.
//
ERROR_CTX_CLIENT_LICENSE_NOT_SET = 7053;
//
// MessageId: ERROR_CTX_LICENSE_NOT_AVAILABLE
//
// MessageText:
//
// The system has reached its licensed logon limit.
// Please try again later.
//
ERROR_CTX_LICENSE_NOT_AVAILABLE = 7054;
//
// MessageId: ERROR_CTX_LICENSE_CLIENT_INVALID
//
// MessageText:
//
// The client you are using is not licensed to use this system. Your logon request is denied.
//
ERROR_CTX_LICENSE_CLIENT_INVALID = 7055;
//
// MessageId: ERROR_CTX_LICENSE_EXPIRED
//
// MessageText:
//
// The system license has expired. Your logon request is denied.
//
ERROR_CTX_LICENSE_EXPIRED = 7056;
///////////////////////////////////////////////////
// /
// Traffic Control Error Codes /
// /
// 7500 to 7999 /
// /
// defined in: tcerror.h /
///////////////////////////////////////////////////
///////////////////////////////////////////////////
// /
// Active Directory Error Codes /
// /
// 8000 to 8999 /
///////////////////////////////////////////////////
// *****************
// FACILITY_FILE_REPLICATION_SERVICE
// *****************
//
// MessageId: FRS_ERR_INVALID_API_SEQUENCE
//
// MessageText:
//
// The file replication service API was called incorrectly.
//
FRS_ERR_INVALID_API_SEQUENCE = 8001;
//
// MessageId: FRS_ERR_STARTING_SERVICE
//
// MessageText:
//
// The file replication service cannot be started.
//
FRS_ERR_STARTING_SERVICE = 8002;
//
// MessageId: FRS_ERR_STOPPING_SERVICE
//
// MessageText:
//
// The file replication service cannot be stopped.
//
FRS_ERR_STOPPING_SERVICE = 8003;
//
// MessageId: FRS_ERR_INTERNAL_API
//
// MessageText:
//
// The file replication service API terminated the request.
// The event log may have more information.
//
FRS_ERR_INTERNAL_API = 8004;
//
// MessageId: FRS_ERR_INTERNAL
//
// MessageText:
//
// The file replication service terminated the request.
// The event log may have more information.
//
FRS_ERR_INTERNAL = 8005;
//
// MessageId: FRS_ERR_SERVICE_COMM
//
// MessageText:
//
// The file replication service cannot be contacted.
// The event log may have more information.
//
FRS_ERR_SERVICE_COMM = 8006;
//
// MessageId: FRS_ERR_INSUFFICIENT_PRIV
//
// MessageText:
//
// The file replication service cannot satisfy the request because the user has insufficient privileges.
// The event log may have more information.
//
FRS_ERR_INSUFFICIENT_PRIV = 8007;
//
// MessageId: FRS_ERR_AUTHENTICATION
//
// MessageText:
//
// The file replication service cannot satisfy the request because authenticated RPC is not available.
// The event log may have more information.
//
FRS_ERR_AUTHENTICATION = 8008;
//
// MessageId: FRS_ERR_PARENT_INSUFFICIENT_PRIV
//
// MessageText:
//
// The file replication service cannot satisfy the request because the user has insufficient privileges on the domain controller.
// The event log may have more information.
//
FRS_ERR_PARENT_INSUFFICIENT_PRIV = 8009;
//
// MessageId: FRS_ERR_PARENT_AUTHENTICATION
//
// MessageText:
//
// The file replication service cannot satisfy the request because authenticated RPC is not available on the domain controller.
// The event log may have more information.
//
FRS_ERR_PARENT_AUTHENTICATION = 8010;
//
// MessageId: FRS_ERR_CHILD_TO_PARENT_COMM
//
// MessageText:
//
// The file replication service cannot communicate with the file replication service on the domain controller.
// The event log may have more information.
//
FRS_ERR_CHILD_TO_PARENT_COMM = 8011;
//
// MessageId: FRS_ERR_PARENT_TO_CHILD_COMM
//
// MessageText:
//
// The file replication service on the domain controller cannot communicate with the file replication service on this computer.
// The event log may have more information.
//
FRS_ERR_PARENT_TO_CHILD_COMM = 8012;
//
// MessageId: FRS_ERR_SYSVOL_POPULATE
//
// MessageText:
//
// The file replication service cannot populate the system volume because of an internal error.
// The event log may have more information.
//
FRS_ERR_SYSVOL_POPULATE = 8013;
//
// MessageId: FRS_ERR_SYSVOL_POPULATE_TIMEOUT
//
// MessageText:
//
// The file replication service cannot populate the system volume because of an internal timeout.
// The event log may have more information.
//
FRS_ERR_SYSVOL_POPULATE_TIMEOUT = 8014;
//
// MessageId: FRS_ERR_SYSVOL_IS_BUSY
//
// MessageText:
//
// The file replication service cannot process the request. The system volume is busy with a previous request.
//
FRS_ERR_SYSVOL_IS_BUSY = 8015;
//
// MessageId: FRS_ERR_SYSVOL_DEMOTE
//
// MessageText:
//
// The file replication service cannot stop replicating the system volume because of an internal error.
// The event log may have more information.
//
FRS_ERR_SYSVOL_DEMOTE = 8016;
//
// MessageId: FRS_ERR_INVALID_SERVICE_PARAMETER
//
// MessageText:
//
// The file replication service detected an invalid parameter.
//
FRS_ERR_INVALID_SERVICE_PARAMETER = 8017;
// *****************
// FACILITY DIRECTORY SERVICE
// *****************
DS_S_SUCCESS = NO_ERROR;
//
// MessageId: ERROR_DS_NOT_INSTALLED
//
// MessageText:
//
// An error occurred while installing the directory service. For more information, see the event log.
//
ERROR_DS_NOT_INSTALLED = 8200;
//
// MessageId: ERROR_DS_MEMBERSHIP_EVALUATED_LOCALLY
//
// MessageText:
//
// The directory service evaluated group memberships locally.
//
ERROR_DS_MEMBERSHIP_EVALUATED_LOCALLY = 8201;
//
// MessageId: ERROR_DS_NO_ATTRIBUTE_OR_VALUE
//
// MessageText:
//
// The specified directory service attribute or value does not exist.
//
ERROR_DS_NO_ATTRIBUTE_OR_VALUE = 8202;
//
// MessageId: ERROR_DS_INVALID_ATTRIBUTE_SYNTAX
//
// MessageText:
//
// The attribute syntax specified to the directory service is invalid.
//
ERROR_DS_INVALID_ATTRIBUTE_SYNTAX = 8203;
//
// MessageId: ERROR_DS_ATTRIBUTE_TYPE_UNDEFINED
//
// MessageText:
//
// The attribute type specified to the directory service is not defined.
//
ERROR_DS_ATTRIBUTE_TYPE_UNDEFINED = 8204;
//
// MessageId: ERROR_DS_ATTRIBUTE_OR_VALUE_EXISTS
//
// MessageText:
//
// The specified directory service attribute or value already exists.
//
ERROR_DS_ATTRIBUTE_OR_VALUE_EXISTS = 8205;
//
// MessageId: ERROR_DS_BUSY
//
// MessageText:
//
// The directory service is busy.
//
ERROR_DS_BUSY = 8206;
//
// MessageId: ERROR_DS_UNAVAILABLE
//
// MessageText:
//
// The directory service is unavailable.
//
ERROR_DS_UNAVAILABLE = 8207;
//
// MessageId: ERROR_DS_NO_RIDS_ALLOCATED
//
// MessageText:
//
// The directory service was unable to allocate a relative identifier.
//
ERROR_DS_NO_RIDS_ALLOCATED = 8208;
//
// MessageId: ERROR_DS_NO_MORE_RIDS
//
// MessageText:
//
// The directory service has exhausted the pool of relative identifiers.
//
ERROR_DS_NO_MORE_RIDS = 8209;
//
// MessageId: ERROR_DS_INCORRECT_ROLE_OWNER
//
// MessageText:
//
// The requested operation could not be performed because the directory service is not the master for that type of operation.
//
ERROR_DS_INCORRECT_ROLE_OWNER = 8210;
//
// MessageId: ERROR_DS_RIDMGR_INIT_ERROR
//
// MessageText:
//
// The directory service was unable to initialize the subsystem that allocates relative identifiers.
//
ERROR_DS_RIDMGR_INIT_ERROR = 8211;
//
// MessageId: ERROR_DS_OBJ_CLASS_VIOLATION
//
// MessageText:
//
// The requested operation did not satisfy one or more constraints associated with the class of the object.
//
ERROR_DS_OBJ_CLASS_VIOLATION = 8212;
//
// MessageId: ERROR_DS_CANT_ON_NON_LEAF
//
// MessageText:
//
// The directory service can perform the requested operation only on a leaf object.
//
ERROR_DS_CANT_ON_NON_LEAF = 8213;
//
// MessageId: ERROR_DS_CANT_ON_RDN
//
// MessageText:
//
// The directory service cannot perform the requested operation on the RDN attribute of an object.
//
ERROR_DS_CANT_ON_RDN = 8214;
//
// MessageId: ERROR_DS_CANT_MOD_OBJ_CLASS
//
// MessageText:
//
// The directory service detected an attempt to modify the object class of an object.
//
ERROR_DS_CANT_MOD_OBJ_CLASS = 8215;
//
// MessageId: ERROR_DS_CROSS_DOM_MOVE_ERROR
//
// MessageText:
//
// The requested cross-domain move operation could not be performed.
//
ERROR_DS_CROSS_DOM_MOVE_ERROR = 8216;
//
// MessageId: ERROR_DS_GC_NOT_AVAILABLE
//
// MessageText:
//
// Unable to contact the global catalog server.
//
ERROR_DS_GC_NOT_AVAILABLE = 8217;
//
// MessageId: ERROR_SHARED_POLICY
//
// MessageText:
//
// The policy object is shared and can only be modified at the root.
//
ERROR_SHARED_POLICY = 8218;
//
// MessageId: ERROR_POLICY_OBJECT_NOT_FOUND
//
// MessageText:
//
// The policy object does not exist.
//
ERROR_POLICY_OBJECT_NOT_FOUND = 8219;
//
// MessageId: ERROR_POLICY_ONLY_IN_DS
//
// MessageText:
//
// The requested policy information is only in the directory service.
//
ERROR_POLICY_ONLY_IN_DS = 8220;
//
// MessageId: ERROR_PROMOTION_ACTIVE
//
// MessageText:
//
// A domain controller promotion is currently active.
//
ERROR_PROMOTION_ACTIVE = 8221;
//
// MessageId: ERROR_NO_PROMOTION_ACTIVE
//
// MessageText:
//
// A domain controller promotion is not currently active
//
ERROR_NO_PROMOTION_ACTIVE = 8222;
// 8223 unused
//
// MessageId: ERROR_DS_OPERATIONS_ERROR
//
// MessageText:
//
// An operations error occurred.
//
ERROR_DS_OPERATIONS_ERROR = 8224;
//
// MessageId: ERROR_DS_PROTOCOL_ERROR
//
// MessageText:
//
// A protocol error occurred.
//
ERROR_DS_PROTOCOL_ERROR = 8225;
//
// MessageId: ERROR_DS_TIMELIMIT_EXCEEDED
//
// MessageText:
//
// The time limit for this request was exceeded.
//
ERROR_DS_TIMELIMIT_EXCEEDED = 8226;
//
// MessageId: ERROR_DS_SIZELIMIT_EXCEEDED
//
// MessageText:
//
// The size limit for this request was exceeded.
//
ERROR_DS_SIZELIMIT_EXCEEDED = 8227;
//
// MessageId: ERROR_DS_ADMIN_LIMIT_EXCEEDED
//
// MessageText:
//
// The administrative limit for this request was exceeded.
//
ERROR_DS_ADMIN_LIMIT_EXCEEDED = 8228;
//
// MessageId: ERROR_DS_COMPARE_FALSE
//
// MessageText:
//
// The compare response was false.
//
ERROR_DS_COMPARE_FALSE = 8229;
//
// MessageId: ERROR_DS_COMPARE_TRUE
//
// MessageText:
//
// The compare response was true.
//
ERROR_DS_COMPARE_TRUE = 8230;
//
// MessageId: ERROR_DS_AUTH_METHOD_NOT_SUPPORTED
//
// MessageText:
//
// The requested authentication method is not supported by the server.
//
ERROR_DS_AUTH_METHOD_NOT_SUPPORTED = 8231;
//
// MessageId: ERROR_DS_STRONG_AUTH_REQUIRED
//
// MessageText:
//
// A more secure authentication method is required for this server.
//
ERROR_DS_STRONG_AUTH_REQUIRED = 8232;
//
// MessageId: ERROR_DS_INAPPROPRIATE_AUTH
//
// MessageText:
//
// Inappropriate authentication.
//
ERROR_DS_INAPPROPRIATE_AUTH = 8233;
//
// MessageId: ERROR_DS_AUTH_UNKNOWN
//
// MessageText:
//
// The authentication mechanism is unknown.
//
ERROR_DS_AUTH_UNKNOWN = 8234;
//
// MessageId: ERROR_DS_REFERRAL
//
// MessageText:
//
// A referral was returned from the server.
//
ERROR_DS_REFERRAL = 8235;
//
// MessageId: ERROR_DS_UNAVAILABLE_CRIT_EXTENSION
//
// MessageText:
//
// The server does not support the requested critical extension.
//
ERROR_DS_UNAVAILABLE_CRIT_EXTENSION = 8236;
//
// MessageId: ERROR_DS_CONFIDENTIALITY_REQUIRED
//
// MessageText:
//
// This request requires a secure connection.
//
ERROR_DS_CONFIDENTIALITY_REQUIRED = 8237;
//
// MessageId: ERROR_DS_INAPPROPRIATE_MATCHING
//
// MessageText:
//
// Inappropriate matching.
//
ERROR_DS_INAPPROPRIATE_MATCHING = 8238;
//
// MessageId: ERROR_DS_CONSTRAINT_VIOLATION
//
// MessageText:
//
// A constraint violation occurred.
//
ERROR_DS_CONSTRAINT_VIOLATION = 8239;
//
// MessageId: ERROR_DS_NO_SUCH_OBJECT
//
// MessageText:
//
// There is no such object on the server.
//
ERROR_DS_NO_SUCH_OBJECT = 8240;
//
// MessageId: ERROR_DS_ALIAS_PROBLEM
//
// MessageText:
//
// There is an alias problem.
//
ERROR_DS_ALIAS_PROBLEM = 8241;
//
// MessageId: ERROR_DS_INVALID_DN_SYNTAX
//
// MessageText:
//
// An invalid dn syntax has been specified.
//
ERROR_DS_INVALID_DN_SYNTAX = 8242;
//
// MessageId: ERROR_DS_IS_LEAF
//
// MessageText:
//
// The object is a leaf object.
//
ERROR_DS_IS_LEAF = 8243;
//
// MessageId: ERROR_DS_ALIAS_DEREF_PROBLEM
//
// MessageText:
//
// There is an alias dereferencing problem.
//
ERROR_DS_ALIAS_DEREF_PROBLEM = 8244;
//
// MessageId: ERROR_DS_UNWILLING_TO_PERFORM
//
// MessageText:
//
// The server is unwilling to process the request.
//
ERROR_DS_UNWILLING_TO_PERFORM = 8245;
//
// MessageId: ERROR_DS_LOOP_DETECT
//
// MessageText:
//
// A loop has been detected.
//
ERROR_DS_LOOP_DETECT = 8246;
//
// MessageId: ERROR_DS_NAMING_VIOLATION
//
// MessageText:
//
// There is a naming violation.
//
ERROR_DS_NAMING_VIOLATION = 8247;
//
// MessageId: ERROR_DS_OBJECT_RESULTS_TOO_LARGE
//
// MessageText:
//
// The result set is too large.
//
ERROR_DS_OBJECT_RESULTS_TOO_LARGE = 8248;
//
// MessageId: ERROR_DS_AFFECTS_MULTIPLE_DSAS
//
// MessageText:
//
// The operation affects multiple DSAs
//
ERROR_DS_AFFECTS_MULTIPLE_DSAS = 8249;
//
// MessageId: ERROR_DS_SERVER_DOWN
//
// MessageText:
//
// The server is not operational.
//
ERROR_DS_SERVER_DOWN = 8250;
//
// MessageId: ERROR_DS_LOCAL_ERROR
//
// MessageText:
//
// A local error has occurred.
//
ERROR_DS_LOCAL_ERROR = 8251;
//
// MessageId: ERROR_DS_ENCODING_ERROR
//
// MessageText:
//
// An encoding error has occurred.
//
ERROR_DS_ENCODING_ERROR = 8252;
//
// MessageId: ERROR_DS_DECODING_ERROR
//
// MessageText:
//
// A decoding error has occurred.
//
ERROR_DS_DECODING_ERROR = 8253;
//
// MessageId: ERROR_DS_FILTER_UNKNOWN
//
// MessageText:
//
// The search filter cannot be recognized.
//
ERROR_DS_FILTER_UNKNOWN = 8254;
//
// MessageId: ERROR_DS_PARAM_ERROR
//
// MessageText:
//
// One or more parameters are illegal.
//
ERROR_DS_PARAM_ERROR = 8255;
//
// MessageId: ERROR_DS_NOT_SUPPORTED
//
// MessageText:
//
// The specified method is not supported.
//
ERROR_DS_NOT_SUPPORTED = 8256;
//
// MessageId: ERROR_DS_NO_RESULTS_RETURNED
//
// MessageText:
//
// No results were returned.
//
ERROR_DS_NO_RESULTS_RETURNED = 8257;
//
// MessageId: ERROR_DS_CONTROL_NOT_FOUND
//
// MessageText:
//
// The specified control is not supported by the server.
//
ERROR_DS_CONTROL_NOT_FOUND = 8258;
//
// MessageId: ERROR_DS_CLIENT_LOOP
//
// MessageText:
//
// A referral loop was detected by the client.
//
ERROR_DS_CLIENT_LOOP = 8259;
//
// MessageId: ERROR_DS_REFERRAL_LIMIT_EXCEEDED
//
// MessageText:
//
// The preset referral limit was exceeded.
//
ERROR_DS_REFERRAL_LIMIT_EXCEEDED = 8260;
//
// MessageId: ERROR_DS_ROOT_MUST_BE_NC
//
// MessageText:
//
// The root object must be the head of a naming context. The root object cannot have an instantiated parent.
//
ERROR_DS_ROOT_MUST_BE_NC = 8301;
//
// MessageId: ERROR_DS_ADD_REPLICA_INHIBITED
//
// MessageText:
//
// The add replica operation cannot be performed. The naming context must be writable in order to create the replica.
//
ERROR_DS_ADD_REPLICA_INHIBITED = 8302;
//
// MessageId: ERROR_DS_ATT_NOT_DEF_IN_SCHEMA
//
// MessageText:
//
// A reference to an attribute that is not defined in the schema occurred.
//
ERROR_DS_ATT_NOT_DEF_IN_SCHEMA = 8303;
//
// MessageId: ERROR_DS_MAX_OBJ_SIZE_EXCEEDED
//
// MessageText:
//
// The maximum size of an object has been exceeded.
//
ERROR_DS_MAX_OBJ_SIZE_EXCEEDED = 8304;
//
// MessageId: ERROR_DS_OBJ_STRING_NAME_EXISTS
//
// MessageText:
//
// An attempt was made to add an object to the directory with a name that is already in use.
//
ERROR_DS_OBJ_STRING_NAME_EXISTS = 8305;
//
// MessageId: ERROR_DS_NO_RDN_DEFINED_IN_SCHEMA
//
// MessageText:
//
// An attempt was made to add an object of a class that does not have an RDN defined in the schema.
//
ERROR_DS_NO_RDN_DEFINED_IN_SCHEMA = 8306;
//
// MessageId: ERROR_DS_RDN_DOESNT_MATCH_SCHEMA
//
// MessageText:
//
// An attempt was made to add an object using an RDN that is not the RDN defined in the schema.
//
ERROR_DS_RDN_DOESNT_MATCH_SCHEMA = 8307;
//
// MessageId: ERROR_DS_NO_REQUESTED_ATTS_FOUND
//
// MessageText:
//
// None of the requested attributes were found on the objects.
//
ERROR_DS_NO_REQUESTED_ATTS_FOUND = 8308;
//
// MessageId: ERROR_DS_USER_BUFFER_TO_SMALL
//
// MessageText:
//
// The user buffer is too small.
//
ERROR_DS_USER_BUFFER_TO_SMALL = 8309;
//
// MessageId: ERROR_DS_ATT_IS_NOT_ON_OBJ
//
// MessageText:
//
// The attribute specified in the operation is not present on the object.
//
ERROR_DS_ATT_IS_NOT_ON_OBJ = 8310;
//
// MessageId: ERROR_DS_ILLEGAL_MOD_OPERATION
//
// MessageText:
//
// Illegal modify operation. Some aspect of the modification is not permitted.
//
ERROR_DS_ILLEGAL_MOD_OPERATION = 8311;
//
// MessageId: ERROR_DS_OBJ_TOO_LARGE
//
// MessageText:
//
// The specified object is too large.
//
ERROR_DS_OBJ_TOO_LARGE = 8312;
//
// MessageId: ERROR_DS_BAD_INSTANCE_TYPE
//
// MessageText:
//
// The specified instance type is not valid.
//
ERROR_DS_BAD_INSTANCE_TYPE = 8313;
//
// MessageId: ERROR_DS_MASTERDSA_REQUIRED
//
// MessageText:
//
// The operation must be performed at a master DSA.
//
ERROR_DS_MASTERDSA_REQUIRED = 8314;
//
// MessageId: ERROR_DS_OBJECT_CLASS_REQUIRED
//
// MessageText:
//
// The object class attribute must be specified.
//
ERROR_DS_OBJECT_CLASS_REQUIRED = 8315;
//
// MessageId: ERROR_DS_MISSING_REQUIRED_ATT
//
// MessageText:
//
// A required attribute is missing.
//
ERROR_DS_MISSING_REQUIRED_ATT = 8316;
//
// MessageId: ERROR_DS_ATT_NOT_DEF_FOR_CLASS
//
// MessageText:
//
// An attempt was made to modify an object to include an attribute that is not legal for its class.
//
ERROR_DS_ATT_NOT_DEF_FOR_CLASS = 8317;
//
// MessageId: ERROR_DS_ATT_ALREADY_EXISTS
//
// MessageText:
//
// The specified attribute is already present on the object.
//
ERROR_DS_ATT_ALREADY_EXISTS = 8318;
// 8319 unused
//
// MessageId: ERROR_DS_CANT_ADD_ATT_VALUES
//
// MessageText:
//
// The specified attribute is not present, or has no values.
//
ERROR_DS_CANT_ADD_ATT_VALUES = 8320;
//
// MessageId: ERROR_DS_SINGLE_VALUE_CONSTRAINT
//
// MessageText:
//
// Mutliple values were specified for an attribute that can have only one value.
//
ERROR_DS_SINGLE_VALUE_CONSTRAINT = 8321;
//
// MessageId: ERROR_DS_RANGE_CONSTRAINT
//
// MessageText:
//
// A value for the attribute was not in the acceptable range of values.
//
ERROR_DS_RANGE_CONSTRAINT = 8322;
//
// MessageId: ERROR_DS_ATT_VAL_ALREADY_EXISTS
//
// MessageText:
//
// The specified value already exists.
//
ERROR_DS_ATT_VAL_ALREADY_EXISTS = 8323;
//
// MessageId: ERROR_DS_CANT_REM_MISSING_ATT
//
// MessageText:
//
// The attribute cannot be removed because it is not present on the object.
//
ERROR_DS_CANT_REM_MISSING_ATT = 8324;
//
// MessageId: ERROR_DS_CANT_REM_MISSING_ATT_VAL
//
// MessageText:
//
// The attribute value cannot be removed because it is not present on the object.
//
ERROR_DS_CANT_REM_MISSING_ATT_VAL = 8325;
//
// MessageId: ERROR_DS_ROOT_CANT_BE_SUBREF
//
// MessageText:
//
// The specified root object cannot be a subref.
//
ERROR_DS_ROOT_CANT_BE_SUBREF = 8326;
//
// MessageId: ERROR_DS_NO_CHAINING
//
// MessageText:
//
// Chaining is not permitted.
//
ERROR_DS_NO_CHAINING = 8327;
//
// MessageId: ERROR_DS_NO_CHAINED_EVAL
//
// MessageText:
//
// Chained evaluation is not permitted.
//
ERROR_DS_NO_CHAINED_EVAL = 8328;
//
// MessageId: ERROR_DS_NO_PARENT_OBJECT
//
// MessageText:
//
// The operation could not be performed because the object's parent is either uninstantiated or deleted.
//
ERROR_DS_NO_PARENT_OBJECT = 8329;
//
// MessageId: ERROR_DS_PARENT_IS_AN_ALIAS
//
// MessageText:
//
// Having a parent that is an alias is not permitted. Aliases are leaf objects.
//
ERROR_DS_PARENT_IS_AN_ALIAS = 8330;
//
// MessageId: ERROR_DS_CANT_MIX_MASTER_AND_REPS
//
// MessageText:
//
// The object and parent must be of the same type, either both masters or
// both replicas.
//
ERROR_DS_CANT_MIX_MASTER_AND_REPS = 8331;
//
// MessageId: ERROR_DS_CHILDREN_EXIST
//
// MessageText:
//
// The operation cannot be performed because child objects exist. This operation can only be performed on a leaf object.
//
ERROR_DS_CHILDREN_EXIST = 8332;
//
// MessageId: ERROR_DS_OBJ_NOT_FOUND
//
// MessageText:
//
// Directory object not found.
//
ERROR_DS_OBJ_NOT_FOUND = 8333;
//
// MessageId: ERROR_DS_ALIASED_OBJ_MISSING
//
// MessageText:
//
// The aliased object is missing.
//
ERROR_DS_ALIASED_OBJ_MISSING = 8334;
//
// MessageId: ERROR_DS_BAD_NAME_SYNTAX
//
// MessageText:
//
// The object name has bad syntax.
//
ERROR_DS_BAD_NAME_SYNTAX = 8335;
//
// MessageId: ERROR_DS_ALIAS_POINTS_TO_ALIAS
//
// MessageText:
//
// It is not permitted for an alias to refer to another alias.
//
ERROR_DS_ALIAS_POINTS_TO_ALIAS = 8336;
//
// MessageId: ERROR_DS_CANT_DEREF_ALIAS
//
// MessageText:
//
// The alias cannot be dereferenced.
//
ERROR_DS_CANT_DEREF_ALIAS = 8337;
//
// MessageId: ERROR_DS_OUT_OF_SCOPE
//
// MessageText:
//
// The operation is out of scope.
//
ERROR_DS_OUT_OF_SCOPE = 8338;
// 8339 unused
//
// MessageId: ERROR_DS_CANT_DELETE_DSA_OBJ
//
// MessageText:
//
// The DSA object cannot be deleted.
//
ERROR_DS_CANT_DELETE_DSA_OBJ = 8340;
//
// MessageId: ERROR_DS_GENERIC_ERROR
//
// MessageText:
//
// A directory service error has occurred.
//
ERROR_DS_GENERIC_ERROR = 8341;
//
// MessageId: ERROR_DS_DSA_MUST_BE_INT_MASTER
//
// MessageText:
//
// The operation can only be performed on an internal master DSA object.
//
ERROR_DS_DSA_MUST_BE_INT_MASTER = 8342;
//
// MessageId: ERROR_DS_CLASS_NOT_DSA
//
// MessageText:
//
// The object must be of class DSA.
//
ERROR_DS_CLASS_NOT_DSA = 8343;
//
// MessageId: ERROR_DS_INSUFF_ACCESS_RIGHTS
//
// MessageText:
//
// Insufficient access rights to perform the operation.
//
ERROR_DS_INSUFF_ACCESS_RIGHTS = 8344;
//
// MessageId: ERROR_DS_ILLEGAL_SUPERIOR
//
// MessageText:
//
// The object cannot be added because the parent is not on the list of possible superiors.
//
ERROR_DS_ILLEGAL_SUPERIOR = 8345;
//
// MessageId: ERROR_DS_ATTRIBUTE_OWNED_BY_SAM
//
// MessageText:
//
// Access to the attribute is not permitted because the attribute is owned by the Security Accounts Manager (SAM).
//
ERROR_DS_ATTRIBUTE_OWNED_BY_SAM = 8346;
//
// MessageId: ERROR_DS_NAME_TOO_MANY_PARTS
//
// MessageText:
//
// The name has too many parts.
//
ERROR_DS_NAME_TOO_MANY_PARTS = 8347;
//
// MessageId: ERROR_DS_NAME_TOO_LONG
//
// MessageText:
//
// The name is too long.
//
ERROR_DS_NAME_TOO_LONG = 8348;
//
// MessageId: ERROR_DS_NAME_VALUE_TOO_LONG
//
// MessageText:
//
// The name value is too long.
//
ERROR_DS_NAME_VALUE_TOO_LONG = 8349;
//
// MessageId: ERROR_DS_NAME_UNPARSEABLE
//
// MessageText:
//
// The directory service encountered an error parsing a name.
//
ERROR_DS_NAME_UNPARSEABLE = 8350;
//
// MessageId: ERROR_DS_NAME_TYPE_UNKNOWN
//
// MessageText:
//
// The directory service cannot get the attribute type for a name.
//
ERROR_DS_NAME_TYPE_UNKNOWN = 8351;
//
// MessageId: ERROR_DS_NOT_AN_OBJECT
//
// MessageText:
//
// The name does not identify an object; the name identifies a phantom.
//
ERROR_DS_NOT_AN_OBJECT = 8352;
//
// MessageId: ERROR_DS_SEC_DESC_TOO_SHORT
//
// MessageText:
//
// The security descriptor is too short.
//
ERROR_DS_SEC_DESC_TOO_SHORT = 8353;
//
// MessageId: ERROR_DS_SEC_DESC_INVALID
//
// MessageText:
//
// The security descriptor is invalid.
//
ERROR_DS_SEC_DESC_INVALID = 8354;
//
// MessageId: ERROR_DS_NO_DELETED_NAME
//
// MessageText:
//
// Failed to create name for deleted object.
//
ERROR_DS_NO_DELETED_NAME = 8355;
//
// MessageId: ERROR_DS_SUBREF_MUST_HAVE_PARENT
//
// MessageText:
//
// The parent of a new subref must exist.
//
ERROR_DS_SUBREF_MUST_HAVE_PARENT = 8356;
//
// MessageId: ERROR_DS_NCNAME_MUST_BE_NC
//
// MessageText:
//
// The object must be a naming context.
//
ERROR_DS_NCNAME_MUST_BE_NC = 8357;
//
// MessageId: ERROR_DS_CANT_ADD_SYSTEM_ONLY
//
// MessageText:
//
// It is not permitted to add an attribute which is owned by the system.
//
ERROR_DS_CANT_ADD_SYSTEM_ONLY = 8358;
//
// MessageId: ERROR_DS_CLASS_MUST_BE_CONCRETE
//
// MessageText:
//
// The class of the object must be structural; you cannot instantiate an abstract class.
//
ERROR_DS_CLASS_MUST_BE_CONCRETE = 8359;
//
// MessageId: ERROR_DS_INVALID_DMD
//
// MessageText:
//
// The schema object could not be found.
//
ERROR_DS_INVALID_DMD = 8360;
//
// MessageId: ERROR_DS_OBJ_GUID_EXISTS
//
// MessageText:
//
// A local object with this GUID (dead or alive) already exists.
//
ERROR_DS_OBJ_GUID_EXISTS = 8361;
//
// MessageId: ERROR_DS_NOT_ON_BACKLINK
//
// MessageText:
//
// The operation cannot be performed on a back link.
//
ERROR_DS_NOT_ON_BACKLINK = 8362;
//
// MessageId: ERROR_DS_NO_CROSSREF_FOR_NC
//
// MessageText:
//
// The cross reference for the specified naming context could not be found.
//
ERROR_DS_NO_CROSSREF_FOR_NC = 8363;
//
// MessageId: ERROR_DS_SHUTTING_DOWN
//
// MessageText:
//
// The operation could not be performed because the directory service is shutting down.
//
ERROR_DS_SHUTTING_DOWN = 8364;
//
// MessageId: ERROR_DS_UNKNOWN_OPERATION
//
// MessageText:
//
// The directory service request is invalid.
//
ERROR_DS_UNKNOWN_OPERATION = 8365;
//
// MessageId: ERROR_DS_INVALID_ROLE_OWNER
//
// MessageText:
//
// The role owner attribute could not be read.
//
ERROR_DS_INVALID_ROLE_OWNER = 8366;
//
// MessageId: ERROR_DS_COULDNT_CONTACT_FSMO
//
// MessageText:
//
// The requested FSMO operation failed. The current FSMO holder could not be contacted.
//
ERROR_DS_COULDNT_CONTACT_FSMO = 8367;
//
// MessageId: ERROR_DS_CROSS_NC_DN_RENAME
//
// MessageText:
//
// Modification of a DN across a naming context is not permitted.
//
ERROR_DS_CROSS_NC_DN_RENAME = 8368;
//
// MessageId: ERROR_DS_CANT_MOD_SYSTEM_ONLY
//
// MessageText:
//
// The attribute cannot be modified because it is owned by the system.
//
ERROR_DS_CANT_MOD_SYSTEM_ONLY = 8369;
//
// MessageId: ERROR_DS_REPLICATOR_ONLY
//
// MessageText:
//
// Only the replicator can perform this function.
//
ERROR_DS_REPLICATOR_ONLY = 8370;
//
// MessageId: ERROR_DS_OBJ_CLASS_NOT_DEFINED
//
// MessageText:
//
// The specified class is not defined.
//
ERROR_DS_OBJ_CLASS_NOT_DEFINED = 8371;
//
// MessageId: ERROR_DS_OBJ_CLASS_NOT_SUBCLASS
//
// MessageText:
//
// The specified class is not a subclass.
//
ERROR_DS_OBJ_CLASS_NOT_SUBCLASS = 8372;
//
// MessageId: ERROR_DS_NAME_REFERENCE_INVALID
//
// MessageText:
//
// The name reference is invalid.
//
ERROR_DS_NAME_REFERENCE_INVALID = 8373;
//
// MessageId: ERROR_DS_CROSS_REF_EXISTS
//
// MessageText:
//
// A cross reference already exists.
//
ERROR_DS_CROSS_REF_EXISTS = 8374;
//
// MessageId: ERROR_DS_CANT_DEL_MASTER_CROSSREF
//
// MessageText:
//
// It is not permitted to delete a master cross reference.
//
ERROR_DS_CANT_DEL_MASTER_CROSSREF = 8375;
//
// MessageId: ERROR_DS_SUBTREE_NOTIFY_NOT_NC_HEAD
//
// MessageText:
//
// Subtree notifications are only supported on NC heads.
//
ERROR_DS_SUBTREE_NOTIFY_NOT_NC_HEAD = 8376;
//
// MessageId: ERROR_DS_NOTIFY_FILTER_TOO_COMPLEX
//
// MessageText:
//
// Notification filter is too complex.
//
ERROR_DS_NOTIFY_FILTER_TOO_COMPLEX = 8377;
//
// MessageId: ERROR_DS_DUP_RDN
//
// MessageText:
//
// Schema update failed: duplicate RDN.
//
ERROR_DS_DUP_RDN = 8378;
//
// MessageId: ERROR_DS_DUP_OID
//
// MessageText:
//
// Schema update failed: duplicate OID.
//
ERROR_DS_DUP_OID = 8379;
//
// MessageId: ERROR_DS_DUP_MAPI_ID
//
// MessageText:
//
// Schema update failed: duplicate MAPI identifier.
//
ERROR_DS_DUP_MAPI_ID = 8380;
//
// MessageId: ERROR_DS_DUP_SCHEMA_ID_GUID
//
// MessageText:
//
// Schema update failed: duplicate schema-id GUID.
//
ERROR_DS_DUP_SCHEMA_ID_GUID = 8381;
//
// MessageId: ERROR_DS_DUP_LDAP_DISPLAY_NAME
//
// MessageText:
//
// Schema update failed: duplicate LDAP display name.
//
ERROR_DS_DUP_LDAP_DISPLAY_NAME = 8382;
//
// MessageId: ERROR_DS_SEMANTIC_ATT_TEST
//
// MessageText:
//
// Schema update failed: range-lower less than range upper.
//
ERROR_DS_SEMANTIC_ATT_TEST = 8383;
//
// MessageId: ERROR_DS_SYNTAX_MISMATCH
//
// MessageText:
//
// Schema update failed: syntax mismatch.
//
ERROR_DS_SYNTAX_MISMATCH = 8384;
//
// MessageId: ERROR_DS_EXISTS_IN_MUST_HAVE
//
// MessageText:
//
// Schema deletion failed: attribute is used in must-contain.
//
ERROR_DS_EXISTS_IN_MUST_HAVE = 8385;
//
// MessageId: ERROR_DS_EXISTS_IN_MAY_HAVE
//
// MessageText:
//
// Schema deletion failed: attribute is used in may-contain.
//
ERROR_DS_EXISTS_IN_MAY_HAVE = 8386;
//
// MessageId: ERROR_DS_NONEXISTENT_MAY_HAVE
//
// MessageText:
//
// Schema update failed: attribute in may-contain does not exist.
//
ERROR_DS_NONEXISTENT_MAY_HAVE = 8387;
//
// MessageId: ERROR_DS_NONEXISTENT_MUST_HAVE
//
// MessageText:
//
// Schema update failed: attribute in must-contain does not exist.
//
ERROR_DS_NONEXISTENT_MUST_HAVE = 8388;
//
// MessageId: ERROR_DS_AUX_CLS_TEST_FAIL
//
// MessageText:
//
// Schema update failed: class in aux-class list does not exist or is not an auxiliary class.
//
ERROR_DS_AUX_CLS_TEST_FAIL = 8389;
//
// MessageId: ERROR_DS_NONEXISTENT_POSS_SUP
//
// MessageText:
//
// Schema update failed: class in poss-superiors does not exist.
//
ERROR_DS_NONEXISTENT_POSS_SUP = 8390;
//
// MessageId: ERROR_DS_SUB_CLS_TEST_FAIL
//
// MessageText:
//
// Schema update failed: class in subclassof list does not exist or does not satisfy hierarchy rules.
//
ERROR_DS_SUB_CLS_TEST_FAIL = 8391;
//
// MessageId: ERROR_DS_BAD_RDN_ATT_ID_SYNTAX
//
// MessageText:
//
// Schema update failed: Rdn-Att-Id has wrong syntax.
//
ERROR_DS_BAD_RDN_ATT_ID_SYNTAX = 8392;
//
// MessageId: ERROR_DS_EXISTS_IN_AUX_CLS
//
// MessageText:
//
// Schema deletion failed: class is used as auxiliary class.
//
ERROR_DS_EXISTS_IN_AUX_CLS = 8393;
//
// MessageId: ERROR_DS_EXISTS_IN_SUB_CLS
//
// MessageText:
//
// Schema deletion failed: class is used as sub class.
//
ERROR_DS_EXISTS_IN_SUB_CLS = 8394;
//
// MessageId: ERROR_DS_EXISTS_IN_POSS_SUP
//
// MessageText:
//
// Schema deletion failed: class is used as poss superior.
//
ERROR_DS_EXISTS_IN_POSS_SUP = 8395;
//
// MessageId: ERROR_DS_RECALCSCHEMA_FAILED
//
// MessageText:
//
// Schema update failed in recalculating validation cache.
//
ERROR_DS_RECALCSCHEMA_FAILED = 8396;
//
// MessageId: ERROR_DS_TREE_DELETE_NOT_FINISHED
//
// MessageText:
//
// The tree deletion is not finished. The request must be made again to continue deleting the tree.
//
ERROR_DS_TREE_DELETE_NOT_FINISHED = 8397;
//
// MessageId: ERROR_DS_CANT_DELETE
//
// MessageText:
//
// The requested delete operation could not be performed.
//
ERROR_DS_CANT_DELETE = 8398;
//
// MessageId: ERROR_DS_ATT_SCHEMA_REQ_ID
//
// MessageText:
//
// Cannot read the governs class identifier for the schema record.
//
ERROR_DS_ATT_SCHEMA_REQ_ID = 8399;
//
// MessageId: ERROR_DS_BAD_ATT_SCHEMA_SYNTAX
//
// MessageText:
//
// The attribute schema has bad syntax.
//
ERROR_DS_BAD_ATT_SCHEMA_SYNTAX = 8400;
//
// MessageId: ERROR_DS_CANT_CACHE_ATT
//
// MessageText:
//
// The attribute could not be cached.
//
ERROR_DS_CANT_CACHE_ATT = 8401;
//
// MessageId: ERROR_DS_CANT_CACHE_CLASS
//
// MessageText:
//
// The class could not be cached.
//
ERROR_DS_CANT_CACHE_CLASS = 8402;
//
// MessageId: ERROR_DS_CANT_REMOVE_ATT_CACHE
//
// MessageText:
//
// The attribute could not be removed from the cache.
//
ERROR_DS_CANT_REMOVE_ATT_CACHE = 8403;
//
// MessageId: ERROR_DS_CANT_REMOVE_CLASS_CACHE
//
// MessageText:
//
// The class could not be removed from the cache.
//
ERROR_DS_CANT_REMOVE_CLASS_CACHE = 8404;
//
// MessageId: ERROR_DS_CANT_RETRIEVE_DN
//
// MessageText:
//
// The distinguished name attribute could not be read.
//
ERROR_DS_CANT_RETRIEVE_DN = 8405;
//
// MessageId: ERROR_DS_MISSING_SUPREF
//
// MessageText:
//
// A required subref is missing.
//
ERROR_DS_MISSING_SUPREF = 8406;
//
// MessageId: ERROR_DS_CANT_RETRIEVE_INSTANCE
//
// MessageText:
//
// The instance type attribute could not be retrieved.
//
ERROR_DS_CANT_RETRIEVE_INSTANCE = 8407;
//
// MessageId: ERROR_DS_CODE_INCONSISTENCY
//
// MessageText:
//
// An internal error has occurred.
//
ERROR_DS_CODE_INCONSISTENCY = 8408;
//
// MessageId: ERROR_DS_DATABASE_ERROR
//
// MessageText:
//
// A database error has occurred.
//
ERROR_DS_DATABASE_ERROR = 8409;
//
// MessageId: ERROR_DS_GOVERNSID_MISSING
//
// MessageText:
//
// The attribute GOVERNSID is missing.
//
ERROR_DS_GOVERNSID_MISSING = 8410;
//
// MessageId: ERROR_DS_MISSING_EXPECTED_ATT
//
// MessageText:
//
// An expected attribute is missing.
//
ERROR_DS_MISSING_EXPECTED_ATT = 8411;
//
// MessageId: ERROR_DS_NCNAME_MISSING_CR_REF
//
// MessageText:
//
// The specified naming context is missing a cross reference.
//
ERROR_DS_NCNAME_MISSING_CR_REF = 8412;
//
// MessageId: ERROR_DS_SECURITY_CHECKING_ERROR
//
// MessageText:
//
// A security checking error has occurred.
//
ERROR_DS_SECURITY_CHECKING_ERROR = 8413;
//
// MessageId: ERROR_DS_SCHEMA_NOT_LOADED
//
// MessageText:
//
// The schema is not loaded.
//
ERROR_DS_SCHEMA_NOT_LOADED = 8414;
//
// MessageId: ERROR_DS_SCHEMA_ALLOC_FAILED
//
// MessageText:
//
// Schema allocation failed. Please check if the machine is running low on memory.
//
ERROR_DS_SCHEMA_ALLOC_FAILED = 8415;
//
// MessageId: ERROR_DS_ATT_SCHEMA_REQ_SYNTAX
//
// MessageText:
//
// Failed to obtain the required syntax for the attribute schema.
//
ERROR_DS_ATT_SCHEMA_REQ_SYNTAX = 8416;
//
// MessageId: ERROR_DS_GCVERIFY_ERROR
//
// MessageText:
//
// The global catalog verification failed. The global catalog is not available or does not support the operation. Some part of the directory is currently not available.
//
ERROR_DS_GCVERIFY_ERROR = 8417;
//
// MessageId: ERROR_DS_DRA_SCHEMA_MISMATCH
//
// MessageText:
//
// The replication operation failed because of a schema mismatch between the servers involved.
//
ERROR_DS_DRA_SCHEMA_MISMATCH = 8418;
//
// MessageId: ERROR_DS_CANT_FIND_DSA_OBJ
//
// MessageText:
//
// The DSA object could not be found.
//
ERROR_DS_CANT_FIND_DSA_OBJ = 8419;
//
// MessageId: ERROR_DS_CANT_FIND_EXPECTED_NC
//
// MessageText:
//
// The naming context could not be found.
//
ERROR_DS_CANT_FIND_EXPECTED_NC = 8420;
//
// MessageId: ERROR_DS_CANT_FIND_NC_IN_CACHE
//
// MessageText:
//
// The naming context could not be found in the cache.
//
ERROR_DS_CANT_FIND_NC_IN_CACHE = 8421;
//
// MessageId: ERROR_DS_CANT_RETRIEVE_CHILD
//
// MessageText:
//
// The child object could not be retrieved.
//
ERROR_DS_CANT_RETRIEVE_CHILD = 8422;
//
// MessageId: ERROR_DS_SECURITY_ILLEGAL_MODIFY
//
// MessageText:
//
// The modification was not permitted for security reasons.
//
ERROR_DS_SECURITY_ILLEGAL_MODIFY = 8423;
//
// MessageId: ERROR_DS_CANT_REPLACE_HIDDEN_REC
//
// MessageText:
//
// The operation cannot replace the hidden record.
//
ERROR_DS_CANT_REPLACE_HIDDEN_REC = 8424;
//
// MessageId: ERROR_DS_BAD_HIERARCHY_FILE
//
// MessageText:
//
// The hierarchy file is invalid.
//
ERROR_DS_BAD_HIERARCHY_FILE = 8425;
//
// MessageId: ERROR_DS_BUILD_HIERARCHY_TABLE_FAILED
//
// MessageText:
//
// The attempt to build the hierarchy table failed.
//
ERROR_DS_BUILD_HIERARCHY_TABLE_FAILED = 8426;
//
// MessageId: ERROR_DS_CONFIG_PARAM_MISSING
//
// MessageText:
//
// The directory configuration parameter is missing from the registry.
//
ERROR_DS_CONFIG_PARAM_MISSING = 8427;
//
// MessageId: ERROR_DS_COUNTING_AB_INDICES_FAILED
//
// MessageText:
//
// The attempt to count the address book indices failed.
//
ERROR_DS_COUNTING_AB_INDICES_FAILED = 8428;
//
// MessageId: ERROR_DS_HIERARCHY_TABLE_MALLOC_FAILED
//
// MessageText:
//
// The allocation of the hierarchy table failed.
//
ERROR_DS_HIERARCHY_TABLE_MALLOC_FAILED = 8429;
//
// MessageId: ERROR_DS_INTERNAL_FAILURE
//
// MessageText:
//
// The directory service encountered an internal failure.
//
ERROR_DS_INTERNAL_FAILURE = 8430;
//
// MessageId: ERROR_DS_UNKNOWN_ERROR
//
// MessageText:
//
// The directory service encountered an unknown failure.
//
ERROR_DS_UNKNOWN_ERROR = 8431;
//
// MessageId: ERROR_DS_ROOT_REQUIRES_CLASS_TOP
//
// MessageText:
//
// A root object requires a class of 'top'.
//
ERROR_DS_ROOT_REQUIRES_CLASS_TOP = 8432;
//
// MessageId: ERROR_DS_REFUSING_FSMO_ROLES
//
// MessageText:
//
// This directory server is shutting down, and cannot take ownership of new floating single-master operation roles.
//
ERROR_DS_REFUSING_FSMO_ROLES = 8433;
//
// MessageId: ERROR_DS_MISSING_FSMO_SETTINGS
//
// MessageText:
//
// The directory service is missing mandatory configuration information, and is unable to determine the ownership of floating single-master operation roles.
//
ERROR_DS_MISSING_FSMO_SETTINGS = 8434;
//
// MessageId: ERROR_DS_UNABLE_TO_SURRENDER_ROLES
//
// MessageText:
//
// The directory service was unable to transfer ownership of one or more floating single-master operation roles to other servers.
//
ERROR_DS_UNABLE_TO_SURRENDER_ROLES = 8435;
//
// MessageId: ERROR_DS_DRA_GENERIC
//
// MessageText:
//
// The replication operation failed.
//
ERROR_DS_DRA_GENERIC = 8436;
//
// MessageId: ERROR_DS_DRA_INVALID_PARAMETER
//
// MessageText:
//
// An invalid parameter was specified for this replication operation.
//
ERROR_DS_DRA_INVALID_PARAMETER = 8437;
//
// MessageId: ERROR_DS_DRA_BUSY
//
// MessageText:
//
// The directory service is too busy to complete the replication operation at this time.
//
ERROR_DS_DRA_BUSY = 8438;
//
// MessageId: ERROR_DS_DRA_BAD_DN
//
// MessageText:
//
// The distinguished name specified for this replication operation is invalid.
//
ERROR_DS_DRA_BAD_DN = 8439;
//
// MessageId: ERROR_DS_DRA_BAD_NC
//
// MessageText:
//
// The naming context specified for this replication operation is invalid.
//
ERROR_DS_DRA_BAD_NC = 8440;
//
// MessageId: ERROR_DS_DRA_DN_EXISTS
//
// MessageText:
//
// The distinguished name specified for this replication operation already exists.
//
ERROR_DS_DRA_DN_EXISTS = 8441;
//
// MessageId: ERROR_DS_DRA_INTERNAL_ERROR
//
// MessageText:
//
// The replication system encountered an internal error.
//
ERROR_DS_DRA_INTERNAL_ERROR = 8442;
//
// MessageId: ERROR_DS_DRA_INCONSISTENT_DIT
//
// MessageText:
//
// The replication operation encountered a database inconsistency.
//
ERROR_DS_DRA_INCONSISTENT_DIT = 8443;
//
// MessageId: ERROR_DS_DRA_CONNECTION_FAILED
//
// MessageText:
//
// The server specified for this replication operation could not be contacted.
//
ERROR_DS_DRA_CONNECTION_FAILED = 8444;
//
// MessageId: ERROR_DS_DRA_BAD_INSTANCE_TYPE
//
// MessageText:
//
// The replication operation encountered an object with an invalid instance type.
//
ERROR_DS_DRA_BAD_INSTANCE_TYPE = 8445;
//
// MessageId: ERROR_DS_DRA_OUT_OF_MEM
//
// MessageText:
//
// The replication operation failed to allocate memory.
//
ERROR_DS_DRA_OUT_OF_MEM = 8446;
//
// MessageId: ERROR_DS_DRA_MAIL_PROBLEM
//
// MessageText:
//
// The replication operation encountered an error with the mail system.
//
ERROR_DS_DRA_MAIL_PROBLEM = 8447;
//
// MessageId: ERROR_DS_DRA_REF_ALREADY_EXISTS
//
// MessageText:
//
// The replication reference information for the target server already exists.
//
ERROR_DS_DRA_REF_ALREADY_EXISTS = 8448;
//
// MessageId: ERROR_DS_DRA_REF_NOT_FOUND
//
// MessageText:
//
// The replication reference information for the target server does not exist.
//
ERROR_DS_DRA_REF_NOT_FOUND = 8449;
//
// MessageId: ERROR_DS_DRA_OBJ_IS_REP_SOURCE
//
// MessageText:
//
// The naming context cannot be removed because it is replicated to another server.
//
ERROR_DS_DRA_OBJ_IS_REP_SOURCE = 8450;
//
// MessageId: ERROR_DS_DRA_DB_ERROR
//
// MessageText:
//
// The replication operation encountered a database error.
//
ERROR_DS_DRA_DB_ERROR = 8451;
//
// MessageId: ERROR_DS_DRA_NO_REPLICA
//
// MessageText:
//
// The naming context is in the process of being removed or is not replicated from the specified server.
//
ERROR_DS_DRA_NO_REPLICA = 8452;
//
// MessageId: ERROR_DS_DRA_ACCESS_DENIED
//
// MessageText:
//
// Replication access was denied.
//
ERROR_DS_DRA_ACCESS_DENIED = 8453;
//
// MessageId: ERROR_DS_DRA_NOT_SUPPORTED
//
// MessageText:
//
// The requested operation is not supported by this version of the directory service.
//
ERROR_DS_DRA_NOT_SUPPORTED = 8454;
//
// MessageId: ERROR_DS_DRA_RPC_CANCELLED
//
// MessageText:
//
// The replication remote procedure call was cancelled.
//
ERROR_DS_DRA_RPC_CANCELLED = 8455;
//
// MessageId: ERROR_DS_DRA_SOURCE_DISABLED
//
// MessageText:
//
// The source server is currently rejecting replication requests.
//
ERROR_DS_DRA_SOURCE_DISABLED = 8456;
//
// MessageId: ERROR_DS_DRA_SINK_DISABLED
//
// MessageText:
//
// The destination server is currently rejecting replication requests.
//
ERROR_DS_DRA_SINK_DISABLED = 8457;
//
// MessageId: ERROR_DS_DRA_NAME_COLLISION
//
// MessageText:
//
// The replication operation failed due to a collision of object names.
//
ERROR_DS_DRA_NAME_COLLISION = 8458;
//
// MessageId: ERROR_DS_DRA_SOURCE_REINSTALLED
//
// MessageText:
//
// The replication source has been reinstalled.
//
ERROR_DS_DRA_SOURCE_REINSTALLED = 8459;
//
// MessageId: ERROR_DS_DRA_MISSING_PARENT
//
// MessageText:
//
// The replication operation failed because a required parent object is missing.
//
ERROR_DS_DRA_MISSING_PARENT = 8460;
//
// MessageId: ERROR_DS_DRA_PREEMPTED
//
// MessageText:
//
// The replication operation was preempted.
//
ERROR_DS_DRA_PREEMPTED = 8461;
//
// MessageId: ERROR_DS_DRA_ABANDON_SYNC
//
// MessageText:
//
// The replication synchronization attempt was abandoned because of a lack of updates.
//
ERROR_DS_DRA_ABANDON_SYNC = 8462;
//
// MessageId: ERROR_DS_DRA_SHUTDOWN
//
// MessageText:
//
// The replication operation was terminated because the system is shutting down.
//
ERROR_DS_DRA_SHUTDOWN = 8463;
//
// MessageId: ERROR_DS_DRA_INCOMPATIBLE_PARTIAL_SET
//
// MessageText:
//
// The replication synchronization attempt failed as the destination partial attribute set is not a subset of source partial attribute set.
//
ERROR_DS_DRA_INCOMPATIBLE_PARTIAL_SET = 8464;
//
// MessageId: ERROR_DS_DRA_SOURCE_IS_PARTIAL_REPLICA
//
// MessageText:
//
// The replication synchronization attempt failed because a master replica attempted to sync from a partial replica.
//
ERROR_DS_DRA_SOURCE_IS_PARTIAL_REPLICA = 8465;
//
// MessageId: ERROR_DS_DRA_EXTN_CONNECTION_FAILED
//
// MessageText:
//
// The server specified for this replication operation was contacted, but that server was unable to contact an additional server needed to complete the operation.
//
ERROR_DS_DRA_EXTN_CONNECTION_FAILED = 8466;
//
// MessageId: ERROR_DS_INSTALL_SCHEMA_MISMATCH
//
// MessageText:
//
// A schema mismatch is detected between the source and the build used during a replica install. The replica cannot be installed.
//
ERROR_DS_INSTALL_SCHEMA_MISMATCH = 8467;
//
// MessageId: ERROR_DS_DUP_LINK_ID
//
// MessageText:
//
// Schema update failed: An attribute with the same link identifier already exists.
//
ERROR_DS_DUP_LINK_ID = 8468;
//
// MessageId: ERROR_DS_NAME_ERROR_RESOLVING
//
// MessageText:
//
// Name translation: Generic processing error.
//
ERROR_DS_NAME_ERROR_RESOLVING = 8469;
//
// MessageId: ERROR_DS_NAME_ERROR_NOT_FOUND
//
// MessageText:
//
// Name translation: Could not find the name or insufficient right to see name.
//
ERROR_DS_NAME_ERROR_NOT_FOUND = 8470;
//
// MessageId: ERROR_DS_NAME_ERROR_NOT_UNIQUE
//
// MessageText:
//
// Name translation: Input name mapped to more than one output name.
//
ERROR_DS_NAME_ERROR_NOT_UNIQUE = 8471;
//
// MessageId: ERROR_DS_NAME_ERROR_NO_MAPPING
//
// MessageText:
//
// Name translation: Input name found, but not the associated output format.
//
ERROR_DS_NAME_ERROR_NO_MAPPING = 8472;
//
// MessageId: ERROR_DS_NAME_ERROR_DOMAIN_ONLY
//
// MessageText:
//
// Name translation: Unable to resolve completely, only the domain was found.
//
ERROR_DS_NAME_ERROR_DOMAIN_ONLY = 8473;
//
// MessageId: ERROR_DS_NAME_ERROR_NO_SYNTACTICAL_MAPPING
//
// MessageText:
//
// Name translation: Unable to perform purely syntactical mapping at the client without going out to the wire.
//
ERROR_DS_NAME_ERROR_NO_SYNTACTICAL_MAPPING = 8474;
//
// MessageId: ERROR_DS_CONSTRUCTED_ATT_MOD
//
// MessageText:
//
// Modification of a constructed att is not allowed.
//
ERROR_DS_CONSTRUCTED_ATT_MOD = 8475;
//
// MessageId: ERROR_DS_WRONG_OM_OBJ_CLASS
//
// MessageText:
//
// The OM-Object-Class specified is incorrect for an attribute with the specified syntax.
//
ERROR_DS_WRONG_OM_OBJ_CLASS = 8476;
//
// MessageId: ERROR_DS_DRA_REPL_PENDING
//
// MessageText:
//
// The replication request has been posted; waiting for reply.
//
ERROR_DS_DRA_REPL_PENDING = 8477;
//
// MessageId: ERROR_DS_DS_REQUIRED
//
// MessageText:
//
// The requested operation requires a directory service, and none was available.
//
ERROR_DS_DS_REQUIRED = 8478;
//
// MessageId: ERROR_DS_INVALID_LDAP_DISPLAY_NAME
//
// MessageText:
//
// The LDAP display name of the class or attribute contains non-ASCII characters.
//
ERROR_DS_INVALID_LDAP_DISPLAY_NAME = 8479;
//
// MessageId: ERROR_DS_NON_BASE_SEARCH
//
// MessageText:
//
// The requested search operation is only supported for base searches.
//
ERROR_DS_NON_BASE_SEARCH = 8480;
//
// MessageId: ERROR_DS_CANT_RETRIEVE_ATTS
//
// MessageText:
//
// The search failed to retrieve attributes from the database.
//
ERROR_DS_CANT_RETRIEVE_ATTS = 8481;
//
// MessageId: ERROR_DS_BACKLINK_WITHOUT_LINK
//
// MessageText:
//
// The schema update operation tried to add a backward link attribute that has no corresponding forward link.
//
ERROR_DS_BACKLINK_WITHOUT_LINK = 8482;
//
// MessageId: ERROR_DS_EPOCH_MISMATCH
//
// MessageText:
//
// Source and destination of a cross-domain move do not agree on the object's epoch number. Either source or destination does not have the latest version of the object.
//
ERROR_DS_EPOCH_MISMATCH = 8483;
//
// MessageId: ERROR_DS_SRC_NAME_MISMATCH
//
// MessageText:
//
// Source and destination of a cross-domain move do not agree on the object's current name. Either source or destination does not have the latest version of the object.
//
ERROR_DS_SRC_NAME_MISMATCH = 8484;
//
// MessageId: ERROR_DS_SRC_AND_DST_NC_IDENTICAL
//
// MessageText:
//
// Source and destination for the cross-domain move operation are identical. Caller should use local move operation instead of cross-domain move operation.
//
ERROR_DS_SRC_AND_DST_NC_IDENTICAL = 8485;
//
// MessageId: ERROR_DS_DST_NC_MISMATCH
//
// MessageText:
//
// Source and destination for a cross-domain move are not in agreement on the naming contexts in the forest. Either source or destination does not have the latest version of the Partitions container.
//
ERROR_DS_DST_NC_MISMATCH = 8486;
//
// MessageId: ERROR_DS_NOT_AUTHORITIVE_FOR_DST_NC
//
// MessageText:
//
// Destination of a cross-domain move is not authoritative for the destination naming context.
//
ERROR_DS_NOT_AUTHORITIVE_FOR_DST_NC = 8487;
//
// MessageId: ERROR_DS_SRC_GUID_MISMATCH
//
// MessageText:
//
// Source and destination of a cross-domain move do not agree on the identity of the source object. Either source or destination does not have the latest version of the source object.
//
ERROR_DS_SRC_GUID_MISMATCH = 8488;
//
// MessageId: ERROR_DS_CANT_MOVE_DELETED_OBJECT
//
// MessageText:
//
// Object being moved across-domains is already known to be deleted by the destination server. The source server does not have the latest version of the source object.
//
ERROR_DS_CANT_MOVE_DELETED_OBJECT = 8489;
//
// MessageId: ERROR_DS_PDC_OPERATION_IN_PROGRESS
//
// MessageText:
//
// Another operation which requires exclusive access to the PDC FSMO is already in progress.
//
ERROR_DS_PDC_OPERATION_IN_PROGRESS = 8490;
//
// MessageId: ERROR_DS_CROSS_DOMAIN_CLEANUP_REQD
//
// MessageText:
//
// A cross-domain move operation failed such that two versions of the moved object exist - one each in the source and destination domains. The destination object needs to be removed to restore the system to a consistent state.
//
ERROR_DS_CROSS_DOMAIN_CLEANUP_REQD = 8491;
//
// MessageId: ERROR_DS_ILLEGAL_XDOM_MOVE_OPERATION
//
// MessageText:
//
// This object may not be moved across domain boundaries either because cross-domain moves for this class are disallowed, or the object has some special characteristics, eg: trust account or restricted RID, which prevent its move.
//
ERROR_DS_ILLEGAL_XDOM_MOVE_OPERATION = 8492;
//
// MessageId: ERROR_DS_CANT_WITH_ACCT_GROUP_MEMBERSHPS
//
// MessageText:
//
// Can't move objects with memberships across domain boundaries as once moved, this would violate the membership conditions of the account group. Remove the object from any account group memberships and retry.
//
ERROR_DS_CANT_WITH_ACCT_GROUP_MEMBERSHPS = 8493;
//
// MessageId: ERROR_DS_NC_MUST_HAVE_NC_PARENT
//
// MessageText:
//
// A naming context head must be the immediate child of another naming context head, not of an interior node.
//
ERROR_DS_NC_MUST_HAVE_NC_PARENT = 8494;
//
// MessageId: ERROR_DS_CR_IMPOSSIBLE_TO_VALIDATE
//
// MessageText:
//
// The directory cannot validate the proposed naming context name because it does not hold a replica of the naming context above the proposed naming context. Please ensure that the domain naming master role is held by a server that is configured as a global catalog server, and that the server is up to date with its replication partners.
//
ERROR_DS_CR_IMPOSSIBLE_TO_VALIDATE = 8495;
//
// MessageId: ERROR_DS_DST_DOMAIN_NOT_NATIVE
//
// MessageText:
//
// Destination domain must be in native mode.
//
ERROR_DS_DST_DOMAIN_NOT_NATIVE = 8496;
//
// MessageId: ERROR_DS_MISSING_INFRASTRUCTURE_CONTAINER
//
// MessageText:
//
// The operation can not be performed because the server does not have an infrastructure container in the domain of interest.
//
ERROR_DS_MISSING_INFRASTRUCTURE_CONTAINER = 8497;
//
// MessageId: ERROR_DS_CANT_MOVE_ACCOUNT_GROUP
//
// MessageText:
//
// Cross-domain move of account groups is not allowed.
//
ERROR_DS_CANT_MOVE_ACCOUNT_GROUP = 8498;
//
// MessageId: ERROR_DS_CANT_MOVE_RESOURCE_GROUP
//
// MessageText:
//
// Cross-domain move of resource groups is not allowed.
//
ERROR_DS_CANT_MOVE_RESOURCE_GROUP = 8499;
//
// MessageId: ERROR_DS_INVALID_SEARCH_FLAG
//
// MessageText:
//
// The search flags for the attribute are invalid. The ANR bit is valid only on attributes of Unicode or Teletex strings.
//
ERROR_DS_INVALID_SEARCH_FLAG = 8500;
//
// MessageId: ERROR_DS_NO_TREE_DELETE_ABOVE_NC
//
// MessageText:
//
// Tree deletions starting at an object which has an NC head as a descendant are not allowed.
//
ERROR_DS_NO_TREE_DELETE_ABOVE_NC = 8501;
//
// MessageId: ERROR_DS_COULDNT_LOCK_TREE_FOR_DELETE
//
// MessageText:
//
// The directory service failed to lock a tree in preparation for a tree deletion because the tree was in use.
//
ERROR_DS_COULDNT_LOCK_TREE_FOR_DELETE = 8502;
//
// MessageId: ERROR_DS_COULDNT_IDENTIFY_OBJECTS_FOR_TREE_DELETE
//
// MessageText:
//
// The directory service failed to identify the list of objects to delete while attempting a tree deletion.
//
ERROR_DS_COULDNT_IDENTIFY_OBJECTS_FOR_TREE_DELETE = 8503;
//
// MessageId: ERROR_DS_SAM_INIT_FAILURE
//
// MessageText:
//
// Security Accounts Manager initialization failed because of the following error: %1.
// Error Status: 0x%2. Click OK to shut down the system and reboot into Directory Services Restore Mode. Check the event log for detailed information.
//
ERROR_DS_SAM_INIT_FAILURE = 8504;
//
// MessageId: ERROR_DS_SENSITIVE_GROUP_VIOLATION
//
// MessageText:
//
// Only an administrator can modify the membership list of an administrative group.
//
ERROR_DS_SENSITIVE_GROUP_VIOLATION = 8505;
//
// MessageId: ERROR_DS_CANT_MOD_PRIMARYGROUPID
//
// MessageText:
//
// Cannot change the primary group ID of a domain controller account.
//
ERROR_DS_CANT_MOD_PRIMARYGROUPID = 8506;
//
// MessageId: ERROR_DS_ILLEGAL_BASE_SCHEMA_MOD
//
// MessageText:
//
// An attempt is made to modify the base schema.
//
ERROR_DS_ILLEGAL_BASE_SCHEMA_MOD = 8507;
//
// MessageId: ERROR_DS_NONSAFE_SCHEMA_CHANGE
//
// MessageText:
//
// Adding a new mandatory attribute to an existing class, deleting a mandatory attribute from an existing class, or adding an optional attribute to the special class Top that is not a backlink attribute (directly or through inheritance, for example, by adding or deleting an auxiliary class) is not allowed.
//
ERROR_DS_NONSAFE_SCHEMA_CHANGE = 8508;
//
// MessageId: ERROR_DS_SCHEMA_UPDATE_DISALLOWED
//
// MessageText:
//
// Schema update is not allowed on this DC. Either the registry key is not set or the DC is not the schema FSMO Role Owner.
//
ERROR_DS_SCHEMA_UPDATE_DISALLOWED = 8509;
//
// MessageId: ERROR_DS_CANT_CREATE_UNDER_SCHEMA
//
// MessageText:
//
// An object of this class cannot be created under the schema container. You can only create attribute-schema and class-schema objects under the schema container.
//
ERROR_DS_CANT_CREATE_UNDER_SCHEMA = 8510;
//
// MessageId: ERROR_DS_INSTALL_NO_SRC_SCH_VERSION
//
// MessageText:
//
// The replica/child install failed to get the objectVersion attribute on the schema container on the source DC. Either the attribute is missing on the schema container or the credentials supplied do not have permission to read it.
//
ERROR_DS_INSTALL_NO_SRC_SCH_VERSION = 8511;
//
// MessageId: ERROR_DS_INSTALL_NO_SCH_VERSION_IN_INIFILE
//
// MessageText:
//
// The replica/child install failed to read the objectVersion attribute in the SCHEMA section of the file schema.ini in the system32 directory.
//
ERROR_DS_INSTALL_NO_SCH_VERSION_IN_INIFILE = 8512;
//
// MessageId: ERROR_DS_INVALID_GROUP_TYPE
//
// MessageText:
//
// The specified group type is invalid.
//
ERROR_DS_INVALID_GROUP_TYPE = 8513;
//
// MessageId: ERROR_DS_NO_NEST_GLOBALGROUP_IN_MIXEDDOMAIN
//
// MessageText:
//
// You cannot nest global groups in a mixed domain if the group is security-enabled.
//
ERROR_DS_NO_NEST_GLOBALGROUP_IN_MIXEDDOMAIN = 8514;
//
// MessageId: ERROR_DS_NO_NEST_LOCALGROUP_IN_MIXEDDOMAIN
//
// MessageText:
//
// You cannot nest local groups in a mixed domain if the group is security-enabled.
//
ERROR_DS_NO_NEST_LOCALGROUP_IN_MIXEDDOMAIN = 8515;
//
// MessageId: ERROR_DS_GLOBAL_CANT_HAVE_LOCAL_MEMBER
//
// MessageText:
//
// A global group cannot have a local group as a member.
//
ERROR_DS_GLOBAL_CANT_HAVE_LOCAL_MEMBER = 8516;
//
// MessageId: ERROR_DS_GLOBAL_CANT_HAVE_UNIVERSAL_MEMBER
//
// MessageText:
//
// A global group cannot have a universal group as a member.
//
ERROR_DS_GLOBAL_CANT_HAVE_UNIVERSAL_MEMBER = 8517;
//
// MessageId: ERROR_DS_UNIVERSAL_CANT_HAVE_LOCAL_MEMBER
//
// MessageText:
//
// A universal group cannot have a local group as a member.
//
ERROR_DS_UNIVERSAL_CANT_HAVE_LOCAL_MEMBER = 8518;
//
// MessageId: ERROR_DS_GLOBAL_CANT_HAVE_CROSSDOMAIN_MEMBER
//
// MessageText:
//
// A global group cannot have a cross-domain member.
//
ERROR_DS_GLOBAL_CANT_HAVE_CROSSDOMAIN_MEMBER = 8519;
//
// MessageId: ERROR_DS_LOCAL_CANT_HAVE_CROSSDOMAIN_LOCAL_MEMBER
//
// MessageText:
//
// A local group cannot have another cross domain local group as a member.
//
ERROR_DS_LOCAL_CANT_HAVE_CROSSDOMAIN_LOCAL_MEMBER = 8520;
//
// MessageId: ERROR_DS_HAVE_PRIMARY_MEMBERS
//
// MessageText:
//
// A group with primary members cannot change to a security-disabled group.
//
ERROR_DS_HAVE_PRIMARY_MEMBERS = 8521;
//
// MessageId: ERROR_DS_STRING_SD_CONVERSION_FAILED
//
// MessageText:
//
// The schema cache load failed to convert the string default SD on a class-schema object.
//
ERROR_DS_STRING_SD_CONVERSION_FAILED = 8522;
//
// MessageId: ERROR_DS_NAMING_MASTER_GC
//
// MessageText:
//
// Only DSAs configured to be Global Catalog servers should be allowed to hold the Domain Naming Master FSMO role.
//
ERROR_DS_NAMING_MASTER_GC = 8523;
//
// MessageId: ERROR_DS_DNS_LOOKUP_FAILURE
//
// MessageText:
//
// The DSA operation is unable to proceed because of a DNS lookup failure.
//
ERROR_DS_DNS_LOOKUP_FAILURE = 8524;
//
// MessageId: ERROR_DS_COULDNT_UPDATE_SPNS
//
// MessageText:
//
// While processing a change to the DNS Host Name for an object, the Service Principal Name values could not be kept in sync.
//
ERROR_DS_COULDNT_UPDATE_SPNS = 8525;
//
// MessageId: ERROR_DS_CANT_RETRIEVE_SD
//
// MessageText:
//
// The Security Descriptor attribute could not be read.
//
ERROR_DS_CANT_RETRIEVE_SD = 8526;
//
// MessageId: ERROR_DS_KEY_NOT_UNIQUE
//
// MessageText:
//
// The object requested was not found, but an object with that key was found.
//
ERROR_DS_KEY_NOT_UNIQUE = 8527;
//
// MessageId: ERROR_DS_WRONG_LINKED_ATT_SYNTAX
//
// MessageText:
//
// The syntax of the linked attribute being added is incorrect. Forward links can only have syntax 2.5.5.1, 2.5.5.7, and 2.5.5.14, and backlinks can only have syntax 2.5.5.1
//
ERROR_DS_WRONG_LINKED_ATT_SYNTAX = 8528;
//
// MessageId: ERROR_DS_SAM_NEED_BOOTKEY_PASSWORD
//
// MessageText:
//
// Security Account Manager needs to get the boot password.
//
ERROR_DS_SAM_NEED_BOOTKEY_PASSWORD = 8529;
//
// MessageId: ERROR_DS_SAM_NEED_BOOTKEY_FLOPPY
//
// MessageText:
//
// Security Account Manager needs to get the boot key from floppy disk.
//
ERROR_DS_SAM_NEED_BOOTKEY_FLOPPY = 8530;
//
// MessageId: ERROR_DS_CANT_START
//
// MessageText:
//
// Directory Service cannot start.
//
ERROR_DS_CANT_START = 8531;
//
// MessageId: ERROR_DS_INIT_FAILURE
//
// MessageText:
//
// Directory Services could not start.
//
ERROR_DS_INIT_FAILURE = 8532;
//
// MessageId: ERROR_DS_NO_PKT_PRIVACY_ON_CONNECTION
//
// MessageText:
//
// The connection between client and server requires packet privacy or better.
//
ERROR_DS_NO_PKT_PRIVACY_ON_CONNECTION = 8533;
//
// MessageId: ERROR_DS_SOURCE_DOMAIN_IN_FOREST
//
// MessageText:
//
// The source domain may not be in the same forest as destination.
//
ERROR_DS_SOURCE_DOMAIN_IN_FOREST = 8534;
//
// MessageId: ERROR_DS_DESTINATION_DOMAIN_NOT_IN_FOREST
//
// MessageText:
//
// The destination domain must be in the forest.
//
ERROR_DS_DESTINATION_DOMAIN_NOT_IN_FOREST = 8535;
//
// MessageId: ERROR_DS_DESTINATION_AUDITING_NOT_ENABLED
//
// MessageText:
//
// The operation requires that destination domain auditing be enabled.
//
ERROR_DS_DESTINATION_AUDITING_NOT_ENABLED = 8536;
//
// MessageId: ERROR_DS_CANT_FIND_DC_FOR_SRC_DOMAIN
//
// MessageText:
//
// The operation couldn't locate a DC for the source domain.
//
ERROR_DS_CANT_FIND_DC_FOR_SRC_DOMAIN = 8537;
//
// MessageId: ERROR_DS_SRC_OBJ_NOT_GROUP_OR_USER
//
// MessageText:
//
// The source object must be a group or user.
//
ERROR_DS_SRC_OBJ_NOT_GROUP_OR_USER = 8538;
//
// MessageId: ERROR_DS_SRC_SID_EXISTS_IN_FOREST
//
// MessageText:
//
// The source object's SID already exists in destination forest.
//
ERROR_DS_SRC_SID_EXISTS_IN_FOREST = 8539;
//
// MessageId: ERROR_DS_SRC_AND_DST_OBJECT_CLASS_MISMATCH
//
// MessageText:
//
// The source and destination object must be of the same type.
//
ERROR_DS_SRC_AND_DST_OBJECT_CLASS_MISMATCH = 8540;
//
// MessageId: ERROR_SAM_INIT_FAILURE
//
// MessageText:
//
// Security Accounts Manager initialization failed because of the following error: %1.
// Error Status: 0x%2. Click OK to shut down the system and reboot into Safe Mode. Check the event log for detailed information.
//
ERROR_SAM_INIT_FAILURE = 8541;
//
// MessageId: ERROR_DS_DRA_SCHEMA_INFO_SHIP
//
// MessageText:
//
// Schema information could not be included in the replication request.
//
ERROR_DS_DRA_SCHEMA_INFO_SHIP = 8542;
//
// MessageId: ERROR_DS_DRA_SCHEMA_CONFLICT
//
// MessageText:
//
// The replication operation could not be completed due to a schema
// incompatibility.
//
ERROR_DS_DRA_SCHEMA_CONFLICT = 8543;
//
// MessageId: ERROR_DS_DRA_EARLIER_SCHEMA_CONFLICT
//
// MessageText:
//
// The replication operation could not be completed due to a previous schema incompatibility.
//
ERROR_DS_DRA_EARLIER_SCHEMA_CONFLICT = 8544;
//
// MessageId: ERROR_DS_DRA_OBJ_NC_MISMATCH
//
// MessageText:
//
// The replication update could not be applied because either the source or the destination has not yet received information regarding a recent cross-domain move operation.
//
ERROR_DS_DRA_OBJ_NC_MISMATCH = 8545;
//
// MessageId: ERROR_DS_NC_STILL_HAS_DSAS
//
// MessageText:
//
// The requested domain could not be deleted because there exist domain controllers that still host this domain.
//
ERROR_DS_NC_STILL_HAS_DSAS = 8546;
//
// MessageId: ERROR_DS_GC_REQUIRED
//
// MessageText:
//
// The requested operation can be performed only on a global catalog server.
//
ERROR_DS_GC_REQUIRED = 8547;
//
// MessageId: ERROR_DS_LOCAL_MEMBER_OF_LOCAL_ONLY
//
// MessageText:
//
// A local group can only be a member of other local groups in the same domain.
//
ERROR_DS_LOCAL_MEMBER_OF_LOCAL_ONLY = 8548;
//
// MessageId: ERROR_DS_NO_FPO_IN_UNIVERSAL_GROUPS
//
// MessageText:
//
// Foreign security principals cannot be members of universal groups.
//
ERROR_DS_NO_FPO_IN_UNIVERSAL_GROUPS = 8549;
//
// MessageId: ERROR_DS_CANT_ADD_TO_GC
//
// MessageText:
//
// The attribute is not allowed to be replicated to the GC because of security reasons.
//
ERROR_DS_CANT_ADD_TO_GC = 8550;
//
// MessageId: ERROR_DS_NO_CHECKPOINT_WITH_PDC
//
// MessageText:
//
// The checkpoint with the PDC could not be taken because there too many modifications being processed currently.
//
ERROR_DS_NO_CHECKPOINT_WITH_PDC = 8551;
//
// MessageId: ERROR_DS_SOURCE_AUDITING_NOT_ENABLED
//
// MessageText:
//
// The operation requires that source domain auditing be enabled.
//
ERROR_DS_SOURCE_AUDITING_NOT_ENABLED = 8552;
//
// MessageId: ERROR_DS_CANT_CREATE_IN_NONDOMAIN_NC
//
// MessageText:
//
// Security principal objects can only be created inside domain naming contexts.
//
ERROR_DS_CANT_CREATE_IN_NONDOMAIN_NC = 8553;
//
// MessageId: ERROR_DS_INVALID_NAME_FOR_SPN
//
// MessageText:
//
// A Service Principal Name (SPN) could not be constructed because the provided hostname is not in the necessary format.
//
ERROR_DS_INVALID_NAME_FOR_SPN = 8554;
//
// MessageId: ERROR_DS_FILTER_USES_CONTRUCTED_ATTRS
//
// MessageText:
//
// A Filter was passed that uses constructed attributes.
//
ERROR_DS_FILTER_USES_CONTRUCTED_ATTRS = 8555;
//
// MessageId: ERROR_DS_UNICODEPWD_NOT_IN_QUOTES
//
// MessageText:
//
// The unicodePwd attribute value must be enclosed in double quotes.
//
ERROR_DS_UNICODEPWD_NOT_IN_QUOTES = 8556;
//
// MessageId: ERROR_DS_MACHINE_ACCOUNT_QUOTA_EXCEEDED
//
// MessageText:
//
// Your computer could not be joined to the domain. You have exceeded the maximum number of computer accounts you are allowed to create in this domain. Contact your system administrator to have this limit reset or increased.
//
ERROR_DS_MACHINE_ACCOUNT_QUOTA_EXCEEDED = 8557;
//
// MessageId: ERROR_DS_MUST_BE_RUN_ON_DST_DC
//
// MessageText:
//
// For security reasons, the operation must be run on the destination DC.
//
ERROR_DS_MUST_BE_RUN_ON_DST_DC = 8558;
//
// MessageId: ERROR_DS_SRC_DC_MUST_BE_SP4_OR_GREATER
//
// MessageText:
//
// For security reasons, the source DC must be Service Pack 4 or greater.
//
ERROR_DS_SRC_DC_MUST_BE_SP4_OR_GREATER = 8559;
//
// MessageId: ERROR_DS_CANT_TREE_DELETE_CRITICAL_OBJ
//
// MessageText:
//
// Critical Directory Service System objects cannot be deleted during tree delete operations. The tree delete may have been partially performed.
//
ERROR_DS_CANT_TREE_DELETE_CRITICAL_OBJ = 8560;
///////////////////////////////////////////////////
// /
// End of Active Directory Error Codes /
// /
// 8000 to 8999 /
///////////////////////////////////////////////////
///////////////////////////////////////////////////
// //
// DNS Error Codes //
// //
// 9000 to 9999 //
///////////////////////////////////////////////////
// =============================
// Facility DNS Error Messages
// =============================
//
// DNS response codes.
//
DNS_ERROR_RESPONSE_CODES_BASE = 900;
DNS_ERROR_RCODE_NO_ERROR = NO_ERROR;
DNS_ERROR_MASK = $00002328; // 9000 or DNS_ERROR_RESPONSE_CODES_BASE
// DNS_ERROR_RCODE_FORMAT_ERROR 0x00002329
//
// MessageId: DNS_ERROR_RCODE_FORMAT_ERROR
//
// MessageText:
//
// DNS server unable to interpret format.
//
DNS_ERROR_RCODE_FORMAT_ERROR = 9001;
// DNS_ERROR_RCODE_SERVER_FAILURE 0x0000232a
//
// MessageId: DNS_ERROR_RCODE_SERVER_FAILURE
//
// MessageText:
//
// DNS server failure.
//
DNS_ERROR_RCODE_SERVER_FAILURE = 9002;
// DNS_ERROR_RCODE_NAME_ERROR 0x0000232b
//
// MessageId: DNS_ERROR_RCODE_NAME_ERROR
//
// MessageText:
//
// DNS name does not exist.
//
DNS_ERROR_RCODE_NAME_ERROR = 9003;
// DNS_ERROR_RCODE_NOT_IMPLEMENTED 0x0000232c
//
// MessageId: DNS_ERROR_RCODE_NOT_IMPLEMENTED
//
// MessageText:
//
// DNS request not supported by name server.
//
DNS_ERROR_RCODE_NOT_IMPLEMENTED = 9004;
// DNS_ERROR_RCODE_REFUSED 0x0000232d
//
// MessageId: DNS_ERROR_RCODE_REFUSED
//
// MessageText:
//
// DNS operation refused.
//
DNS_ERROR_RCODE_REFUSED = 9005;
// DNS_ERROR_RCODE_YXDOMAIN 0x0000232e
//
// MessageId: DNS_ERROR_RCODE_YXDOMAIN
//
// MessageText:
//
// DNS name that ought not exist, does exist.
//
DNS_ERROR_RCODE_YXDOMAIN = 9006;
// DNS_ERROR_RCODE_YXRRSET 0x0000232f
//
// MessageId: DNS_ERROR_RCODE_YXRRSET
//
// MessageText:
//
// DNS RR set that ought not exist, does exist.
//
DNS_ERROR_RCODE_YXRRSET = 9007;
// DNS_ERROR_RCODE_NXRRSET 0x00002330
//
// MessageId: DNS_ERROR_RCODE_NXRRSET
//
// MessageText:
//
// DNS RR set that ought to exist, does not exist.
//
DNS_ERROR_RCODE_NXRRSET = 9008;
// DNS_ERROR_RCODE_NOTAUTH 0x00002331
//
// MessageId: DNS_ERROR_RCODE_NOTAUTH
//
// MessageText:
//
// DNS server not authoritative for zone.
//
DNS_ERROR_RCODE_NOTAUTH = 9009;
// DNS_ERROR_RCODE_NOTZONE 0x00002332
//
// MessageId: DNS_ERROR_RCODE_NOTZONE
//
// MessageText:
//
// DNS name in update or prereq is not in zone.
//
DNS_ERROR_RCODE_NOTZONE = 9010;
// DNS_ERROR_RCODE_BADSIG 0x00002338
//
// MessageId: DNS_ERROR_RCODE_BADSIG
//
// MessageText:
//
// DNS signature failed to verify.
//
DNS_ERROR_RCODE_BADSIG = 9016;
// DNS_ERROR_RCODE_BADKEY 0x00002339
//
// MessageId: DNS_ERROR_RCODE_BADKEY
//
// MessageText:
//
// DNS bad key.
//
DNS_ERROR_RCODE_BADKEY = 9017;
// DNS_ERROR_RCODE_BADTIME 0x0000233a
//
// MessageId: DNS_ERROR_RCODE_BADTIME
//
// MessageText:
//
// DNS signature validity expired.
//
DNS_ERROR_RCODE_BADTIME = 9018;
DNS_ERROR_RCODE_LAST = DNS_ERROR_RCODE_BADTIME;
//
// Packet format
//
DNS_ERROR_PACKET_FMT_BASE = 950;
// DNS_INFO_NO_RECORDS 0x0000251d
//
// MessageId: DNS_INFO_NO_RECORDS
//
// MessageText:
//
// No records found for given DNS query.
//
DNS_INFO_NO_RECORDS = 9501;
// DNS_ERROR_BAD_PACKET 0x0000251e
//
// MessageId: DNS_ERROR_BAD_PACKET
//
// MessageText:
//
// Bad DNS packet.
//
DNS_ERROR_BAD_PACKET = 9502;
// DNS_ERROR_NO_PACKET 0x0000251f
//
// MessageId: DNS_ERROR_NO_PACKET
//
// MessageText:
//
// No DNS packet.
//
DNS_ERROR_NO_PACKET = 9503;
// DNS_ERROR_RCODE 0x00002520
//
// MessageId: DNS_ERROR_RCODE
//
// MessageText:
//
// DNS error, check rcode.
//
DNS_ERROR_RCODE = 9504;
// DNS_ERROR_UNSECURE_PACKET 0x00002521
//
// MessageId: DNS_ERROR_UNSECURE_PACKET
//
// MessageText:
//
// Unsecured DNS packet.
//
DNS_ERROR_UNSECURE_PACKET = 9505;
DNS_STATUS_PACKET_UNSECURE = DNS_ERROR_UNSECURE_PACKET;
//
// General API errors
//
DNS_ERROR_NO_MEMORY = ERROR_OUTOFMEMORY;
DNS_ERROR_INVALID_NAME = ERROR_INVALID_NAME;
DNS_ERROR_INVALID_DATA = ERROR_INVALID_DATA;
DNS_ERROR_GENERAL_API_BASE = 9550;
// DNS_ERROR_INVALID_TYPE 0x0000254f
//
// MessageId: DNS_ERROR_INVALID_TYPE
//
// MessageText:
//
// Invalid DNS type.
//
DNS_ERROR_INVALID_TYPE = 9551;
// DNS_ERROR_INVALID_IP_ADDRESS 0x00002550
//
// MessageId: DNS_ERROR_INVALID_IP_ADDRESS
//
// MessageText:
//
// Invalid IP address.
//
DNS_ERROR_INVALID_IP_ADDRESS = 9552;
// DNS_ERROR_INVALID_PROPERTY 0x00002551
//
// MessageId: DNS_ERROR_INVALID_PROPERTY
//
// MessageText:
//
// Invalid property.
//
DNS_ERROR_INVALID_PROPERTY = 9553;
// DNS_ERROR_TRY_AGAIN_LATER 0x00002552
//
// MessageId: DNS_ERROR_TRY_AGAIN_LATER
//
// MessageText:
//
// Try DNS operation again later.
//
DNS_ERROR_TRY_AGAIN_LATER = 9554;
// DNS_ERROR_NOT_UNIQUE 0x00002553
//
// MessageId: DNS_ERROR_NOT_UNIQUE
//
// MessageText:
//
// Record for given name and type is not unique.
//
DNS_ERROR_NOT_UNIQUE = 9555;
// DNS_ERROR_NON_RFC_NAME 0x00002554
//
// MessageId: DNS_ERROR_NON_RFC_NAME
//
// MessageText:
//
// DNS name does not comply with RFC specifications.
//
DNS_ERROR_NON_RFC_NAME = 9556;
// DNS_STATUS_FQDN 0x00002555
//
// MessageId: DNS_STATUS_FQDN
//
// MessageText:
//
// DNS name is a fully-qualified DNS name.
//
DNS_STATUS_FQDN = 9557;
// DNS_STATUS_DOTTED_NAME 0x00002556
//
// MessageId: DNS_STATUS_DOTTED_NAME
//
// MessageText:
//
// DNS name is dotted (multi-label).
//
DNS_STATUS_DOTTED_NAME = 9558;
// DNS_STATUS_SINGLE_PART_NAME 0x00002557
//
// MessageId: DNS_STATUS_SINGLE_PART_NAME
//
// MessageText:
//
// DNS name is a single-part name.
//
DNS_STATUS_SINGLE_PART_NAME = 9559;
// DNS_ERROR_INVALID_NAME_CHAR 0x00002558
//
// MessageId: DNS_ERROR_INVALID_NAME_CHAR
//
// MessageText:
//
// DNS name contains an invalid character.
//
DNS_ERROR_INVALID_NAME_CHAR = 9560;
// DNS_ERROR_NUMERIC_NAME 0x00002559
//
// MessageId: DNS_ERROR_NUMERIC_NAME
//
// MessageText:
//
// DNS name is entirely numeric.
//
DNS_ERROR_NUMERIC_NAME = 9561;
//
// Zone errors
//
DNS_ERROR_ZONE_BASE = 9600;
// DNS_ERROR_ZONE_DOES_NOT_EXIST 0x00002581
//
// MessageId: DNS_ERROR_ZONE_DOES_NOT_EXIST
//
// MessageText:
//
// DNS zone does not exist.
//
DNS_ERROR_ZONE_DOES_NOT_EXIST = 9601;
// DNS_ERROR_NO_ZONE_INFO 0x00002582
//
// MessageId: DNS_ERROR_NO_ZONE_INFO
//
// MessageText:
//
// DNS zone information not available.
//
DNS_ERROR_NO_ZONE_INFO = 9602;
// DNS_ERROR_INVALID_ZONE_OPERATION 0x00002583
//
// MessageId: DNS_ERROR_INVALID_ZONE_OPERATION
//
// MessageText:
//
// Invalid operation for DNS zone.
//
DNS_ERROR_INVALID_ZONE_OPERATION = 9603;
// DNS_ERROR_ZONE_CONFIGURATION_ERROR 0x00002584
//
// MessageId: DNS_ERROR_ZONE_CONFIGURATION_ERROR
//
// MessageText:
//
// Invalid DNS zone configuration.
//
DNS_ERROR_ZONE_CONFIGURATION_ERROR = 9604;
// DNS_ERROR_ZONE_HAS_NO_SOA_RECORD 0x00002585
//
// MessageId: DNS_ERROR_ZONE_HAS_NO_SOA_RECORD
//
// MessageText:
//
// DNS zone has no start of authority (SOA) record.
//
DNS_ERROR_ZONE_HAS_NO_SOA_RECORD = 9605;
// DNS_ERROR_ZONE_HAS_NO_NS_RECORDS 0x00002586
//
// MessageId: DNS_ERROR_ZONE_HAS_NO_NS_RECORDS
//
// MessageText:
//
// DNS zone has no Name Server (NS) record.
//
DNS_ERROR_ZONE_HAS_NO_NS_RECORDS = 9606;
// DNS_ERROR_ZONE_LOCKED 0x00002587
//
// MessageId: DNS_ERROR_ZONE_LOCKED
//
// MessageText:
//
// DNS zone is locked.
//
DNS_ERROR_ZONE_LOCKED = 9607;
// DNS_ERROR_ZONE_CREATION_FAILED 0x00002588
//
// MessageId: DNS_ERROR_ZONE_CREATION_FAILED
//
// MessageText:
//
// DNS zone creation failed.
//
DNS_ERROR_ZONE_CREATION_FAILED = 9608;
// DNS_ERROR_ZONE_ALREADY_EXISTS 0x00002589
//
// MessageId: DNS_ERROR_ZONE_ALREADY_EXISTS
//
// MessageText:
//
// DNS zone already exists.
//
DNS_ERROR_ZONE_ALREADY_EXISTS = 9609;
// DNS_ERROR_AUTOZONE_ALREADY_EXISTS 0x0000258a
//
// MessageId: DNS_ERROR_AUTOZONE_ALREADY_EXISTS
//
// MessageText:
//
// DNS automatic zone already exists.
//
DNS_ERROR_AUTOZONE_ALREADY_EXISTS = 9610;
// DNS_ERROR_INVALID_ZONE_TYPE 0x0000258b
//
// MessageId: DNS_ERROR_INVALID_ZONE_TYPE
//
// MessageText:
//
// Invalid DNS zone type.
//
DNS_ERROR_INVALID_ZONE_TYPE = 9611;
// DNS_ERROR_SECONDARY_REQUIRES_MASTER_IP 0x0000258c
//
// MessageId: DNS_ERROR_SECONDARY_REQUIRES_MASTER_IP
//
// MessageText:
//
// Secondary DNS zone requires master IP address.
//
DNS_ERROR_SECONDARY_REQUIRES_MASTER_IP = 9612;
// DNS_ERROR_ZONE_NOT_SECONDARY 0x0000258d
//
// MessageId: DNS_ERROR_ZONE_NOT_SECONDARY
//
// MessageText:
//
// DNS zone not secondary.
//
DNS_ERROR_ZONE_NOT_SECONDARY = 9613;
// DNS_ERROR_NEED_SECONDARY_ADDRESSES 0x0000258e
//
// MessageId: DNS_ERROR_NEED_SECONDARY_ADDRESSES
//
// MessageText:
//
// Need secondary IP address.
//
DNS_ERROR_NEED_SECONDARY_ADDRESSES = 9614;
// DNS_ERROR_WINS_INIT_FAILED 0x0000258f
//
// MessageId: DNS_ERROR_WINS_INIT_FAILED
//
// MessageText:
//
// WINS initialization failed.
//
DNS_ERROR_WINS_INIT_FAILED = 9615;
// DNS_ERROR_NEED_WINS_SERVERS 0x00002590
//
// MessageId: DNS_ERROR_NEED_WINS_SERVERS
//
// MessageText:
//
// Need WINS servers.
//
DNS_ERROR_NEED_WINS_SERVERS = 9616;
// DNS_ERROR_NBSTAT_INIT_FAILED 0x00002591
//
// MessageId: DNS_ERROR_NBSTAT_INIT_FAILED
//
// MessageText:
//
// NBTSTAT initialization call failed.
//
DNS_ERROR_NBSTAT_INIT_FAILED = 9617;
// DNS_ERROR_SOA_DELETE_INVALID 0x00002592
//
// MessageId: DNS_ERROR_SOA_DELETE_INVALID
//
// MessageText:
//
// Invalid delete of start of authority (SOA)
//
DNS_ERROR_SOA_DELETE_INVALID = 9618;
//
// Datafile errors
//
DNS_ERROR_DATAFILE_BASE = 9650;
// DNS 0x000025b3
//
// MessageId: DNS_ERROR_PRIMARY_REQUIRES_DATAFILE
//
// MessageText:
//
// Primary DNS zone requires datafile.
//
DNS_ERROR_PRIMARY_REQUIRES_DATAFILE = 9651;
// DNS 0x000025b4
//
// MessageId: DNS_ERROR_INVALID_DATAFILE_NAME
//
// MessageText:
//
// Invalid datafile name for DNS zone.
//
DNS_ERROR_INVALID_DATAFILE_NAME = 9652;
// DNS 0x000025b5
//
// MessageId: DNS_ERROR_DATAFILE_OPEN_FAILURE
//
// MessageText:
//
// Failed to open datafile for DNS zone.
//
DNS_ERROR_DATAFILE_OPEN_FAILURE = 9653;
// DNS 0x000025b6
//
// MessageId: DNS_ERROR_FILE_WRITEBACK_FAILED
//
// MessageText:
//
// Failed to write datafile for DNS zone.
//
DNS_ERROR_FILE_WRITEBACK_FAILED = 9654;
// DNS 0x000025b7
//
// MessageId: DNS_ERROR_DATAFILE_PARSING
//
// MessageText:
//
// Failure while reading datafile for DNS zone.
//
DNS_ERROR_DATAFILE_PARSING = 9655;
//
// Database errors
//
DNS_ERROR_DATABASE_BASE = 9700;
// DNS_ERROR_RECORD_DOES_NOT_EXIST 0x000025e5
//
// MessageId: DNS_ERROR_RECORD_DOES_NOT_EXIST
//
// MessageText:
//
// DNS record does not exist.
//
DNS_ERROR_RECORD_DOES_NOT_EXIST = 9701;
// DNS_ERROR_RECORD_FORMAT 0x000025e6
//
// MessageId: DNS_ERROR_RECORD_FORMAT
//
// MessageText:
//
// DNS record format error.
//
DNS_ERROR_RECORD_FORMAT = 9702;
// DNS_ERROR_NODE_CREATION_FAILED 0x000025e7
//
// MessageId: DNS_ERROR_NODE_CREATION_FAILED
//
// MessageText:
//
// Node creation failure in DNS.
//
DNS_ERROR_NODE_CREATION_FAILED = 9703;
// DNS_ERROR_UNKNOWN_RECORD_TYPE 0x000025e8
//
// MessageId: DNS_ERROR_UNKNOWN_RECORD_TYPE
//
// MessageText:
//
// Unknown DNS record type.
//
DNS_ERROR_UNKNOWN_RECORD_TYPE = 9704;
// DNS_ERROR_RECORD_TIMED_OUT 0x000025e9
//
// MessageId: DNS_ERROR_RECORD_TIMED_OUT
//
// MessageText:
//
// DNS record timed out.
//
DNS_ERROR_RECORD_TIMED_OUT = 9705;
// DNS_ERROR_NAME_NOT_IN_ZONE 0x000025ea
//
// MessageId: DNS_ERROR_NAME_NOT_IN_ZONE
//
// MessageText:
//
// Name not in DNS zone.
//
DNS_ERROR_NAME_NOT_IN_ZONE = 9706;
// DNS_ERROR_CNAME_LOOP 0x000025eb
//
// MessageId: DNS_ERROR_CNAME_LOOP
//
// MessageText:
//
// CNAME loop detected.
//
DNS_ERROR_CNAME_LOOP = 9707;
// DNS_ERROR_NODE_IS_CNAME 0x000025ec
//
// MessageId: DNS_ERROR_NODE_IS_CNAME
//
// MessageText:
//
// Node is a CNAME DNS record.
//
DNS_ERROR_NODE_IS_CNAME = 9708;
// DNS_ERROR_CNAME_COLLISION 0x000025ed
//
// MessageId: DNS_ERROR_CNAME_COLLISION
//
// MessageText:
//
// A CNAME record already exists for given name.
//
DNS_ERROR_CNAME_COLLISION = 9709;
// DNS_ERROR_RECORD_ONLY_AT_ZONE_ROOT 0x000025ee
//
// MessageId: DNS_ERROR_RECORD_ONLY_AT_ZONE_ROOT
//
// MessageText:
//
// Record only at DNS zone root.
//
DNS_ERROR_RECORD_ONLY_AT_ZONE_ROOT = 9710;
// DNS_ERROR_RECORD_ALREADY_EXISTS 0x000025ef
//
// MessageId: DNS_ERROR_RECORD_ALREADY_EXISTS
//
// MessageText:
//
// DNS record already exists.
//
DNS_ERROR_RECORD_ALREADY_EXISTS = 9711;
// DNS_ERROR_SECONDARY_DATA 0x000025f0
//
// MessageId: DNS_ERROR_SECONDARY_DATA
//
// MessageText:
//
// Secondary DNS zone data error.
//
DNS_ERROR_SECONDARY_DATA = 9712;
// DNS_ERROR_NO_CREATE_CACHE_DATA 0x000025f1
//
// MessageId: DNS_ERROR_NO_CREATE_CACHE_DATA
//
// MessageText:
//
// Could not create DNS cache data.
//
DNS_ERROR_NO_CREATE_CACHE_DATA = 9713;
// DNS_ERROR_NAME_DOES_NOT_EXIST 0x000025f2
//
// MessageId: DNS_ERROR_NAME_DOES_NOT_EXIST
//
// MessageText:
//
// DNS name does not exist.
//
DNS_ERROR_NAME_DOES_NOT_EXIST = 9714;
// DNS_WARNING_PTR_CREATE_FAILED 0x000025f3
//
// MessageId: DNS_WARNING_PTR_CREATE_FAILED
//
// MessageText:
//
// Could not create pointer (PTR) record.
//
DNS_WARNING_PTR_CREATE_FAILED = 9715;
// DNS_WARNING_DOMAIN_UNDELETED 0x000025f4
//
// MessageId: DNS_WARNING_DOMAIN_UNDELETED
//
// MessageText:
//
// DNS domain was undeleted.
//
DNS_WARNING_DOMAIN_UNDELETED = 9716;
// DNS_ERROR_DS_UNAVAILABLE 0x000025f5
//
// MessageId: DNS_ERROR_DS_UNAVAILABLE
//
// MessageText:
//
// The directory service is unavailable.
//
DNS_ERROR_DS_UNAVAILABLE = 9717;
// DNS_ERROR_DS_ZONE_ALREADY_EXISTS 0x000025f6
//
// MessageId: DNS_ERROR_DS_ZONE_ALREADY_EXISTS
//
// MessageText:
//
// DNS zone already exists in the directory service.
//
DNS_ERROR_DS_ZONE_ALREADY_EXISTS = 9718;
// DNS_ERROR_NO_BOOTFILE_IF_DS_ZONE 0x000025f7
//
// MessageId: DNS_ERROR_NO_BOOTFILE_IF_DS_ZONE
//
// MessageText:
//
// DNS server not creating or reading the boot file for the directory service integrated DNS zone.
//
DNS_ERROR_NO_BOOTFILE_IF_DS_ZONE = 9719;
//
// Operation errors
//
DNS_ERROR_OPERATION_BASE = 9750;
// DNS_INFO_AXFR_COMPLETE 0x00002617
//
// MessageId: DNS_INFO_AXFR_COMPLETE
//
// MessageText:
//
// DNS AXFR (zone transfer) complete.
//
DNS_INFO_AXFR_COMPLETE = 9751;
// DNS_ERROR_AXFR 0x00002618
//
// MessageId: DNS_ERROR_AXFR
//
// MessageText:
//
// DNS zone transfer failed.
//
DNS_ERROR_AXFR = 9752;
// DNS_INFO_ADDED_LOCAL_WINS 0x00002619
//
// MessageId: DNS_INFO_ADDED_LOCAL_WINS
//
// MessageText:
//
// Added local WINS server.
//
DNS_INFO_ADDED_LOCAL_WINS = 9753;
//
// Secure update
//
DNS_ERROR_SECURE_BASE = 9800;
// DNS_STATUS_CONTINUE_NEEDED 0x00002649
//
// MessageId: DNS_STATUS_CONTINUE_NEEDED
//
// MessageText:
//
// Secure update call needs to continue update request.
//
DNS_STATUS_CONTINUE_NEEDED = 9801;
//
// Setup errors
//
DNS_ERROR_SETUP_BASE = 9850;
// DNS_ERROR_NO_TCPIP 0x0000267b
//
// MessageId: DNS_ERROR_NO_TCPIP
//
// MessageText:
//
// TCP/IP network protocol not installed.
//
DNS_ERROR_NO_TCPIP = 9851;
// DNS_ERROR_NO_DNS_SERVERS 0x0000267c
//
// MessageId: DNS_ERROR_NO_DNS_SERVERS
//
// MessageText:
//
// No DNS servers configured for local system.
//
DNS_ERROR_NO_DNS_SERVERS = 9852;
///////////////////////////////////////////////////
// //
// End of DNS Error Codes //
// //
// 9000 to 9999 //
///////////////////////////////////////////////////
///////////////////////////////////////////////////
// //
// WinSock Error Codes //
// //
// 10000 to 11999 //
///////////////////////////////////////////////////
//
// WinSock error codes are also defined in WinSock.h
// and WinSock2.h, hence the IFDEF
//
WSABASEERR = 10000;
//
// MessageId: WSAEINTR
//
// MessageText:
//
// A blocking operation was interrupted by a call to WSACancelBlockingCall.
//
WSAEINTR = 10004;
//
// MessageId: WSAEBADF
//
// MessageText:
//
// The file handle supplied is not valid.
//
WSAEBADF = 10009;
//
// MessageId: WSAEACCES
//
// MessageText:
//
// An attempt was made to access a socket in a way forbidden by its access permissions.
//
WSAEACCES = 10013;
//
// MessageId: WSAEFAULT
//
// MessageText:
//
// The system detected an invalid pointer address in attempting to use a pointer argument in a call.
//
WSAEFAULT = 10014;
//
// MessageId: WSAEINVAL
//
// MessageText:
//
// An invalid argument was supplied.
//
WSAEINVAL = 10022;
//
// MessageId: WSAEMFILE
//
// MessageText:
//
// Too many open sockets.
//
WSAEMFILE = 10024;
//
// MessageId: WSAEWOULDBLOCK
//
// MessageText:
//
// A non-blocking socket operation could not be completed immediately.
//
WSAEWOULDBLOCK = 10035;
//
// MessageId: WSAEINPROGRESS
//
// MessageText:
//
// A blocking operation is currently executing.
//
WSAEINPROGRESS = 10036;
//
// MessageId: WSAEALREADY
//
// MessageText:
//
// An operation was attempted on a non-blocking socket that already had an operation in progress.
//
WSAEALREADY = 10037;
//
// MessageId: WSAENOTSOCK
//
// MessageText:
//
// An operation was attempted on something that is not a socket.
//
WSAENOTSOCK = 10038;
//
// MessageId: WSAEDESTADDRREQ
//
// MessageText:
//
// A required address was omitted from an operation on a socket.
//
WSAEDESTADDRREQ = 10039;
//
// MessageId: WSAEMSGSIZE
//
// MessageText:
//
// A message sent on a datagram socket was larger than the internal message buffer or some other network limit, or the buffer used to receive a datagram into was smaller than the datagram itself.
//
WSAEMSGSIZE = 10040;
//
// MessageId: WSAEPROTOTYPE
//
// MessageText:
//
// A protocol was specified in the socket function call that does not support the semantics of the socket type requested.
//
WSAEPROTOTYPE = 10041;
//
// MessageId: WSAENOPROTOOPT
//
// MessageText:
//
// An unknown, invalid, or unsupported option or level was specified in a getsockopt or setsockopt call.
//
WSAENOPROTOOPT = 10042;
//
// MessageId: WSAEPROTONOSUPPORT
//
// MessageText:
//
// The requested protocol has not been configured into the system, or no implementation for it exists.
//
WSAEPROTONOSUPPORT = 10043;
//
// MessageId: WSAESOCKTNOSUPPORT
//
// MessageText:
//
// The support for the specified socket type does not exist in this address family.
//
WSAESOCKTNOSUPPORT = 10044;
//
// MessageId: WSAEOPNOTSUPP
//
// MessageText:
//
// The attempted operation is not supported for the type of object referenced.
//
WSAEOPNOTSUPP = 10045;
//
// MessageId: WSAEPFNOSUPPORT
//
// MessageText:
//
// The protocol family has not been configured into the system or no implementation for it exists.
//
WSAEPFNOSUPPORT = 10046;
//
// MessageId: WSAEAFNOSUPPORT
//
// MessageText:
//
// An address incompatible with the requested protocol was used.
//
WSAEAFNOSUPPORT = 10047;
//
// MessageId: WSAEADDRINUSE
//
// MessageText:
//
// Only one usage of each socket address (protocol/network address/port)
// is normally permitted.
//
WSAEADDRINUSE = 10048;
//
// MessageId: WSAEADDRNOTAVAIL
//
// MessageText:
//
// The requested address is not valid in its context.
//
WSAEADDRNOTAVAIL = 10049;
//
// MessageId: WSAENETDOWN
//
// MessageText:
//
// A socket operation encountered a dead network.
//
WSAENETDOWN = 10050;
//
// MessageId: WSAENETUNREACH
//
// MessageText:
//
// A socket operation was attempted to an unreachable network.
//
WSAENETUNREACH = 10051;
//
// MessageId: WSAENETRESET
//
// MessageText:
//
// The connection has been broken due to keep-alive activity detecting a failure while the operation was in progress.
//
WSAENETRESET = 10052;
//
// MessageId: WSAECONNABORTED
//
// MessageText:
//
// An established connection was aborted by the software in your host machine.
//
WSAECONNABORTED = 10053;
//
// MessageId: WSAECONNRESET
//
// MessageText:
//
// An existing connection was forcibly closed by the remote host.
//
WSAECONNRESET = 10054;
//
// MessageId: WSAENOBUFS
//
// MessageText:
//
// An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full.
//
WSAENOBUFS = 10055;
//
// MessageId: WSAEISCONN
//
// MessageText:
//
// A connect request was made on an already connected socket.
//
WSAEISCONN = 10056;
//
// MessageId: WSAENOTCONN
//
// MessageText:
//
// A request to send or receive data was disallowed because the socket is not connected and (when sending on a datagram socket using a sendto call) no address was supplied.
//
WSAENOTCONN = 10057;
//
// MessageId: WSAESHUTDOWN
//
// MessageText:
//
// A request to send or receive data was disallowed because the socket had already been shut down in that direction with a previous shutdown call.
//
WSAESHUTDOWN = 10058;
//
// MessageId: WSAETOOMANYREFS
//
// MessageText:
//
// Too many references to some kernel object.
//
WSAETOOMANYREFS = 10059;
//
// MessageId: WSAETIMEDOUT
//
// MessageText:
//
// A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
//
WSAETIMEDOUT = 10060;
//
// MessageId: WSAECONNREFUSED
//
// MessageText:
//
// No connection could be made because the target machine actively refused it.
//
WSAECONNREFUSED = 10061;
//
// MessageId: WSAELOOP
//
// MessageText:
//
// Cannot translate name.
//
WSAELOOP = 10062;
//
// MessageId: WSAENAMETOOLONG
//
// MessageText:
//
// Name component or name was too long.
//
WSAENAMETOOLONG = 10063;
//
// MessageId: WSAEHOSTDOWN
//
// MessageText:
//
// A socket operation failed because the destination host was down.
//
WSAEHOSTDOWN = 10064;
//
// MessageId: WSAEHOSTUNREACH
//
// MessageText:
//
// A socket operation was attempted to an unreachable host.
//
WSAEHOSTUNREACH = 10065;
//
// MessageId: WSAENOTEMPTY
//
// MessageText:
//
// Cannot remove a directory that is not empty.
//
WSAENOTEMPTY = 10066;
//
// MessageId: WSAEPROCLIM
//
// MessageText:
//
// A Windows Sockets implementation may have a limit on the number of applications that may use it simultaneously.
//
WSAEPROCLIM = 10067;
//
// MessageId: WSAEUSERS
//
// MessageText:
//
// Ran out of quota.
//
WSAEUSERS = 10068;
//
// MessageId: WSAEDQUOT
//
// MessageText:
//
// Ran out of disk quota.
//
WSAEDQUOT = 10069;
//
// MessageId: WSAESTALE
//
// MessageText:
//
// File handle reference is no longer available.
//
WSAESTALE = 10070;
//
// MessageId: WSAEREMOTE
//
// MessageText:
//
// Item is not available locally.
//
WSAEREMOTE = 10071;
//
// MessageId: WSASYSNOTREADY
//
// MessageText:
//
// WSAStartup cannot function at this time because the underlying system it uses to provide network services is currently unavailable.
//
WSASYSNOTREADY = 10091;
//
// MessageId: WSAVERNOTSUPPORTED
//
// MessageText:
//
// The Windows Sockets version requested is not supported.
//
WSAVERNOTSUPPORTED = 10092;
//
// MessageId: WSANOTINITIALISED
//
// MessageText:
//
// Either the application has not called WSAStartup, or WSAStartup failed.
//
WSANOTINITIALISED = 10093;
//
// MessageId: WSAEDISCON
//
// MessageText:
//
// Returned by WSARecv or WSARecvFrom to indicate the remote party has initiated a graceful shutdown sequence.
//
WSAEDISCON = 10101;
//
// MessageId: WSAENOMORE
//
// MessageText:
//
// No more results can be returned by WSALookupServiceNext.
//
WSAENOMORE = 10102;
//
// MessageId: WSAECANCELLED
//
// MessageText:
//
// A call to WSALookupServiceEnd was made while this call was still processing. The call has been canceled.
//
WSAECANCELLED = 10103;
//
// MessageId: WSAEINVALIDPROCTABLE
//
// MessageText:
//
// The procedure call table is invalid.
//
WSAEINVALIDPROCTABLE = 10104;
//
// MessageId: WSAEINVALIDPROVIDER
//
// MessageText:
//
// The requested service provider is invalid.
//
WSAEINVALIDPROVIDER = 10105;
//
// MessageId: WSAEPROVIDERFAILEDINIT
//
// MessageText:
//
// The requested service provider could not be loaded or initialized.
//
WSAEPROVIDERFAILEDINIT = 10106;
//
// MessageId: WSASYSCALLFAILURE
//
// MessageText:
//
// A system call that should never fail has failed.
//
WSASYSCALLFAILURE = 10107;
//
// MessageId: WSASERVICE_NOT_FOUND
//
// MessageText:
//
// No such service is known. The service cannot be found in the specified name space.
//
WSASERVICE_NOT_FOUND = 10108;
//
// MessageId: WSATYPE_NOT_FOUND
//
// MessageText:
//
// The specified class was not found.
//
WSATYPE_NOT_FOUND = 10109;
//
// MessageId: WSA_E_NO_MORE
//
// MessageText:
//
// No more results can be returned by WSALookupServiceNext.
//
WSA_E_NO_MORE = 10110;
//
// MessageId: WSA_E_CANCELLED
//
// MessageText:
//
// A call to WSALookupServiceEnd was made while this call was still processing. The call has been canceled.
//
WSA_E_CANCELLED = 10111;
//
// MessageId: WSAEREFUSED
//
// MessageText:
//
// A database query failed because it was actively refused.
//
WSAEREFUSED = 10112;
//
// MessageId: WSAHOST_NOT_FOUND
//
// MessageText:
//
// No such host is known.
//
WSAHOST_NOT_FOUND = 11001;
//
// MessageId: WSATRY_AGAIN
//
// MessageText:
//
// This is usually a temporary error during hostname resolution and means that the local server did not receive a response from an authoritative server.
//
WSATRY_AGAIN = 11002;
//
// MessageId: WSANO_RECOVERY
//
// MessageText:
//
// A non-recoverable error occurred during a database lookup.
//
WSANO_RECOVERY = 11003;
//
// MessageId: WSANO_DATA
//
// MessageText:
//
// The requested name is valid and was found in the database, but it does not have the correct associated data being resolved for.
//
WSANO_DATA = 11004;
//
// MessageId: WSA_QOS_RECEIVERS
//
// MessageText:
//
// At least one reserve has arrived.
//
WSA_QOS_RECEIVERS = 11005;
//
// MessageId: WSA_QOS_SENDERS
//
// MessageText:
//
// At least one path has arrived.
//
WSA_QOS_SENDERS = 11006;
//
// MessageId: WSA_QOS_NO_SENDERS
//
// MessageText:
//
// There are no senders.
//
WSA_QOS_NO_SENDERS = 11007;
//
// MessageId: WSA_QOS_NO_RECEIVERS
//
// MessageText:
//
// There are no receivers.
//
WSA_QOS_NO_RECEIVERS = 11008;
//
// MessageId: WSA_QOS_REQUEST_CONFIRMED
//
// MessageText:
//
// Reserve has been confirmed.
//
WSA_QOS_REQUEST_CONFIRMED = 11009;
//
// MessageId: WSA_QOS_ADMISSION_FAILURE
//
// MessageText:
//
// Error due to lack of resources.
//
WSA_QOS_ADMISSION_FAILURE = 11010;
//
// MessageId: WSA_QOS_POLICY_FAILURE
//
// MessageText:
//
// Rejected for administrative reasons - bad credentials.
//
WSA_QOS_POLICY_FAILURE = 11011;
//
// MessageId: WSA_QOS_BAD_STYLE
//
// MessageText:
//
// Unknown or conflicting style.
//
WSA_QOS_BAD_STYLE = 11012;
//
// MessageId: WSA_QOS_BAD_OBJECT
//
// MessageText:
//
// Problem with some part of the filterspec or providerspecific buffer in general.
//
WSA_QOS_BAD_OBJECT = 11013;
//
// MessageId: WSA_QOS_TRAFFIC_CTRL_ERROR
//
// MessageText:
//
// Problem with some part of the flowspec.
//
WSA_QOS_TRAFFIC_CTRL_ERROR = 11014;
//
// MessageId: WSA_QOS_GENERIC_ERROR
//
// MessageText:
//
// General QOS error.
//
WSA_QOS_GENERIC_ERROR = 11015;
//
// MessageId: WSA_QOS_ESERVICETYPE
//
// MessageText:
//
// An invalid or unrecognized service type was found in the flowspec.
//
WSA_QOS_ESERVICETYPE = 11016;
//
// MessageId: WSA_QOS_EFLOWSPEC
//
// MessageText:
//
// An invalid or inconsistent flowspec was found in the QOS structure.
//
WSA_QOS_EFLOWSPEC = 11017;
//
// MessageId: WSA_QOS_EPROVSPECBUF
//
// MessageText:
//
// Invalid QOS provider-specific buffer.
//
WSA_QOS_EPROVSPECBUF = 11018;
//
// MessageId: WSA_QOS_EFILTERSTYLE
//
// MessageText:
//
// An invalid QOS filter style was used.
//
WSA_QOS_EFILTERSTYLE = 11019;
//
// MessageId: WSA_QOS_EFILTERTYPE
//
// MessageText:
//
// An invalid QOS filter type was used.
//
WSA_QOS_EFILTERTYPE = 11020;
//
// MessageId: WSA_QOS_EFILTERCOUNT
//
// MessageText:
//
// An incorrect number of QOS FILTERSPECs were specified in the FLOWDESCRIPTOR.
//
WSA_QOS_EFILTERCOUNT = 11021;
//
// MessageId: WSA_QOS_EOBJLENGTH
//
// MessageText:
//
// An object with an invalid ObjectLength field was specified in the QOS provider-specific buffer.
//
WSA_QOS_EOBJLENGTH = 11022;
//
// MessageId: WSA_QOS_EFLOWCOUNT
//
// MessageText:
//
// An incorrect number of flow descriptors was specified in the QOS structure.
//
WSA_QOS_EFLOWCOUNT = 11023;
//
// MessageId: WSA_QOS_EUNKOWNPSOBJ
//
// MessageText:
//
// An unrecognized object was found in the QOS provider-specific buffer.
//
WSA_QOS_EUNKOWNPSOBJ = 11024;
//
// MessageId: WSA_QOS_EPOLICYOBJ
//
// MessageText:
//
// An invalid policy object was found in the QOS provider-specific buffer.
//
WSA_QOS_EPOLICYOBJ = 11025;
//
// MessageId: WSA_QOS_EFLOWDESC
//
// MessageText:
//
// An invalid QOS flow descriptor was found in the flow descriptor list.
//
WSA_QOS_EFLOWDESC = 11026;
//
// MessageId: WSA_QOS_EPSFLOWSPEC
//
// MessageText:
//
// An invalid or inconsistent flowspec was found in the QOS provider specific buffer.
//
WSA_QOS_EPSFLOWSPEC = 11027;
//
// MessageId: WSA_QOS_EPSFILTERSPEC
//
// MessageText:
//
// An invalid FILTERSPEC was found in the QOS provider-specific buffer.
//
WSA_QOS_EPSFILTERSPEC = 11028;
//
// MessageId: WSA_QOS_ESDMODEOBJ
//
// MessageText:
//
// An invalid shape discard mode object was found in the QOS provider specific buffer.
//
WSA_QOS_ESDMODEOBJ = 11029;
//
// MessageId: WSA_QOS_ESHAPERATEOBJ
//
// MessageText:
//
// An invalid shaping rate object was found in the QOS provider-specific buffer.
//
WSA_QOS_ESHAPERATEOBJ = 11030;
//
// MessageId: WSA_QOS_RESERVED_PETYPE
//
// MessageText:
//
// A reserved policy element was found in the QOS provider-specific buffer.
//
WSA_QOS_RESERVED_PETYPE = 11031;
///////////////////////////////////////////////////
// //
// End of WinSock Error Codes //
// //
// 10000 to 11999 //
///////////////////////////////////////////////////
////////////////////////////////////
// //
// COM Error Codes //
// //
////////////////////////////////////
//
// The return value of COM functions and methods is an HRESULT.
// This is not a handle to anything, but is merely a 32-bit value
// with several fields encoded in the value. The parts of an
// HRESULT are shown below.
//
// Many of the macros and functions below were orginally defined to
// operate on SCODEs. SCODEs are no longer used. The macros are
// still present for compatibility and easy porting of Win16 code.
// Newly written code should use the HRESULT macros and functions.
//
//
// HRESULTs are 32 bit values layed out as follows:
//
// 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
// +-+-+-+-+-+---------------------+-------------------------------+
// |S|R|C|N|r| Facility | Code |
// +-+-+-+-+-+---------------------+-------------------------------+
//
// where
//
// S - Severity - indicates success/fail
//
// 0 - Success
// 1 - Fail (COERROR)
//
// R - reserved portion of the facility code, corresponds to NT's
// second severity bit.
//
// C - reserved portion of the facility code, corresponds to NT's
// C field.
//
// N - reserved portion of the facility code. Used to indicate a
// mapped NT status value.
//
// r - reserved portion of the facility code. Reserved for internal
// use. Used to indicate HRESULT values that are not status
// values, but are instead message ids for display strings.
//
// Facility - is the facility code
//
// Code - is the facility's status code
//
//
// Severity values
//
SEVERITY_SUCCESS = 0;
SEVERITY_ERROR = 1;
{ TODO: SUCCEEDED(Status) and FAILED(Status) are
already translated in Windows.pas
//
// Generic test for success on any status value (non-negative numbers
// indicate success).
//
#define SUCCEEDED(Status) ((HRESULT)(Status) >= 0)
//
// and the inverse
//
#define FAILED(Status) ((HRESULT)(Status)<0)
//
// Generic test for error on any status value.
//
#define IS_ERROR(Status) ((unsigned long)(Status) >> 31 == SEVERITY_ERROR)
//
// Return the code
//
#define HRESULT_CODE(hr) ((hr) & 0xFFFF)
#define SCODE_CODE(sc) ((sc) & 0xFFFF)
//
// Return the facility
//
#define HRESULT_FACILITY(hr) (((hr) >> 16) & 0x1fff)
#define SCODE_FACILITY(sc) (((sc) >> 16) & 0x1fff)
//
// Return the severity
//
#define HRESULT_SEVERITY(hr) (((hr) >> 31) & 0x1)
#define SCODE_SEVERITY(sc) (((sc) >> 31) & 0x1)
//
// Create an HRESULT value from component pieces
//
#define MAKE_HRESULT(sev,fac,code) \
((HRESULT) (((unsigned long)(sev)<<31) | ((unsigned long)(fac)<<16) | ((unsigned long)(code))) )
#define MAKE_SCODE(sev,fac,code) \
((SCODE) (((unsigned long)(sev)<<31) | ((unsigned long)(fac)<<16) | ((unsigned long)(code))) )
//
// Map a WIN32 error value into a HRESULT
// Note: This assumes that WIN32 errors fall in the range -32k to 32k.
//
// Define bits here so macros are guaranteed to work
#define FACILITY_NT_BIT 0x10000000
#define HRESULT_FROM_WIN32(x) ((HRESULT)(x) <= 0 ? ((HRESULT)(x)) : ((HRESULT) (((x) & 0x0000FFFF) | (FACILITY_WIN32 << 16) | 0x80000000)))
//
// Map an NT status value into a HRESULT
//
#define HRESULT_FROM_NT(x) ((HRESULT) ((x) | FACILITY_NT_BIT))
// ****** OBSOLETE functions
// HRESULT functions
// As noted above, these functions are obsolete and should not be used.
// Extract the SCODE from a HRESULT
#define GetScode(hr) ((SCODE) (hr))
// Convert an SCODE into an HRESULT.
#define ResultFromScode(sc) ((HRESULT) (sc))
// PropagateResult is a noop
#define PropagateResult(hrPrevious, scBase) ((HRESULT) scBase)
// ****** End of OBSOLETE functions.
// ---------------------- HRESULT value definitions -----------------
//
// HRESULT definitions
//
#ifdef RC_INVOKED
#define _HRESULT_TYPEDEF_(_sc) _sc
#else // RC_INVOKED
#define _HRESULT_TYPEDEF_(_sc) ((HRESULT)_sc)
#endif // RC_INVOKED
}
NOERROR = 0;
//
// Error definitions follow
//
//
// Codes 0x4000-0x40ff are reserved for OLE
//
//
// Error codes
//
//
// MessageId: E_UNEXPECTED
//
// MessageText:
//
// Catastrophic failure
//
E_UNEXPECTED = HRESULT($8000FFFF);
//
// MessageId: E_NOTIMPL
//
// MessageText:
//
// Not implemented
//
E_NOTIMPL = HRESULT($80004001);
//
// MessageId: E_OUTOFMEMORY
//
// MessageText:
//
// Ran out of memory
//
E_OUTOFMEMORY = HRESULT($8007000E);
//
// MessageId: E_INVALIDARG
//
// MessageText:
//
// One or more arguments are invalid
//
E_INVALIDARG = HRESULT($80070057);
//
// MessageId: E_NOINTERFACE
//
// MessageText:
//
// No such interface supported
//
E_NOINTERFACE = HRESULT($80004002);
//
// MessageId: E_POINTER
//
// MessageText:
//
// Invalid pointer
//
E_POINTER = HRESULT($80004003);
//
// MessageId: E_HANDLE
//
// MessageText:
//
// Invalid handle
//
E_HANDLE = HRESULT($80070006);
//
// MessageId: E_ABORT
//
// MessageText:
//
// Operation aborted
//
E_ABORT = HRESULT($80004004);
//
// MessageId: E_FAIL
//
// MessageText:
//
// Unspecified error
//
E_FAIL = HRESULT($80004005);
//
// MessageId: E_ACCESSDENIED
//
// MessageText:
//
// General access denied error
//
E_ACCESSDENIED = HRESULT($80070005);
//
// MessageId: E_PENDING
//
// MessageText:
//
// The data necessary to complete this operation is not yet available.
//
E_PENDING = HRESULT($8000000A);
//
// MessageId: CO_E_INIT_TLS
//
// MessageText:
//
// Thread local storage failure
//
CO_E_INIT_TLS = HRESULT($80004006);
//
// MessageId: CO_E_INIT_SHARED_ALLOCATOR
//
// MessageText:
//
// Get shared memory allocator failure
//
CO_E_INIT_SHARED_ALLOCATOR = HRESULT($80004007);
//
// MessageId: CO_E_INIT_MEMORY_ALLOCATOR
//
// MessageText:
//
// Get memory allocator failure
//
CO_E_INIT_MEMORY_ALLOCATOR = HRESULT($80004008);
//
// MessageId: CO_E_INIT_CLASS_CACHE
//
// MessageText:
//
// Unable to initialize class cache
//
CO_E_INIT_CLASS_CACHE = HRESULT($80004009);
//
// MessageId: CO_E_INIT_RPC_CHANNEL
//
// MessageText:
//
// Unable to initialize RPC services
//
CO_E_INIT_RPC_CHANNEL = HRESULT($8000400A);
//
// MessageId: CO_E_INIT_TLS_SET_CHANNEL_CONTROL
//
// MessageText:
//
// Cannot set thread local storage channel control
//
CO_E_INIT_TLS_SET_CHANNEL_CONTROL = HRESULT($8000400B);
//
// MessageId: CO_E_INIT_TLS_CHANNEL_CONTROL
//
// MessageText:
//
// Could not allocate thread local storage channel control
//
CO_E_INIT_TLS_CHANNEL_CONTROL = HRESULT($8000400C);
//
// MessageId: CO_E_INIT_UNACCEPTED_USER_ALLOCATOR
//
// MessageText:
//
// The user supplied memory allocator is unacceptable
//
CO_E_INIT_UNACCEPTED_USER_ALLOCATOR = HRESULT($8000400D);
//
// MessageId: CO_E_INIT_SCM_MUTEX_EXISTS
//
// MessageText:
//
// The OLE service mutex already exists
//
CO_E_INIT_SCM_MUTEX_EXISTS = HRESULT($8000400E);
//
// MessageId: CO_E_INIT_SCM_FILE_MAPPING_EXISTS
//
// MessageText:
//
// The OLE service file mapping already exists
//
CO_E_INIT_SCM_FILE_MAPPING_EXISTS = HRESULT($8000400F);
//
// MessageId: CO_E_INIT_SCM_MAP_VIEW_OF_FILE
//
// MessageText:
//
// Unable to map view of file for OLE service
//
CO_E_INIT_SCM_MAP_VIEW_OF_FILE = HRESULT($80004010);
//
// MessageId: CO_E_INIT_SCM_EXEC_FAILURE
//
// MessageText:
//
// Failure attempting to launch OLE service
//
CO_E_INIT_SCM_EXEC_FAILURE = HRESULT($80004011);
//
// MessageId: CO_E_INIT_ONLY_SINGLE_THREADED
//
// MessageText:
//
// There was an attempt to call CoInitialize a second time while single threaded
//
CO_E_INIT_ONLY_SINGLE_THREADED = HRESULT($80004012);
//
// MessageId: CO_E_CANT_REMOTE
//
// MessageText:
//
// A Remote activation was necessary but was not allowed
//
CO_E_CANT_REMOTE = HRESULT($80004013);
//
// MessageId: CO_E_BAD_SERVER_NAME
//
// MessageText:
//
// A Remote activation was necessary but the server name provided was invalid
//
CO_E_BAD_SERVER_NAME = HRESULT($80004014);
//
// MessageId: CO_E_WRONG_SERVER_IDENTITY
//
// MessageText:
//
// The class is configured to run as a security id different from the caller
//
CO_E_WRONG_SERVER_IDENTITY = HRESULT($80004015);
//
// MessageId: CO_E_OLE1DDE_DISABLED
//
// MessageText:
//
// Use of Ole1 services requiring DDE windows is disabled
//
CO_E_OLE1DDE_DISABLED = HRESULT($80004016);
//
// MessageId: CO_E_RUNAS_SYNTAX
//
// MessageText:
//
// A RunAs specification must be <domain name>\<user name> or simply <user name>
//
CO_E_RUNAS_SYNTAX = HRESULT($80004017);
//
// MessageId: CO_E_CREATEPROCESS_FAILURE
//
// MessageText:
//
// The server process could not be started. The pathname may be incorrect.
//
CO_E_CREATEPROCESS_FAILURE = HRESULT($80004018);
//
// MessageId: CO_E_RUNAS_CREATEPROCESS_FAILURE
//
// MessageText:
//
// The server process could not be started as the configured identity. The pathname may be incorrect or unavailable.
//
CO_E_RUNAS_CREATEPROCESS_FAILURE = HRESULT($80004019);
//
// MessageId: CO_E_RUNAS_LOGON_FAILURE
//
// MessageText:
//
// The server process could not be started because the configured identity is incorrect. Check the username and password.
//
CO_E_RUNAS_LOGON_FAILURE = HRESULT($8000401A);
//
// MessageId: CO_E_LAUNCH_PERMSSION_DENIED
//
// MessageText:
//
// The client is not allowed to launch this server.
//
CO_E_LAUNCH_PERMSSION_DENIED = HRESULT($8000401B);
//
// MessageId: CO_E_START_SERVICE_FAILURE
//
// MessageText:
//
// The service providing this server could not be started.
//
CO_E_START_SERVICE_FAILURE = HRESULT($8000401C);
//
// MessageId: CO_E_REMOTE_COMMUNICATION_FAILURE
//
// MessageText:
//
// This computer was unable to communicate with the computer providing the server.
//
CO_E_REMOTE_COMMUNICATION_FAILURE = HRESULT($8000401D);
//
// MessageId: CO_E_SERVER_START_TIMEOUT
//
// MessageText:
//
// The server did not respond after being launched.
//
CO_E_SERVER_START_TIMEOUT = HRESULT($8000401E);
//
// MessageId: CO_E_CLSREG_INCONSISTENT
//
// MessageText:
//
// The registration information for this server is inconsistent or incomplete.
//
CO_E_CLSREG_INCONSISTENT = HRESULT($8000401F);
//
// MessageId: CO_E_IIDREG_INCONSISTENT
//
// MessageText:
//
// The registration information for this interface is inconsistent or incomplete.
//
CO_E_IIDREG_INCONSISTENT = HRESULT($80004020);
//
// MessageId: CO_E_NOT_SUPPORTED
//
// MessageText:
//
// The operation attempted is not supported.
//
CO_E_NOT_SUPPORTED = HRESULT($80004021);
//
// MessageId: CO_E_RELOAD_DLL
//
// MessageText:
//
// A dll must be loaded.
//
CO_E_RELOAD_DLL = HRESULT($80004022);
//
// MessageId: CO_E_MSI_ERROR
//
// MessageText:
//
// A Microsoft Software Installer error was encountered.
//
CO_E_MSI_ERROR = HRESULT($80004023);
//
// MessageId: CO_E_ATTEMPT_TO_CREATE_OUTSIDE_CLIENT_CONTEXT
//
// MessageText:
//
// The specified activation could not occur in the client context as specified.
//
CO_E_ATTEMPT_TO_CREATE_OUTSIDE_CLIENT_CONTEXT = HRESULT($80004024);
//
// Success codes
//
S_OK = HRESULT($00000000);
S_FALSE = HRESULT($00000001);
// ******************
// FACILITY_ITF
// ******************
//
// Codes 0x0-0x01ff are reserved for the OLE group of
// interfaces.
//
//
// Generic OLE errors that may be returned by many inerfaces
//
OLE_E_FIRST = HRESULT($80040000);
OLE_E_LAST = HRESULT($800400FF);
OLE_S_FIRST = HRESULT($00040000);
OLE_S_LAST = HRESULT($000400FF);
//
// Old OLE errors
//
//
// MessageId: OLE_E_OLEVERB
//
// MessageText:
//
// Invalid OLEVERB structure
//
OLE_E_OLEVERB = HRESULT($80040000);
//
// MessageId: OLE_E_ADVF
//
// MessageText:
//
// Invalid advise flags
//
OLE_E_ADVF = HRESULT($80040001);
//
// MessageId: OLE_E_ENUM_NOMORE
//
// MessageText:
//
// Can't enumerate any more, because the associated data is missing
//
OLE_E_ENUM_NOMORE = HRESULT($80040002);
//
// MessageId: OLE_E_ADVISENOTSUPPORTED
//
// MessageText:
//
// This implementation doesn't take advises
//
OLE_E_ADVISENOTSUPPORTED = HRESULT($80040003);
//
// MessageId: OLE_E_NOCONNECTION
//
// MessageText:
//
// There is no connection for this connection ID
//
OLE_E_NOCONNECTION = HRESULT($80040004);
//
// MessageId: OLE_E_NOTRUNNING
//
// MessageText:
//
// Need to run the object to perform this operation
//
OLE_E_NOTRUNNING = HRESULT($80040005);
//
// MessageId: OLE_E_NOCACHE
//
// MessageText:
//
// There is no cache to operate on
//
OLE_E_NOCACHE = HRESULT($80040006);
//
// MessageId: OLE_E_BLANK
//
// MessageText:
//
// Uninitialized object
//
OLE_E_BLANK = HRESULT($80040007);
//
// MessageId: OLE_E_CLASSDIFF
//
// MessageText:
//
// Linked object's source class has changed
//
OLE_E_CLASSDIFF = HRESULT($80040008);
//
// MessageId: OLE_E_CANT_GETMONIKER
//
// MessageText:
//
// Not able to get the moniker of the object
//
OLE_E_CANT_GETMONIKER = HRESULT($80040009);
//
// MessageId: OLE_E_CANT_BINDTOSOURCE
//
// MessageText:
//
// Not able to bind to the source
//
OLE_E_CANT_BINDTOSOURCE = HRESULT($8004000A);
//
// MessageId: OLE_E_STATIC
//
// MessageText:
//
// Object is static; operation not allowed
//
OLE_E_STATIC = HRESULT($8004000B);
//
// MessageId: OLE_E_PROMPTSAVECANCELLED
//
// MessageText:
//
// User canceled out of save dialog
//
OLE_E_PROMPTSAVECANCELLED = HRESULT($8004000C);
//
// MessageId: OLE_E_INVALIDRECT
//
// MessageText:
//
// Invalid rectangle
//
OLE_E_INVALIDRECT = HRESULT($8004000D);
//
// MessageId: OLE_E_WRONGCOMPOBJ
//
// MessageText:
//
// compobj.dll is too old for the ole2.dll initialized
//
OLE_E_WRONGCOMPOBJ = HRESULT($8004000E);
//
// MessageId: OLE_E_INVALIDHWND
//
// MessageText:
//
// Invalid window handle
//
OLE_E_INVALIDHWND = HRESULT($8004000F);
//
// MessageId: OLE_E_NOT_INPLACEACTIVE
//
// MessageText:
//
// Object is not in any of the inplace active states
//
OLE_E_NOT_INPLACEACTIVE = HRESULT($80040010);
//
// MessageId: OLE_E_CANTCONVERT
//
// MessageText:
//
// Not able to convert object
//
OLE_E_CANTCONVERT = HRESULT($80040011);
//
// MessageId: OLE_E_NOSTORAGE
//
// MessageText:
//
// Not able to perform the operation because object is not given storage yet
//
OLE_E_NOSTORAGE = HRESULT($80040012);
//
// MessageId: DV_E_FORMATETC
//
// MessageText:
//
// Invalid FORMATETC structure
//
DV_E_FORMATETC = HRESULT($80040064);
//
// MessageId: DV_E_DVTARGETDEVICE
//
// MessageText:
//
// Invalid DVTARGETDEVICE structure
//
DV_E_DVTARGETDEVICE = HRESULT($80040065);
//
// MessageId: DV_E_STGMEDIUM
//
// MessageText:
//
// Invalid STDGMEDIUM structure
//
DV_E_STGMEDIUM = HRESULT($80040066);
//
// MessageId: DV_E_STATDATA
//
// MessageText:
//
// Invalid STATDATA structure
//
DV_E_STATDATA = HRESULT($80040067);
//
// MessageId: DV_E_LINDEX
//
// MessageText:
//
// Invalid lindex
//
DV_E_LINDEX = HRESULT($80040068);
//
// MessageId: DV_E_TYMED
//
// MessageText:
//
// Invalid tymed
//
DV_E_TYMED = HRESULT($80040069);
//
// MessageId: DV_E_CLIPFORMAT
//
// MessageText:
//
// Invalid clipboard format
//
DV_E_CLIPFORMAT = HRESULT($8004006A);
//
// MessageId: DV_E_DVASPECT
//
// MessageText:
//
// Invalid aspect(s)
//
DV_E_DVASPECT = HRESULT($8004006B);
//
// MessageId: DV_E_DVTARGETDEVICE_SIZE
//
// MessageText:
//
// tdSize parameter of the DVTARGETDEVICE structure is invalid
//
DV_E_DVTARGETDEVICE_SIZE = HRESULT($8004006C);
//
// MessageId: DV_E_NOIVIEWOBJECT
//
// MessageText:
//
// Object doesn't support IViewObject interface
//
DV_E_NOIVIEWOBJECT = HRESULT($8004006D);
DRAGDROP_E_FIRST = HRESULT($80040100);
DRAGDROP_E_LAST = HRESULT($8004010F);
DRAGDROP_S_FIRST = HRESULT($00040100);
DRAGDROP_S_LAST = HRESULT($0004010F);
//
// MessageId: DRAGDROP_E_NOTREGISTERED
//
// MessageText:
//
// Trying to revoke a drop target that has not been registered
//
DRAGDROP_E_NOTREGISTERED = HRESULT($80040100);
//
// MessageId: DRAGDROP_E_ALREADYREGISTERED
//
// MessageText:
//
// This window has already been registered as a drop target
//
DRAGDROP_E_ALREADYREGISTERED = HRESULT($80040101);
//
// MessageId: DRAGDROP_E_INVALIDHWND
//
// MessageText:
//
// Invalid window handle
//
DRAGDROP_E_INVALIDHWND = HRESULT($80040102);
CLASSFACTORY_E_FIRST = HRESULT($80040110);
CLASSFACTORY_E_LAST = HRESULT($8004011F);
CLASSFACTORY_S_FIRST = HRESULT($00040110);
CLASSFACTORY_S_LAST = HRESULT($0004011F);
//
// MessageId: CLASS_E_NOAGGREGATION
//
// MessageText:
//
// Class does not support aggregation (or class object is remote)
//
CLASS_E_NOAGGREGATION = HRESULT($80040110);
//
// MessageId: CLASS_E_CLASSNOTAVAILABLE
//
// MessageText:
//
// ClassFactory cannot supply requested class
//
CLASS_E_CLASSNOTAVAILABLE = HRESULT($80040111);
//
// MessageId: CLASS_E_NOTLICENSED
//
// MessageText:
//
// Class is not licensed for use
//
CLASS_E_NOTLICENSED = HRESULT($80040112);
MARSHAL_E_FIRST = HRESULT($80040120);
MARSHAL_E_LAST = HRESULT($8004012F);
MARSHAL_S_FIRST = HRESULT($00040120);
MARSHAL_S_LAST = HRESULT($0004012F);
DATA_E_FIRST = HRESULT($80040130);
DATA_E_LAST = HRESULT($8004013F);
DATA_S_FIRST = HRESULT($00040130);
DATA_S_LAST = HRESULT($0004013F);
VIEW_E_FIRST = HRESULT($80040140);
VIEW_E_LAST = HRESULT($8004014F);
VIEW_S_FIRST = HRESULT($00040140);
VIEW_S_LAST = HRESULT($0004014F);
//
// MessageId: VIEW_E_DRAW
//
// MessageText:
//
// Error drawing view
//
VIEW_E_DRAW = HRESULT($80040140);
REGDB_E_FIRST = HRESULT($80040150);
REGDB_E_LAST = HRESULT($8004015F);
REGDB_S_FIRST = HRESULT($00040150);
REGDB_S_LAST = HRESULT($0004015F);
//
// MessageId: REGDB_E_READREGDB
//
// MessageText:
//
// Could not read key from registry
//
REGDB_E_READREGDB = HRESULT($80040150);
//
// MessageId: REGDB_E_WRITEREGDB
//
// MessageText:
//
// Could not write key to registry
//
REGDB_E_WRITEREGDB = HRESULT($80040151);
//
// MessageId: REGDB_E_KEYMISSING
//
// MessageText:
//
// Could not find the key in the registry
//
REGDB_E_KEYMISSING = HRESULT($80040152);
//
// MessageId: REGDB_E_INVALIDVALUE
//
// MessageText:
//
// Invalid value for registry
//
REGDB_E_INVALIDVALUE = HRESULT($80040153);
//
// MessageId: REGDB_E_CLASSNOTREG
//
// MessageText:
//
// Class not registered
//
REGDB_E_CLASSNOTREG = HRESULT($80040154);
//
// MessageId: REGDB_E_IIDNOTREG
//
// MessageText:
//
// Interface not registered
//
REGDB_E_IIDNOTREG = HRESULT($80040155);
//
// MessageId: REGDB_E_BADTHREADINGMODEL
//
// MessageText:
//
// Threading model entry is not valid
//
REGDB_E_BADTHREADINGMODEL = HRESULT($80040156);
CAT_E_FIRST = HRESULT($80040160);
CAT_E_LAST = HRESULT($80040161);
//
// MessageId: CAT_E_CATIDNOEXIST
//
// MessageText:
//
// CATID does not exist
//
CAT_E_CATIDNOEXIST = HRESULT($80040160);
//
// MessageId: CAT_E_NODESCRIPTION
//
// MessageText:
//
// Description not found
//
CAT_E_NODESCRIPTION = HRESULT($80040161);
////////////////////////////////////
// //
// Class Store Error Codes //
// //
////////////////////////////////////
CS_E_FIRST = HRESULT($80040164);
CS_E_LAST = HRESULT($8004016F);
//
// MessageId: CS_E_PACKAGE_NOTFOUND
//
// MessageText:
//
// No package in the software installation data in the Active Directory meets this criteria.
//
CS_E_PACKAGE_NOTFOUND = HRESULT($80040164);
//
// MessageId: CS_E_NOT_DELETABLE
//
// MessageText:
//
// Deleting this will break the referential integrity of the software installation data in the Active Directory.
//
CS_E_NOT_DELETABLE = HRESULT($80040165);
//
// MessageId: CS_E_CLASS_NOTFOUND
//
// MessageText:
//
// The CLSID was not found in the software installation data in the Active Directory.
//
CS_E_CLASS_NOTFOUND = HRESULT($80040166);
//
// MessageId: CS_E_INVALID_VERSION
//
// MessageText:
//
// The software installation data in the Active Directory is corrupt.
//
CS_E_INVALID_VERSION = HRESULT($80040167);
//
// MessageId: CS_E_NO_CLASSSTORE
//
// MessageText:
//
// There is no software installation data in the Active Directory.
//
CS_E_NO_CLASSSTORE = HRESULT($80040168);
//
// MessageId: CS_E_OBJECT_NOTFOUND
//
// MessageText:
//
// There is no software installation data object in the Active Directory.
//
CS_E_OBJECT_NOTFOUND = HRESULT($80040169);
//
// MessageId: CS_E_OBJECT_ALREADY_EXISTS
//
// MessageText:
//
// The software installation data object in the Active Directory already exists.
//
CS_E_OBJECT_ALREADY_EXISTS = HRESULT($8004016A);
//
// MessageId: CS_E_INVALID_PATH
//
// MessageText:
//
// The path to the software installation data in the Active Directory is not correct.
//
CS_E_INVALID_PATH = HRESULT($8004016B);
//
// MessageId: CS_E_NETWORK_ERROR
//
// MessageText:
//
// A network error interrupted the operation.
//
CS_E_NETWORK_ERROR = HRESULT($8004016C);
//
// MessageId: CS_E_ADMIN_LIMIT_EXCEEDED
//
// MessageText:
//
// The size of this object exceeds the maximum size set by the Administrator.
//
CS_E_ADMIN_LIMIT_EXCEEDED = HRESULT($8004016D);
//
// MessageId: CS_E_SCHEMA_MISMATCH
//
// MessageText:
//
// The schema for the software installation data in the Active Directory does not match the required schema.
//
CS_E_SCHEMA_MISMATCH = HRESULT($8004016E);
//
// MessageId: CS_E_INTERNAL_ERROR
//
// MessageText:
//
// An error occurred in the software installation data in the Active Directory.
//
CS_E_INTERNAL_ERROR = HRESULT($8004016F);
CACHE_E_FIRST = HRESULT($80040170);
CACHE_E_LAST = HRESULT($8004017F);
CACHE_S_FIRST = HRESULT($00040170);
CACHE_S_LAST = HRESULT($0004017F);
//
// MessageId: CACHE_E_NOCACHE_UPDATED
//
// MessageText:
//
// Cache not updated
//
CACHE_E_NOCACHE_UPDATED = HRESULT($80040170);
OLEOBJ_E_FIRST = HRESULT($80040180);
OLEOBJ_E_LAST = HRESULT($8004018F);
OLEOBJ_S_FIRST = HRESULT($00040180);
OLEOBJ_S_LAST = HRESULT($0004018F);
//
// MessageId: OLEOBJ_E_NOVERBS
//
// MessageText:
//
// No verbs for OLE object
//
OLEOBJ_E_NOVERBS = HRESULT($80040180);
//
// MessageId: OLEOBJ_E_INVALIDVERB
//
// MessageText:
//
// Invalid verb for OLE object
//
OLEOBJ_E_INVALIDVERB = HRESULT($80040181);
CLIENTSITE_E_FIRST = HRESULT($80040190);
CLIENTSITE_E_LAST = HRESULT($8004019F);
CLIENTSITE_S_FIRST = HRESULT($00040190);
CLIENTSITE_S_LAST = HRESULT($0004019F);
//
// MessageId: INPLACE_E_NOTUNDOABLE
//
// MessageText:
//
// Undo is not available
//
INPLACE_E_NOTUNDOABLE = HRESULT($800401A0);
//
// MessageId: INPLACE_E_NOTOOLSPACE
//
// MessageText:
//
// Space for tools is not available
//
INPLACE_E_NOTOOLSPACE = HRESULT($800401A1);
INPLACE_E_FIRST = HRESULT($800401A0);
INPLACE_E_LAST = HRESULT($800401AF);
INPLACE_S_FIRST = HRESULT($000401A0);
INPLACE_S_LAST = HRESULT($000401AF);
ENUM_E_FIRST = HRESULT($800401B0);
ENUM_E_LAST = HRESULT($800401BF);
ENUM_S_FIRST = HRESULT($000401B0);
ENUM_S_LAST = HRESULT($000401BF);
CONVERT10_E_FIRST = HRESULT($800401C0);
CONVERT10_E_LAST = HRESULT($800401CF);
CONVERT10_S_FIRST = HRESULT($000401C0);
CONVERT10_S_LAST = HRESULT($000401CF);
//
// MessageId: CONVERT10_E_OLESTREAM_GET
//
// MessageText:
//
// OLESTREAM Get method failed
//
CONVERT10_E_OLESTREAM_GET = HRESULT($800401C0);
//
// MessageId: CONVERT10_E_OLESTREAM_PUT
//
// MessageText:
//
// OLESTREAM Put method failed
//
CONVERT10_E_OLESTREAM_PUT = HRESULT($800401C1);
//
// MessageId: CONVERT10_E_OLESTREAM_FMT
//
// MessageText:
//
// Contents of the OLESTREAM not in correct format
//
CONVERT10_E_OLESTREAM_FMT = HRESULT($800401C2);
//
// MessageId: CONVERT10_E_OLESTREAM_BITMAP_TO_DIB
//
// MessageText:
//
// There was an error in a Windows GDI call while converting the bitmap to a DIB
//
CONVERT10_E_OLESTREAM_BITMAP_TO_DIB = HRESULT($800401C3);
//
// MessageId: CONVERT10_E_STG_FMT
//
// MessageText:
//
// Contents of the IStorage not in correct format
//
CONVERT10_E_STG_FMT = HRESULT($800401C4);
//
// MessageId: CONVERT10_E_STG_NO_STD_STREAM
//
// MessageText:
//
// Contents of IStorage is missing one of the standard streams
//
CONVERT10_E_STG_NO_STD_STREAM = HRESULT($800401C5);
//
// MessageId: CONVERT10_E_STG_DIB_TO_BITMAP
//
// MessageText:
//
// There was an error in a Windows GDI call while converting the DIB to a bitmap.
//
//
CONVERT10_E_STG_DIB_TO_BITMAP = HRESULT($800401C6);
CLIPBRD_E_FIRST = HRESULT($800401D0);
CLIPBRD_E_LAST = HRESULT($800401DF);
CLIPBRD_S_FIRST = HRESULT($000401D0);
CLIPBRD_S_LAST = HRESULT($000401DF);
//
// MessageId: CLIPBRD_E_CANT_OPEN
//
// MessageText:
//
// OpenClipboard Failed
//
CLIPBRD_E_CANT_OPEN = HRESULT($800401D0);
//
// MessageId: CLIPBRD_E_CANT_EMPTY
//
// MessageText:
//
// EmptyClipboard Failed
//
CLIPBRD_E_CANT_EMPTY = HRESULT($800401D1);
//
// MessageId: CLIPBRD_E_CANT_SET
//
// MessageText:
//
// SetClipboard Failed
//
CLIPBRD_E_CANT_SET = HRESULT($800401D2);
//
// MessageId: CLIPBRD_E_BAD_DATA
//
// MessageText:
//
// Data on clipboard is invalid
//
CLIPBRD_E_BAD_DATA = HRESULT($800401D3);
//
// MessageId: CLIPBRD_E_CANT_CLOSE
//
// MessageText:
//
// CloseClipboard Failed
//
CLIPBRD_E_CANT_CLOSE = HRESULT($800401D4);
MK_E_FIRST = HRESULT($800401E0);
MK_E_LAST = HRESULT($800401EF);
MK_S_FIRST = HRESULT($000401E0);
MK_S_LAST = HRESULT($000401EF);
//
// MessageId: MK_E_CONNECTMANUALLY
//
// MessageText:
//
// Moniker needs to be connected manually
//
MK_E_CONNECTMANUALLY = HRESULT($800401E0);
//
// MessageId: MK_E_EXCEEDEDDEADLINE
//
// MessageText:
//
// Operation exceeded deadline
//
MK_E_EXCEEDEDDEADLINE = HRESULT($800401E1);
//
// MessageId: MK_E_NEEDGENERIC
//
// MessageText:
//
// Moniker needs to be generic
//
MK_E_NEEDGENERIC = HRESULT($800401E2);
//
// MessageId: MK_E_UNAVAILABLE
//
// MessageText:
//
// Operation unavailable
//
MK_E_UNAVAILABLE = HRESULT($800401E3);
//
// MessageId: MK_E_SYNTAX
//
// MessageText:
//
// Invalid syntax
//
MK_E_SYNTAX = HRESULT($800401E4);
//
// MessageId: MK_E_NOOBJECT
//
// MessageText:
//
// No object for moniker
//
MK_E_NOOBJECT = HRESULT($800401E5);
//
// MessageId: MK_E_INVALIDEXTENSION
//
// MessageText:
//
// Bad extension for file
//
MK_E_INVALIDEXTENSION = HRESULT($800401E6);
//
// MessageId: MK_E_INTERMEDIATEINTERFACENOTSUPPORTED
//
// MessageText:
//
// Intermediate operation failed
//
MK_E_INTERMEDIATEINTERFACENOTSUPPORTED = HRESULT($800401E7);
//
// MessageId: MK_E_NOTBINDABLE
//
// MessageText:
//
// Moniker is not bindable
//
MK_E_NOTBINDABLE = HRESULT($800401E8);
//
// MessageId: MK_E_NOTBOUND
//
// MessageText:
//
// Moniker is not bound
//
MK_E_NOTBOUND = HRESULT($800401E9);
//
// MessageId: MK_E_CANTOPENFILE
//
// MessageText:
//
// Moniker cannot open file
//
MK_E_CANTOPENFILE = HRESULT($800401EA);
//
// MessageId: MK_E_MUSTBOTHERUSER
//
// MessageText:
//
// User input required for operation to succeed
//
MK_E_MUSTBOTHERUSER = HRESULT($800401EB);
//
// MessageId: MK_E_NOINVERSE
//
// MessageText:
//
// Moniker class has no inverse
//
MK_E_NOINVERSE = HRESULT($800401EC);
//
// MessageId: MK_E_NOSTORAGE
//
// MessageText:
//
// Moniker does not refer to storage
//
MK_E_NOSTORAGE = HRESULT($800401ED);
//
// MessageId: MK_E_NOPREFIX
//
// MessageText:
//
// No common prefix
//
MK_E_NOPREFIX = HRESULT($800401EE);
//
// MessageId: MK_E_ENUMERATION_FAILED
//
// MessageText:
//
// Moniker could not be enumerated
//
MK_E_ENUMERATION_FAILED = HRESULT($800401EF);
CO_E_FIRST = HRESULT($800401F0);
CO_E_LAST = HRESULT($800401FF);
CO_S_FIRST = HRESULT($000401F0);
CO_S_LAST = HRESULT($000401FF);
//
// MessageId: CO_E_NOTINITIALIZED
//
// MessageText:
//
// CoInitialize has not been called.
//
CO_E_NOTINITIALIZED = HRESULT($800401F0);
//
// MessageId: CO_E_ALREADYINITIALIZED
//
// MessageText:
//
// CoInitialize has already been called.
//
CO_E_ALREADYINITIALIZED = HRESULT($800401F1);
//
// MessageId: CO_E_CANTDETERMINECLASS
//
// MessageText:
//
// Class of object cannot be determined
//
CO_E_CANTDETERMINECLASS = HRESULT($800401F2);
//
// MessageId: CO_E_CLASSSTRING
//
// MessageText:
//
// Invalid class string
//
CO_E_CLASSSTRING = HRESULT($800401F3);
//
// MessageId: CO_E_IIDSTRING
//
// MessageText:
//
// Invalid interface string
//
CO_E_IIDSTRING = HRESULT($800401F4);
//
// MessageId: CO_E_APPNOTFOUND
//
// MessageText:
//
// Application not found
//
CO_E_APPNOTFOUND = HRESULT($800401F5);
//
// MessageId: CO_E_APPSINGLEUSE
//
// MessageText:
//
// Application cannot be run more than once
//
CO_E_APPSINGLEUSE = HRESULT($800401F6);
//
// MessageId: CO_E_ERRORINAPP
//
// MessageText:
//
// Some error in application program
//
CO_E_ERRORINAPP = HRESULT($800401F7);
//
// MessageId: CO_E_DLLNOTFOUND
//
// MessageText:
//
// DLL for class not found
//
CO_E_DLLNOTFOUND = HRESULT($800401F8);
//
// MessageId: CO_E_ERRORINDLL
//
// MessageText:
//
// Error in the DLL
//
CO_E_ERRORINDLL = HRESULT($800401F9);
//
// MessageId: CO_E_WRONGOSFORAPP
//
// MessageText:
//
// Wrong OS or OS version for application
//
CO_E_WRONGOSFORAPP = HRESULT($800401FA);
//
// MessageId: CO_E_OBJNOTREG
//
// MessageText:
//
// Object is not registered
//
CO_E_OBJNOTREG = HRESULT($800401FB);
//
// MessageId: CO_E_OBJISREG
//
// MessageText:
//
// Object is already registered
//
CO_E_OBJISREG = HRESULT($800401FC);
//
// MessageId: CO_E_OBJNOTCONNECTED
//
// MessageText:
//
// Object is not connected to server
//
CO_E_OBJNOTCONNECTED = HRESULT($800401FD);
//
// MessageId: CO_E_APPDIDNTREG
//
// MessageText:
//
// Application was launched but it didn't register a class factory
//
CO_E_APPDIDNTREG = HRESULT($800401FE);
//
// MessageId: CO_E_RELEASED
//
// MessageText:
//
// Object has been released
//
CO_E_RELEASED = HRESULT($800401FF);
EVENT_E_FIRST = HRESULT($80040200);
EVENT_E_LAST = HRESULT($8004021F);
EVENT_S_FIRST = HRESULT($00040200);
EVENT_S_LAST = HRESULT($0004021F);
//
// MessageId: EVENT_S_SOME_SUBSCRIBERS_FAILED
//
// MessageText:
//
// An event was able to invoke some but not all of the subscribers
//
EVENT_S_SOME_SUBSCRIBERS_FAILED = HRESULT($00040200);
//
// MessageId: EVENT_E_ALL_SUBSCRIBERS_FAILED
//
// MessageText:
//
// An event was unable to invoke any of the subscribers
//
EVENT_E_ALL_SUBSCRIBERS_FAILED = HRESULT($80040201);
//
// MessageId: EVENT_S_NOSUBSCRIBERS
//
// MessageText:
//
// An event was delivered but there were no subscribers
//
EVENT_S_NOSUBSCRIBERS = HRESULT($00040202);
//
// MessageId: EVENT_E_QUERYSYNTAX
//
// MessageText:
//
// A syntax error occurred trying to evaluate a query string
//
EVENT_E_QUERYSYNTAX = HRESULT($80040203);
//
// MessageId: EVENT_E_QUERYFIELD
//
// MessageText:
//
// An invalid field name was used in a query string
//
EVENT_E_QUERYFIELD = HRESULT($80040204);
//
// MessageId: EVENT_E_INTERNALEXCEPTION
//
// MessageText:
//
// An unexpected exception was raised
//
EVENT_E_INTERNALEXCEPTION = HRESULT($80040205);
//
// MessageId: EVENT_E_INTERNALERROR
//
// MessageText:
//
// An unexpected internal error was detected
//
EVENT_E_INTERNALERROR = HRESULT($80040206);
//
// MessageId: EVENT_E_INVALID_PER_USER_SID
//
// MessageText:
//
// The owner SID on a per-user subscription doesn't exist
//
EVENT_E_INVALID_PER_USER_SID = HRESULT($80040207);
//
// MessageId: EVENT_E_USER_EXCEPTION
//
// MessageText:
//
// A user-supplied component or subscriber raised an exception
//
EVENT_E_USER_EXCEPTION = HRESULT($80040208);
//
// MessageId: EVENT_E_TOO_MANY_METHODS
//
// MessageText:
//
// An interface has too many methods to fire events from
//
EVENT_E_TOO_MANY_METHODS = HRESULT($80040209);
//
// MessageId: EVENT_E_MISSING_EVENTCLASS
//
// MessageText:
//
// A subscription cannot be stored unless its event class already exists
//
EVENT_E_MISSING_EVENTCLASS = HRESULT($8004020A);
//
// MessageId: EVENT_E_NOT_ALL_REMOVED
//
// MessageText:
//
// Not all the objects requested could be removed
//
EVENT_E_NOT_ALL_REMOVED = HRESULT($8004020B);
//
// MessageId: EVENT_E_COMPLUS_NOT_INSTALLED
//
// MessageText:
//
// COM+ is required for this operation, but is not installed
//
EVENT_E_COMPLUS_NOT_INSTALLED = HRESULT($8004020C);
CONTEXT_E_FIRST = HRESULT($8004E000);
CONTEXT_E_LAST = HRESULT($8004E02F);
CONTEXT_S_FIRST = HRESULT($0004E000);
CONTEXT_S_LAST = HRESULT($0004E02F);
//
// MessageId: CONTEXT_E_ABORTED
//
// MessageText:
//
// The root transaction wanted to commit, but transaction aborted
//
CONTEXT_E_ABORTED = HRESULT($8004E002);
//
// MessageId: CONTEXT_E_ABORTING
//
// MessageText:
//
// You made a method call on a COM+ component that has a transaction that has already aborted or in the process of aborting.
//
CONTEXT_E_ABORTING = HRESULT($8004E003);
//
// MessageId: CONTEXT_E_NOCONTEXT
//
// MessageText:
//
// There is no MTS object context
//
CONTEXT_E_NOCONTEXT = HRESULT($8004E004);
//
// MessageId: CONTEXT_E_SYNCH_TIMEOUT
//
// MessageText:
//
// The component is configured to use synchronization and a thread has timed out waiting to enter the context.
//
CONTEXT_E_SYNCH_TIMEOUT = HRESULT($8004E006);
//
// MessageId: CONTEXT_E_OLDREF
//
// MessageText:
//
// You made a method call on a COM+ component that has a transaction that has already committed or aborted.
//
CONTEXT_E_OLDREF = HRESULT($8004E007);
//
// MessageId: CONTEXT_E_ROLENOTFOUND
//
// MessageText:
//
// The specified role was not configured for the application
//
CONTEXT_E_ROLENOTFOUND = HRESULT($8004E00C);
//
// MessageId: CONTEXT_E_TMNOTAVAILABLE
//
// MessageText:
//
// COM+ was unable to talk to the Microsoft Distributed Transaction Coordinator
//
CONTEXT_E_TMNOTAVAILABLE = HRESULT($8004E00F);
//
// MessageId: CO_E_ACTIVATIONFAILED
//
// MessageText:
//
// An unexpected error occurred during COM+ Activation.
//
CO_E_ACTIVATIONFAILED = HRESULT($8004E021);
//
// MessageId: CO_E_ACTIVATIONFAILED_EVENTLOGGED
//
// MessageText:
//
// COM+ Activation failed. Check the event log for more information
//
CO_E_ACTIVATIONFAILED_EVENTLOGGED = HRESULT($8004E022);
//
// MessageId: CO_E_ACTIVATIONFAILED_CATALOGERROR
//
// MessageText:
//
// COM+ Activation failed due to a catalog or configuration error.
//
CO_E_ACTIVATIONFAILED_CATALOGERROR = HRESULT($8004E023);
//
// MessageId: CO_E_ACTIVATIONFAILED_TIMEOUT
//
// MessageText:
//
// COM+ activation failed because the activation could not be completed in the specified amount of time.
//
CO_E_ACTIVATIONFAILED_TIMEOUT = HRESULT($8004E024);
//
// MessageId: CO_E_INITIALIZATIONFAILED
//
// MessageText:
//
// COM+ Activation failed because an initialization function failed. Check the event log for more information.
//
CO_E_INITIALIZATIONFAILED = HRESULT($8004E025);
//
// MessageId: CONTEXT_E_NOJIT
//
// MessageText:
//
// The requested operation requires that JIT be in the current context and it is not
//
CONTEXT_E_NOJIT = HRESULT($8004E026);
//
// MessageId: CONTEXT_E_NOTRANSACTION
//
// MessageText:
//
// The requested operation requires that the current context have a Transaction, and it does not
//
CONTEXT_E_NOTRANSACTION = HRESULT($8004E027);
//
// MessageId: CO_E_THREADINGMODEL_CHANGED
//
// MessageText:
//
// The components threading model has changed after install into a COM+ Application. Please re-install component.
//
CO_E_THREADINGMODEL_CHANGED = HRESULT($8004E028);
//
// Old OLE Success Codes
//
//
// MessageId: OLE_S_USEREG
//
// MessageText:
//
// Use the registry database to provide the requested information
//
OLE_S_USEREG = HRESULT($00040000);
//
// MessageId: OLE_S_STATIC
//
// MessageText:
//
// Success, but static
//
OLE_S_STATIC = HRESULT($00040001);
//
// MessageId: OLE_S_MAC_CLIPFORMAT
//
// MessageText:
//
// Macintosh clipboard format
//
OLE_S_MAC_CLIPFORMAT = HRESULT($00040002);
//
// MessageId: DRAGDROP_S_DROP
//
// MessageText:
//
// Successful drop took place
//
DRAGDROP_S_DROP = HRESULT($00040100);
//
// MessageId: DRAGDROP_S_CANCEL
//
// MessageText:
//
// Drag-drop operation canceled
//
DRAGDROP_S_CANCEL = HRESULT($00040101);
//
// MessageId: DRAGDROP_S_USEDEFAULTCURSORS
//
// MessageText:
//
// Use the default cursor
//
DRAGDROP_S_USEDEFAULTCURSORS = HRESULT($00040102);
//
// MessageId: DATA_S_SAMEFORMATETC
//
// MessageText:
//
// Data has same FORMATETC
//
DATA_S_SAMEFORMATETC = HRESULT($00040130);
//
// MessageId: VIEW_S_ALREADY_FROZEN
//
// MessageText:
//
// View is already frozen
//
VIEW_S_ALREADY_FROZEN = HRESULT($00040140);
//
// MessageId: CACHE_S_FORMATETC_NOTSUPPORTED
//
// MessageText:
//
// FORMATETC not supported
//
CACHE_S_FORMATETC_NOTSUPPORTED = HRESULT($00040170);
//
// MessageId: CACHE_S_SAMECACHE
//
// MessageText:
//
// Same cache
//
CACHE_S_SAMECACHE = HRESULT($00040171);
//
// MessageId: CACHE_S_SOMECACHES_NOTUPDATED
//
// MessageText:
//
// Some cache(s) not updated
//
CACHE_S_SOMECACHES_NOTUPDATED = HRESULT($00040172);
//
// MessageId: OLEOBJ_S_INVALIDVERB
//
// MessageText:
//
// Invalid verb for OLE object
//
OLEOBJ_S_INVALIDVERB = HRESULT($00040180);
//
// MessageId: OLEOBJ_S_CANNOT_DOVERB_NOW
//
// MessageText:
//
// Verb number is valid but verb cannot be done now
//
OLEOBJ_S_CANNOT_DOVERB_NOW = HRESULT($00040181);
//
// MessageId: OLEOBJ_S_INVALIDHWND
//
// MessageText:
//
// Invalid window handle passed
//
OLEOBJ_S_INVALIDHWND = HRESULT($00040182);
//
// MessageId: INPLACE_S_TRUNCATED
//
// MessageText:
//
// Message is too long; some of it had to be truncated before displaying
//
INPLACE_S_TRUNCATED = HRESULT($000401A0);
//
// MessageId: CONVERT10_S_NO_PRESENTATION
//
// MessageText:
//
// Unable to convert OLESTREAM to IStorage
//
CONVERT10_S_NO_PRESENTATION = HRESULT($000401C0);
//
// MessageId: MK_S_REDUCED_TO_SELF
//
// MessageText:
//
// Moniker reduced to itself
//
MK_S_REDUCED_TO_SELF = HRESULT($000401E2);
//
// MessageId: MK_S_ME
//
// MessageText:
//
// Common prefix is this moniker
//
MK_S_ME = HRESULT($000401E4);
//
// MessageId: MK_S_HIM
//
// MessageText:
//
// Common prefix is input moniker
//
MK_S_HIM = HRESULT($000401E5);
//
// MessageId: MK_S_US
//
// MessageText:
//
// Common prefix is both monikers
//
MK_S_US = HRESULT($000401E6);
//
// MessageId: MK_S_MONIKERALREADYREGISTERED
//
// MessageText:
//
// Moniker is already registered in running object table
//
MK_S_MONIKERALREADYREGISTERED = HRESULT($000401E7);
//
// Task Scheduler errors
//
//
// MessageId: SCHED_S_TASK_READY
//
// MessageText:
//
// The task is ready to run at its next scheduled time.
//
SCHED_S_TASK_READY = HRESULT($00041300);
//
// MessageId: SCHED_S_TASK_RUNNING
//
// MessageText:
//
// The task is currently running.
//
SCHED_S_TASK_RUNNING = HRESULT($00041301);
//
// MessageId: SCHED_S_TASK_DISABLED
//
// MessageText:
//
// The task will not run at the scheduled times because it has been disabled.
//
SCHED_S_TASK_DISABLED = HRESULT($00041302);
//
// MessageId: SCHED_S_TASK_HAS_NOT_RUN
//
// MessageText:
//
// The task has not yet run.
//
SCHED_S_TASK_HAS_NOT_RUN = HRESULT($00041303);
//
// MessageId: SCHED_S_TASK_NO_MORE_RUNS
//
// MessageText:
//
// There are no more runs scheduled for this task.
//
SCHED_S_TASK_NO_MORE_RUNS = HRESULT($00041304);
//
// MessageId: SCHED_S_TASK_NOT_SCHEDULED
//
// MessageText:
//
// One or more of the properties that are needed to run this task on a schedule have not been set.
//
SCHED_S_TASK_NOT_SCHEDULED = HRESULT($00041305);
//
// MessageId: SCHED_S_TASK_TERMINATED
//
// MessageText:
//
// The last run of the task was terminated by the user.
//
SCHED_S_TASK_TERMINATED = HRESULT($00041306);
//
// MessageId: SCHED_S_TASK_NO_VALID_TRIGGERS
//
// MessageText:
//
// Either the task has no triggers or the existing triggers are disabled or not set.
//
SCHED_S_TASK_NO_VALID_TRIGGERS = HRESULT($00041307);
//
// MessageId: SCHED_S_EVENT_TRIGGER
//
// MessageText:
//
// Event triggers don't have set run times.
//
SCHED_S_EVENT_TRIGGER = HRESULT($00041308);
//
// MessageId: SCHED_E_TRIGGER_NOT_FOUND
//
// MessageText:
//
// Trigger not found.
//
SCHED_E_TRIGGER_NOT_FOUND = HRESULT($80041309);
//
// MessageId: SCHED_E_TASK_NOT_READY
//
// MessageText:
//
// One or more of the properties that are needed to run this task have not been set.
//
SCHED_E_TASK_NOT_READY = HRESULT($8004130A);
//
// MessageId: SCHED_E_TASK_NOT_RUNNING
//
// MessageText:
//
// There is no running instance of the task to terminate.
//
SCHED_E_TASK_NOT_RUNNING = HRESULT($8004130B);
//
// MessageId: SCHED_E_SERVICE_NOT_INSTALLED
//
// MessageText:
//
// The Task Scheduler Service is not installed on this computer.
//
SCHED_E_SERVICE_NOT_INSTALLED = HRESULT($8004130C);
//
// MessageId: SCHED_E_CANNOT_OPEN_TASK
//
// MessageText:
//
// The task object could not be opened.
//
SCHED_E_CANNOT_OPEN_TASK = HRESULT($8004130D);
//
// MessageId: SCHED_E_INVALID_TASK
//
// MessageText:
//
// The object is either an invalid task object or is not a task object.
//
SCHED_E_INVALID_TASK = HRESULT($8004130E);
//
// MessageId: SCHED_E_ACCOUNT_INFORMATION_NOT_SET
//
// MessageText:
//
// No account information could be found in the Task Scheduler security database for the task indicated.
//
SCHED_E_ACCOUNT_INFORMATION_NOT_SET = HRESULT($8004130F);
//
// MessageId: SCHED_E_ACCOUNT_NAME_NOT_FOUND
//
// MessageText:
//
// Unable to establish existence of the account specified.
//
SCHED_E_ACCOUNT_NAME_NOT_FOUND = HRESULT($80041310);
//
// MessageId: SCHED_E_ACCOUNT_DBASE_CORRUPT
//
// MessageText:
//
// Corruption was detected in the Task Scheduler security database; the database has been reset.
//
SCHED_E_ACCOUNT_DBASE_CORRUPT = HRESULT($80041311);
//
// MessageId: SCHED_E_NO_SECURITY_SERVICES
//
// MessageText:
//
// Task Scheduler security services are available only on Windows NT.
//
SCHED_E_NO_SECURITY_SERVICES = HRESULT($80041312);
//
// MessageId: SCHED_E_UNKNOWN_OBJECT_VERSION
//
// MessageText:
//
// The task object version is either unsupported or invalid.
//
SCHED_E_UNKNOWN_OBJECT_VERSION = HRESULT($80041313);
//
// MessageId: SCHED_E_UNSUPPORTED_ACCOUNT_OPTION
//
// MessageText:
//
// The task has been configured with an unsupported combination of account settings and run time options.
//
SCHED_E_UNSUPPORTED_ACCOUNT_OPTION = HRESULT($80041314);
//
// MessageId: SCHED_E_SERVICE_NOT_RUNNING
//
// MessageText:
//
// The Task Scheduler Service is not running.
//
SCHED_E_SERVICE_NOT_RUNNING = HRESULT($80041315);
// ******************
// FACILITY_WINDOWS
// ******************
//
// Codes 0x0-0x01ff are reserved for the OLE group of
// interfaces.
//
//
// MessageId: CO_E_CLASS_CREATE_FAILED
//
// MessageText:
//
// Attempt to create a class object failed
//
CO_E_CLASS_CREATE_FAILED = HRESULT($80080001);
//
// MessageId: CO_E_SCM_ERROR
//
// MessageText:
//
// OLE service could not bind object
//
CO_E_SCM_ERROR = HRESULT($80080002);
//
// MessageId: CO_E_SCM_RPC_FAILURE
//
// MessageText:
//
// RPC communication failed with OLE service
//
CO_E_SCM_RPC_FAILURE = HRESULT($80080003);
//
// MessageId: CO_E_BAD_PATH
//
// MessageText:
//
// Bad path to object
//
CO_E_BAD_PATH = HRESULT($80080004);
//
// MessageId: CO_E_SERVER_EXEC_FAILURE
//
// MessageText:
//
// Server execution failed
//
CO_E_SERVER_EXEC_FAILURE = HRESULT($80080005);
//
// MessageId: CO_E_OBJSRV_RPC_FAILURE
//
// MessageText:
//
// OLE service could not communicate with the object server
//
CO_E_OBJSRV_RPC_FAILURE = HRESULT($80080006);
//
// MessageId: MK_E_NO_NORMALIZED
//
// MessageText:
//
// Moniker path could not be normalized
//
MK_E_NO_NORMALIZED = HRESULT($80080007);
//
// MessageId: CO_E_SERVER_STOPPING
//
// MessageText:
//
// Object server is stopping when OLE service contacts it
//
CO_E_SERVER_STOPPING = HRESULT($80080008);
//
// MessageId: MEM_E_INVALID_ROOT
//
// MessageText:
//
// An invalid root block pointer was specified
//
MEM_E_INVALID_ROOT = HRESULT($80080009);
//
// MessageId: MEM_E_INVALID_LINK
//
// MessageText:
//
// An allocation chain contained an invalid link pointer
//
MEM_E_INVALID_LINK = HRESULT($80080010);
//
// MessageId: MEM_E_INVALID_SIZE
//
// MessageText:
//
// The requested allocation size was too large
//
MEM_E_INVALID_SIZE = HRESULT($80080011);
//
// MessageId: CO_S_NOTALLINTERFACES
//
// MessageText:
//
// Not all the requested interfaces were available
//
CO_S_NOTALLINTERFACES = HRESULT($00080012);
// ******************
// FACILITY_DISPATCH
// ******************
//
// MessageId: DISP_E_UNKNOWNINTERFACE
//
// MessageText:
//
// Unknown interface.
//
DISP_E_UNKNOWNINTERFACE = HRESULT($80020001);
//
// MessageId: DISP_E_MEMBERNOTFOUND
//
// MessageText:
//
// Member not found.
//
DISP_E_MEMBERNOTFOUND = HRESULT($80020003);
//
// MessageId: DISP_E_PARAMNOTFOUND
//
// MessageText:
//
// Parameter not found.
//
DISP_E_PARAMNOTFOUND = HRESULT($80020004);
//
// MessageId: DISP_E_TYPEMISMATCH
//
// MessageText:
//
// Type mismatch.
//
DISP_E_TYPEMISMATCH = HRESULT($80020005);
//
// MessageId: DISP_E_UNKNOWNNAME
//
// MessageText:
//
// Unknown name.
//
DISP_E_UNKNOWNNAME = HRESULT($80020006);
//
// MessageId: DISP_E_NONAMEDARGS
//
// MessageText:
//
// No named arguments.
//
DISP_E_NONAMEDARGS = HRESULT($80020007);
//
// MessageId: DISP_E_BADVARTYPE
//
// MessageText:
//
// Bad variable type.
//
DISP_E_BADVARTYPE = HRESULT($80020008);
//
// MessageId: DISP_E_EXCEPTION
//
// MessageText:
//
// Exception occurred.
//
DISP_E_EXCEPTION = HRESULT($80020009);
//
// MessageId: DISP_E_OVERFLOW
//
// MessageText:
//
// Out of present range.
//
DISP_E_OVERFLOW = HRESULT($8002000A);
//
// MessageId: DISP_E_BADINDEX
//
// MessageText:
//
// Invalid index.
//
DISP_E_BADINDEX = HRESULT($8002000B);
//
// MessageId: DISP_E_UNKNOWNLCID
//
// MessageText:
//
// Unknown language.
//
DISP_E_UNKNOWNLCID = HRESULT($8002000C);
//
// MessageId: DISP_E_ARRAYISLOCKED
//
// MessageText:
//
// Memory is locked.
//
DISP_E_ARRAYISLOCKED = HRESULT($8002000D);
//
// MessageId: DISP_E_BADPARAMCOUNT
//
// MessageText:
//
// Invalid number of parameters.
//
DISP_E_BADPARAMCOUNT = HRESULT($8002000E);
//
// MessageId: DISP_E_PARAMNOTOPTIONAL
//
// MessageText:
//
// Parameter not optional.
//
DISP_E_PARAMNOTOPTIONAL = HRESULT($8002000F);
//
// MessageId: DISP_E_BADCALLEE
//
// MessageText:
//
// Invalid callee.
//
DISP_E_BADCALLEE = HRESULT($80020010);
//
// MessageId: DISP_E_NOTACOLLECTION
//
// MessageText:
//
// Does not support a collection.
//
DISP_E_NOTACOLLECTION = HRESULT($80020011);
//
// MessageId: DISP_E_DIVBYZERO
//
// MessageText:
//
// Division by zero.
//
DISP_E_DIVBYZERO = HRESULT($80020012);
//
// MessageId: DISP_E_BUFFERTOOSMALL
//
// MessageText:
//
// Buffer too small
//
DISP_E_BUFFERTOOSMALL = HRESULT($80020013);
//
// MessageId: TYPE_E_BUFFERTOOSMALL
//
// MessageText:
//
// Buffer too small.
//
TYPE_E_BUFFERTOOSMALL = HRESULT($80028016);
//
// MessageId: TYPE_E_FIELDNOTFOUND
//
// MessageText:
//
// Field name not defined in the record.
//
TYPE_E_FIELDNOTFOUND = HRESULT($80028017);
//
// MessageId: TYPE_E_INVDATAREAD
//
// MessageText:
//
// Old format or invalid type library.
//
TYPE_E_INVDATAREAD = HRESULT($80028018);
//
// MessageId: TYPE_E_UNSUPFORMAT
//
// MessageText:
//
// Old format or invalid type library.
//
TYPE_E_UNSUPFORMAT = HRESULT($80028019);
//
// MessageId: TYPE_E_REGISTRYACCESS
//
// MessageText:
//
// Error accessing the OLE registry.
//
TYPE_E_REGISTRYACCESS = HRESULT($8002801C);
//
// MessageId: TYPE_E_LIBNOTREGISTERED
//
// MessageText:
//
// Library not registered.
//
TYPE_E_LIBNOTREGISTERED = HRESULT($8002801D);
//
// MessageId: TYPE_E_UNDEFINEDTYPE
//
// MessageText:
//
// Bound to unknown type.
//
TYPE_E_UNDEFINEDTYPE = HRESULT($80028027);
//
// MessageId: TYPE_E_QUALIFIEDNAMEDISALLOWED
//
// MessageText:
//
// Qualified name disallowed.
//
TYPE_E_QUALIFIEDNAMEDISALLOWED = HRESULT($80028028);
//
// MessageId: TYPE_E_INVALIDSTATE
//
// MessageText:
//
// Invalid forward reference, or reference to uncompiled type.
//
TYPE_E_INVALIDSTATE = HRESULT($80028029);
//
// MessageId: TYPE_E_WRONGTYPEKIND
//
// MessageText:
//
// Type mismatch.
//
TYPE_E_WRONGTYPEKIND = HRESULT($8002802A);
//
// MessageId: TYPE_E_ELEMENTNOTFOUND
//
// MessageText:
//
// Element not found.
//
TYPE_E_ELEMENTNOTFOUND = HRESULT($8002802B);
//
// MessageId: TYPE_E_AMBIGUOUSNAME
//
// MessageText:
//
// Ambiguous name.
//
TYPE_E_AMBIGUOUSNAME = HRESULT($8002802C);
//
// MessageId: TYPE_E_NAMECONFLICT
//
// MessageText:
//
// Name already exists in the library.
//
TYPE_E_NAMECONFLICT = HRESULT($8002802D);
//
// MessageId: TYPE_E_UNKNOWNLCID
//
// MessageText:
//
// Unknown LCID.
//
TYPE_E_UNKNOWNLCID = HRESULT($8002802E);
//
// MessageId: TYPE_E_DLLFUNCTIONNOTFOUND
//
// MessageText:
//
// Function not defined in specified DLL.
//
TYPE_E_DLLFUNCTIONNOTFOUND = HRESULT($8002802F);
//
// MessageId: TYPE_E_BADMODULEKIND
//
// MessageText:
//
// Wrong module kind for the operation.
//
TYPE_E_BADMODULEKIND = HRESULT($800288BD);
//
// MessageId: TYPE_E_SIZETOOBIG
//
// MessageText:
//
// Size may not exceed 64K.
//
TYPE_E_SIZETOOBIG = HRESULT($800288C5);
//
// MessageId: TYPE_E_DUPLICATEID
//
// MessageText:
//
// Duplicate ID in inheritance hierarchy.
//
TYPE_E_DUPLICATEID = HRESULT($800288C6);
//
// MessageId: TYPE_E_INVALIDID
//
// MessageText:
//
// Incorrect inheritance depth in standard OLE hmember.
//
TYPE_E_INVALIDID = HRESULT($800288CF);
//
// MessageId: TYPE_E_TYPEMISMATCH
//
// MessageText:
//
// Type mismatch.
//
TYPE_E_TYPEMISMATCH = HRESULT($80028CA0);
//
// MessageId: TYPE_E_OUTOFBOUNDS
//
// MessageText:
//
// Invalid number of arguments.
//
TYPE_E_OUTOFBOUNDS = HRESULT($80028CA1);
//
// MessageId: TYPE_E_IOERROR
//
// MessageText:
//
// I/O Error.
//
TYPE_E_IOERROR = HRESULT($80028CA2);
//
// MessageId: TYPE_E_CANTCREATETMPFILE
//
// MessageText:
//
// Error creating unique tmp file.
//
TYPE_E_CANTCREATETMPFILE = HRESULT($80028CA3);
//
// MessageId: TYPE_E_CANTLOADLIBRARY
//
// MessageText:
//
// Error loading type library/DLL.
//
TYPE_E_CANTLOADLIBRARY = HRESULT($80029C4A);
//
// MessageId: TYPE_E_INCONSISTENTPROPFUNCS
//
// MessageText:
//
// Inconsistent property functions.
//
TYPE_E_INCONSISTENTPROPFUNCS = HRESULT($80029C83);
//
// MessageId: TYPE_E_CIRCULARTYPE
//
// MessageText:
//
// Circular dependency between types/modules.
//
TYPE_E_CIRCULARTYPE = HRESULT($80029C84);
// ******************
// FACILITY_STORAGE
// ******************
//
// MessageId: STG_E_INVALIDFUNCTION
//
// MessageText:
//
// Unable to perform requested operation.
//
STG_E_INVALIDFUNCTION = HRESULT($80030001);
//
// MessageId: STG_E_FILENOTFOUND
//
// MessageText:
//
// %1 could not be found.
//
STG_E_FILENOTFOUND = HRESULT($80030002);
//
// MessageId: STG_E_PATHNOTFOUND
//
// MessageText:
//
// The path %1 could not be found.
//
STG_E_PATHNOTFOUND = HRESULT($80030003);
//
// MessageId: STG_E_TOOMANYOPENFILES
//
// MessageText:
//
// There are insufficient resources to open another file.
//
STG_E_TOOMANYOPENFILES = HRESULT($80030004);
//
// MessageId: STG_E_ACCESSDENIED
//
// MessageText:
//
// Access Denied.
//
STG_E_ACCESSDENIED = HRESULT($80030005);
//
// MessageId: STG_E_INVALIDHANDLE
//
// MessageText:
//
// Attempted an operation on an invalid object.
//
STG_E_INVALIDHANDLE = HRESULT($80030006);
//
// MessageId: STG_E_INSUFFICIENTMEMORY
//
// MessageText:
//
// There is insufficient memory available to complete operation.
//
STG_E_INSUFFICIENTMEMORY = HRESULT($80030008);
//
// MessageId: STG_E_INVALIDPOINTER
//
// MessageText:
//
// Invalid pointer error.
//
STG_E_INVALIDPOINTER = HRESULT($80030009);
//
// MessageId: STG_E_NOMOREFILES
//
// MessageText:
//
// There are no more entries to return.
//
STG_E_NOMOREFILES = HRESULT($80030012);
//
// MessageId: STG_E_DISKISWRITEPROTECTED
//
// MessageText:
//
// Disk is write-protected.
//
STG_E_DISKISWRITEPROTECTED = HRESULT($80030013);
//
// MessageId: STG_E_SEEKERROR
//
// MessageText:
//
// An error occurred during a seek operation.
//
STG_E_SEEKERROR = HRESULT($80030019);
//
// MessageId: STG_E_WRITEFAULT
//
// MessageText:
//
// A disk error occurred during a write operation.
//
STG_E_WRITEFAULT = HRESULT($8003001D);
//
// MessageId: STG_E_READFAULT
//
// MessageText:
//
// A disk error occurred during a read operation.
//
STG_E_READFAULT = HRESULT($8003001E);
//
// MessageId: STG_E_SHAREVIOLATION
//
// MessageText:
//
// A share violation has occurred.
//
STG_E_SHAREVIOLATION = HRESULT($80030020);
//
// MessageId: STG_E_LOCKVIOLATION
//
// MessageText:
//
// A lock violation has occurred.
//
STG_E_LOCKVIOLATION = HRESULT($80030021);
//
// MessageId: STG_E_FILEALREADYEXISTS
//
// MessageText:
//
// %1 already exists.
//
STG_E_FILEALREADYEXISTS = HRESULT($80030050);
//
// MessageId: STG_E_INVALIDPARAMETER
//
// MessageText:
//
// Invalid parameter error.
//
STG_E_INVALIDPARAMETER = HRESULT($80030057);
//
// MessageId: STG_E_MEDIUMFULL
//
// MessageText:
//
// There is insufficient disk space to complete operation.
//
STG_E_MEDIUMFULL = HRESULT($80030070);
//
// MessageId: STG_E_PROPSETMISMATCHED
//
// MessageText:
//
// Illegal write of non-simple property to simple property set.
//
STG_E_PROPSETMISMATCHED = HRESULT($800300F0);
//
// MessageId: STG_E_ABNORMALAPIEXIT
//
// MessageText:
//
// An API call exited abnormally.
//
STG_E_ABNORMALAPIEXIT = HRESULT($800300FA);
//
// MessageId: STG_E_INVALIDHEADER
//
// MessageText:
//
// The file %1 is not a valid compound file.
//
STG_E_INVALIDHEADER = HRESULT($800300FB);
//
// MessageId: STG_E_INVALIDNAME
//
// MessageText:
//
// The name %1 is not valid.
//
STG_E_INVALIDNAME = HRESULT($800300FC);
//
// MessageId: STG_E_UNKNOWN
//
// MessageText:
//
// An unexpected error occurred.
//
STG_E_UNKNOWN = HRESULT($800300FD);
//
// MessageId: STG_E_UNIMPLEMENTEDFUNCTION
//
// MessageText:
//
// That function is not implemented.
//
STG_E_UNIMPLEMENTEDFUNCTION = HRESULT($800300FE);
//
// MessageId: STG_E_INVALIDFLAG
//
// MessageText:
//
// Invalid flag error.
//
STG_E_INVALIDFLAG = HRESULT($800300FF);
//
// MessageId: STG_E_INUSE
//
// MessageText:
//
// Attempted to use an object that is busy.
//
STG_E_INUSE = HRESULT($80030100);
//
// MessageId: STG_E_NOTCURRENT
//
// MessageText:
//
// The storage has been changed since the last commit.
//
STG_E_NOTCURRENT = HRESULT($80030101);
//
// MessageId: STG_E_REVERTED
//
// MessageText:
//
// Attempted to use an object that has ceased to exist.
//
STG_E_REVERTED = HRESULT($80030102);
//
// MessageId: STG_E_CANTSAVE
//
// MessageText:
//
// Can't save.
//
STG_E_CANTSAVE = HRESULT($80030103);
//
// MessageId: STG_E_OLDFORMAT
//
// MessageText:
//
// The compound file %1 was produced with an incompatible version of storage.
//
STG_E_OLDFORMAT = HRESULT($80030104);
//
// MessageId: STG_E_OLDDLL
//
// MessageText:
//
// The compound file %1 was produced with a newer version of storage.
//
STG_E_OLDDLL = HRESULT($80030105);
//
// MessageId: STG_E_SHAREREQUIRED
//
// MessageText:
//
// Share.exe or equivalent is required for operation.
//
STG_E_SHAREREQUIRED = HRESULT($80030106);
//
// MessageId: STG_E_NOTFILEBASEDSTORAGE
//
// MessageText:
//
// Illegal operation called on non-file based storage.
//
STG_E_NOTFILEBASEDSTORAGE = HRESULT($80030107);
//
// MessageId: STG_E_EXTANTMARSHALLINGS
//
// MessageText:
//
// Illegal operation called on object with extant marshallings.
//
STG_E_EXTANTMARSHALLINGS = HRESULT($80030108);
//
// MessageId: STG_E_DOCFILECORRUPT
//
// MessageText:
//
// The docfile has been corrupted.
//
STG_E_DOCFILECORRUPT = HRESULT($80030109);
//
// MessageId: STG_E_BADBASEADDRESS
//
// MessageText:
//
// OLE32.DLL has been loaded at the wrong address.
//
STG_E_BADBASEADDRESS = HRESULT($80030110);
//
// MessageId: STG_E_DOCFILETOOLARGE
//
// MessageText:
//
// The compound file is too large for the current implementation
//
STG_E_DOCFILETOOLARGE = HRESULT($80030111);
//
// MessageId: STG_E_NOTSIMPLEFORMAT
//
// MessageText:
//
// The compound file was not created with the STGM_SIMPLE flag
//
STG_E_NOTSIMPLEFORMAT = HRESULT($80030112);
//
// MessageId: STG_E_INCOMPLETE
//
// MessageText:
//
// The file download was aborted abnormally. The file is incomplete.
//
STG_E_INCOMPLETE = HRESULT($80030201);
//
// MessageId: STG_E_TERMINATED
//
// MessageText:
//
// The file download has been terminated.
//
STG_E_TERMINATED = HRESULT($80030202);
//
// MessageId: STG_S_CONVERTED
//
// MessageText:
//
// The underlying file was converted to compound file format.
//
STG_S_CONVERTED = HRESULT($00030200);
//
// MessageId: STG_S_BLOCK
//
// MessageText:
//
// The storage operation should block until more data is available.
//
STG_S_BLOCK = HRESULT($00030201);
//
// MessageId: STG_S_RETRYNOW
//
// MessageText:
//
// The storage operation should retry immediately.
//
STG_S_RETRYNOW = HRESULT($00030202);
//
// MessageId: STG_S_MONITORING
//
// MessageText:
//
// The notified event sink will not influence the storage operation.
//
STG_S_MONITORING = HRESULT($00030203);
//
// MessageId: STG_S_MULTIPLEOPENS
//
// MessageText:
//
// Multiple opens prevent consolidated. (commit succeeded).
//
STG_S_MULTIPLEOPENS = HRESULT($00030204);
//
// MessageId: STG_S_CONSOLIDATIONFAILED
//
// MessageText:
//
// Consolidation of the storage file failed. (commit succeeded).
//
STG_S_CONSOLIDATIONFAILED = HRESULT($00030205);
//
// MessageId: STG_S_CANNOTCONSOLIDATE
//
// MessageText:
//
// Consolidation of the storage file is inappropriate. (commit succeeded).
//
STG_S_CANNOTCONSOLIDATE = HRESULT($00030206);
// ******************
// FACILITY_RPC
// ******************
//
// Codes 0x0-0x11 are propagated from 16 bit OLE.
//
//
// MessageId: RPC_E_CALL_REJECTED
//
// MessageText:
//
// Call was rejected by callee.
//
RPC_E_CALL_REJECTED = HRESULT($80010001);
//
// MessageId: RPC_E_CALL_CANCELED
//
// MessageText:
//
// Call was canceled by the message filter.
//
RPC_E_CALL_CANCELED = HRESULT($80010002);
//
// MessageId: RPC_E_CANTPOST_INSENDCALL
//
// MessageText:
//
// The caller is dispatching an intertask SendMessage call and cannot call out via PostMessage.
//
RPC_E_CANTPOST_INSENDCALL = HRESULT($80010003);
//
// MessageId: RPC_E_CANTCALLOUT_INASYNCCALL
//
// MessageText:
//
// The caller is dispatching an asynchronous call and cannot make an outgoing call on behalf of this call.
//
RPC_E_CANTCALLOUT_INASYNCCALL = HRESULT($80010004);
//
// MessageId: RPC_E_CANTCALLOUT_INEXTERNALCALL
//
// MessageText:
//
// It is illegal to call out while inside message filter.
//
RPC_E_CANTCALLOUT_INEXTERNALCALL = HRESULT($80010005);
//
// MessageId: RPC_E_CONNECTION_TERMINATED
//
// MessageText:
//
// The connection terminated or is in a bogus state and cannot be used any more. Other connections are still valid.
//
RPC_E_CONNECTION_TERMINATED = HRESULT($80010006);
//
// MessageId: RPC_E_SERVER_DIED
//
// MessageText:
//
// The callee (server [not server application]) is not available and disappeared; all connections are invalid. The call may have executed.
//
RPC_E_SERVER_DIED = HRESULT($80010007);
//
// MessageId: RPC_E_CLIENT_DIED
//
// MessageText:
//
// The caller (client) disappeared while the callee (server) was processing a call.
//
RPC_E_CLIENT_DIED = HRESULT($80010008);
//
// MessageId: RPC_E_INVALID_DATAPACKET
//
// MessageText:
//
// The data packet with the marshalled parameter data is incorrect.
//
RPC_E_INVALID_DATAPACKET = HRESULT($80010009);
//
// MessageId: RPC_E_CANTTRANSMIT_CALL
//
// MessageText:
//
// The call was not transmitted properly; the message queue was full and was not emptied after yielding.
//
RPC_E_CANTTRANSMIT_CALL = HRESULT($8001000A);
//
// MessageId: RPC_E_CLIENT_CANTMARSHAL_DATA
//
// MessageText:
//
// The client (caller) cannot marshall the parameter data - low memory, etc.
//
RPC_E_CLIENT_CANTMARSHAL_DATA = HRESULT($8001000B);
//
// MessageId: RPC_E_CLIENT_CANTUNMARSHAL_DATA
//
// MessageText:
//
// The client (caller) cannot unmarshall the return data - low memory, etc.
//
RPC_E_CLIENT_CANTUNMARSHAL_DATA = HRESULT($8001000C);
//
// MessageId: RPC_E_SERVER_CANTMARSHAL_DATA
//
// MessageText:
//
// The server (callee) cannot marshall the return data - low memory, etc.
//
RPC_E_SERVER_CANTMARSHAL_DATA = HRESULT($8001000D);
//
// MessageId: RPC_E_SERVER_CANTUNMARSHAL_DATA
//
// MessageText:
//
// The server (callee) cannot unmarshall the parameter data - low memory, etc.
//
RPC_E_SERVER_CANTUNMARSHAL_DATA = HRESULT($8001000E);
//
// MessageId: RPC_E_INVALID_DATA
//
// MessageText:
//
// Received data is invalid; could be server or client data.
//
RPC_E_INVALID_DATA = HRESULT($8001000F);
//
// MessageId: RPC_E_INVALID_PARAMETER
//
// MessageText:
//
// A particular parameter is invalid and cannot be (un)marshalled.
//
RPC_E_INVALID_PARAMETER = HRESULT($80010010);
//
// MessageId: RPC_E_CANTCALLOUT_AGAIN
//
// MessageText:
//
// There is no second outgoing call on same channel in DDE conversation.
//
RPC_E_CANTCALLOUT_AGAIN = HRESULT($80010011);
//
// MessageId: RPC_E_SERVER_DIED_DNE
//
// MessageText:
//
// The callee (server [not server application]) is not available and disappeared; all connections are invalid. The call did not execute.
//
RPC_E_SERVER_DIED_DNE = HRESULT($80010012);
//
// MessageId: RPC_E_SYS_CALL_FAILED
//
// MessageText:
//
// System call failed.
//
RPC_E_SYS_CALL_FAILED = HRESULT($80010100);
//
// MessageId: RPC_E_OUT_OF_RESOURCES
//
// MessageText:
//
// Could not allocate some required resource (memory, events, ...)
//
RPC_E_OUT_OF_RESOURCES = HRESULT($80010101);
//
// MessageId: RPC_E_ATTEMPTED_MULTITHREAD
//
// MessageText:
//
// Attempted to make calls on more than one thread in single threaded mode.
//
RPC_E_ATTEMPTED_MULTITHREAD = HRESULT($80010102);
//
// MessageId: RPC_E_NOT_REGISTERED
//
// MessageText:
//
// The requested interface is not registered on the server object.
//
RPC_E_NOT_REGISTERED = HRESULT($80010103);
//
// MessageId: RPC_E_FAULT
//
// MessageText:
//
// RPC could not call the server or could not return the results of calling the server.
//
RPC_E_FAULT = HRESULT($80010104);
//
// MessageId: RPC_E_SERVERFAULT
//
// MessageText:
//
// The server threw an exception.
//
RPC_E_SERVERFAULT = HRESULT($80010105);
//
// MessageId: RPC_E_CHANGED_MODE
//
// MessageText:
//
// Cannot change thread mode after it is set.
//
RPC_E_CHANGED_MODE = HRESULT($80010106);
//
// MessageId: RPC_E_INVALIDMETHOD
//
// MessageText:
//
// The method called does not exist on the server.
//
RPC_E_INVALIDMETHOD = HRESULT($80010107);
//
// MessageId: RPC_E_DISCONNECTED
//
// MessageText:
//
// The object invoked has disconnected from its clients.
//
RPC_E_DISCONNECTED = HRESULT($80010108);
//
// MessageId: RPC_E_RETRY
//
// MessageText:
//
// The object invoked chose not to process the call now. Try again later.
//
RPC_E_RETRY = HRESULT($80010109);
//
// MessageId: RPC_E_SERVERCALL_RETRYLATER
//
// MessageText:
//
// The message filter indicated that the application is busy.
//
RPC_E_SERVERCALL_RETRYLATER = HRESULT($8001010A);
//
// MessageId: RPC_E_SERVERCALL_REJECTED
//
// MessageText:
//
// The message filter rejected the call.
//
RPC_E_SERVERCALL_REJECTED = HRESULT($8001010B);
//
// MessageId: RPC_E_INVALID_CALLDATA
//
// MessageText:
//
// A call control interfaces was called with invalid data.
//
RPC_E_INVALID_CALLDATA = HRESULT($8001010C);
//
// MessageId: RPC_E_CANTCALLOUT_ININPUTSYNCCALL
//
// MessageText:
//
// An outgoing call cannot be made since the application is dispatching an input-synchronous call.
//
RPC_E_CANTCALLOUT_ININPUTSYNCCALL = HRESULT($8001010D);
//
// MessageId: RPC_E_WRONG_THREAD
//
// MessageText:
//
// The application called an interface that was marshalled for a different thread.
//
RPC_E_WRONG_THREAD = HRESULT($8001010E);
//
// MessageId: RPC_E_THREAD_NOT_INIT
//
// MessageText:
//
// CoInitialize has not been called on the current thread.
//
RPC_E_THREAD_NOT_INIT = HRESULT($8001010F);
//
// MessageId: RPC_E_VERSION_MISMATCH
//
// MessageText:
//
// The version of OLE on the client and server machines does not match.
//
RPC_E_VERSION_MISMATCH = HRESULT($80010110);
//
// MessageId: RPC_E_INVALID_HEADER
//
// MessageText:
//
// OLE received a packet with an invalid header.
//
RPC_E_INVALID_HEADER = HRESULT($80010111);
//
// MessageId: RPC_E_INVALID_EXTENSION
//
// MessageText:
//
// OLE received a packet with an invalid extension.
//
RPC_E_INVALID_EXTENSION = HRESULT($80010112);
//
// MessageId: RPC_E_INVALID_IPID
//
// MessageText:
//
// The requested object or interface does not exist.
//
RPC_E_INVALID_IPID = HRESULT($80010113);
//
// MessageId: RPC_E_INVALID_OBJECT
//
// MessageText:
//
// The requested object does not exist.
//
RPC_E_INVALID_OBJECT = HRESULT($80010114);
//
// MessageId: RPC_S_CALLPENDING
//
// MessageText:
//
// OLE has sent a request and is waiting for a reply.
//
RPC_S_CALLPENDING = HRESULT($80010115);
//
// MessageId: RPC_S_WAITONTIMER
//
// MessageText:
//
// OLE is waiting before retrying a request.
//
RPC_S_WAITONTIMER = HRESULT($80010116);
//
// MessageId: RPC_E_CALL_COMPLETE
//
// MessageText:
//
// Call context cannot be accessed after call completed.
//
RPC_E_CALL_COMPLETE = HRESULT($80010117);
//
// MessageId: RPC_E_UNSECURE_CALL
//
// MessageText:
//
// Impersonate on unsecure calls is not supported.
//
RPC_E_UNSECURE_CALL = HRESULT($80010118);
//
// MessageId: RPC_E_TOO_LATE
//
// MessageText:
//
// Security must be initialized before any interfaces are marshalled or unmarshalled. It cannot be changed once initialized.
//
RPC_E_TOO_LATE = HRESULT($80010119);
//
// MessageId: RPC_E_NO_GOOD_SECURITY_PACKAGES
//
// MessageText:
//
// No security packages are installed on this machine or the user is not logged on or there are no compatible security packages between the client and server.
//
RPC_E_NO_GOOD_SECURITY_PACKAGES = HRESULT($8001011A);
//
// MessageId: RPC_E_ACCESS_DENIED
//
// MessageText:
//
// Access is denied.
//
RPC_E_ACCESS_DENIED = HRESULT($8001011B);
//
// MessageId: RPC_E_REMOTE_DISABLED
//
// MessageText:
//
// Remote calls are not allowed for this process.
//
RPC_E_REMOTE_DISABLED = HRESULT($8001011C);
//
// MessageId: RPC_E_INVALID_OBJREF
//
// MessageText:
//
// The marshaled interface data packet (OBJREF) has an invalid or unknown format.
//
RPC_E_INVALID_OBJREF = HRESULT($8001011D);
//
// MessageId: RPC_E_NO_CONTEXT
//
// MessageText:
//
// No context is associated with this call. This happens for some custom marshalled calls and on the client side of the call.
//
RPC_E_NO_CONTEXT = HRESULT($8001011E);
//
// MessageId: RPC_E_TIMEOUT
//
// MessageText:
//
// This operation returned because the timeout period expired.
//
RPC_E_TIMEOUT = HRESULT($8001011F);
//
// MessageId: RPC_E_NO_SYNC
//
// MessageText:
//
// There are no synchronize objects to wait on.
//
RPC_E_NO_SYNC = HRESULT($80010120);
//
// MessageId: RPC_E_FULLSIC_REQUIRED
//
// MessageText:
//
// Full subject issuer chain SSL principal name expected from the server.
//
RPC_E_FULLSIC_REQUIRED = HRESULT($80010121);
//
// MessageId: RPC_E_INVALID_STD_NAME
//
// MessageText:
//
// Principal name is not a valid MSSTD name.
//
RPC_E_INVALID_STD_NAME = HRESULT($80010122);
//
// MessageId: CO_E_FAILEDTOIMPERSONATE
//
// MessageText:
//
// Unable to impersonate DCOM client
//
CO_E_FAILEDTOIMPERSONATE = HRESULT($80010123);
//
// MessageId: CO_E_FAILEDTOGETSECCTX
//
// MessageText:
//
// Unable to obtain server's security context
//
CO_E_FAILEDTOGETSECCTX = HRESULT($80010124);
//
// MessageId: CO_E_FAILEDTOOPENTHREADTOKEN
//
// MessageText:
//
// Unable to open the access token of the current thread
//
CO_E_FAILEDTOOPENTHREADTOKEN = HRESULT($80010125);
//
// MessageId: CO_E_FAILEDTOGETTOKENINFO
//
// MessageText:
//
// Unable to obtain user info from an access token
//
CO_E_FAILEDTOGETTOKENINFO = HRESULT($80010126);
//
// MessageId: CO_E_TRUSTEEDOESNTMATCHCLIENT
//
// MessageText:
//
// The client who called IAccessControl::IsAccessPermitted was not the trustee provided to the method
//
CO_E_TRUSTEEDOESNTMATCHCLIENT = HRESULT($80010127);
//
// MessageId: CO_E_FAILEDTOQUERYCLIENTBLANKET
//
// MessageText:
//
// Unable to obtain the client's security blanket
//
CO_E_FAILEDTOQUERYCLIENTBLANKET = HRESULT($80010128);
//
// MessageId: CO_E_FAILEDTOSETDACL
//
// MessageText:
//
// Unable to set a discretionary ACL into a security descriptor
//
CO_E_FAILEDTOSETDACL = HRESULT($80010129);
//
// MessageId: CO_E_ACCESSCHECKFAILED
//
// MessageText:
//
// The system function, AccessCheck, returned false
//
CO_E_ACCESSCHECKFAILED = HRESULT($8001012A);
//
// MessageId: CO_E_NETACCESSAPIFAILED
//
// MessageText:
//
// Either NetAccessDel or NetAccessAdd returned an error code.
//
CO_E_NETACCESSAPIFAILED = HRESULT($8001012B);
//
// MessageId: CO_E_WRONGTRUSTEENAMESYNTAX
//
// MessageText:
//
// One of the trustee strings provided by the user did not conform to the <Domain>\<Name> syntax and it was not the "*" string
//
CO_E_WRONGTRUSTEENAMESYNTAX = HRESULT($8001012C);
//
// MessageId: CO_E_INVALIDSID
//
// MessageText:
//
// One of the security identifiers provided by the user was invalid
//
CO_E_INVALIDSID = HRESULT($8001012D);
//
// MessageId: CO_E_CONVERSIONFAILED
//
// MessageText:
//
// Unable to convert a wide character trustee string to a multibyte trustee string
//
CO_E_CONVERSIONFAILED = HRESULT($8001012E);
//
// MessageId: CO_E_NOMATCHINGSIDFOUND
//
// MessageText:
//
// Unable to find a security identifier that corresponds to a trustee string provided by the user
//
CO_E_NOMATCHINGSIDFOUND = HRESULT($8001012F);
//
// MessageId: CO_E_LOOKUPACCSIDFAILED
//
// MessageText:
//
// The system function, LookupAccountSID, failed
//
CO_E_LOOKUPACCSIDFAILED = HRESULT($80010130);
//
// MessageId: CO_E_NOMATCHINGNAMEFOUND
//
// MessageText:
//
// Unable to find a trustee name that corresponds to a security identifier provided by the user
//
CO_E_NOMATCHINGNAMEFOUND = HRESULT($80010131);
//
// MessageId: CO_E_LOOKUPACCNAMEFAILED
//
// MessageText:
//
// The system function, LookupAccountName, failed
//
CO_E_LOOKUPACCNAMEFAILED = HRESULT($80010132);
//
// MessageId: CO_E_SETSERLHNDLFAILED
//
// MessageText:
//
// Unable to set or reset a serialization handle
//
CO_E_SETSERLHNDLFAILED = HRESULT($80010133);
//
// MessageId: CO_E_FAILEDTOGETWINDIR
//
// MessageText:
//
// Unable to obtain the Windows directory
//
CO_E_FAILEDTOGETWINDIR = HRESULT($80010134);
//
// MessageId: CO_E_PATHTOOLONG
//
// MessageText:
//
// Path too long
//
CO_E_PATHTOOLONG = HRESULT($80010135);
//
// MessageId: CO_E_FAILEDTOGENUUID
//
// MessageText:
//
// Unable to generate a uuid.
//
CO_E_FAILEDTOGENUUID = HRESULT($80010136);
//
// MessageId: CO_E_FAILEDTOCREATEFILE
//
// MessageText:
//
// Unable to create file
//
CO_E_FAILEDTOCREATEFILE = HRESULT($80010137);
//
// MessageId: CO_E_FAILEDTOCLOSEHANDLE
//
// MessageText:
//
// Unable to close a serialization handle or a file handle.
//
CO_E_FAILEDTOCLOSEHANDLE = HRESULT($80010138);
//
// MessageId: CO_E_EXCEEDSYSACLLIMIT
//
// MessageText:
//
// The number of ACEs in an ACL exceeds the system limit.
//
CO_E_EXCEEDSYSACLLIMIT = HRESULT($80010139);
//
// MessageId: CO_E_ACESINWRONGORDER
//
// MessageText:
//
// Not all the DENY_ACCESS ACEs are arranged in front of the GRANT_ACCESS ACEs in the stream.
//
CO_E_ACESINWRONGORDER = HRESULT($8001013A);
//
// MessageId: CO_E_INCOMPATIBLESTREAMVERSION
//
// MessageText:
//
// The version of ACL format in the stream is not supported by this implementation of IAccessControl
//
CO_E_INCOMPATIBLESTREAMVERSION = HRESULT($8001013B);
//
// MessageId: CO_E_FAILEDTOOPENPROCESSTOKEN
//
// MessageText:
//
// Unable to open the access token of the server process
//
CO_E_FAILEDTOOPENPROCESSTOKEN = HRESULT($8001013C);
//
// MessageId: CO_E_DECODEFAILED
//
// MessageText:
//
// Unable to decode the ACL in the stream provided by the user
//
CO_E_DECODEFAILED = HRESULT($8001013D);
//
// MessageId: CO_E_ACNOTINITIALIZED
//
// MessageText:
//
// The COM IAccessControl object is not initialized
//
CO_E_ACNOTINITIALIZED = HRESULT($8001013F);
//
// MessageId: CO_E_CANCEL_DISABLED
//
// MessageText:
//
// Call Cancellation is disabled
//
CO_E_CANCEL_DISABLED = HRESULT($80010140);
//
// MessageId: RPC_E_UNEXPECTED
//
// MessageText:
//
// An internal error occurred.
//
RPC_E_UNEXPECTED = HRESULT($8001FFFF);
/////////////////
//
// FACILITY_SSPI
//
/////////////////
//
// MessageId: NTE_BAD_UID
//
// MessageText:
//
// Bad UID.
//
NTE_BAD_UID = HRESULT($80090001);
//
// MessageId: NTE_BAD_HASH
//
// MessageText:
//
// Bad Hash.
//
NTE_BAD_HASH = HRESULT($80090002);
//
// MessageId: NTE_BAD_KEY
//
// MessageText:
//
// Bad Key.
//
NTE_BAD_KEY = HRESULT($80090003);
//
// MessageId: NTE_BAD_LEN
//
// MessageText:
//
// Bad Length.
//
NTE_BAD_LEN = HRESULT($80090004);
//
// MessageId: NTE_BAD_DATA
//
// MessageText:
//
// Bad Data.
//
NTE_BAD_DATA = HRESULT($80090005);
//
// MessageId: NTE_BAD_SIGNATURE
//
// MessageText:
//
// Invalid Signature.
//
NTE_BAD_SIGNATURE = HRESULT($80090006);
//
// MessageId: NTE_BAD_VER
//
// MessageText:
//
// Bad Version of provider.
//
NTE_BAD_VER = HRESULT($80090007);
//
// MessageId: NTE_BAD_ALGID
//
// MessageText:
//
// Invalid algorithm specified.
//
NTE_BAD_ALGID = HRESULT($80090008);
//
// MessageId: NTE_BAD_FLAGS
//
// MessageText:
//
// Invalid flags specified.
//
NTE_BAD_FLAGS = HRESULT($80090009);
//
// MessageId: NTE_BAD_TYPE
//
// MessageText:
//
// Invalid type specified.
//
NTE_BAD_TYPE = HRESULT($8009000A);
//
// MessageId: NTE_BAD_KEY_STATE
//
// MessageText:
//
// Key not valid for use in specified state.
//
NTE_BAD_KEY_STATE = HRESULT($8009000B);
//
// MessageId: NTE_BAD_HASH_STATE
//
// MessageText:
//
// Hash not valid for use in specified state.
//
NTE_BAD_HASH_STATE = HRESULT($8009000C);
//
// MessageId: NTE_NO_KEY
//
// MessageText:
//
// Key does not exist.
//
NTE_NO_KEY = HRESULT($8009000D);
//
// MessageId: NTE_NO_MEMORY
//
// MessageText:
//
// Insufficient memory available for the operation.
//
NTE_NO_MEMORY = HRESULT($8009000E);
//
// MessageId: NTE_EXISTS
//
// MessageText:
//
// Object already exists.
//
NTE_EXISTS = HRESULT($8009000F);
//
// MessageId: NTE_PERM
//
// MessageText:
//
// Access denied.
//
NTE_PERM = HRESULT($80090010);
//
// MessageId: NTE_NOT_FOUND
//
// MessageText:
//
// Object was not found.
//
NTE_NOT_FOUND = HRESULT($80090011);
//
// MessageId: NTE_DOUBLE_ENCRYPT
//
// MessageText:
//
// Data already encrypted.
//
NTE_DOUBLE_ENCRYPT = HRESULT($80090012);
//
// MessageId: NTE_BAD_PROVIDER
//
// MessageText:
//
// Invalid provider specified.
//
NTE_BAD_PROVIDER = HRESULT($80090013);
//
// MessageId: NTE_BAD_PROV_TYPE
//
// MessageText:
//
// Invalid provider type specified.
//
NTE_BAD_PROV_TYPE = HRESULT($80090014);
//
// MessageId: NTE_BAD_PUBLIC_KEY
//
// MessageText:
//
// Provider's public key is invalid.
//
NTE_BAD_PUBLIC_KEY = HRESULT($80090015);
//
// MessageId: NTE_BAD_KEYSET
//
// MessageText:
//
// Keyset does not exist
//
NTE_BAD_KEYSET = HRESULT($80090016);
//
// MessageId: NTE_PROV_TYPE_NOT_DEF
//
// MessageText:
//
// Provider type not defined.
//
NTE_PROV_TYPE_NOT_DEF = HRESULT($80090017);
//
// MessageId: NTE_PROV_TYPE_ENTRY_BAD
//
// MessageText:
//
// Provider type as registered is invalid.
//
NTE_PROV_TYPE_ENTRY_BAD = HRESULT($80090018);
//
// MessageId: NTE_KEYSET_NOT_DEF
//
// MessageText:
//
// The keyset is not defined.
//
NTE_KEYSET_NOT_DEF = HRESULT($80090019);
//
// MessageId: NTE_KEYSET_ENTRY_BAD
//
// MessageText:
//
// Keyset as registered is invalid.
//
NTE_KEYSET_ENTRY_BAD = HRESULT($8009001A);
//
// MessageId: NTE_PROV_TYPE_NO_MATCH
//
// MessageText:
//
// Provider type does not match registered value.
//
NTE_PROV_TYPE_NO_MATCH = HRESULT($8009001B);
//
// MessageId: NTE_SIGNATURE_FILE_BAD
//
// MessageText:
//
// The digital signature file is corrupt.
//
NTE_SIGNATURE_FILE_BAD = HRESULT($8009001C);
//
// MessageId: NTE_PROVIDER_DLL_FAIL
//
// MessageText:
//
// Provider DLL failed to initialize correctly.
//
NTE_PROVIDER_DLL_FAIL = HRESULT($8009001D);
//
// MessageId: NTE_PROV_DLL_NOT_FOUND
//
// MessageText:
//
// Provider DLL could not be found.
//
NTE_PROV_DLL_NOT_FOUND = HRESULT($8009001E);
//
// MessageId: NTE_BAD_KEYSET_PARAM
//
// MessageText:
//
// The Keyset parameter is invalid.
//
NTE_BAD_KEYSET_PARAM = HRESULT($8009001F);
//
// MessageId: NTE_FAIL
//
// MessageText:
//
// An internal error occurred.
//
NTE_FAIL = HRESULT($80090020);
//
// MessageId: NTE_SYS_ERR
//
// MessageText:
//
// A base error occurred.
//
NTE_SYS_ERR = HRESULT($80090021);
//
// MessageId: NTE_SILENT_CONTEXT
//
// MessageText:
//
// Provider could not perform the action since the context was acquired as silent.
//
NTE_SILENT_CONTEXT = HRESULT($80090022);
//
// MessageId: NTE_TOKEN_KEYSET_STORAGE_FULL
//
// MessageText:
//
// The security token does not have storage space available for an additional container.
//
NTE_TOKEN_KEYSET_STORAGE_FULL = HRESULT($80090023);
//
// MessageId: NTE_TEMPORARY_PROFILE
//
// MessageText:
//
// The profile for the user is a temporary profile.
//
NTE_TEMPORARY_PROFILE = HRESULT($80090024);
//
// MessageId: NTE_FIXEDPARAMETER
//
// MessageText:
//
// The key parameters could not be set because the CSP uses fixed parameters.
//
NTE_FIXEDPARAMETER = HRESULT($80090025);
//
// MessageId: SEC_E_INSUFFICIENT_MEMORY
//
// MessageText:
//
// Not enough memory is available to complete this request
//
SEC_E_INSUFFICIENT_MEMORY = HRESULT($80090300);
//
// MessageId: SEC_E_INVALID_HANDLE
//
// MessageText:
//
// The handle specified is invalid
//
SEC_E_INVALID_HANDLE = HRESULT($80090301);
//
// MessageId: SEC_E_UNSUPPORTED_FUNCTION
//
// MessageText:
//
// The function requested is not supported
//
SEC_E_UNSUPPORTED_FUNCTION = HRESULT($80090302);
//
// MessageId: SEC_E_TARGET_UNKNOWN
//
// MessageText:
//
// The specified target is unknown or unreachable
//
SEC_E_TARGET_UNKNOWN = HRESULT($80090303);
//
// MessageId: SEC_E_INTERNAL_ERROR
//
// MessageText:
//
// The Local Security Authority cannot be contacted
//
SEC_E_INTERNAL_ERROR = HRESULT($80090304);
//
// MessageId: SEC_E_SECPKG_NOT_FOUND
//
// MessageText:
//
// The requested security package does not exist
//
SEC_E_SECPKG_NOT_FOUND = HRESULT($80090305);
//
// MessageId: SEC_E_NOT_OWNER
//
// MessageText:
//
// The caller is not the owner of the desired credentials
//
SEC_E_NOT_OWNER = HRESULT($80090306);
//
// MessageId: SEC_E_CANNOT_INSTALL
//
// MessageText:
//
// The security package failed to initialize, and cannot be installed
//
SEC_E_CANNOT_INSTALL = HRESULT($80090307);
//
// MessageId: SEC_E_INVALID_TOKEN
//
// MessageText:
//
// The token supplied to the function is invalid
//
SEC_E_INVALID_TOKEN = HRESULT($80090308);
//
// MessageId: SEC_E_CANNOT_PACK
//
// MessageText:
//
// The security package is not able to marshall the logon buffer, so the logon attempt has failed
//
SEC_E_CANNOT_PACK = HRESULT($80090309);
//
// MessageId: SEC_E_QOP_NOT_SUPPORTED
//
// MessageText:
//
// The per-message Quality of Protection is not supported by the security package
//
SEC_E_QOP_NOT_SUPPORTED = HRESULT($8009030A);
//
// MessageId: SEC_E_NO_IMPERSONATION
//
// MessageText:
//
// The security context does not allow impersonation of the client
//
SEC_E_NO_IMPERSONATION = HRESULT($8009030B);
//
// MessageId: SEC_E_LOGON_DENIED
//
// MessageText:
//
// The logon attempt failed
//
SEC_E_LOGON_DENIED = HRESULT($8009030C);
//
// MessageId: SEC_E_UNKNOWN_CREDENTIALS
//
// MessageText:
//
// The credentials supplied to the package were not recognized
//
SEC_E_UNKNOWN_CREDENTIALS = HRESULT($8009030D);
//
// MessageId: SEC_E_NO_CREDENTIALS
//
// MessageText:
//
// No credentials are available in the security package
//
SEC_E_NO_CREDENTIALS = HRESULT($8009030E);
//
// MessageId: SEC_E_MESSAGE_ALTERED
//
// MessageText:
//
// The message or signature supplied for verification has been altered
//
SEC_E_MESSAGE_ALTERED = HRESULT($8009030F);
//
// MessageId: SEC_E_OUT_OF_SEQUENCE
//
// MessageText:
//
// The message supplied for verification is out of sequence
//
SEC_E_OUT_OF_SEQUENCE = HRESULT($80090310);
//
// MessageId: SEC_E_NO_AUTHENTICATING_AUTHORITY
//
// MessageText:
//
// No authority could be contacted for authentication.
//
SEC_E_NO_AUTHENTICATING_AUTHORITY = HRESULT($80090311);
//
// MessageId: SEC_I_CONTINUE_NEEDED
//
// MessageText:
//
// The function completed successfully, but must be called again to complete the context
//
SEC_I_CONTINUE_NEEDED = HRESULT($00090312);
//
// MessageId: SEC_I_COMPLETE_NEEDED
//
// MessageText:
//
// The function completed successfully, but CompleteToken must be called
//
SEC_I_COMPLETE_NEEDED = HRESULT($00090313);
//
// MessageId: SEC_I_COMPLETE_AND_CONTINUE
//
// MessageText:
//
// The function completed successfully, but both CompleteToken and this function must be called to complete the context
//
SEC_I_COMPLETE_AND_CONTINUE = HRESULT($00090314);
//
// MessageId: SEC_I_LOCAL_LOGON
//
// MessageText:
//
// The logon was completed, but no network authority was available. The logon was made using locally known information
//
SEC_I_LOCAL_LOGON = HRESULT($00090315);
//
// MessageId: SEC_E_BAD_PKGID
//
// MessageText:
//
// The requested security package does not exist
//
SEC_E_BAD_PKGID = HRESULT($80090316);
//
// MessageId: SEC_E_CONTEXT_EXPIRED
//
// MessageText:
//
// The context has expired and can no longer be used.
//
SEC_E_CONTEXT_EXPIRED = HRESULT($80090317);
//
// MessageId: SEC_E_INCOMPLETE_MESSAGE
//
// MessageText:
//
// The supplied message is incomplete. The signature was not verified.
//
SEC_E_INCOMPLETE_MESSAGE = HRESULT($80090318);
//
// MessageId: SEC_E_INCOMPLETE_CREDENTIALS
//
// MessageText:
//
// The credentials supplied were not complete, and could not be verified. The context could not be initialized.
//
SEC_E_INCOMPLETE_CREDENTIALS = HRESULT($80090320);
//
// MessageId: SEC_E_BUFFER_TOO_SMALL
//
// MessageText:
//
// The buffers supplied to a function was too small.
//
SEC_E_BUFFER_TOO_SMALL = HRESULT($80090321);
//
// MessageId: SEC_I_INCOMPLETE_CREDENTIALS
//
// MessageText:
//
// The credentials supplied were not complete, and could not be verified. Additional information can be returned from the context.
//
SEC_I_INCOMPLETE_CREDENTIALS = HRESULT($00090320);
//
// MessageId: SEC_I_RENEGOTIATE
//
// MessageText:
//
// The context data must be renegotiated with the peer.
//
SEC_I_RENEGOTIATE = HRESULT($00090321);
//
// MessageId: SEC_E_WRONG_PRINCIPAL
//
// MessageText:
//
// The target principal name is incorrect.
//
SEC_E_WRONG_PRINCIPAL = HRESULT($80090322);
//
// MessageId: SEC_I_NO_LSA_CONTEXT
//
// MessageText:
//
// There is no LSA mode context associated with this context.
//
SEC_I_NO_LSA_CONTEXT = HRESULT($00090323);
//
// MessageId: SEC_E_TIME_SKEW
//
// MessageText:
//
// The clocks on the client and server machines are skewed.
//
SEC_E_TIME_SKEW = HRESULT($80090324);
//
// MessageId: SEC_E_UNTRUSTED_ROOT
//
// MessageText:
//
// The certificate chain was issued by an untrusted authority.
//
SEC_E_UNTRUSTED_ROOT = HRESULT($80090325);
//
// MessageId: SEC_E_ILLEGAL_MESSAGE
//
// MessageText:
//
// The message received was unexpected or badly formatted.
//
SEC_E_ILLEGAL_MESSAGE = HRESULT($80090326);
//
// MessageId: SEC_E_CERT_UNKNOWN
//
// MessageText:
//
// An unknown error occurred while processing the certificate.
//
SEC_E_CERT_UNKNOWN = HRESULT($80090327);
//
// MessageId: SEC_E_CERT_EXPIRED
//
// MessageText:
//
// The received certificate has expired.
//
SEC_E_CERT_EXPIRED = HRESULT($80090328);
//
// MessageId: SEC_E_ENCRYPT_FAILURE
//
// MessageText:
//
// The specified data could not be encrypted.
//
SEC_E_ENCRYPT_FAILURE = HRESULT($80090329);
//
// MessageId: SEC_E_DECRYPT_FAILURE
//
// MessageText:
//
// The specified data could not be decrypted.
//
//
SEC_E_DECRYPT_FAILURE = HRESULT($80090330);
//
// MessageId: SEC_E_ALGORITHM_MISMATCH
//
// MessageText:
//
// The client and server cannot communicate, because they do not possess a common algorithm.
//
SEC_E_ALGORITHM_MISMATCH = HRESULT($80090331);
//
// MessageId: SEC_E_SECURITY_QOS_FAILED
//
// MessageText:
//
// The security context could not be established due to a failure in the requested quality of service (e.g. mutual authentication or delegation).
//
SEC_E_SECURITY_QOS_FAILED = HRESULT($80090332);
//
// Provided for backwards compatibility
//
SEC_E_NO_SPM = SEC_E_INTERNAL_ERROR;
SEC_E_NOT_SUPPORTED = SEC_E_UNSUPPORTED_FUNCTION;
//
// MessageId: CRYPT_E_MSG_ERROR
//
// MessageText:
//
// An error occurred while performing an operation on a cryptographic message.
//
CRYPT_E_MSG_ERROR = HRESULT($80091001);
//
// MessageId: CRYPT_E_UNKNOWN_ALGO
//
// MessageText:
//
// Unknown cryptographic algorithm.
//
CRYPT_E_UNKNOWN_ALGO = HRESULT($80091002);
//
// MessageId: CRYPT_E_OID_FORMAT
//
// MessageText:
//
// The object identifier is poorly formatted.
//
CRYPT_E_OID_FORMAT = HRESULT($80091003);
//
// MessageId: CRYPT_E_INVALID_MSG_TYPE
//
// MessageText:
//
// Invalid cryptographic message type.
//
CRYPT_E_INVALID_MSG_TYPE = HRESULT($80091004);
//
// MessageId: CRYPT_E_UNEXPECTED_ENCODING
//
// MessageText:
//
// Unexpected cryptographic message encoding.
//
CRYPT_E_UNEXPECTED_ENCODING = HRESULT($80091005);
//
// MessageId: CRYPT_E_AUTH_ATTR_MISSING
//
// MessageText:
//
// The cryptographic message does not contain an expected authenticated attribute.
//
CRYPT_E_AUTH_ATTR_MISSING = HRESULT($80091006);
//
// MessageId: CRYPT_E_HASH_VALUE
//
// MessageText:
//
// The hash value is not correct.
//
CRYPT_E_HASH_VALUE = HRESULT($80091007);
//
// MessageId: CRYPT_E_INVALID_INDEX
//
// MessageText:
//
// The index value is not valid.
//
CRYPT_E_INVALID_INDEX = HRESULT($80091008);
//
// MessageId: CRYPT_E_ALREADY_DECRYPTED
//
// MessageText:
//
// The content of the cryptographic message has already been decrypted.
//
CRYPT_E_ALREADY_DECRYPTED = HRESULT($80091009);
//
// MessageId: CRYPT_E_NOT_DECRYPTED
//
// MessageText:
//
// The content of the cryptographic message has not been decrypted yet.
//
CRYPT_E_NOT_DECRYPTED = HRESULT($8009100A);
//
// MessageId: CRYPT_E_RECIPIENT_NOT_FOUND
//
// MessageText:
//
// The enveloped-data message does not contain the specified recipient.
//
CRYPT_E_RECIPIENT_NOT_FOUND = HRESULT($8009100B);
//
// MessageId: CRYPT_E_CONTROL_TYPE
//
// MessageText:
//
// Invalid control type.
//
CRYPT_E_CONTROL_TYPE = HRESULT($8009100C);
//
// MessageId: CRYPT_E_ISSUER_SERIALNUMBER
//
// MessageText:
//
// Invalid issuer and/or serial number.
//
CRYPT_E_ISSUER_SERIALNUMBER = HRESULT($8009100D);
//
// MessageId: CRYPT_E_SIGNER_NOT_FOUND
//
// MessageText:
//
// Cannot find the original signer.
//
CRYPT_E_SIGNER_NOT_FOUND = HRESULT($8009100E);
//
// MessageId: CRYPT_E_ATTRIBUTES_MISSING
//
// MessageText:
//
// The cryptographic message does not contain all of the requested attributes.
//
CRYPT_E_ATTRIBUTES_MISSING = HRESULT($8009100F);
//
// MessageId: CRYPT_E_STREAM_MSG_NOT_READY
//
// MessageText:
//
// The streamed cryptographic message is not ready to return data.
//
CRYPT_E_STREAM_MSG_NOT_READY = HRESULT($80091010);
//
// MessageId: CRYPT_E_STREAM_INSUFFICIENT_DATA
//
// MessageText:
//
// The streamed cryptographic message requires more data to complete the decode operation.
//
CRYPT_E_STREAM_INSUFFICIENT_DATA = HRESULT($80091011);
//
// MessageId: CRYPT_E_BAD_LEN
//
// MessageText:
//
// The length specified for the output data was insufficient.
//
CRYPT_E_BAD_LEN = HRESULT($80092001);
//
// MessageId: CRYPT_E_BAD_ENCODE
//
// MessageText:
//
// An error occurred during encode or decode operation.
//
CRYPT_E_BAD_ENCODE = HRESULT($80092002);
//
// MessageId: CRYPT_E_FILE_ERROR
//
// MessageText:
//
// An error occurred while reading or writing to a file.
//
CRYPT_E_FILE_ERROR = HRESULT($80092003);
//
// MessageId: CRYPT_E_NOT_FOUND
//
// MessageText:
//
// Cannot find object or property.
//
CRYPT_E_NOT_FOUND = HRESULT($80092004);
//
// MessageId: CRYPT_E_EXISTS
//
// MessageText:
//
// The object or property already exists.
//
CRYPT_E_EXISTS = HRESULT($80092005);
//
// MessageId: CRYPT_E_NO_PROVIDER
//
// MessageText:
//
// No provider was specified for the store or object.
//
CRYPT_E_NO_PROVIDER = HRESULT($80092006);
//
// MessageId: CRYPT_E_SELF_SIGNED
//
// MessageText:
//
// The specified certificate is self signed.
//
CRYPT_E_SELF_SIGNED = HRESULT($80092007);
//
// MessageId: CRYPT_E_DELETED_PREV
//
// MessageText:
//
// The previous certificate or CRL context was deleted.
//
CRYPT_E_DELETED_PREV = HRESULT($80092008);
//
// MessageId: CRYPT_E_NO_MATCH
//
// MessageText:
//
// Cannot find the requested object.
//
CRYPT_E_NO_MATCH = HRESULT($80092009);
//
// MessageId: CRYPT_E_UNEXPECTED_MSG_TYPE
//
// MessageText:
//
// The certificate does not have a property that references a private key.
//
CRYPT_E_UNEXPECTED_MSG_TYPE = HRESULT($8009200A);
//
// MessageId: CRYPT_E_NO_KEY_PROPERTY
//
// MessageText:
//
// Cannot find the certificate and private key for decryption.
//
CRYPT_E_NO_KEY_PROPERTY = HRESULT($8009200B);
//
// MessageId: CRYPT_E_NO_DECRYPT_CERT
//
// MessageText:
//
// Cannot find the certificate and private key to use for decryption.
//
CRYPT_E_NO_DECRYPT_CERT = HRESULT($8009200C);
//
// MessageId: CRYPT_E_BAD_MSG
//
// MessageText:
//
// Not a cryptographic message or the cryptographic message is not formatted correctly.
//
CRYPT_E_BAD_MSG = HRESULT($8009200D);
//
// MessageId: CRYPT_E_NO_SIGNER
//
// MessageText:
//
// The signed cryptographic message does not have a signer for the specified signer index.
//
CRYPT_E_NO_SIGNER = HRESULT($8009200E);
//
// MessageId: CRYPT_E_PENDING_CLOSE
//
// MessageText:
//
// Final closure is pending until additional frees or closes.
//
CRYPT_E_PENDING_CLOSE = HRESULT($8009200F);
//
// MessageId: CRYPT_E_REVOKED
//
// MessageText:
//
// The certificate is revoked.
//
CRYPT_E_REVOKED = HRESULT($80092010);
//
// MessageId: CRYPT_E_NO_REVOCATION_DLL
//
// MessageText:
//
// No Dll or exported function was found to verify revocation.
//
CRYPT_E_NO_REVOCATION_DLL = HRESULT($80092011);
//
// MessageId: CRYPT_E_NO_REVOCATION_CHECK
//
// MessageText:
//
// The revocation function was unable to check revocation for the certificate.
//
CRYPT_E_NO_REVOCATION_CHECK = HRESULT($80092012);
//
// MessageId: CRYPT_E_REVOCATION_OFFLINE
//
// MessageText:
//
// The revocation function was unable to check revocation because the revocation server was offline.
//
CRYPT_E_REVOCATION_OFFLINE = HRESULT($80092013);
//
// MessageId: CRYPT_E_NOT_IN_REVOCATION_DATABASE
//
// MessageText:
//
// The certificate is not in the revocation server's database.
//
CRYPT_E_NOT_IN_REVOCATION_DATABASE = HRESULT($80092014);
//
// MessageId: CRYPT_E_INVALID_NUMERIC_STRING
//
// MessageText:
//
// The string contains a non-numeric character.
//
CRYPT_E_INVALID_NUMERIC_STRING = HRESULT($80092020);
//
// MessageId: CRYPT_E_INVALID_PRINTABLE_STRING
//
// MessageText:
//
// The string contains a non-printable character.
//
CRYPT_E_INVALID_PRINTABLE_STRING = HRESULT($80092021);
//
// MessageId: CRYPT_E_INVALID_IA5_STRING
//
// MessageText:
//
// The string contains a character not in the 7 bit ASCII character set.
//
CRYPT_E_INVALID_IA5_STRING = HRESULT($80092022);
//
// MessageId: CRYPT_E_INVALID_X500_STRING
//
// MessageText:
//
// The string contains an invalid X500 name attribute key, oid, value or delimiter.
//
CRYPT_E_INVALID_X500_STRING = HRESULT($80092023);
//
// MessageId: CRYPT_E_NOT_CHAR_STRING
//
// MessageText:
//
// The dwValueType for the CERT_NAME_VALUE is not one of the character strings. Most likely it is either a CERT_RDN_ENCODED_BLOB or CERT_TDN_OCTED_STRING.
//
CRYPT_E_NOT_CHAR_STRING = HRESULT($80092024);
//
// MessageId: CRYPT_E_FILERESIZED
//
// MessageText:
//
// The Put operation can not continue. The file needs to be resized. However, there is already a signature present. A complete signing operation must be done.
//
CRYPT_E_FILERESIZED = HRESULT($80092025);
//
// MessageId: CRYPT_E_SECURITY_SETTINGS
//
// MessageText:
//
// The cryptographic operation failed due to a local security option setting.
//
CRYPT_E_SECURITY_SETTINGS = HRESULT($80092026);
//
// MessageId: CRYPT_E_NO_VERIFY_USAGE_DLL
//
// MessageText:
//
// No DLL or exported function was found to verify subject usage.
//
CRYPT_E_NO_VERIFY_USAGE_DLL = HRESULT($80092027);
//
// MessageId: CRYPT_E_NO_VERIFY_USAGE_CHECK
//
// MessageText:
//
// The called function was unable to do a usage check on the subject.
//
CRYPT_E_NO_VERIFY_USAGE_CHECK = HRESULT($80092028);
//
// MessageId: CRYPT_E_VERIFY_USAGE_OFFLINE
//
// MessageText:
//
// Since the server was offline, the called function was unable to complete the usage check.
//
CRYPT_E_VERIFY_USAGE_OFFLINE = HRESULT($80092029);
//
// MessageId: CRYPT_E_NOT_IN_CTL
//
// MessageText:
//
// The subject was not found in a Certificate Trust List (CTL).
//
CRYPT_E_NOT_IN_CTL = HRESULT($8009202A);
//
// MessageId: CRYPT_E_NO_TRUSTED_SIGNER
//
// MessageText:
//
// None of the signers of the cryptographic message or certificate trust list is trusted.
//
CRYPT_E_NO_TRUSTED_SIGNER = HRESULT($8009202B);
//
// MessageId: CRYPT_E_MISSING_PUBKEY_PARA
//
// MessageText:
//
// The public key's algorithm parameters are missing.
//
CRYPT_E_MISSING_PUBKEY_PARA = HRESULT($8009202C);
//
// MessageId: CRYPT_E_OSS_ERROR
//
// MessageText:
//
// OSS Certificate encode/decode error code base
//
// See asn1code.h for a definition of the OSS runtime errors. The OSS
// error values are offset by CRYPT_E_OSS_ERROR.
//
CRYPT_E_OSS_ERROR = HRESULT($80093000);
//
// MessageId: OSS_MORE_BUF
//
// MessageText:
//
// OSS ASN.1 Error: Output Buffer is too small.
//
OSS_MORE_BUF = HRESULT($80093001);
//
// MessageId: OSS_NEGATIVE_UINTEGER
//
// MessageText:
//
// OSS ASN.1 Error: Signed integer is encoded as a unsigned integer.
//
OSS_NEGATIVE_UINTEGER = HRESULT($80093002);
//
// MessageId: OSS_PDU_RANGE
//
// MessageText:
//
// OSS ASN.1 Error: Unknown ASN.1 data type.
//
OSS_PDU_RANGE = HRESULT($80093003);
//
// MessageId: OSS_MORE_INPUT
//
// MessageText:
//
// OSS ASN.1 Error: Output buffer is too small, the decoded data has been truncated.
//
OSS_MORE_INPUT = HRESULT($80093004);
//
// MessageId: OSS_DATA_ERROR
//
// MessageText:
//
// OSS ASN.1 Error: Invalid data.
//
OSS_DATA_ERROR = HRESULT($80093005);
//
// MessageId: OSS_BAD_ARG
//
// MessageText:
//
// OSS ASN.1 Error: Invalid argument.
//
OSS_BAD_ARG = HRESULT($80093006);
//
// MessageId: OSS_BAD_VERSION
//
// MessageText:
//
// OSS ASN.1 Error: Encode/Decode version mismatch.
//
OSS_BAD_VERSION = HRESULT($80093007);
//
// MessageId: OSS_OUT_MEMORY
//
// MessageText:
//
// OSS ASN.1 Error: Out of memory.
//
OSS_OUT_MEMORY = HRESULT($80093008);
//
// MessageId: OSS_PDU_MISMATCH
//
// MessageText:
//
// OSS ASN.1 Error: Encode/Decode Error.
//
OSS_PDU_MISMATCH = HRESULT($80093009);
//
// MessageId: OSS_LIMITED
//
// MessageText:
//
// OSS ASN.1 Error: Internal Error.
//
OSS_LIMITED = HRESULT($8009300A);
//
// MessageId: OSS_BAD_PTR
//
// MessageText:
//
// OSS ASN.1 Error: Invalid data.
//
OSS_BAD_PTR = HRESULT($8009300B);
//
// MessageId: OSS_BAD_TIME
//
// MessageText:
//
// OSS ASN.1 Error: Invalid data.
//
OSS_BAD_TIME = HRESULT($8009300C);
//
// MessageId: OSS_INDEFINITE_NOT_SUPPORTED
//
// MessageText:
//
// OSS ASN.1 Error: Unsupported BER indefinite-length encoding.
//
OSS_INDEFINITE_NOT_SUPPORTED = HRESULT($8009300D);
//
// MessageId: OSS_MEM_ERROR
//
// MessageText:
//
// OSS ASN.1 Error: Access violation.
//
OSS_MEM_ERROR = HRESULT($8009300E);
//
// MessageId: OSS_BAD_TABLE
//
// MessageText:
//
// OSS ASN.1 Error: Invalid data.
//
OSS_BAD_TABLE = HRESULT($8009300F);
//
// MessageId: OSS_TOO_LONG
//
// MessageText:
//
// OSS ASN.1 Error: Invalid data.
//
OSS_TOO_LONG = HRESULT($80093010);
//
// MessageId: OSS_CONSTRAINT_VIOLATED
//
// MessageText:
//
// OSS ASN.1 Error: Invalid data.
//
OSS_CONSTRAINT_VIOLATED = HRESULT($80093011);
//
// MessageId: OSS_FATAL_ERROR
//
// MessageText:
//
// OSS ASN.1 Error: Internal Error.
//
OSS_FATAL_ERROR = HRESULT($80093012);
//
// MessageId: OSS_ACCESS_SERIALIZATION_ERROR
//
// MessageText:
//
// OSS ASN.1 Error: Multi-threading conflict.
//
OSS_ACCESS_SERIALIZATION_ERROR = HRESULT($80093013);
//
// MessageId: OSS_NULL_TBL
//
// MessageText:
//
// OSS ASN.1 Error: Invalid data.
//
OSS_NULL_TBL = HRESULT($80093014);
//
// MessageId: OSS_NULL_FCN
//
// MessageText:
//
// OSS ASN.1 Error: Invalid data.
//
OSS_NULL_FCN = HRESULT($80093015);
//
// MessageId: OSS_BAD_ENCRULES
//
// MessageText:
//
// OSS ASN.1 Error: Invalid data.
//
OSS_BAD_ENCRULES = HRESULT($80093016);
//
// MessageId: OSS_UNAVAIL_ENCRULES
//
// MessageText:
//
// OSS ASN.1 Error: Encode/Decode function not implemented.
//
OSS_UNAVAIL_ENCRULES = HRESULT($80093017);
//
// MessageId: OSS_CANT_OPEN_TRACE_WINDOW
//
// MessageText:
//
// OSS ASN.1 Error: Trace file error.
//
OSS_CANT_OPEN_TRACE_WINDOW = HRESULT($80093018);
//
// MessageId: OSS_UNIMPLEMENTED
//
// MessageText:
//
// OSS ASN.1 Error: Function not implemented.
//
OSS_UNIMPLEMENTED = HRESULT($80093019);
//
// MessageId: OSS_OID_DLL_NOT_LINKED
//
// MessageText:
//
// OSS ASN.1 Error: Program link error.
//
OSS_OID_DLL_NOT_LINKED = HRESULT($8009301A);
//
// MessageId: OSS_CANT_OPEN_TRACE_FILE
//
// MessageText:
//
// OSS ASN.1 Error: Trace file error.
//
OSS_CANT_OPEN_TRACE_FILE = HRESULT($8009301B);
//
// MessageId: OSS_TRACE_FILE_ALREADY_OPEN
//
// MessageText:
//
// OSS ASN.1 Error: Trace file error.
//
OSS_TRACE_FILE_ALREADY_OPEN = HRESULT($8009301C);
//
// MessageId: OSS_TABLE_MISMATCH
//
// MessageText:
//
// OSS ASN.1 Error: Invalid data.
//
OSS_TABLE_MISMATCH = HRESULT($8009301D);
//
// MessageId: OSS_TYPE_NOT_SUPPORTED
//
// MessageText:
//
// OSS ASN.1 Error: Invalid data.
//
OSS_TYPE_NOT_SUPPORTED = HRESULT($8009301E);
//
// MessageId: OSS_REAL_DLL_NOT_LINKED
//
// MessageText:
//
// OSS ASN.1 Error: Program link error.
//
OSS_REAL_DLL_NOT_LINKED = HRESULT($8009301F);
//
// MessageId: OSS_REAL_CODE_NOT_LINKED
//
// MessageText:
//
// OSS ASN.1 Error: Program link error.
//
OSS_REAL_CODE_NOT_LINKED = HRESULT($80093020);
//
// MessageId: OSS_OUT_OF_RANGE
//
// MessageText:
//
// OSS ASN.1 Error: Program link error.
//
OSS_OUT_OF_RANGE = HRESULT($80093021);
//
// MessageId: OSS_COPIER_DLL_NOT_LINKED
//
// MessageText:
//
// OSS ASN.1 Error: Program link error.
//
OSS_COPIER_DLL_NOT_LINKED = HRESULT($80093022);
//
// MessageId: OSS_CONSTRAINT_DLL_NOT_LINKED
//
// MessageText:
//
// OSS ASN.1 Error: Program link error.
//
OSS_CONSTRAINT_DLL_NOT_LINKED = HRESULT($80093023);
//
// MessageId: OSS_COMPARATOR_DLL_NOT_LINKED
//
// MessageText:
//
// OSS ASN.1 Error: Program link error.
//
OSS_COMPARATOR_DLL_NOT_LINKED = HRESULT($80093024);
//
// MessageId: OSS_COMPARATOR_CODE_NOT_LINKED
//
// MessageText:
//
// OSS ASN.1 Error: Program link error.
//
OSS_COMPARATOR_CODE_NOT_LINKED = HRESULT($80093025);
//
// MessageId: OSS_MEM_MGR_DLL_NOT_LINKED
//
// MessageText:
//
// OSS ASN.1 Error: Program link error.
//
OSS_MEM_MGR_DLL_NOT_LINKED = HRESULT($80093026);
//
// MessageId: OSS_PDV_DLL_NOT_LINKED
//
// MessageText:
//
// OSS ASN.1 Error: Program link error.
//
OSS_PDV_DLL_NOT_LINKED = HRESULT($80093027);
//
// MessageId: OSS_PDV_CODE_NOT_LINKED
//
// MessageText:
//
// OSS ASN.1 Error: Program link error.
//
OSS_PDV_CODE_NOT_LINKED = HRESULT($80093028);
//
// MessageId: OSS_API_DLL_NOT_LINKED
//
// MessageText:
//
// OSS ASN.1 Error: Program link error.
//
OSS_API_DLL_NOT_LINKED = HRESULT($80093029);
//
// MessageId: OSS_BERDER_DLL_NOT_LINKED
//
// MessageText:
//
// OSS ASN.1 Error: Program link error.
//
OSS_BERDER_DLL_NOT_LINKED = HRESULT($8009302A);
//
// MessageId: OSS_PER_DLL_NOT_LINKED
//
// MessageText:
//
// OSS ASN.1 Error: Program link error.
//
OSS_PER_DLL_NOT_LINKED = HRESULT($8009302B);
//
// MessageId: OSS_OPEN_TYPE_ERROR
//
// MessageText:
//
// OSS ASN.1 Error: Program link error.
//
OSS_OPEN_TYPE_ERROR = HRESULT($8009302C);
//
// MessageId: OSS_MUTEX_NOT_CREATED
//
// MessageText:
//
// OSS ASN.1 Error: System resource error.
//
OSS_MUTEX_NOT_CREATED = HRESULT($8009302D);
//
// MessageId: OSS_CANT_CLOSE_TRACE_FILE
//
// MessageText:
//
// OSS ASN.1 Error: Trace file error.
//
OSS_CANT_CLOSE_TRACE_FILE = HRESULT($8009302E);
//
// MessageId: CRYPT_E_ASN1_ERROR
//
// MessageText:
//
// ASN1 Certificate encode/decode error code base.
//
// The ASN1 error values are offset by CRYPT_E_ASN1_ERROR.
//
CRYPT_E_ASN1_ERROR = HRESULT($80093100);
//
// MessageId: CRYPT_E_ASN1_INTERNAL
//
// MessageText:
//
// ASN1 internal encode or decode error.
//
CRYPT_E_ASN1_INTERNAL = HRESULT($80093101);
//
// MessageId: CRYPT_E_ASN1_EOD
//
// MessageText:
//
// ASN1 unexpected end of data.
//
CRYPT_E_ASN1_EOD = HRESULT($80093102);
//
// MessageId: CRYPT_E_ASN1_CORRUPT
//
// MessageText:
//
// ASN1 corrupted data.
//
CRYPT_E_ASN1_CORRUPT = HRESULT($80093103);
//
// MessageId: CRYPT_E_ASN1_LARGE
//
// MessageText:
//
// ASN1 value too large.
//
CRYPT_E_ASN1_LARGE = HRESULT($80093104);
//
// MessageId: CRYPT_E_ASN1_CONSTRAINT
//
// MessageText:
//
// ASN1 constraint violated.
//
CRYPT_E_ASN1_CONSTRAINT = HRESULT($80093105);
//
// MessageId: CRYPT_E_ASN1_MEMORY
//
// MessageText:
//
// ASN1 out of memory.
//
CRYPT_E_ASN1_MEMORY = HRESULT($80093106);
//
// MessageId: CRYPT_E_ASN1_OVERFLOW
//
// MessageText:
//
// ASN1 buffer overflow.
//
CRYPT_E_ASN1_OVERFLOW = HRESULT($80093107);
//
// MessageId: CRYPT_E_ASN1_BADPDU
//
// MessageText:
//
// ASN1 function not supported for this PDU.
//
CRYPT_E_ASN1_BADPDU = HRESULT($80093108);
//
// MessageId: CRYPT_E_ASN1_BADARGS
//
// MessageText:
//
// ASN1 bad arguments to function call.
//
CRYPT_E_ASN1_BADARGS = HRESULT($80093109);
//
// MessageId: CRYPT_E_ASN1_BADREAL
//
// MessageText:
//
// ASN1 bad real value.
//
CRYPT_E_ASN1_BADREAL = HRESULT($8009310A);
//
// MessageId: CRYPT_E_ASN1_BADTAG
//
// MessageText:
//
// ASN1 bad tag value met.
//
CRYPT_E_ASN1_BADTAG = HRESULT($8009310B);
//
// MessageId: CRYPT_E_ASN1_CHOICE
//
// MessageText:
//
// ASN1 bad choice value.
//
CRYPT_E_ASN1_CHOICE = HRESULT($8009310C);
//
// MessageId: CRYPT_E_ASN1_RULE
//
// MessageText:
//
// ASN1 bad encoding rule.
//
CRYPT_E_ASN1_RULE = HRESULT($8009310D);
//
// MessageId: CRYPT_E_ASN1_UTF8
//
// MessageText:
//
// ASN1 bad unicode (UTF8).
//
CRYPT_E_ASN1_UTF8 = HRESULT($8009310E);
//
// MessageId: CRYPT_E_ASN1_PDU_TYPE
//
// MessageText:
//
// ASN1 bad PDU type.
//
CRYPT_E_ASN1_PDU_TYPE = HRESULT($80093133);
//
// MessageId: CRYPT_E_ASN1_NYI
//
// MessageText:
//
// ASN1 not yet implemented.
//
CRYPT_E_ASN1_NYI = HRESULT($80093134);
//
// MessageId: CRYPT_E_ASN1_EXTENDED
//
// MessageText:
//
// ASN1 skipped unknown extension(s).
//
CRYPT_E_ASN1_EXTENDED = HRESULT($80093201);
//
// MessageId: CRYPT_E_ASN1_NOEOD
//
// MessageText:
//
// ASN1 end of data expected
//
CRYPT_E_ASN1_NOEOD = HRESULT($80093202);
//
// MessageId: CERTSRV_E_BAD_REQUESTSUBJECT
//
// MessageText:
//
// The request subject name is invalid or too long.
//
CERTSRV_E_BAD_REQUESTSUBJECT = HRESULT($80094001);
//
// MessageId: CERTSRV_E_NO_REQUEST
//
// MessageText:
//
// The request does not exist.
//
CERTSRV_E_NO_REQUEST = HRESULT($80094002);
//
// MessageId: CERTSRV_E_BAD_REQUESTSTATUS
//
// MessageText:
//
// The request's current status does not allow this operation.
//
CERTSRV_E_BAD_REQUESTSTATUS = HRESULT($80094003);
//
// MessageId: CERTSRV_E_PROPERTY_EMPTY
//
// MessageText:
//
// The requested property value is empty.
//
CERTSRV_E_PROPERTY_EMPTY = HRESULT($80094004);
//
// MessageId: CERTSRV_E_INVALID_CA_CERTIFICATE
//
// MessageText:
//
// The certification authority's certificate contains invalid data.
//
CERTSRV_E_INVALID_CA_CERTIFICATE = HRESULT($80094005);
//
// MessageId: CERTSRV_E_SERVER_SUSPENDED
//
// MessageText:
//
// Certificate service has been suspended for a database restore operation.
//
CERTSRV_E_SERVER_SUSPENDED = HRESULT($80094006);
//
// MessageId: CERTSRV_E_ENCODING_LENGTH
//
// MessageText:
//
// The certificate contains an encoded length that is potentially incompatible with older enrollment software.
//
CERTSRV_E_ENCODING_LENGTH = HRESULT($80094007);
//
// MessageId: CERTSRV_E_UNSUPPORTED_CERT_TYPE
//
// MessageText:
//
// The requested certificate template is not supported by this CA.
//
CERTSRV_E_UNSUPPORTED_CERT_TYPE = HRESULT($80094800);
//
// MessageId: CERTSRV_E_NO_CERT_TYPE
//
// MessageText:
//
// The request contains no certificate template information.
//
CERTSRV_E_NO_CERT_TYPE = HRESULT($80094801);
//
// MessageId: TRUST_E_SYSTEM_ERROR
//
// MessageText:
//
// A system-level error occurred while verifying trust.
//
TRUST_E_SYSTEM_ERROR = HRESULT($80096001);
//
// MessageId: TRUST_E_NO_SIGNER_CERT
//
// MessageText:
//
// The certificate for the signer of the message is invalid or not found.
//
TRUST_E_NO_SIGNER_CERT = HRESULT($80096002);
//
// MessageId: TRUST_E_COUNTER_SIGNER
//
// MessageText:
//
// One of the counter signatures was invalid.
//
TRUST_E_COUNTER_SIGNER = HRESULT($80096003);
//
// MessageId: TRUST_E_CERT_SIGNATURE
//
// MessageText:
//
// The signature of the certificate can not be verified.
//
TRUST_E_CERT_SIGNATURE = HRESULT($80096004);
//
// MessageId: TRUST_E_TIME_STAMP
//
// MessageText:
//
// The timestamp signature and/or certificate could not be verified or is malformed.
//
TRUST_E_TIME_STAMP = HRESULT($80096005);
//
// MessageId: TRUST_E_BAD_DIGEST
//
// MessageText:
//
// The digital signature of the object did not verify.
//
TRUST_E_BAD_DIGEST = HRESULT($80096010);
//
// MessageId: TRUST_E_BASIC_CONSTRAINTS
//
// MessageText:
//
// A certificate's basic constraint extension has not been observed.
//
TRUST_E_BASIC_CONSTRAINTS = HRESULT($80096019);
//
// MessageId: TRUST_E_FINANCIAL_CRITERIA
//
// MessageText:
//
// The certificate does not meet or contain the Authenticode financial extensions.
//
TRUST_E_FINANCIAL_CRITERIA = HRESULT($8009601E);
//
// Error codes for mssipotf.dll
// Most of the error codes can only occur when an error occurs
// during font file signing
//
//
//
// MessageId: MSSIPOTF_E_OUTOFMEMRANGE
//
// MessageText:
//
// Tried to reference a part of the file outside the proper range.
//
MSSIPOTF_E_OUTOFMEMRANGE = HRESULT($80097001);
//
// MessageId: MSSIPOTF_E_CANTGETOBJECT
//
// MessageText:
//
// Could not retrieve an object from the file.
//
MSSIPOTF_E_CANTGETOBJECT = HRESULT($80097002);
//
// MessageId: MSSIPOTF_E_NOHEADTABLE
//
// MessageText:
//
// Could not find the head table in the file.
//
MSSIPOTF_E_NOHEADTABLE = HRESULT($80097003);
//
// MessageId: MSSIPOTF_E_BAD_MAGICNUMBER
//
// MessageText:
//
// The magic number in the head table is incorrect.
//
MSSIPOTF_E_BAD_MAGICNUMBER = HRESULT($80097004);
//
// MessageId: MSSIPOTF_E_BAD_OFFSET_TABLE
//
// MessageText:
//
// The offset table has incorrect values.
//
MSSIPOTF_E_BAD_OFFSET_TABLE = HRESULT($80097005);
//
// MessageId: MSSIPOTF_E_TABLE_TAGORDER
//
// MessageText:
//
// Duplicate table tags or tags out of alphabetical order.
//
MSSIPOTF_E_TABLE_TAGORDER = HRESULT($80097006);
//
// MessageId: MSSIPOTF_E_TABLE_LONGWORD
//
// MessageText:
//
// A table does not start on a long word boundary.
//
MSSIPOTF_E_TABLE_LONGWORD = HRESULT($80097007);
//
// MessageId: MSSIPOTF_E_BAD_FIRST_TABLE_PLACEMENT
//
// MessageText:
//
// First table does not appear after header information.
//
MSSIPOTF_E_BAD_FIRST_TABLE_PLACEMENT = HRESULT($80097008);
//
// MessageId: MSSIPOTF_E_TABLES_OVERLAP
//
// MessageText:
//
// Two or more tables overlap.
//
MSSIPOTF_E_TABLES_OVERLAP = HRESULT($80097009);
//
// MessageId: MSSIPOTF_E_TABLE_PADBYTES
//
// MessageText:
//
// Too many pad bytes between tables or pad bytes are not 0.
//
MSSIPOTF_E_TABLE_PADBYTES = HRESULT($8009700A);
//
// MessageId: MSSIPOTF_E_FILETOOSMALL
//
// MessageText:
//
// File is too small to contain the last table.
//
MSSIPOTF_E_FILETOOSMALL = HRESULT($8009700B);
//
// MessageId: MSSIPOTF_E_TABLE_CHECKSUM
//
// MessageText:
//
// A table checksum is incorrect.
//
MSSIPOTF_E_TABLE_CHECKSUM = HRESULT($8009700C);
//
// MessageId: MSSIPOTF_E_FILE_CHECKSUM
//
// MessageText:
//
// The file checksum is incorrect.
//
MSSIPOTF_E_FILE_CHECKSUM = HRESULT($8009700D);
//
// MessageId: MSSIPOTF_E_FAILED_POLICY
//
// MessageText:
//
// The signature does not have the correct attributes for the policy.
//
MSSIPOTF_E_FAILED_POLICY = HRESULT($80097010);
//
// MessageId: MSSIPOTF_E_FAILED_HINTS_CHECK
//
// MessageText:
//
// The file did not pass the hints check.
//
MSSIPOTF_E_FAILED_HINTS_CHECK = HRESULT($80097011);
//
// MessageId: MSSIPOTF_E_NOT_OPENTYPE
//
// MessageText:
//
// The file is not an OpenType file.
//
MSSIPOTF_E_NOT_OPENTYPE = HRESULT($80097012);
//
// MessageId: MSSIPOTF_E_FILE
//
// MessageText:
//
// Failed on a file operation (open, map, read, write).
//
MSSIPOTF_E_FILE = HRESULT($80097013);
//
// MessageId: MSSIPOTF_E_CRYPT
//
// MessageText:
//
// A call to a CryptoAPI function failed.
//
MSSIPOTF_E_CRYPT = HRESULT($80097014);
//
// MessageId: MSSIPOTF_E_BADVERSION
//
// MessageText:
//
// There is a bad version number in the file.
//
MSSIPOTF_E_BADVERSION = HRESULT($80097015);
//
// MessageId: MSSIPOTF_E_DSIG_STRUCTURE
//
// MessageText:
//
// The structure of the DSIG table is incorrect.
//
MSSIPOTF_E_DSIG_STRUCTURE = HRESULT($80097016);
//
// MessageId: MSSIPOTF_E_PCONST_CHECK
//
// MessageText:
//
// A check failed in a partially constant table.
//
MSSIPOTF_E_PCONST_CHECK = HRESULT($80097017);
//
// MessageId: MSSIPOTF_E_STRUCTURE
//
// MessageText:
//
// Some kind of structural error.
//
MSSIPOTF_E_STRUCTURE = HRESULT($80097018);
NTE_OP_OK = 0;
//
// Note that additional FACILITY_SSPI errors are in issperr.h
//
// ******************
// FACILITY_CERT
// ******************
//
// MessageId: TRUST_E_PROVIDER_UNKNOWN
//
// MessageText:
//
// Unknown trust provider.
//
TRUST_E_PROVIDER_UNKNOWN = HRESULT($800B0001);
//
// MessageId: TRUST_E_ACTION_UNKNOWN
//
// MessageText:
//
// The trust verification action specified is not supported by the specified trust provider.
//
TRUST_E_ACTION_UNKNOWN = HRESULT($800B0002);
//
// MessageId: TRUST_E_SUBJECT_FORM_UNKNOWN
//
// MessageText:
//
// The form specified for the subject is not one supported or known by the specified trust provider.
//
TRUST_E_SUBJECT_FORM_UNKNOWN = HRESULT($800B0003);
//
// MessageId: TRUST_E_SUBJECT_NOT_TRUSTED
//
// MessageText:
//
// The subject is not trusted for the specified action.
//
TRUST_E_SUBJECT_NOT_TRUSTED = HRESULT($800B0004);
//
// MessageId: DIGSIG_E_ENCODE
//
// MessageText:
//
// Error due to problem in ASN.1 encoding process.
//
DIGSIG_E_ENCODE = HRESULT($800B0005);
//
// MessageId: DIGSIG_E_DECODE
//
// MessageText:
//
// Error due to problem in ASN.1 decoding process.
//
DIGSIG_E_DECODE = HRESULT($800B0006);
//
// MessageId: DIGSIG_E_EXTENSIBILITY
//
// MessageText:
//
// Reading / writing Extensions where Attributes are appropriate, and visa versa.
//
DIGSIG_E_EXTENSIBILITY = HRESULT($800B0007);
//
// MessageId: DIGSIG_E_CRYPTO
//
// MessageText:
//
// Unspecified cryptographic failure.
//
DIGSIG_E_CRYPTO = HRESULT($800B0008);
//
// MessageId: PERSIST_E_SIZEDEFINITE
//
// MessageText:
//
// The size of the data could not be determined.
//
PERSIST_E_SIZEDEFINITE = HRESULT($800B0009);
//
// MessageId: PERSIST_E_SIZEINDEFINITE
//
// MessageText:
//
// The size of the indefinite-sized data could not be determined.
//
PERSIST_E_SIZEINDEFINITE = HRESULT($800B000A);
//
// MessageId: PERSIST_E_NOTSELFSIZING
//
// MessageText:
//
// This object does not read and write self-sizing data.
//
PERSIST_E_NOTSELFSIZING = HRESULT($800B000B);
//
// MessageId: TRUST_E_NOSIGNATURE
//
// MessageText:
//
// No signature was present in the subject.
//
TRUST_E_NOSIGNATURE = HRESULT($800B0100);
//
// MessageId: CERT_E_EXPIRED
//
// MessageText:
//
// A required certificate is not within its validity period when verifying against the current system clock or the timestamp in the signed file.
//
CERT_E_EXPIRED = HRESULT($800B0101);
//
// MessageId: CERT_E_VALIDITYPERIODNESTING
//
// MessageText:
//
// The validity periods of the certification chain do not nest correctly.
//
CERT_E_VALIDITYPERIODNESTING = HRESULT($800B0102);
//
// MessageId: CERT_E_ROLE
//
// MessageText:
//
// A certificate that can only be used as an end-entity is being used as a CA or visa versa.
//
CERT_E_ROLE = HRESULT($800B0103);
//
// MessageId: CERT_E_PATHLENCONST
//
// MessageText:
//
// A path length constraint in the certification chain has been violated.
//
CERT_E_PATHLENCONST = HRESULT($800B0104);
//
// MessageId: CERT_E_CRITICAL
//
// MessageText:
//
// A certificate contains an unknown extension that is marked 'critical'.
//
CERT_E_CRITICAL = HRESULT($800B0105);
//
// MessageId: CERT_E_PURPOSE
//
// MessageText:
//
// A certificate being used for a purpose other than the ones specified by its CA.
//
CERT_E_PURPOSE = HRESULT($800B0106);
//
// MessageId: CERT_E_ISSUERCHAINING
//
// MessageText:
//
// A parent of a given certificate in fact did not issue that child certificate.
//
CERT_E_ISSUERCHAINING = HRESULT($800B0107);
//
// MessageId: CERT_E_MALFORMED
//
// MessageText:
//
// A certificate is missing or has an empty value for an important field, such as a subject or issuer name.
//
CERT_E_MALFORMED = HRESULT($800B0108);
//
// MessageId: CERT_E_UNTRUSTEDROOT
//
// MessageText:
//
// A certificate chain processed correctly, but terminated in a root certificate which is not trusted by the trust provider.
//
CERT_E_UNTRUSTEDROOT = HRESULT($800B0109);
//
// MessageId: CERT_E_CHAINING
//
// MessageText:
//
// An internal certificate chaining error has occurred.
//
CERT_E_CHAINING = HRESULT($800B010A);
//
// MessageId: TRUST_E_FAIL
//
// MessageText:
//
// Generic trust failure.
//
TRUST_E_FAIL = HRESULT($800B010B);
//
// MessageId: CERT_E_REVOKED
//
// MessageText:
//
// A certificate was explicitly revoked by its issuer.
//
CERT_E_REVOKED = HRESULT($800B010C);
//
// MessageId: CERT_E_UNTRUSTEDTESTROOT
//
// MessageText:
//
// The certification path terminates with the test root which is not trusted with the current policy settings.
//
CERT_E_UNTRUSTEDTESTROOT = HRESULT($800B010D);
//
// MessageId: CERT_E_REVOCATION_FAILURE
//
// MessageText:
//
// The revocation process could not continue - the certificate(s) could not be checked.
//
CERT_E_REVOCATION_FAILURE = HRESULT($800B010E);
//
// MessageId: CERT_E_CN_NO_MATCH
//
// MessageText:
//
// The certificate's CN name does not match the passed value.
//
CERT_E_CN_NO_MATCH = HRESULT($800B010F);
//
// MessageId: CERT_E_WRONG_USAGE
//
// MessageText:
//
// The certificate is not valid for the requested usage.
//
CERT_E_WRONG_USAGE = HRESULT($800B0110);
//
// MessageId: TRUST_E_EXPLICIT_DISTRUST
//
// MessageText:
//
// The certificate was explicitly marked as untrusted by the user.
//
TRUST_E_EXPLICIT_DISTRUST = HRESULT($800B0111);
//
// MessageId: CERT_E_UNTRUSTEDCA
//
// MessageText:
//
// A certification chain processed correctly, but one of the CA certificates is not trusted by the policy provider.
//
CERT_E_UNTRUSTEDCA = HRESULT($800B0112);
// *****************
// FACILITY_SETUPAPI
// *****************
//
// Since these error codes aren't in the standard Win32 range (i.e., 0-64K), define a
// macro to map either Win32 or SetupAPI error codes into an HRESULT.
//
{ TODO : implement HRESULT_FROM_SETUPAPI(x)
#define HRESULT_FROM_SETUPAPI(x) ((((x) & (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR)) == (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR)) \
? ((HRESULT) (((x) & 0x0000FFFF) | (FACILITY_SETUPAPI << 16) | 0x80000000)) \
: HRESULT_FROM_WIN32(x))
}
//
// MessageId: SPAPI_E_EXPECTED_SECTION_NAME
//
// MessageText:
//
// A non-empty line was encountered in the INF before the start of a section.
//
SPAPI_E_EXPECTED_SECTION_NAME = HRESULT($800F0000);
//
// MessageId: SPAPI_E_BAD_SECTION_NAME_LINE
//
// MessageText:
//
// A section name marker in the INF is not complete, or does not exist on a line by itself.
//
SPAPI_E_BAD_SECTION_NAME_LINE = HRESULT($800F0001);
//
// MessageId: SPAPI_E_SECTION_NAME_TOO_LONG
//
// MessageText:
//
// An INF section was encountered whose name exceeds the maximum section name length.
//
SPAPI_E_SECTION_NAME_TOO_LONG = HRESULT($800F0002);
//
// MessageId: SPAPI_E_GENERAL_SYNTAX
//
// MessageText:
//
// The syntax of the INF is invalid.
//
SPAPI_E_GENERAL_SYNTAX = HRESULT($800F0003);
//
// MessageId: SPAPI_E_WRONG_INF_STYLE
//
// MessageText:
//
// The style of the INF is different than what was requested.
//
SPAPI_E_WRONG_INF_STYLE = HRESULT($800F0100);
//
// MessageId: SPAPI_E_SECTION_NOT_FOUND
//
// MessageText:
//
// The required section was not found in the INF.
//
SPAPI_E_SECTION_NOT_FOUND = HRESULT($800F0101);
//
// MessageId: SPAPI_E_LINE_NOT_FOUND
//
// MessageText:
//
// The required line was not found in the INF.
//
SPAPI_E_LINE_NOT_FOUND = HRESULT($800F0102);
//
// MessageId: SPAPI_E_NO_BACKUP
//
// MessageText:
//
// The files affected by the installation of this file queue have not been backed up for uninstall.
//
SPAPI_E_NO_BACKUP = HRESULT($800F0103);
//
// MessageId: SPAPI_E_NO_ASSOCIATED_CLASS
//
// MessageText:
//
// The INF or the device information set or element does not have an associated install class.
//
SPAPI_E_NO_ASSOCIATED_CLASS = HRESULT($800F0200);
//
// MessageId: SPAPI_E_CLASS_MISMATCH
//
// MessageText:
//
// The INF or the device information set or element does not match the specified install class.
//
SPAPI_E_CLASS_MISMATCH = HRESULT($800F0201);
//
// MessageId: SPAPI_E_DUPLICATE_FOUND
//
// MessageText:
//
// An existing device was found that is a duplicate of the device being manually installed.
//
SPAPI_E_DUPLICATE_FOUND = HRESULT($800F0202);
//
// MessageId: SPAPI_E_NO_DRIVER_SELECTED
//
// MessageText:
//
// There is no driver selected for the device information set or element.
//
SPAPI_E_NO_DRIVER_SELECTED = HRESULT($800F0203);
//
// MessageId: SPAPI_E_KEY_DOES_NOT_EXIST
//
// MessageText:
//
// The requested device registry key does not exist.
//
SPAPI_E_KEY_DOES_NOT_EXIST = HRESULT($800F0204);
//
// MessageId: SPAPI_E_INVALID_DEVINST_NAME
//
// MessageText:
//
// The device instance name is invalid.
//
SPAPI_E_INVALID_DEVINST_NAME = HRESULT($800F0205);
//
// MessageId: SPAPI_E_INVALID_CLASS
//
// MessageText:
//
// The install class is not present or is invalid.
//
SPAPI_E_INVALID_CLASS = HRESULT($800F0206);
//
// MessageId: SPAPI_E_DEVINST_ALREADY_EXISTS
//
// MessageText:
//
// The device instance cannot be created because it already exists.
//
SPAPI_E_DEVINST_ALREADY_EXISTS = HRESULT($800F0207);
//
// MessageId: SPAPI_E_DEVINFO_NOT_REGISTERED
//
// MessageText:
//
// The operation cannot be performed on a device information element that has not been registered.
//
SPAPI_E_DEVINFO_NOT_REGISTERED = HRESULT($800F0208);
//
// MessageId: SPAPI_E_INVALID_REG_PROPERTY
//
// MessageText:
//
// The device property code is invalid.
//
SPAPI_E_INVALID_REG_PROPERTY = HRESULT($800F0209);
//
// MessageId: SPAPI_E_NO_INF
//
// MessageText:
//
// The INF from which a driver list is to be built does not exist.
//
SPAPI_E_NO_INF = HRESULT($800F020A);
//
// MessageId: SPAPI_E_NO_SUCH_DEVINST
//
// MessageText:
//
// The device instance does not exist in the hardware tree.
//
SPAPI_E_NO_SUCH_DEVINST = HRESULT($800F020B);
//
// MessageId: SPAPI_E_CANT_LOAD_CLASS_ICON
//
// MessageText:
//
// The icon representing this install class cannot be loaded.
//
SPAPI_E_CANT_LOAD_CLASS_ICON = HRESULT($800F020C);
//
// MessageId: SPAPI_E_INVALID_CLASS_INSTALLER
//
// MessageText:
//
// The class installer registry entry is invalid.
//
SPAPI_E_INVALID_CLASS_INSTALLER = HRESULT($800F020D);
//
// MessageId: SPAPI_E_DI_DO_DEFAULT
//
// MessageText:
//
// The class installer has indicated that the default action should be performed for this installation request.
//
SPAPI_E_DI_DO_DEFAULT = HRESULT($800F020E);
//
// MessageId: SPAPI_E_DI_NOFILECOPY
//
// MessageText:
//
// The operation does not require any files to be copied.
//
SPAPI_E_DI_NOFILECOPY = HRESULT($800F020F);
//
// MessageId: SPAPI_E_INVALID_HWPROFILE
//
// MessageText:
//
// The specified hardware profile does not exist.
//
SPAPI_E_INVALID_HWPROFILE = HRESULT($800F0210);
//
// MessageId: SPAPI_E_NO_DEVICE_SELECTED
//
// MessageText:
//
// There is no device information element currently selected for this device information set.
//
SPAPI_E_NO_DEVICE_SELECTED = HRESULT($800F0211);
//
// MessageId: SPAPI_E_DEVINFO_LIST_LOCKED
//
// MessageText:
//
// The operation cannot be performed because the device information set is locked.
//
SPAPI_E_DEVINFO_LIST_LOCKED = HRESULT($800F0212);
//
// MessageId: SPAPI_E_DEVINFO_DATA_LOCKED
//
// MessageText:
//
// The operation cannot be performed because the device information element is locked.
//
SPAPI_E_DEVINFO_DATA_LOCKED = HRESULT($800F0213);
//
// MessageId: SPAPI_E_DI_BAD_PATH
//
// MessageText:
//
// The specified path does not contain any applicable device INFs.
//
SPAPI_E_DI_BAD_PATH = HRESULT($800F0214);
//
// MessageId: SPAPI_E_NO_CLASSINSTALL_PARAMS
//
// MessageText:
//
// No class installer parameters have been set for the device information set or element.
//
SPAPI_E_NO_CLASSINSTALL_PARAMS = HRESULT($800F0215);
//
// MessageId: SPAPI_E_FILEQUEUE_LOCKED
//
// MessageText:
//
// The operation cannot be performed because the file queue is locked.
//
SPAPI_E_FILEQUEUE_LOCKED = HRESULT($800F0216);
//
// MessageId: SPAPI_E_BAD_SERVICE_INSTALLSECT
//
// MessageText:
//
// A service installation section in this INF is invalid.
//
SPAPI_E_BAD_SERVICE_INSTALLSECT = HRESULT($800F0217);
//
// MessageId: SPAPI_E_NO_CLASS_DRIVER_LIST
//
// MessageText:
//
// There is no class driver list for the device information element.
//
SPAPI_E_NO_CLASS_DRIVER_LIST = HRESULT($800F0218);
//
// MessageId: SPAPI_E_NO_ASSOCIATED_SERVICE
//
// MessageText:
//
// The installation failed because a function driver was not specified for this device instance.
//
SPAPI_E_NO_ASSOCIATED_SERVICE = HRESULT($800F0219);
//
// MessageId: SPAPI_E_NO_DEFAULT_DEVICE_INTERFACE
//
// MessageText:
//
// There is presently no default device interface designated for this interface class.
//
SPAPI_E_NO_DEFAULT_DEVICE_INTERFACE = HRESULT($800F021A);
//
// MessageId: SPAPI_E_DEVICE_INTERFACE_ACTIVE
//
// MessageText:
//
// The operation cannot be performed because the device interface is currently active.
//
SPAPI_E_DEVICE_INTERFACE_ACTIVE = HRESULT($800F021B);
//
// MessageId: SPAPI_E_DEVICE_INTERFACE_REMOVED
//
// MessageText:
//
// The operation cannot be performed because the device interface has been removed from the system.
//
SPAPI_E_DEVICE_INTERFACE_REMOVED = HRESULT($800F021C);
//
// MessageId: SPAPI_E_BAD_INTERFACE_INSTALLSECT
//
// MessageText:
//
// An interface installation section in this INF is invalid.
//
SPAPI_E_BAD_INTERFACE_INSTALLSECT = HRESULT($800F021D);
//
// MessageId: SPAPI_E_NO_SUCH_INTERFACE_CLASS
//
// MessageText:
//
// This interface class does not exist in the system.
//
SPAPI_E_NO_SUCH_INTERFACE_CLASS = HRESULT($800F021E);
//
// MessageId: SPAPI_E_INVALID_REFERENCE_STRING
//
// MessageText:
//
// The reference string supplied for this interface device is invalid.
//
SPAPI_E_INVALID_REFERENCE_STRING = HRESULT($800F021F);
//
// MessageId: SPAPI_E_INVALID_MACHINENAME
//
// MessageText:
//
// The specified machine name does not conform to UNC naming conventions.
//
SPAPI_E_INVALID_MACHINENAME = HRESULT($800F0220);
//
// MessageId: SPAPI_E_REMOTE_COMM_FAILURE
//
// MessageText:
//
// A general remote communication error occurred.
//
SPAPI_E_REMOTE_COMM_FAILURE = HRESULT($800F0221);
//
// MessageId: SPAPI_E_MACHINE_UNAVAILABLE
//
// MessageText:
//
// The machine selected for remote communication is not available at this time.
//
SPAPI_E_MACHINE_UNAVAILABLE = HRESULT($800F0222);
//
// MessageId: SPAPI_E_NO_CONFIGMGR_SERVICES
//
// MessageText:
//
// The Plug and Play service is not available on the remote machine.
//
SPAPI_E_NO_CONFIGMGR_SERVICES = HRESULT($800F0223);
//
// MessageId: SPAPI_E_INVALID_PROPPAGE_PROVIDER
//
// MessageText:
//
// The property page provider registry entry is invalid.
//
SPAPI_E_INVALID_PROPPAGE_PROVIDER = HRESULT($800F0224);
//
// MessageId: SPAPI_E_NO_SUCH_DEVICE_INTERFACE
//
// MessageText:
//
// The requested device interface is not present in the system.
//
SPAPI_E_NO_SUCH_DEVICE_INTERFACE = HRESULT($800F0225);
//
// MessageId: SPAPI_E_DI_POSTPROCESSING_REQUIRED
//
// MessageText:
//
// The device's co-installer has additional work to perform after installation is complete.
//
SPAPI_E_DI_POSTPROCESSING_REQUIRED = HRESULT($800F0226);
//
// MessageId: SPAPI_E_INVALID_COINSTALLER
//
// MessageText:
//
// The device's co-installer is invalid.
//
SPAPI_E_INVALID_COINSTALLER = HRESULT($800F0227);
//
// MessageId: SPAPI_E_NO_COMPAT_DRIVERS
//
// MessageText:
//
// There are no compatible drivers for this device.
//
SPAPI_E_NO_COMPAT_DRIVERS = HRESULT($800F0228);
//
// MessageId: SPAPI_E_NO_DEVICE_ICON
//
// MessageText:
//
// There is no icon that represents this device or device type.
//
SPAPI_E_NO_DEVICE_ICON = HRESULT($800F0229);
//
// MessageId: SPAPI_E_INVALID_INF_LOGCONFIG
//
// MessageText:
//
// A logical configuration specified in this INF is invalid.
//
SPAPI_E_INVALID_INF_LOGCONFIG = HRESULT($800F022A);
//
// MessageId: SPAPI_E_DI_DONT_INSTALL
//
// MessageText:
//
// The class installer has denied the request to install or upgrade this device.
//
SPAPI_E_DI_DONT_INSTALL = HRESULT($800F022B);
//
// MessageId: SPAPI_E_INVALID_FILTER_DRIVER
//
// MessageText:
//
// One of the filter drivers installed for this device is invalid.
//
SPAPI_E_INVALID_FILTER_DRIVER = HRESULT($800F022C);
//
// MessageId: SPAPI_E_NON_WINDOWS_NT_DRIVER
//
// MessageText:
//
// The driver selected for this device does not support Windows 2000.
//
SPAPI_E_NON_WINDOWS_NT_DRIVER = HRESULT($800F022D);
//
// MessageId: SPAPI_E_NON_WINDOWS_DRIVER
//
// MessageText:
//
// The driver selected for this device does not support Windows.
//
SPAPI_E_NON_WINDOWS_DRIVER = HRESULT($800F022E);
//
// MessageId: SPAPI_E_NO_CATALOG_FOR_OEM_INF
//
// MessageText:
//
// The third-party INF does not contain digital signature information.
//
SPAPI_E_NO_CATALOG_FOR_OEM_INF = HRESULT($800F022F);
//
// MessageId: SPAPI_E_DEVINSTALL_QUEUE_NONNATIVE
//
// MessageText:
//
// An invalid attempt was made to use a device installation file queue for verification of digital signatures relative to other platforms.
//
SPAPI_E_DEVINSTALL_QUEUE_NONNATIVE = HRESULT($800F0230);
//
// MessageId: SPAPI_E_NOT_DISABLEABLE
//
// MessageText:
//
// The device cannot be disabled.
//
SPAPI_E_NOT_DISABLEABLE = HRESULT($800F0231);
//
// MessageId: SPAPI_E_CANT_REMOVE_DEVINST
//
// MessageText:
//
// The device could not be dynamically removed.
//
SPAPI_E_CANT_REMOVE_DEVINST = HRESULT($800F0232);
//
// MessageId: SPAPI_E_ERROR_NOT_INSTALLED
//
// MessageText:
//
// No installed components were detected.
//
SPAPI_E_ERROR_NOT_INSTALLED = HRESULT($800F1000);
// *****************
// FACILITY_SCARD
// *****************
//
// =============================
// Facility SCARD Error Messages
// =============================
//
SCARD_S_SUCCESS = NO_ERROR;
//
// MessageId: SCARD_F_INTERNAL_ERROR
//
// MessageText:
//
// An internal consistency check failed.
//
SCARD_F_INTERNAL_ERROR = HRESULT($80100001);
//
// MessageId: SCARD_E_CANCELLED
//
// MessageText:
//
// The action was cancelled by an SCardCancel request.
//
SCARD_E_CANCELLED = HRESULT($80100002);
//
// MessageId: SCARD_E_INVALID_HANDLE
//
// MessageText:
//
// The supplied handle was invalid.
//
SCARD_E_INVALID_HANDLE = HRESULT($80100003);
//
// MessageId: SCARD_E_INVALID_PARAMETER
//
// MessageText:
//
// One or more of the supplied parameters could not be properly interpreted.
//
SCARD_E_INVALID_PARAMETER = HRESULT($80100004);
//
// MessageId: SCARD_E_INVALID_TARGET
//
// MessageText:
//
// Registry startup information is missing or invalid.
//
SCARD_E_INVALID_TARGET = HRESULT($80100005);
//
// MessageId: SCARD_E_NO_MEMORY
//
// MessageText:
//
// Not enough memory available to complete this command.
//
SCARD_E_NO_MEMORY = HRESULT($80100006);
//
// MessageId: SCARD_F_WAITED_TOO_LONG
//
// MessageText:
//
// An internal consistency timer has expired.
//
SCARD_F_WAITED_TOO_LONG = HRESULT($80100007);
//
// MessageId: SCARD_E_INSUFFICIENT_BUFFER
//
// MessageText:
//
// The data buffer to receive returned data is too small for the returned data.
//
SCARD_E_INSUFFICIENT_BUFFER = HRESULT($80100008);
//
// MessageId: SCARD_E_UNKNOWN_READER
//
// MessageText:
//
// The specified reader name is not recognized.
//
SCARD_E_UNKNOWN_READER = HRESULT($80100009);
//
// MessageId: SCARD_E_TIMEOUT
//
// MessageText:
//
// The user-specified timeout value has expired.
//
SCARD_E_TIMEOUT = HRESULT($8010000A);
//
// MessageId: SCARD_E_SHARING_VIOLATION
//
// MessageText:
//
// The smart card cannot be accessed because of other connections outstanding.
//
SCARD_E_SHARING_VIOLATION = HRESULT($8010000B);
//
// MessageId: SCARD_E_NO_SMARTCARD
//
// MessageText:
//
// The operation requires a Smart Card, but no Smart Card is currently in the device.
//
SCARD_E_NO_SMARTCARD = HRESULT($8010000C);
//
// MessageId: SCARD_E_UNKNOWN_CARD
//
// MessageText:
//
// The specified smart card name is not recognized.
//
SCARD_E_UNKNOWN_CARD = HRESULT($8010000D);
//
// MessageId: SCARD_E_CANT_DISPOSE
//
// MessageText:
//
// The system could not dispose of the media in the requested manner.
//
SCARD_E_CANT_DISPOSE = HRESULT($8010000E);
//
// MessageId: SCARD_E_PROTO_MISMATCH
//
// MessageText:
//
// The requested protocols are incompatible with the protocol currently in use with the smart card.
//
SCARD_E_PROTO_MISMATCH = HRESULT($8010000F);
//
// MessageId: SCARD_E_NOT_READY
//
// MessageText:
//
// The reader or smart card is not ready to accept commands.
//
SCARD_E_NOT_READY = HRESULT($80100010);
//
// MessageId: SCARD_E_INVALID_VALUE
//
// MessageText:
//
// One or more of the supplied parameters values could not be properly interpreted.
//
SCARD_E_INVALID_VALUE = HRESULT($80100011);
//
// MessageId: SCARD_E_SYSTEM_CANCELLED
//
// MessageText:
//
// The action was cancelled by the system, presumably to log off or shut down.
//
SCARD_E_SYSTEM_CANCELLED = HRESULT($80100012);
//
// MessageId: SCARD_F_COMM_ERROR
//
// MessageText:
//
// An internal communications error has been detected.
//
SCARD_F_COMM_ERROR = HRESULT($80100013);
//
// MessageId: SCARD_F_UNKNOWN_ERROR
//
// MessageText:
//
// An internal error has been detected, but the source is unknown.
//
SCARD_F_UNKNOWN_ERROR = HRESULT($80100014);
//
// MessageId: SCARD_E_INVALID_ATR
//
// MessageText:
//
// An ATR obtained from the registry is not a valid ATR string.
//
SCARD_E_INVALID_ATR = HRESULT($80100015);
//
// MessageId: SCARD_E_NOT_TRANSACTED
//
// MessageText:
//
// An attempt was made to end a non-existent transaction.
//
SCARD_E_NOT_TRANSACTED = HRESULT($80100016);
//
// MessageId: SCARD_E_READER_UNAVAILABLE
//
// MessageText:
//
// The specified reader is not currently available for use.
//
SCARD_E_READER_UNAVAILABLE = HRESULT($80100017);
//
// MessageId: SCARD_P_SHUTDOWN
//
// MessageText:
//
// The operation has been aborted to allow the server application to exit.
//
SCARD_P_SHUTDOWN = HRESULT($80100018);
//
// MessageId: SCARD_E_PCI_TOO_SMALL
//
// MessageText:
//
// The PCI Receive buffer was too small.
//
SCARD_E_PCI_TOO_SMALL = HRESULT($80100019);
//
// MessageId: SCARD_E_READER_UNSUPPORTED
//
// MessageText:
//
// The reader driver does not meet minimal requirements for support.
//
SCARD_E_READER_UNSUPPORTED = HRESULT($8010001A);
//
// MessageId: SCARD_E_DUPLICATE_READER
//
// MessageText:
//
// The reader driver did not produce a unique reader name.
//
SCARD_E_DUPLICATE_READER = HRESULT($8010001B);
//
// MessageId: SCARD_E_CARD_UNSUPPORTED
//
// MessageText:
//
// The smart card does not meet minimal requirements for support.
//
SCARD_E_CARD_UNSUPPORTED = HRESULT($8010001C);
//
// MessageId: SCARD_E_NO_SERVICE
//
// MessageText:
//
// The Smart card resource manager is not running.
//
SCARD_E_NO_SERVICE = HRESULT($8010001D);
//
// MessageId: SCARD_E_SERVICE_STOPPED
//
// MessageText:
//
// The Smart card resource manager has shut down.
//
SCARD_E_SERVICE_STOPPED = HRESULT($8010001E);
//
// MessageId: SCARD_E_UNEXPECTED
//
// MessageText:
//
// An unexpected card error has occurred.
//
SCARD_E_UNEXPECTED = HRESULT($8010001F);
//
// MessageId: SCARD_E_ICC_INSTALLATION
//
// MessageText:
//
// No Primary Provider can be found for the smart card.
//
SCARD_E_ICC_INSTALLATION = HRESULT($80100020);
//
// MessageId: SCARD_E_ICC_CREATEORDER
//
// MessageText:
//
// The requested order of object creation is not supported.
//
SCARD_E_ICC_CREATEORDER = HRESULT($80100021);
//
// MessageId: SCARD_E_UNSUPPORTED_FEATURE
//
// MessageText:
//
// This smart card does not support the requested feature.
//
SCARD_E_UNSUPPORTED_FEATURE = HRESULT($80100022);
//
// MessageId: SCARD_E_DIR_NOT_FOUND
//
// MessageText:
//
// The identified directory does not exist in the smart card.
//
SCARD_E_DIR_NOT_FOUND = HRESULT($80100023);
//
// MessageId: SCARD_E_FILE_NOT_FOUND
//
// MessageText:
//
// The identified file does not exist in the smart card.
//
SCARD_E_FILE_NOT_FOUND = HRESULT($80100024);
//
// MessageId: SCARD_E_NO_DIR
//
// MessageText:
//
// The supplied path does not represent a smart card directory.
//
SCARD_E_NO_DIR = HRESULT($80100025);
//
// MessageId: SCARD_E_NO_FILE
//
// MessageText:
//
// The supplied path does not represent a smart card file.
//
SCARD_E_NO_FILE = HRESULT($80100026);
//
// MessageId: SCARD_E_NO_ACCESS
//
// MessageText:
//
// Access is denied to this file.
//
SCARD_E_NO_ACCESS = HRESULT($80100027);
//
// MessageId: SCARD_E_WRITE_TOO_MANY
//
// MessageText:
//
// An attempt was made to write more data than would fit in the target object.
//
SCARD_E_WRITE_TOO_MANY = HRESULT($80100028);
//
// MessageId: SCARD_E_BAD_SEEK
//
// MessageText:
//
// There was an error trying to set the smart card file object pointer.
//
SCARD_E_BAD_SEEK = HRESULT($80100029);
//
// MessageId: SCARD_E_INVALID_CHV
//
// MessageText:
//
// The supplied PIN is incorrect.
//
SCARD_E_INVALID_CHV = HRESULT($8010002A);
//
// MessageId: SCARD_E_UNKNOWN_RES_MNG
//
// MessageText:
//
// An unrecognized error code was returned from a layered component.
//
SCARD_E_UNKNOWN_RES_MNG = HRESULT($8010002B);
//
// MessageId: SCARD_E_NO_SUCH_CERTIFICATE
//
// MessageText:
//
// The requested certificate does not exist.
//
SCARD_E_NO_SUCH_CERTIFICATE = HRESULT($8010002C);
//
// MessageId: SCARD_E_CERTIFICATE_UNAVAILABLE
//
// MessageText:
//
// The requested certificate could not be obtained.
//
SCARD_E_CERTIFICATE_UNAVAILABLE = HRESULT($8010002D);
//
// MessageId: SCARD_E_NO_READERS_AVAILABLE
//
// MessageText:
//
// Cannot find a smart card reader.
//
SCARD_E_NO_READERS_AVAILABLE = HRESULT($8010002E);
//
// MessageId: SCARD_E_COMM_DATA_LOST
//
// MessageText:
//
// A communications error with the smart card has been detected. Retry the operation.
//
SCARD_E_COMM_DATA_LOST = HRESULT($8010002F);
//
// These are warning codes.
//
//
// MessageId: SCARD_W_UNSUPPORTED_CARD
//
// MessageText:
//
// The reader cannot communicate with the smart card, due to ATR configuration conflicts.
//
SCARD_W_UNSUPPORTED_CARD = HRESULT($80100065);
//
// MessageId: SCARD_W_UNRESPONSIVE_CARD
//
// MessageText:
//
// The smart card is not responding to a reset.
//
SCARD_W_UNRESPONSIVE_CARD = HRESULT($80100066);
//
// MessageId: SCARD_W_UNPOWERED_CARD
//
// MessageText:
//
// Power has been removed from the smart card, so that further communication is not possible.
//
SCARD_W_UNPOWERED_CARD = HRESULT($80100067);
//
// MessageId: SCARD_W_RESET_CARD
//
// MessageText:
//
// The smart card has been reset, so any shared state information is invalid.
//
SCARD_W_RESET_CARD = HRESULT($80100068);
//
// MessageId: SCARD_W_REMOVED_CARD
//
// MessageText:
//
// The smart card has been removed, so that further communication is not possible.
//
SCARD_W_REMOVED_CARD = HRESULT($80100069);
//
// MessageId: SCARD_W_SECURITY_VIOLATION
//
// MessageText:
//
// Access was denied because of a security violation.
//
SCARD_W_SECURITY_VIOLATION = HRESULT($8010006A);
//
// MessageId: SCARD_W_WRONG_CHV
//
// MessageText:
//
// The card cannot be accessed because the wrong PIN was presented.
//
SCARD_W_WRONG_CHV = HRESULT($8010006B);
//
// MessageId: SCARD_W_CHV_BLOCKED
//
// MessageText:
//
// The card cannot be accessed because the maximum number of PIN entry attempts has been reached.
//
SCARD_W_CHV_BLOCKED = HRESULT($8010006C);
//
// MessageId: SCARD_W_EOF
//
// MessageText:
//
// The end of the smart card file has been reached.
//
SCARD_W_EOF = HRESULT($8010006D);
//
// MessageId: SCARD_W_CANCELLED_BY_USER
//
// MessageText:
//
// The action was cancelled by the user.
//
SCARD_W_CANCELLED_BY_USER = HRESULT($8010006E);
// *****************
// FACILITY_COMPLUS
// *****************
//
// ===============================
// Facility COMPLUS Error Messages
// ===============================
//
//
// COMPLUS Admin errors
//
//
// MessageId: COMADMIN_E_OBJECTERRORS
//
// MessageText:
//
// Errors occurred accessing one or more objects - the ErrorInfo collection may have more detail
//
COMADMIN_E_OBJECTERRORS = HRESULT($80110401);
//
// MessageId: COMADMIN_E_OBJECTINVALID
//
// MessageText:
//
// One or more of the object's properties are missing or invalid
//
COMADMIN_E_OBJECTINVALID = HRESULT($80110402);
//
// MessageId: COMADMIN_E_KEYMISSING
//
// MessageText:
//
// The object was not found in the catalog
//
COMADMIN_E_KEYMISSING = HRESULT($80110403);
//
// MessageId: COMADMIN_E_ALREADYINSTALLED
//
// MessageText:
//
// The object is already registered
//
COMADMIN_E_ALREADYINSTALLED = HRESULT($80110404);
//
// MessageId: COMADMIN_E_APP_FILE_WRITEFAIL
//
// MessageText:
//
// Error occurred writing to the application file
//
COMADMIN_E_APP_FILE_WRITEFAIL = HRESULT($80110407);
//
// MessageId: COMADMIN_E_APP_FILE_READFAIL
//
// MessageText:
//
// Error occurred reading the application file
//
COMADMIN_E_APP_FILE_READFAIL = HRESULT($80110408);
//
// MessageId: COMADMIN_E_APP_FILE_VERSION
//
// MessageText:
//
// Invalid version number in application file
//
COMADMIN_E_APP_FILE_VERSION = HRESULT($80110409);
//
// MessageId: COMADMIN_E_BADPATH
//
// MessageText:
//
// The file path is invalid
//
COMADMIN_E_BADPATH = HRESULT($8011040A);
//
// MessageId: COMADMIN_E_APPLICATIONEXISTS
//
// MessageText:
//
// The application is already installed
//
COMADMIN_E_APPLICATIONEXISTS = HRESULT($8011040B);
//
// MessageId: COMADMIN_E_ROLEEXISTS
//
// MessageText:
//
// The role already exists
//
COMADMIN_E_ROLEEXISTS = HRESULT($8011040C);
//
// MessageId: COMADMIN_E_CANTCOPYFILE
//
// MessageText:
//
// An error occurred copying the file
//
COMADMIN_E_CANTCOPYFILE = HRESULT($8011040D);
//
// MessageId: COMADMIN_E_NOUSER
//
// MessageText:
//
// One or more users are not valid
//
COMADMIN_E_NOUSER = HRESULT($8011040F);
//
// MessageId: COMADMIN_E_INVALIDUSERIDS
//
// MessageText:
//
// One or more users in the application file are not valid
//
COMADMIN_E_INVALIDUSERIDS = HRESULT($80110410);
//
// MessageId: COMADMIN_E_NOREGISTRYCLSID
//
// MessageText:
//
// The component's CLSID is missing or corrupt
//
COMADMIN_E_NOREGISTRYCLSID = HRESULT($80110411);
//
// MessageId: COMADMIN_E_BADREGISTRYPROGID
//
// MessageText:
//
// The component's progID is missing or corrupt
//
COMADMIN_E_BADREGISTRYPROGID = HRESULT($80110412);
//
// MessageId: COMADMIN_E_AUTHENTICATIONLEVEL
//
// MessageText:
//
// Unable to set required authentication level for update request
//
COMADMIN_E_AUTHENTICATIONLEVEL = HRESULT($80110413);
//
// MessageId: COMADMIN_E_USERPASSWDNOTVALID
//
// MessageText:
//
// The identity or password set on the application is not valid
//
COMADMIN_E_USERPASSWDNOTVALID = HRESULT($80110414);
//
// MessageId: COMADMIN_E_CLSIDORIIDMISMATCH
//
// MessageText:
//
// Application file CLSIDs or IIDs do not match corresponding DLLs
//
COMADMIN_E_CLSIDORIIDMISMATCH = HRESULT($80110418);
//
// MessageId: COMADMIN_E_REMOTEINTERFACE
//
// MessageText:
//
// Interface information is either missing or changed
//
COMADMIN_E_REMOTEINTERFACE = HRESULT($80110419);
//
// MessageId: COMADMIN_E_DLLREGISTERSERVER
//
// MessageText:
//
// DllRegisterServer failed on component install
//
COMADMIN_E_DLLREGISTERSERVER = HRESULT($8011041A);
//
// MessageId: COMADMIN_E_NOSERVERSHARE
//
// MessageText:
//
// No server file share available
//
COMADMIN_E_NOSERVERSHARE = HRESULT($8011041B);
//
// MessageId: COMADMIN_E_DLLLOADFAILED
//
// MessageText:
//
// DLL could not be loaded
//
COMADMIN_E_DLLLOADFAILED = HRESULT($8011041D);
//
// MessageId: COMADMIN_E_BADREGISTRYLIBID
//
// MessageText:
//
// The registered TypeLib ID is not valid
//
COMADMIN_E_BADREGISTRYLIBID = HRESULT($8011041E);
//
// MessageId: COMADMIN_E_APPDIRNOTFOUND
//
// MessageText:
//
// Application install directory not found
//
COMADMIN_E_APPDIRNOTFOUND = HRESULT($8011041F);
//
// MessageId: COMADMIN_E_REGISTRARFAILED
//
// MessageText:
//
// Errors occurred while in the component registrar
//
COMADMIN_E_REGISTRARFAILED = HRESULT($80110423);
//
// MessageId: COMADMIN_E_COMPFILE_DOESNOTEXIST
//
// MessageText:
//
// The file does not exist
//
COMADMIN_E_COMPFILE_DOESNOTEXIST = HRESULT($80110424);
//
// MessageId: COMADMIN_E_COMPFILE_LOADDLLFAIL
//
// MessageText:
//
// The DLL could not be loaded
//
COMADMIN_E_COMPFILE_LOADDLLFAIL = HRESULT($80110425);
//
// MessageId: COMADMIN_E_COMPFILE_GETCLASSOBJ
//
// MessageText:
//
// GetClassObject failed in the DLL
//
COMADMIN_E_COMPFILE_GETCLASSOBJ = HRESULT($80110426);
//
// MessageId: COMADMIN_E_COMPFILE_CLASSNOTAVAIL
//
// MessageText:
//
// The DLL does not support the components listed in the TypeLib
//
COMADMIN_E_COMPFILE_CLASSNOTAVAIL = HRESULT($80110427);
//
// MessageId: COMADMIN_E_COMPFILE_BADTLB
//
// MessageText:
//
// The TypeLib could not be loaded
//
COMADMIN_E_COMPFILE_BADTLB = HRESULT($80110428);
//
// MessageId: COMADMIN_E_COMPFILE_NOTINSTALLABLE
//
// MessageText:
//
// The file does not contain components or component information
//
COMADMIN_E_COMPFILE_NOTINSTALLABLE = HRESULT($80110429);
//
// MessageId: COMADMIN_E_NOTCHANGEABLE
//
// MessageText:
//
// Changes to this object and its sub-objects have been disabled
//
COMADMIN_E_NOTCHANGEABLE = HRESULT($8011042A);
//
// MessageId: COMADMIN_E_NOTDELETEABLE
//
// MessageText:
//
// The delete function has been disabled for this object
//
COMADMIN_E_NOTDELETEABLE = HRESULT($8011042B);
//
// MessageId: COMADMIN_E_SESSION
//
// MessageText:
//
// The server catalog version is not supported
//
COMADMIN_E_SESSION = HRESULT($8011042C);
//
// MessageId: COMADMIN_E_COMP_MOVE_LOCKED
//
// MessageText:
//
// The component move was disallowed, because the source or destination application is either a system application or currently locked against changes
//
COMADMIN_E_COMP_MOVE_LOCKED = HRESULT($8011042D);
//
// MessageId: COMADMIN_E_COMP_MOVE_BAD_DEST
//
// MessageText:
//
// The component move failed because the destination application no longer exists
//
COMADMIN_E_COMP_MOVE_BAD_DEST = HRESULT($8011042E);
//
// MessageId: COMADMIN_E_REGISTERTLB
//
// MessageText:
//
// The system was unable to register the TypeLib
//
COMADMIN_E_REGISTERTLB = HRESULT($80110430);
//
// MessageId: COMADMIN_E_SYSTEMAPP
//
// MessageText:
//
// This operation can not be performed on the system application
//
COMADMIN_E_SYSTEMAPP = HRESULT($80110433);
//
// MessageId: COMADMIN_E_COMPFILE_NOREGISTRAR
//
// MessageText:
//
// The component registrar referenced in this file is not available
//
COMADMIN_E_COMPFILE_NOREGISTRAR = HRESULT($80110434);
//
// MessageId: COMADMIN_E_COREQCOMPINSTALLED
//
// MessageText:
//
// A component in the same DLL is already installed
//
COMADMIN_E_COREQCOMPINSTALLED = HRESULT($80110435);
//
// MessageId: COMADMIN_E_SERVICENOTINSTALLED
//
// MessageText:
//
// The service is not installed
//
COMADMIN_E_SERVICENOTINSTALLED = HRESULT($80110436);
//
// MessageId: COMADMIN_E_PROPERTYSAVEFAILED
//
// MessageText:
//
// One or more property settings are either invalid or in conflict with each other
//
COMADMIN_E_PROPERTYSAVEFAILED = HRESULT($80110437);
//
// MessageId: COMADMIN_E_OBJECTEXISTS
//
// MessageText:
//
// The object you are attempting to add or rename already exists
//
COMADMIN_E_OBJECTEXISTS = HRESULT($80110438);
//
// MessageId: COMADMIN_E_REGFILE_CORRUPT
//
// MessageText:
//
// The registration file is corrupt
//
COMADMIN_E_REGFILE_CORRUPT = HRESULT($8011043B);
//
// MessageId: COMADMIN_E_PROPERTY_OVERFLOW
//
// MessageText:
//
// The property value is too large
//
COMADMIN_E_PROPERTY_OVERFLOW = HRESULT($8011043C);
//
// MessageId: COMADMIN_E_NOTINREGISTRY
//
// MessageText:
//
// Object was not found in registry
//
COMADMIN_E_NOTINREGISTRY = HRESULT($8011043E);
//
// MessageId: COMADMIN_E_OBJECTNOTPOOLABLE
//
// MessageText:
//
// This object is not poolable
//
COMADMIN_E_OBJECTNOTPOOLABLE = HRESULT($8011043F);
//
// MessageId: COMADMIN_E_APPLID_MATCHES_CLSID
//
// MessageText:
//
// A CLSID with the same GUID as the new application ID is already installed on this machine
//
COMADMIN_E_APPLID_MATCHES_CLSID = HRESULT($80110446);
//
// MessageId: COMADMIN_E_ROLE_DOES_NOT_EXIST
//
// MessageText:
//
// A role assigned to a component, interface, or method did not exist in the application
//
COMADMIN_E_ROLE_DOES_NOT_EXIST = HRESULT($80110447);
//
// MessageId: COMADMIN_E_START_APP_NEEDS_COMPONENTS
//
// MessageText:
//
// You must have components in an application in order to start the application
//
COMADMIN_E_START_APP_NEEDS_COMPONENTS = HRESULT($80110448);
//
// MessageId: COMADMIN_E_REQUIRES_DIFFERENT_PLATFORM
//
// MessageText:
//
// This operation is not enabled on this platform
//
COMADMIN_E_REQUIRES_DIFFERENT_PLATFORM = HRESULT($80110449);
//
// MessageId: COMADMIN_E_CAN_NOT_EXPORT_APP_PROXY
//
// MessageText:
//
// Application Proxy is not exportable
//
COMADMIN_E_CAN_NOT_EXPORT_APP_PROXY = HRESULT($8011044A);
//
// MessageId: COMADMIN_E_CAN_NOT_START_APP
//
// MessageText:
//
// Failed to start application because it is either a library application or an application proxy
//
COMADMIN_E_CAN_NOT_START_APP = HRESULT($8011044B);
//
// MessageId: COMADMIN_E_CAN_NOT_EXPORT_SYS_APP
//
// MessageText:
//
// System application is not exportable
//
COMADMIN_E_CAN_NOT_EXPORT_SYS_APP = HRESULT($8011044C);
//
// MessageId: COMADMIN_E_CANT_SUBSCRIBE_TO_COMPONENT
//
// MessageText:
//
// Can not subscribe to this component (the component may have been imported)
//
COMADMIN_E_CANT_SUBSCRIBE_TO_COMPONENT = HRESULT($8011044D);
//
// MessageId: COMADMIN_E_OBJECT_PARENT_MISSING
//
// MessageText:
//
// One of the objects being inserted or updated does not belong to a valid parent collection
//
COMADMIN_E_OBJECT_PARENT_MISSING = HRESULT($80110808);
//
// MessageId: COMADMIN_E_OBJECT_DOES_NOT_EXIST
//
// MessageText:
//
// One of the specified objects cannot be found
//
COMADMIN_E_OBJECT_DOES_NOT_EXIST = HRESULT($80110809);
//
// COMPLUS Queued component errors
//
//
// MessageId: COMQC_E_APPLICATION_NOT_QUEUED
//
// MessageText:
//
// Only COM+ applications marked "queued" can be created using the "queue" moniker.
//
COMQC_E_APPLICATION_NOT_QUEUED = HRESULT($80110600);
//
// MessageId: COMQC_E_NO_QUEUEABLE_INTERFACES
//
// MessageText:
//
// At least one interface must be marked 'queued" in order to create a queued component instance with the "queue" moniker.
//
COMQC_E_NO_QUEUEABLE_INTERFACES = HRESULT($80110601);
//
// MessageId: COMQC_E_QUEUING_SERVICE_NOT_AVAILABLE
//
// MessageText:
//
// MSMQ, which is required for the requested operation, is not installed.
//
COMQC_E_QUEUING_SERVICE_NOT_AVAILABLE = HRESULT($80110602);
implementation
end.
|
//////////////////////////////
//
// Author: Kazoku
// Date: 04/11/2021
//
//////////////////////////////
begin
writeln('hello world');
end. |
unit uPostagensDAO;
interface
uses
FireDAC.Comp.Client, uConexao, System.SysUtils, System.StrUtils;
type
TPostagensDAO = class
private
FConexao : TConexao;
public
constructor Create;
function Exibir(): TFDQuery;
function Excluir(pId: Integer): Boolean;
function Alterar(pIdUsario, pId : Integer; pTituloPostagem, pPostagem : string): Boolean;
function Inserir (pIdUsario, pId : Integer; pTituloPostagem, pPostagem : string) : Boolean;
function CriarBanco(pBancoDados : string ): Boolean;
function ExecutaScript(): Boolean;
end;
implementation
{ TPostagensDAO }
function TPostagensDAO.Alterar(pIdUsario, pId : Integer; pTituloPostagem, pPostagem : string): Boolean;
const
SEL_POST = 'SELECT * FROM POSTS WHERE ID = %S';
UPD = 'UPDATE POSTS SET ID_USER = %S, TITULO_POSTAGEM = %S, POSTAGEM = %S WHERE ID = %S';
var
Qry, Qry2: TFDQuery;
begin
Result := False;
Qry := FConexao.CriaQuery();
Qry2 := FConexao.CriaQuery();
try
Qry.SQL.Add(Format(SEL_POST,[IntToStr(pId)]));
Qry.Open;
if Qry.RecordCount > 0 then
begin
Qry2.ExecSQL(Format(UPD,[
IntToStr(pIdUsario),
pTituloPostagem.QuotedString,
pPostagem.QuotedString,
IntToStr(pId)]));
Result := True;
end;
finally
Qry.Free;
Qry2.Free;
end;
end;
constructor TPostagensDAO.Create;
begin
FConexao := TConexao.GetInstancia;
end;
function TPostagensDAO.CriarBanco(pBancoDados: string): Boolean;
const
BANCO = 'CREATE DATABASE %S';
var
Qry: TFDQuery;
begin
Qry := FConexao.CriaQuery();
try
Qry.ExecSQL(Format(BANCO,[pBancoDados]));
Result := True;
finally
Qry.Free;
end;
end;
function TPostagensDAO.Excluir(pId: Integer): Boolean;
const
DEL = 'DELETE POSTS WHERE ID = %S';
var
Qry: TFDQuery;
begin
Qry := FConexao.CriaQuery();
try
Qry.ExecSQL(Format(DEL,[IntToStr(pId)]));
Result := True;
finally
Qry.Free;
end;
end;
function TPostagensDAO.ExecutaScript: Boolean;
const
SCRIPT = 'CREATE TABLE POSTS ( '+
' ID_USER INT, '+
' ID INT, '+
' TITULO_POSTAGEM VARCHAR(100), '+
' POSTAGEM VARCHAR(500) '+
' ) ';
var
Qry: TFDQuery;
begin
Qry := FConexao.CriaQuery();
try
Qry.ExecSQL(SCRIPT);
Result := True;
finally
Qry.Free;
end;
end;
function TPostagensDAO.Exibir: TFDQuery;
const
SELECT = 'SELECT ID_USER, ID, TITULO_POSTAGEM, POSTAGEM FROM POSTS ORDER BY ID_USER, ID';
var
Qry: TFDQuery;
begin
try
Qry := FConexao.CriaQuery();
Qry.SQL.Add(SELECT);
Qry.Open();
Result := Qry;
finally
//Qry.Free;
end;
end;
function TPostagensDAO.Inserir(pIdUsario, pId: Integer; pTituloPostagem, pPostagem: string): Boolean;
const
INSERT = 'INSERT INTO POSTS (ID_USER, ID, TITULO_POSTAGEM, POSTAGEM) VALUES (%S, %S, %S, %S)';
var
Qry: TFDQuery;
begin
try
Qry := FConexao.CriaQuery();
Qry.SQL.Add(Format(INSERT,[
IntToStr(pIdUsario),
IntToStr(pId),
pTituloPostagem.QuotedString,
pPostagem.QuotedString
]));
Qry.ExecSQL;
finally
Qry.Free;
end;
end;
end.
|
unit CommandSet.NVMe;
interface
uses
Windows, SysUtils,
OSFile.IoControl, CommandSet, BufferInterpreter, BufferInterpreter.NVMe,
Device.SlotSpeed, Getter.SlotSpeed;
type
TNVMeCommandSet = class abstract(TCommandSet)
public
function DataSetManagement(StartLBA, LBACount: Int64): Cardinal;
override;
function IsDataSetManagementSupported: Boolean; override;
function IsExternal: Boolean; override;
procedure Flush; override;
private
type
SCSI_COMMAND_DESCRIPTOR_BLOCK = record
SCSICommand: UCHAR;
MiscellaneousCDBInformation: UCHAR;
LogicalBlockAddress: Array[0..7] of UCHAR;
TransferParameterListAllocationLength: Array[0..3] of UCHAR;
MiscellaneousCDBInformation2: UCHAR;
Control: UCHAR;
end;
SCSI_PASS_THROUGH = record
Length: USHORT;
ScsiStatus: UCHAR;
PathId: UCHAR;
TargetId: UCHAR;
Lun: UCHAR;
CdbLength: UCHAR;
SenseInfoLength: UCHAR;
DataIn: UCHAR;
DataTransferLength: ULONG;
TimeOutValue: ULONG;
DataBufferOffset: ULONG_PTR;
SenseInfoOffset: ULONG;
CommandDescriptorBlock: SCSI_COMMAND_DESCRIPTOR_BLOCK;
end;
SCSI_24B_SENSE_BUFFER = record
ResponseCodeAndValidBit: UCHAR;
Obsolete: UCHAR;
SenseKeyILIEOMFilemark: UCHAR;
Information: Array[0..3] of UCHAR;
AdditionalSenseLengthMinusSeven: UCHAR;
CommandSpecificInformation: Array[0..3] of UCHAR;
AdditionalSenseCode: UCHAR;
AdditionalSenseCodeQualifier: UCHAR;
FieldReplaceableUnitCode: UCHAR;
SenseKeySpecific: Array[0..2] of UCHAR;
AdditionalSenseBytes: Array[0..5] of UCHAR;
end;
SCSI_WITH_BUFFER = record
Parameter: SCSI_PASS_THROUGH;
SenseBuffer: SCSI_24B_SENSE_BUFFER;
Buffer: TLargeBuffer;
end;
const
SCSI_IOCTL_DATA_OUT = 0;
SCSI_IOCTL_DATA_IN = 1;
SCSI_IOCTL_DATA_UNSPECIFIED = 2;
protected
procedure SetBufferAndReadCapacity;
function InterpretReadCapacityBuffer: TIdentifyDeviceResult;
function GetSlotSpeed: TSlotMaxCurrSpeed;
private
IoInnerBuffer: SCSI_WITH_BUFFER;
function GetCommonBuffer: SCSI_WITH_BUFFER;
function GetCommonCommandDescriptorBlock: SCSI_COMMAND_DESCRIPTOR_BLOCK;
procedure SetInnerBufferAsFlagsAndCdb(Flags: ULONG;
CommandDescriptorBlock: SCSI_COMMAND_DESCRIPTOR_BLOCK);
procedure SetInnerBufferToReadCapacity;
procedure SetUnmapHeader;
procedure SetUnmapLBA(StartLBA: Int64);
procedure SetUnmapLBACount(LBACount: Int64);
procedure SetInnerBufferToUnmap(const StartLBA, LBACount: Int64);
end;
implementation
{ TNVMeCommandSet }
function TNVMeCommandSet.GetCommonBuffer: SCSI_WITH_BUFFER;
const
SATTargetId = 1;
begin
FillChar(result, SizeOf(result), #0);
result.Parameter.Length :=
SizeOf(result.Parameter);
result.Parameter.TargetId := SATTargetId;
result.Parameter.CdbLength := SizeOf(result.Parameter.CommandDescriptorBlock);
result.Parameter.SenseInfoLength :=
SizeOf(result.SenseBuffer);
result.Parameter.DataTransferLength :=
SizeOf(result.Buffer);
result.Parameter.TimeOutValue := 2;
result.Parameter.DataBufferOffset :=
PAnsiChar(@result.Buffer) - PAnsiChar(@result);
result.Parameter.SenseInfoOffset :=
PAnsiChar(@result.SenseBuffer) - PAnsiChar(@result);
end;
function TNVMeCommandSet.GetSlotSpeed: TSlotMaxCurrSpeed;
{$IFNDEF SERVICE}
var
SlotSpeedGetter: TSlotSpeedGetter;
{$ENDIF}
begin
FillChar(result, SizeOf(result), #0);
{$IFNDEF SERVICE}
SlotSpeedGetter := TSlotSpeedGetter.Create(GetPathOfFileAccessing);
try
result := SlotSpeedGetter.GetSlotSpeed;
finally
FreeAndNil(SlotSpeedGetter);
end;
{$ENDIF}
end;
function TNVMeCommandSet.GetCommonCommandDescriptorBlock:
SCSI_COMMAND_DESCRIPTOR_BLOCK;
begin
FillChar(result, SizeOf(result), #0);
end;
procedure TNVMeCommandSet.SetInnerBufferAsFlagsAndCdb
(Flags: ULONG; CommandDescriptorBlock: SCSI_COMMAND_DESCRIPTOR_BLOCK);
begin
IoInnerBuffer := GetCommonBuffer;
IoInnerBuffer.Parameter.DataIn := Flags;
IoInnerBuffer.Parameter.CommandDescriptorBlock := CommandDescriptorBlock;
end;
procedure TNVMeCommandSet.SetUnmapHeader;
const
HeaderSize = 6;
ContentSize = 16;
begin
IoInnerBuffer.Buffer[1] := HeaderSize + ContentSize;
IoInnerBuffer.Buffer[3] := ContentSize;
end;
procedure TNVMeCommandSet.SetBufferAndReadCapacity;
begin
SetInnerBufferToReadCapacity;
IoControl(TIoControlCode.SCSIPassThrough,
BuildOSBufferBy<SCSI_WITH_BUFFER, SCSI_WITH_BUFFER>(IoInnerBuffer,
IoInnerBuffer));
end;
procedure TNVMeCommandSet.SetInnerBufferToReadCapacity;
const
ReadCapacityCommand = $9E;
AllocationLowBit = 3;
var
CommandDescriptorBlock: SCSI_COMMAND_DESCRIPTOR_BLOCK;
begin
CommandDescriptorBlock := GetCommonCommandDescriptorBlock;
CommandDescriptorBlock.SCSICommand := ReadCapacityCommand;
CommandDescriptorBlock.MiscellaneousCDBInformation := $10;
CommandDescriptorBlock.TransferParameterListAllocationLength[
AllocationLowBit - 1] := (SizeOf(IoInnerBuffer.Buffer) shr 8) and $FF;
CommandDescriptorBlock.TransferParameterListAllocationLength[
AllocationLowBit] := SizeOf(IoInnerBuffer.Buffer) and $FF;
SetInnerBufferAsFlagsAndCdb(SCSI_IOCTL_DATA_IN, CommandDescriptorBlock);
end;
function TNVMeCommandSet.InterpretReadCapacityBuffer:
TIdentifyDeviceResult;
var
SCSIBufferInterpreter: TNVMeBufferInterpreter;
begin
SCSIBufferInterpreter := TNVMeBufferInterpreter.Create;
result :=
SCSIBufferInterpreter.BufferToCapacityAndLBA(IoInnerBuffer.Buffer);
FreeAndNil(SCSIBufferInterpreter);
end;
function TNVMeCommandSet.IsDataSetManagementSupported: Boolean;
begin
exit(true);
end;
function TNVMeCommandSet.IsExternal: Boolean;
begin
result := false;
end;
procedure TNVMeCommandSet.SetUnmapLBA(StartLBA: Int64);
const
StartLBAHi = 10;
begin
IoInnerBuffer.Buffer[StartLBAHi + 5] := StartLBA and 255;
StartLBA := StartLBA shr 8;
IoInnerBuffer.Buffer[StartLBAHi + 4] := StartLBA and 255;
StartLBA := StartLBA shr 8;
IoInnerBuffer.Buffer[StartLBAHi + 3] := StartLBA and 255;
StartLBA := StartLBA shr 8;
IoInnerBuffer.Buffer[StartLBAHi + 2] := StartLBA and 255;
StartLBA := StartLBA shr 8;
IoInnerBuffer.Buffer[StartLBAHi + 1] := StartLBA and 255;
StartLBA := StartLBA shr 8;
IoInnerBuffer.Buffer[StartLBAHi] := StartLBA;
end;
procedure TNVMeCommandSet.SetUnmapLBACount(LBACount: Int64);
const
LBACountHi = 16;
begin
IoInnerBuffer.Buffer[LBACountHi + 3] := LBACount and 255;
LBACount := LBACount shr 8;
IoInnerBuffer.Buffer[LBACountHi + 2] := LBACount and 255;
LBACount := LBACount shr 8;
IoInnerBuffer.Buffer[LBACountHi + 1] := LBACount and 255;
LBACount := LBACount shr 8;
IoInnerBuffer.Buffer[LBACountHi] := LBACount shr 8;
end;
procedure TNVMeCommandSet.SetInnerBufferToUnmap(const StartLBA, LBACount:
Int64);
var
CommandDescriptorBlock: SCSI_COMMAND_DESCRIPTOR_BLOCK;
const
UnmapCommand = $42;
begin
CommandDescriptorBlock := GetCommonCommandDescriptorBlock;
CommandDescriptorBlock.SCSICommand := UnmapCommand;
CommandDescriptorBlock.LogicalBlockAddress[6] := 24;
SetInnerBufferAsFlagsAndCdb(SCSI_IOCTL_DATA_OUT, CommandDescriptorBlock);
SetUnmapHeader;
SetUnmapLBA(StartLBA);
SetUnmapLBACount(LBACount);
end;
function TNVMeCommandSet.DataSetManagement(StartLBA, LBACount: Int64):
Cardinal;
begin
SetInnerBufferToUnmap(StartLBA, LBACount);
result := ExceptionFreeIoControl(TIoControlCode.SCSIPassThrough,
BuildOSBufferBy<SCSI_WITH_BUFFER, SCSI_WITH_BUFFER>(IoInnerBuffer,
IoInnerBuffer));
end;
procedure TNVMeCommandSet.Flush;
const
FlushCommand = $91;
var
CommandDescriptorBlock: SCSI_COMMAND_DESCRIPTOR_BLOCK;
begin
CommandDescriptorBlock := GetCommonCommandDescriptorBlock;
CommandDescriptorBlock.SCSICommand := FlushCommand;
SetInnerBufferAsFlagsAndCdb(SCSI_IOCTL_DATA_UNSPECIFIED,
CommandDescriptorBlock);
IoControl(TIoControlCode.SCSIPassThrough,
BuildOSBufferBy<SCSI_WITH_BUFFER, SCSI_WITH_BUFFER>(IoInnerBuffer,
IoInnerBuffer));
end;
end.
|
unit uUtils;
{$I ..\Include\IntXLib.inc}
interface
uses
uIntXLibTypes;
type
/// <summary>
/// Custom class that contains various helper functions.
/// </summary>
TUtils = class sealed(TObject)
public
/// <summary>
/// Calculates Arithmetic shift right.
/// </summary>
/// <param name="value">Integer value to compute 'Asr' on.</param>
/// <param name="ShiftBits"> number of bits to shift value to.</param>
/// <returns>Shifted value.</returns>
/// <seealso href="http://stackoverflow.com/questions/21940986/">[Delphi ASR Implementation for Integer]</seealso>
class function Asr32(value: Integer; ShiftBits: Integer): Integer; overload;
static; inline;
/// <summary>
/// Calculates Arithmetic shift right.
/// </summary>
/// <param name="value">Int64 value to compute 'Asr' on.</param>
/// <param name="ShiftBits"> number of bits to shift value to.</param>
/// <returns>Shifted value.</returns>
/// <seealso href="http://github.com/Spelt/ZXing.Delphi/blob/master/Lib/Classes/Common/MathUtils.pas">[Delphi ASR Implementation for Int64]</seealso>
class function Asr64(value: Int64; ShiftBits: Integer): Int64; overload;
static; inline;
// Lifted from DaThoX Free Pascal generics library with little modifications.
class procedure QuickSort(var AValues: TIntXLibCharArray;
ALeft, ARight: Integer); static;
end;
implementation
class function TUtils.Asr32(value: Integer; ShiftBits: Integer): Integer;
begin
Result := value shr ShiftBits;
if (value and $80000000) > 0 then
// if you don't want to cast ($FFFFFFFF) to an Integer, simply replace it with
// (-1) to avoid range check error.
Result := Result or (Integer($FFFFFFFF) shl (32 - ShiftBits));
end;
class function TUtils.Asr64(value: Int64; ShiftBits: Integer): Int64;
begin
Result := value shr ShiftBits;
if (value and $8000000000000000) > 0 then
Result := Result or ($FFFFFFFFFFFFFFFF shl (64 - ShiftBits));
end;
class procedure TUtils.QuickSort(var AValues: TIntXLibCharArray;
ALeft, ARight: Integer);
var
I, J: Integer;
P, Q: Char;
begin
if ((ARight - ALeft) <= 0) or (Length(AValues) = 0) then
Exit;
repeat
I := ALeft;
J := ARight;
P := AValues[ALeft + (ARight - ALeft) shr 1];
repeat
while AValues[I] < P do
Inc(I);
while AValues[J] > P do
Dec(J);
if I <= J then
begin
if I <> J then
begin
Q := AValues[I];
AValues[I] := AValues[J];
AValues[J] := Q;
end;
Inc(I);
Dec(J);
end;
until I > J;
// sort the smaller range recursively
// sort the bigger range via the loop
// Reasons: memory usage is O(log(n)) instead of O(n) and loop is faster than recursion
if J - ALeft < ARight - I then
begin
if ALeft < J then
QuickSort(AValues, ALeft, J);
ALeft := I;
end
else
begin
if I < ARight then
QuickSort(AValues, I, ARight);
ARight := J;
end;
until ALeft >= ARight;
end;
end.
|
unit Demo.Forms.Serialization.Records;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls,
Demo.Forms.Serialization.Base;
type
TfrmSerializationRecords = class(TfrmSerializationBase)
btnSerSimpleMRecord: TButton;
btnDesSimpleMRecord: TButton;
btnSerSimpleRecord: TButton;
btnDesSimpleRecord: TButton;
procedure btnSerSimpleRecordClick(Sender: TObject);
procedure btnDesSimpleRecordClick(Sender: TObject);
procedure btnSerSimpleMRecordClick(Sender: TObject);
private
procedure SerializeSimple<T>(AValue: T);
procedure DeserializeSimple<T>(AValue: T);
public
{ Public declarations }
end;
var
frmSerializationRecords: TfrmSerializationRecords;
implementation
uses
System.Rtti,
Demo.Neon.Entities;
{$R *.dfm}
procedure TfrmSerializationRecords.btnDesSimpleRecordClick(Sender: TObject);
var
LRecord: TMyRecord;
begin
DeserializeSimple<TMyRecord>(LRecord);
end;
procedure TfrmSerializationRecords.btnSerSimpleMRecordClick(Sender: TObject);
var
LVal: TManagedRecord;
begin
LVal.Name := 'Paolo';
LVal.Age := 50;
LVal.Height := 1.70;
SerializeSimple<TManagedRecord>(LVal);
end;
procedure TfrmSerializationRecords.btnSerSimpleRecordClick(Sender: TObject);
var
LVal: TMyRecord;
begin
LVal.Speed := TEnumSpeed.Low;
LVal.One := 'Test Test Test';
LVal.Two := 42;
SerializeSimple<TMyRecord>(LVal);
end;
procedure TfrmSerializationRecords.DeserializeSimple<T>(AValue: T);
var
LVal: T;
begin
LVal := DeserializeValueTo<T>(AValue,
memoSerialize.Lines, frmConfiguration.BuildSerializerConfig);
SerializeValueFrom<T>(
TValue.From<T>(LVal), memoDeserialize.Lines, frmConfiguration.BuildSerializerConfig);
end;
procedure TfrmSerializationRecords.SerializeSimple<T>(AValue: T);
begin
SerializeValueFrom<T>(
TValue.From<T>(AValue), memoSerialize.Lines, frmConfiguration.BuildSerializerConfig);
end;
end.
|
{**********************************************}
{ TCCIFunction (Commodity Chanel Index) }
{ Copyright (c) 2002-2004 by David Berneda }
{**********************************************}
unit TeeCCIFunction;
{$I TeeDefs.inc}
interface
uses
{$IFNDEF LINUX}
Windows, Messages,
{$ENDIF}
SysUtils, Classes,
{$IFDEF CLX}
QGraphics, QControls, QForms, QDialogs, QStdCtrls, QComCtrls,
{$ELSE}
Graphics, Controls, Forms, Dialogs, StdCtrls, ComCtrls,
{$ENDIF}
OHLChart, TeEngine, TeCanvas, Chart, TeeBaseFuncEdit, StatChar;
type
TCCIFunction=class(TTeeFunction)
private
FAveSeries : TChartSeries;
FConstant : Double;
FMovAve : TMovingAverageFunction;
FTypical : TChartSeries;
function IsConstStored: Boolean;
procedure SetConstant(const Value: Double);
protected
class Function GetEditorClass:String; override;
Function IsValidSource(Value:TChartSeries):Boolean; override;
public
Constructor Create(AOwner:TComponent); override;
Destructor Destroy; override;
procedure AddPoints(Source:TChartSeries); override;
published
property Constant:Double read FConstant write SetConstant stored IsConstStored;
end;
TCCIFuncEditor = class(TBaseFunctionEditor)
Label1: TLabel;
EConst: TEdit;
Label2: TLabel;
EPeriod: TEdit;
UDPeriod: TUpDown;
procedure EConstChange(Sender: TObject);
procedure EPeriodChange(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
protected
procedure ApplyFormChanges; override;
Procedure SetFunction; override;
public
{ Public declarations }
end;
implementation
{$IFNDEF CLX}
{$R *.DFM}
{$ELSE}
{$R *.xfm}
{$ENDIF}
uses TeeProCo, TeeProcs, TeeConst;
{ TCCIFunction }
constructor TCCIFunction.Create(AOwner: TComponent);
begin
inherited;
InternalSetPeriod(20);
CanUsePeriod:=False;
SingleSource:=True;
HideSourceList:=True;
FTypical:=TChartSeries.Create(nil);
FMovAve:=TMovingAverageFunction.Create(nil);
FAveSeries:=TChartSeries.Create(nil);
FAveSeries.SetFunction(FMovAve);
end;
Destructor TCCIFunction.Destroy;
begin
FAveSeries.Free;
FTypical.Free;
inherited;
end;
procedure TCCIFunction.AddPoints(Source: TChartSeries);
var tmpPeriod : Integer;
Function MeanDeviation(Index:Integer):Double;
var tmpTotal : Double;
t : Integer;
begin
tmpTotal:=0;
for t:=Index downto Index-tmpPeriod do
tmpTotal:=tmpTotal+Abs(FAveSeries.MandatoryValueList.Value[Index-tmpPeriod]-
FTypical.MandatoryValueList[t]);
result:=tmpTotal/tmpPeriod;
end;
Procedure CalculateMovAve;
const Third=1/3.0;
var t : Integer;
begin
FTypical.Clear;
FMovAve.Period:=tmpPeriod;
FTypical.BeginUpdate;
for t:=0 to Source.Count-1 do
with TOHLCSeries(Source) do
FTypical.Add( (HighValues.Value[t]+
LowValues.Value[t]+
CloseValues.Value[t]
)*Third
);
FTypical.EndUpdate;
// This code should be replaced with FAveSeries.DataSource:=FTypical...
for t:=tmpPeriod to FTypical.Count-1 do
FAveSeries.Add(FMovAve.Calculate(FTypical,t-tmpPeriod,t));
end;
var t : Integer;
tmp : Double;
tmpConstant : Double;
begin
ParentSeries.Clear;
tmpPeriod:=Round(Period);
if tmpPeriod>0 then
begin
CalculateMovAve;
tmpConstant:=Constant;
if tmpConstant=0 then tmpConstant:=1;
for t:=tmpPeriod to Source.Count-1 do
begin
tmp:=(
FTypical.MandatoryValueList.Value[t]-
FAveSeries.MandatoryValueList.Value[t]
) /
( tmpConstant*MeanDeviation(t) );
ParentSeries.AddXY(Source.NotMandatoryValueList.Value[t],tmp);
end;
end;
end;
class function TCCIFunction.GetEditorClass: String;
begin
result:='TCCIFuncEditor';
end;
function TCCIFunction.IsValidSource(Value: TChartSeries): Boolean;
begin
result:=Value is TOHLCSeries;
end;
function TCCIFunction.IsConstStored: Boolean;
begin
result:=FConstant<>0.015;
end;
procedure TCCIFunction.SetConstant(const Value: Double);
begin
if FConstant<>Value then
begin
FConstant := Value;
Recalculate;
end;
end;
{ TCCIFuncEditor }
procedure TCCIFuncEditor.ApplyFormChanges;
begin
inherited;
with TCCIFunction(IFunction) do
begin
Constant:=StrToFloatDef(EConst.Text,Constant);
Period:=UDPeriod.Position;
end;
end;
procedure TCCIFuncEditor.SetFunction;
begin
inherited;
with TCCIFunction(IFunction) do
begin
EConst.Text:=FloatToStr(Constant);
UDPeriod.Position:=Round(Period);
end;
end;
procedure TCCIFuncEditor.EConstChange(Sender: TObject);
begin
EnableApply;
end;
procedure TCCIFuncEditor.EPeriodChange(Sender: TObject);
begin
EnableApply;
end;
procedure TCCIFuncEditor.FormCreate(Sender: TObject);
begin
inherited;
EConst.Text:=FloatToStr(0.015); // due to locale settings...
end;
initialization
RegisterClass(TCCIFuncEditor);
RegisterTeeFunction( TCCIFunction,
{$IFNDEF CLR}@{$ENDIF}TeeMsg_FunctionCCI,
{$IFNDEF CLR}@{$ENDIF}TeeMsg_GalleryFinancial );
finalization
UnRegisterTeeFunctions([ TCCIFunction ]);
end.
|
unit TestUsesFindReplace;
{(*}
(*------------------------------------------------------------------------------
Delphi Code formatter source code
The Original Code is TestUsesFindReplace, released October 2003.
The Initial Developer of the Original Code is Anthony Steele.
Portions created by Anthony Steele are Copyright (C) 1999-2003 Anthony Steele.
All Rights Reserved.
Contributor(s): Anthony Steele.
The contents of this file are subject to the Mozilla Public License Version 1.1
(the "License"). you may not use this file except in compliance with the License.
You may obtain a copy of the License at http://www.mozilla.org/NPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied.
See the License for the specific language governing rights and limitations
under the License.
Alternatively, the contents of this file may be used under the terms of
the GNU General Public License Version 2 or later (the "GPL")
See http://www.gnu.org/licenses/gpl.html
------------------------------------------------------------------------------*)
{*)}
{$I JcfGlobal.inc}
interface
{
AFS 4 Oct 2003
test the use clause add, remove and replace processes }
uses BaseTestProcess;
type
TTestUsesFindReplace = class(TBaseTestProcess)
private
public
procedure SetUp; override;
procedure TearDown; override;
published
procedure TestAdd1;
procedure TestAdd2;
procedure TestCreateIntfUses;
procedure TestCreateImplUses;
procedure TestAdd4;
procedure TestAddInterface;
procedure TestAddBoth;
procedure TestAddBoth2;
procedure TestRemove1;
procedure TestRemove2;
procedure TestRemove3;
procedure TestRemove4;
procedure TestReplace1;
procedure TestReplace2;
procedure TestReplace3;
procedure TestReplace4;
procedure TestReplace5;
procedure TestReplace6;
procedure TestReplace7;
procedure TestReplace8;
end;
implementation
uses
{ DUnit }
TestFrameWork,
{ local }
JcfStringutils,
JcfSettings,
UsesClauseInsert, UsesClauseRemove, UsesClauseFindReplace;
procedure TTestUsesFindReplace.Setup;
begin
inherited;
JcfFormatSettings.UsesClause.InsertInterfaceEnabled := True;
JcfFormatSettings.UsesClause.InsertImplementationEnabled := True;
JcfFormatSettings.UsesClause.RemoveEnabled := True;
JcfFormatSettings.UsesClause.InsertInterface.Clear;
JcfFormatSettings.UsesClause.InsertImplementation.Clear;
JcfFormatSettings.UsesClause.InsertImplementation.Add('foo');
JcfFormatSettings.UsesClause.Remove.Clear;
JcfFormatSettings.UsesClause.Remove.Add('foo');
JcfFormatSettings.UsesClause.Find.Clear;
JcfFormatSettings.UsesClause.Replace.Clear;
JcfFormatSettings.UsesClause.Find.Add('foo');
JcfFormatSettings.UsesClause.Replace.Add('foo2');
end;
procedure TTestUsesFindReplace.TearDown;
begin
inherited;
JcfFormatSettings.UsesClause.InsertImplementation.Clear;
JcfFormatSettings.UsesClause.InsertInterface.Clear;
JcfFormatSettings.UsesClause.Remove.Clear;
JcfFormatSettings.UsesClause.InsertInterfaceEnabled := False;
JcfFormatSettings.UsesClause.InsertImplementationEnabled := False;
JcfFormatSettings.UsesClause.RemoveEnabled := False;
JcfFormatSettings.UsesClause.Find.Clear;
JcfFormatSettings.UsesClause.Replace.Clear;
end;
procedure TTestUsesFindReplace.TestAdd1;
const
IN_UNIT_TEXT = UNIT_HEADER + ' uses bar;' + UNIT_FOOTER;
OUT_UNIT_TEXT = UNIT_HEADER + ' uses bar,foo;' + UNIT_FOOTER;
begin
TestProcessResult(TUsesClauseInsert, IN_UNIT_TEXT, OUT_UNIT_TEXT);
end;
procedure TTestUsesFindReplace.TestAdd2;
const
IN_UNIT_TEXT = UNIT_HEADER + ' uses bar, fish;' + UNIT_FOOTER;
OUT_UNIT_TEXT = UNIT_HEADER + ' uses bar, fish,foo;' + UNIT_FOOTER;
begin
TestProcessResult(TUsesClauseInsert, IN_UNIT_TEXT, OUT_UNIT_TEXT);
end;
procedure TTestUsesFindReplace.TestCreateIntfUses;
const
IN_UNIT_TEXT = 'unit Test;' + NativeLineBreak +
'interface' + NativeLineBreak + 'implementation' + UNIT_FOOTER;
OUT_UNIT_TEXT = 'unit Test;' + NativeLineBreak +
'interface uses foo;' + NativeLineBreak + 'implementation' + UNIT_FOOTER;
begin
JcfFormatSettings.UsesClause.InsertInterface.Clear;
JcfFormatSettings.UsesClause.InsertInterface.Add('foo');
JcfFormatSettings.UsesClause.InsertImplementation.Clear;
TestProcessResult(TUsesClauseInsert, IN_UNIT_TEXT, OUT_UNIT_TEXT);
end;
procedure TTestUsesFindReplace.TestCreateImplUses;
const
IN_UNIT_TEXT = INTERFACE_HEADER + 'implementation' + UNIT_FOOTER;
OUT_UNIT_TEXT = INTERFACE_HEADER + 'implementation uses foo;' + UNIT_FOOTER;
begin
TestProcessResult(TUsesClauseInsert, IN_UNIT_TEXT, OUT_UNIT_TEXT);
end;
procedure TTestUsesFindReplace.TestAdd4;
const
IN_UNIT_TEXT = UNIT_HEADER + ' uses bar;' + UNIT_FOOTER;
OUT_UNIT_TEXT = UNIT_HEADER + ' uses bar,foo,t1,t2,t3;' + UNIT_FOOTER;
begin
JcfFormatSettings.UsesClause.InsertImplementation.Add('t1');
JcfFormatSettings.UsesClause.InsertImplementation.Add('t2');
JcfFormatSettings.UsesClause.InsertImplementation.Add('t3');
TestProcessResult(TUsesClauseInsert, IN_UNIT_TEXT, OUT_UNIT_TEXT);
end;
procedure TTestUsesFindReplace.TestAddInterface;
const
IN_UNIT_TEXT = INTERFACE_HEADER + 'uses Bar;' +
'implementation' + NativeLineBreak + UNIT_FOOTER;
OUT_UNIT_TEXT = INTERFACE_HEADER + 'uses Bar,IntfFoo;' +
'implementation' + NativeLineBreak + UNIT_FOOTER;
begin
JcfFormatSettings.UsesClause.InsertInterface.Add('IntfFoo');
JcfFormatSettings.UsesClause.InsertImplementation.Clear;
TestProcessResult(TUsesClauseInsert, IN_UNIT_TEXT, OUT_UNIT_TEXT);
end;
procedure TTestUsesFindReplace.TestAddBoth;
const
IN_UNIT_TEXT = INTERFACE_HEADER + 'uses Bar;' +
'implementation' + NativeLineBreak + UNIT_FOOTER;
OUT_UNIT_TEXT = INTERFACE_HEADER + 'uses Bar,IntfFoo;' +
'implementation uses foo;' + NativeLineBreak + UNIT_FOOTER;
begin
JcfFormatSettings.UsesClause.InsertInterface.Add('IntfFoo');
// impl keeps the 'foo' item
TestProcessResult(TUsesClauseInsert, IN_UNIT_TEXT, OUT_UNIT_TEXT);
end;
procedure TTestUsesFindReplace.TestAddBoth2;
const
IN_UNIT_TEXT = INTERFACE_HEADER +
'implementation uses Bar;' + NativeLineBreak + UNIT_FOOTER;
OUT_UNIT_TEXT = 'unit Test;' + NativeLineBreak +
'interface uses IntfFoo;' + NativeLineBreak +
'implementation uses Bar,foo;' + NativeLineBreak + UNIT_FOOTER;
begin
JcfFormatSettings.UsesClause.InsertInterface.Add('IntfFoo');
// impl keeps the 'foo' item
TestProcessResult(TUsesClauseInsert, IN_UNIT_TEXT, OUT_UNIT_TEXT);
end;
procedure TTestUsesFindReplace.TestRemove1;
const
IN_UNIT_TEXT = UNIT_HEADER + ' uses foo, bar;' + UNIT_FOOTER;
OUT_UNIT_TEXT = UNIT_HEADER + ' uses bar;' + UNIT_FOOTER;
begin
TestProcessResult(TUsesClauseRemove, IN_UNIT_TEXT, OUT_UNIT_TEXT);
end;
procedure TTestUsesFindReplace.TestRemove2;
const
IN_UNIT_TEXT = UNIT_HEADER + ' uses bar, foo;' + UNIT_FOOTER;
OUT_UNIT_TEXT = UNIT_HEADER + ' uses bar ;' + UNIT_FOOTER;
begin
TestProcessResult(TUsesClauseRemove, IN_UNIT_TEXT, OUT_UNIT_TEXT);
end;
procedure TTestUsesFindReplace.TestRemove3;
const
IN_UNIT_TEXT = UNIT_HEADER + ' uses bar, foo, fish;' + UNIT_FOOTER;
OUT_UNIT_TEXT = UNIT_HEADER + ' uses bar, fish;' + UNIT_FOOTER;
begin
TestProcessResult(TUsesClauseRemove, IN_UNIT_TEXT, OUT_UNIT_TEXT);
end;
procedure TTestUsesFindReplace.TestRemove4;
const
IN_UNIT_TEXT = UNIT_HEADER + ' uses foo;' + UNIT_FOOTER;
OUT_UNIT_TEXT = UNIT_HEADER + ' ' + UNIT_FOOTER;
begin
TestProcessResult(TUsesClauseRemove, IN_UNIT_TEXT, OUT_UNIT_TEXT);
end;
procedure TTestUsesFindReplace.TestReplace1;
const
IN_UNIT_TEXT = UNIT_HEADER + ' uses foo;' + UNIT_FOOTER;
OUT_UNIT_TEXT = UNIT_HEADER + ' uses foo2;' + UNIT_FOOTER;
begin
TestProcessResult(TUsesClauseFindReplace, IN_UNIT_TEXT, OUT_UNIT_TEXT);
end;
procedure TTestUsesFindReplace.TestReplace2;
const
IN_UNIT_TEXT = UNIT_HEADER + ' uses foo, bar;' + UNIT_FOOTER;
OUT_UNIT_TEXT = UNIT_HEADER + ' uses foo2, bar;' + UNIT_FOOTER;
begin
TestProcessResult(TUsesClauseFindReplace, IN_UNIT_TEXT, OUT_UNIT_TEXT);
end;
procedure TTestUsesFindReplace.TestReplace3;
const
IN_UNIT_TEXT = UNIT_HEADER + ' uses bar, foo;' + UNIT_FOOTER;
OUT_UNIT_TEXT = UNIT_HEADER + ' uses bar, foo2;' + UNIT_FOOTER;
begin
TestProcessResult(TUsesClauseFindReplace, IN_UNIT_TEXT, OUT_UNIT_TEXT);
end;
procedure TTestUsesFindReplace.TestReplace4;
const
IN_UNIT_TEXT = UNIT_HEADER + ' uses foo, bar;' + UNIT_FOOTER;
OUT_UNIT_TEXT = UNIT_HEADER + ' uses foo2 ;' + UNIT_FOOTER;
begin
JcfFormatSettings.UsesClause.Find.Add('bar');
TestProcessResult(TUsesClauseFindReplace, IN_UNIT_TEXT, OUT_UNIT_TEXT);
end;
procedure TTestUsesFindReplace.TestReplace5;
const
IN_UNIT_TEXT = INTERFACE_HEADER + 'uses foo, Fish;' + NativeLineBreak +
'implementation' + NativeLineBreak +
'uses bar, spon;' + UNIT_FOOTER;
OUT_UNIT_TEXT = INTERFACE_HEADER + 'uses foo2, Fish;' + NativeLineBreak +
'implementation' + NativeLineBreak +
'uses spon;' + UNIT_FOOTER;
begin
JcfFormatSettings.UsesClause.Find.Add('bar');
TestProcessResult(TUsesClauseFindReplace, IN_UNIT_TEXT, OUT_UNIT_TEXT);
end;
procedure TTestUsesFindReplace.TestReplace6;
const
IN_UNIT_TEXT = INTERFACE_HEADER + 'uses foo, Fish;' + NativeLineBreak +
'implementation' + NativeLineBreak +
'uses spon, bar;' + UNIT_FOOTER;
OUT_UNIT_TEXT = INTERFACE_HEADER + 'uses foo2, Fish;' + NativeLineBreak +
'implementation' + NativeLineBreak +
'uses spon ;' + UNIT_FOOTER;
begin
JcfFormatSettings.UsesClause.Find.Add('bar');
TestProcessResult(TUsesClauseFindReplace, IN_UNIT_TEXT, OUT_UNIT_TEXT);
end;
procedure TTestUsesFindReplace.TestReplace7;
const
IN_UNIT_TEXT = INTERFACE_HEADER + 'uses foo, Fish;' + NativeLineBreak +
'implementation' + NativeLineBreak +
'uses bar;' + UNIT_FOOTER;
OUT_UNIT_TEXT = INTERFACE_HEADER + 'uses foo2, Fish;' + NativeLineBreak +
'implementation' + NativeLineBreak + ' ' +
UNIT_FOOTER;
begin
JcfFormatSettings.UsesClause.Find.Add('bar');
TestProcessResult(TUsesClauseFindReplace, IN_UNIT_TEXT, OUT_UNIT_TEXT);
end;
procedure TTestUsesFindReplace.TestReplace8;
const
IN_UNIT_TEXT = INTERFACE_HEADER + 'uses foo, bar;' + NativeLineBreak +
'implementation' + NativeLineBreak +
'uses Fish;' + UNIT_FOOTER;
OUT_UNIT_TEXT = INTERFACE_HEADER + 'uses foo2 ;' + NativeLineBreak +
'implementation' + NativeLineBreak +
'uses Fish;' + UNIT_FOOTER;
begin
JcfFormatSettings.UsesClause.Find.Add('bar');
TestProcessResult(TUsesClauseFindReplace, IN_UNIT_TEXT, OUT_UNIT_TEXT);
end;
initialization
TestFramework.RegisterTest('Processes', TTestUsesFindReplace.Suite);
end.
|
unit Watcher;
{$I define.inc}
interface
uses Plus, Windows, xBase, Classes {$IFDEF ReadDirectoryChanges}, RadDW_NT {$ENDIF};
type
TDirectoryWatcher = class(T_Thread)
hDirectoryWatcherEvent: THandle;
{$IFDEF ReadDirectoryChanges}
FileFlagsWatcher: TRadiusNTDirWatch;
{$ENDIF}
hOutboundWatcher,
hHomeDirWatcher: THandle;
hFileFlagsWatcher: THandle;
hNodelistsWatcher: PWOHandleArray;
fSize: integer;
fTime: TFileTime;
Busy: boolean;
// hOutboundReader: THandle;
// hOutboundEvent: THandle;
constructor Create;
destructor Destroy; override;
procedure FillArray;
procedure CheckLists;
procedure InvokeExec; override;
procedure InvokeDone; override;
class function ThreadName: string; override;
public
property OutBoundWatcher: THandle read hOutboundWatcher;
{$IFDEF ReadDirectoryChanges}
procedure OnFileFlagsWatcherNotify(Sender :TObject; Action :Integer; const FileName :string);
{$ENDIF}
end;
TWatcherType = (
wtOutbound,
wtFileFlags,
wtHomeDir,
wtStopEvent
// wtOutReader
);
var
DirectoryWatcher: TDirectoryWatcher;
IgnoreNextEvent: boolean;
IgnoreNextAlert: boolean;
procedure StartWatcher;
procedure StopWatcher;
function GetBuildDateStr(const fn: string): string;
implementation
uses Forms, SysUtils, Recs, RadIni, MlrThr, Wizard, NdlUtil;
{$IFDEF ReadDirectoryChanges}
procedure TDirectoryWatcher.OnFileFlagsWatcherNotify(Sender :TObject; Action :Integer; const FileName :string);
var
P: TStringHolder;
begin
case Action of
FILE_ACTION_ADDED,
FILE_ACTION_MODIFIED,
FILE_ACTION_RENAMED_NEW_NAME:
begin
if (not Terminated) and (Application <> nil) and (Application.MainForm <> nil) then
begin
P := TStringHolder.Create;
P.S := StrAsg(MakeFullDir(IniFile.FlagsDir, filename));
PostMessage(Application.MainForm.Handle, WM_CHECKFILEFLAGS, Integer(P), 0);
end;
end;
else;
end;{of case}
end;
{$ENDIF}
constructor TDirectoryWatcher.Create;
var
Subtree: boolean;
outboundpath: string;
begin
inherited Create;
hDirectoryWatcherEvent := CreateEvt(False);
ResetEvent(hDirectoryWatcherEvent);
Subtree := True;
if not IniFile.D5Out then outboundpath := IniFile.Outbound
else outboundpath := ExtractFilePath(IniFile.Outbound);
hOutboundWatcher := FindFirstChangeNotification(PChar(FullPath(outboundpath)),
Bool(Integer(Subtree)), FILE_NOTIFY_CHANGE_FILE_NAME + FILE_NOTIFY_CHANGE_SIZE);
Subtree := False;
{$IFDEF ReadDirectoryChanges}
if Win32Platform = VER_PLATFORM_WIN32_NT then
begin
FileFlagsWatcher := TRadiusNTDirWatch.Create(nil);
FileFlagsWatcher.WatchSubTree := subtree;
FileFlagsWatcher.Directory := FullPath(IniFile.FlagsDir);
FileFlagsWatcher.OnNotify := OnFileFlagsWatcherNotify;
FileFlagsWatcher.Enabled := true;
end else
{$ENDIF}
begin
hFileFlagsWatcher := FindFirstChangeNotification(PChar(FullPath(IniFile.FlagsDir)),
Bool(Integer(Subtree)), FILE_NOTIFY_CHANGE_FILE_NAME + FILE_NOTIFY_CHANGE_LAST_WRITE);
end;
Subtree := False;
hHomeDirWatcher := FindFirstChangeNotification(PChar(JustPathName(IniFName)),
Bool(Integer(Subtree)), FILE_NOTIFY_CHANGE_LAST_WRITE);
{ hOutboundReader := CreateFile (
PChar(FullPath(FullPath(outboundpath))),
GENERIC_READ or GENERIC_WRITE, // access (read-write) mode
FILE_SHARE_READ or FILE_SHARE_DELETE, // share mode
nil, // security descriptor
OPEN_EXISTING, // how to create
FILE_FLAG_BACKUP_SEMANTICS or
FILE_FLAG_OVERLAPPED, // file attributes
0 // file with attributes to copy
);
hOutboundEvent := CreateEvt(False);}
Priority := tpLowest;
end;
procedure TDirectoryWatcher.FillArray;
var
l: TStringList;
i: integer;
begin
try
EnterNlCs;
if NodeController = nil then exit;
l := TStringList.Create;
l.CaseSensitive := False;
l.Duplicates := dupIgnore;
l.Sorted := True;
for i := 0 to NodeController.Lists.Count - 1 do begin
l.Add(JustPathName(NodeController.Lists[i]));
end;
if hNodelistsWatcher <> nil then begin
for i := 0 to fSize - 1 do begin
FindCloseChangeNotification(hNodelistsWatcher[i]);
end;
FreeMem(hNodelistsWatcher, fSize * SizeOf(THandle));
end;
fSize := l.Count;
GetMem(hNodelistsWatcher, fSize * SizeOf(THandle));
for i := 0 to fSize - 1 do begin
hNodelistsWatcher[i] := FindFirstChangeNotification(PChar(FullPath(l[i])),
Bool(Integer(False)), FILE_NOTIFY_CHANGE_FILE_NAME + FILE_NOTIFY_CHANGE_LAST_WRITE);
end;
l.Free;
finally
LeaveNlCs;
end;
end;
destructor TDirectoryWatcher.Destroy;
var i: integer;
begin
FindCloseChangeNotification(hOutboundWatcher);
FindCloseChangeNotification(hFileFlagsWatcher);
FindCloseChangeNotification(hHomeDirWatcher);
CloseHandle(hDirectoryWatcherEvent);
for i := 0 to fSize - 1 do begin
FindCloseChangeNotification(hNodelistsWatcher[i]);
end;
FreeMem(hNodelistsWatcher);
// CloseHandle(hOutboundReader);
// ZeroHandle(hOutboundEvent);
inherited Destroy;
end;
procedure TDirectoryWatcher.CheckLists;
var
i: integer;
o,
c: Int64;
begin
if IniFile = nil then exit;
if IniFile.AutoNodelist then begin
EnterNlCs;
if NodeController <> nil then begin
for i := 0 to NodeController.Lists.Count - 1 do begin
o := Int64(NodeController.Lists.Objects[i]);
c := Plus.GetFileTime(NodeController.Lists[i]);
if o <> c then begin
PostMsg(WM_COMPILENL);
break
end;
end;
end;
LeaveNlCs;
end;
end;
{type
_FILE_NOTIFY_INFORMATION = record
NextEntryOffset,
Action,
FileNameLength: DWORD;
FileName: WideChar;
end;}
procedure TDirectoryWatcher.InvokeExec;
var
HandlesArray: PWOHandleArray;
WaitResult: DWORD;
i: integer;
n: integer;
p3: TFileTime;
{ o: integer;
FNI: array[0..1024] of _FILE_NOTIFY_INFORMATION;
Ov: TOverlapped;}
begin
if Terminated {or ApplicationDowned} or ExitNow then
begin
sleep(100);
exit;
end;
if hOutboundWatcher = INVALID_HANDLE_VALUE then begin Terminated := True; Exit end;
if hFileFlagsWatcher = INVALID_HANDLE_VALUE then begin Terminated := True; Exit end;
if hHomeDirWatcher = INVALID_HANDLE_VALUE then begin Terminated := True; Exit end;
if hDirectoryWatcherEvent = INVALID_HANDLE_VALUE then begin Terminated := True; Exit end;
{ FillChar(Ov, SizeOf(Ov), #0);
Ov.hEvent := hOutboundEvent;
if (hOutboundReader <> 0) then begin
ReadDirectoryChangesW(
hOutboundReader, @FNI, SizeOf(FNI), True, FILE_NOTIFY_CHANGE_SIZE, @o, @Ov, nil);
end;}
if IniFile.AutoNodelist then begin
FillArray;
end;
n := Integer(wtStopEvent);
GetMem(HandlesArray, (n + 1 + fSize) * SizeOf(THandle));
try
HandlesArray[0] := hOutboundWatcher;
HandlesArray[1] := hFileFlagsWatcher;
HandlesArray[2] := hHomeDirWatcher;
HandlesArray[n] := hDirectoryWatcherEvent;
for i := 1 to fSize do begin
HandlesArray[n + i] := hNodelistsWatcher[i - 1];
end;
Busy := False;
WaitResult := WaitForMultipleObjects(n + 1 + fSize, HandlesArray, False, INFINITE) - WAIT_OBJECT_0;
Busy := True;
if Terminated then exit;
if WaitResult = WAIT_FAILED then
begin
sleep(1000);
exit;
end;
if Terminated then exit;
if IniFile = nil then exit;
if Terminated then exit;
case WaitResult of
0:
begin
if (not Terminated) and (Application <> nil) and (Application.MainForm <> nil) then begin
if not IgnoreNextEvent and not IgnoreNextAlert then begin
ScanCounter := 1;
end else begin
ScanCounter := 0;
end;
if IgnoreNextAlert then begin
IgnoreNextAlert := False;
end;
FindNextChangeNotification(hOutboundWatcher);
FindNextChangeNotification(hOutboundWatcher);
end;
end;
1:
begin
if (not Terminated) and (Application <> nil) and (Application.MainForm <> nil) then begin
PostMessage(Application.MainForm.Handle, WM_CHECKFILEFLAGS, 0, 0);
FindNextChangeNotification(hFileFlagsWatcher);
end;
end;
2:
begin
if (not Terminated) and (Application <> nil) and (Application.MainForm <> nil) then
begin
getfiletime(SysUtils.FileOpen(IniFName, SysUtils.fmShareDenyNone), nil, nil, @p3);
if (p3.dwLowDateTime <> FTime.dwLowDateTime) or (p3.dwHighDateTime <> FTime.dwHighDateTime) then
begin
sleep(10); //to avoid problems with external editing of config
PostMessage(Application.MainForm.Handle, WM_CFGREREAD, 0, 0);
FTime.dwLowDateTime := p3.dwLowDateTime;
FTime.dwHighDateTime := p3.dwHighDateTime;
end;
FindNextChangeNotification(hHomeDirWatcher);
end;
end;
{ wtOutReader:
begin
ReadDirectoryChangesW(
hOutboundReader, @FNI, SizeOf(FNI), True, FILE_NOTIFY_CHANGE_SIZE, @o, @Ov, nil);
FindNextChangeNotification(hOutboundWatcher);
end;}
4..999:
begin
if (not Terminated) and (Application <> nil) and (Application.MainForm <> nil) and (IniFile.AutoNodelist) then begin
CheckLists;
end;
exit;
end;
end; {case}
if IniFile.AutoNodelist then CheckLists;
finally
n := Integer(wtStopEvent);
FreeMem(HandlesArray, (n + 1 + fSize) * SizeOf(THandle));
end;
sleep(100);
end;
procedure TDirectoryWatcher.InvokeDone;
begin
Busy := False;
inherited;
end;
class function TDirectoryWatcher.ThreadName: string;
begin
Result := 'Directory Watcher';
end;
procedure StartWatcher;
begin
// if not IniFile.EnableWatcher then exit;
DirectoryWatcher := TDirectoryWatcher.Create;
DirectoryWatcher.Priority := tpIdle;
DirectoryWatcher.Suspended := False;
end;
procedure StopWatcher;
begin
DirectoryWatcher.Terminated := True;
while DirectoryWatcher.Busy do begin
sleep(100);
Application.ProcessMessages;
end;
SetEvt(DirectoryWatcher.hDirectoryWatcherEvent);
DirectoryWatcher.WaitFor;
FreeObject(DirectoryWatcher);
end;
// (c) 2001 Chelmodeyev AV'
function GetBuildDateStr;
type
TExeHeader = record
F1 : array [0..23] of char;
Flag : Byte;
F2 : array [0..34] of char;
AdrPE : LongInt; //OffSet to PE Header
end;
TPEHeader = record
Sign : array [0..5] of char;
NObj : Word;
F3 : array [0..11] of char;
NTHead : Word;
F4 : array [0..226] of Char
end;
Trsrc = record
ObjName : array [0..7] of char;
F5 : array [0..11] of char;
PhysOffs : DWord;
F6 : array [0..11] of char;
End;
TFirst = record
F7 : array [0..3] of char;
CompD : DWord;
end;
var
fname: tfilestream;
n : Integer;
EH : TExeHeader;
PEH : TPEHeader;
RSRC : Trsrc;
First: TFirst;
begin
FName := TFileStream.Create(Fn, fmOpenRead or fmShareDenyNone);
fname.seek(0, soFrombeginning);
fname.read(EH, 64);
fname.seek(EH.AdrPE, soFrombeginning);
fname.read(PEH, 248);
fname.seek(EH.AdrPE + 248, soFrombeginning);
For n := 1 to PEH.Nobj do
begin
fname.read(RSRC, 40);
if RSRC.ObjName = '.rsrc' then begin
fname.seek(RSRC.PhysOffs, soFrombeginning);
fname.read(First, 8);
Break;
end;
end;
If RSRC.ObjName <> '.rsrc' then
result := 'unknown'
else
result := FormatDateTime('mmmm d, yyyy', FileDateToDateTime(First.CompD));
fname.free;
end;
end.
|
{ *********************************************************************
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* Autor: Brovin Y.D.
* E-mail: y.brovin@gmail.com
*
******************************************************************** }
unit FGX.Toasts;
interface
uses
System.Classes, System.UITypes, FMX.Graphics;
resourcestring
SToastsIsNotSupported = 'Toast is not supported on current platform';
type
{ TfgToast }
TfgToast = class;
TfgToastDuration = (Short, Long);
IFGXToastService = interface
['{0F0C46CD-6BAE-4D15-B14C-60FB622AE61E}']
{ Creation }
function CreateToast(const AMessage: string; const ADuration: TfgToastDuration): TfgToast;
{ Manipulation }
procedure Show(const AToast: TfgToast);
procedure Cancel(const AToast: TfgToast);
end;
TfgToast = class abstract
private class var
FToastService: IFGXToastService;
private
FMessage: string;
FIcon: TBitmap;
FDuration: TfgToastDuration;
FBackgroundColor: TAlphaColor;
FMessageColor: TAlphaColor;
procedure SetDuration(const Value: TfgToastDuration);
procedure SetMessage(const Value: string);
procedure SetMessageColor(const Value: TAlphaColor);
procedure SetBackgroundColor(const Value: TAlphaColor);
procedure SetIcon(const Value: TBitmap);
{ Event handlers }
procedure IconChangedHandler(Sender: TObject);
private
class destructor Destroy;
protected
procedure DoBackgroundColorChanged; virtual;
procedure DoMessageChanged; virtual;
procedure DoMessageColorChanged; virtual;
procedure DoDurationChanged; virtual;
procedure DoIconChanged; virtual;
constructor Create; overload;
public
class function Create(const AMessage: string; const ADuration: TfgToastDuration): TfgToast; overload;
destructor Destroy; override;
{ Manipulations }
class procedure Show(const AMessage: string); overload;
class procedure Show(const AMessage: string; const AIcon: TBitmap); overload;
class procedure Show(const AMessage: string; const ADuration: TfgToastDuration); overload;
class procedure Show(const AMessage: string; const ADuration: TfgToastDuration; const AIcon: TBitmap); overload;
class function Supported: Boolean;
procedure Show; overload;
procedure Hide;
function HasIcon: Boolean;
public
/// <summary>Color of toast background</summary>
property BackgroundColor: TAlphaColor read FBackgroundColor write SetBackgroundColor;
/// <summary>Image on toast</summary>
/// <remarks>If you specify icon, Toast will use custom view. It means, that view of toast can be differed from
/// original toast with only text</remarks>
property Icon: TBitmap read FIcon write SetIcon;
/// <summary>Duration of showing toast</summary>
property Duration: TfgToastDuration read FDuration write SetDuration;
/// <summary>Text message</summary>
property Message: string read FMessage write SetMessage;
/// <summary>Font color of <c>Message</c></summary>
property MessageColor: TAlphaColor read FMessageColor write SetMessageColor;
end;
implementation
uses
FMX.Platform, System.SysUtils, FGX.Asserts {$IFDEF ANDROID}, FGX.Toasts.Android{$ENDIF};
{ TfgCustomToast }
procedure TfgToast.Hide;
begin
AssertIsNotNil(FToastService);
if FToastService <> nil then
FToastService.Cancel(Self);
end;
class function TfgToast.Create(const AMessage: string; const ADuration: TfgToastDuration): TfgToast;
begin
if not TPlatformServices.Current.SupportsPlatformService(IFGXToastService, FToastService) then
raise Exception.Create(SToastsIsNotSupported);
Result := FToastService.CreateToast(AMessage, ADuration);
end;
constructor TfgToast.Create;
begin
inherited;
FIcon := TBitmap.Create;
FIcon.OnChange := IconChangedHandler;
end;
class destructor TfgToast.Destroy;
begin
FToastService := nil;
inherited;
end;
destructor TfgToast.Destroy;
begin
FreeAndNil(FIcon);
end;
procedure TfgToast.DoBackgroundColorChanged;
begin
// It is intended for successors
end;
procedure TfgToast.DoDurationChanged;
begin
// It is intended for successors
end;
procedure TfgToast.DoIconChanged;
begin
// It is intended for successors
end;
procedure TfgToast.DoMessageChanged;
begin
// It is intended for successors
end;
procedure TfgToast.DoMessageColorChanged;
begin
// It is intended for successors
end;
function TfgToast.HasIcon: Boolean;
begin
Result := (Icon.Width > 0) and (Icon.Height > 0);
end;
procedure TfgToast.IconChangedHandler(Sender: TObject);
begin
DoIconChanged;
end;
procedure TfgToast.SetBackgroundColor(const Value: TAlphaColor);
begin
if FBackgroundColor <> Value then
begin
FBackgroundColor := Value;
DoBackgroundColorChanged;
end;
end;
procedure TfgToast.SetDuration(const Value: TfgToastDuration);
begin
if FDuration <> Value then
begin
FDuration := Value;
DoDurationChanged;
end;
end;
procedure TfgToast.SetIcon(const Value: TBitmap);
begin
AssertIsNotNil(FIcon);
FIcon.Assign(Value);
end;
procedure TfgToast.SetMessage(const Value: string);
begin
if FMessage <> Value then
begin
FMessage := Value;
DoMessageChanged;
end;
end;
procedure TfgToast.SetMessageColor(const Value: TAlphaColor);
begin
if FMessageColor <> Value then
begin
FMessageColor := Value;
DoMessageColorChanged;
end;
end;
class procedure TfgToast.Show(const AMessage: string);
var
Toast: TfgToast;
begin
Toast := TfgToast.Create(AMessage, TfgToastDuration.Short);
try
Toast.Show;
finally
Toast.Free;
end;
end;
class procedure TfgToast.Show(const AMessage: string; const AIcon: TBitmap);
var
Toast: TfgToast;
begin
Toast := TfgToast.Create(AMessage, TfgToastDuration.Short);
try
Toast.Icon := AIcon;
Toast.Show;
finally
Toast.Free;
end;
end;
class procedure TfgToast.Show(const AMessage: string; const ADuration: TfgToastDuration; const AIcon: TBitmap);
var
Toast: TfgToast;
begin
Toast := TfgToast.Create(AMessage, ADuration);
try
Toast.Icon := AIcon;
Toast.Show;
finally
Toast.Free;
end;
end;
class procedure TfgToast.Show(const AMessage: string; const ADuration: TfgToastDuration);
var
Toast: TfgToast;
begin
Toast := TfgToast.Create(AMessage, ADuration);
try
Toast.Show;
finally
Toast.Free;
end;
end;
procedure TfgToast.Show;
begin
AssertIsNotNil(FToastService);
if FToastService <> nil then
FToastService.Show(Self);
end;
class function TfgToast.Supported: Boolean;
begin
Result := TPlatformServices.Current.SupportsPlatformService(IFGXToastService);
end;
initialization
{$IFDEF ANDROID}
RegisterService;
{$ENDIF}
finalization
{$IFDEF ANDROID}
UnregisterService;
{$ENDIF}
end.
|
{*******************************************************}
{ }
{ CodeGear Delphi Runtime Library }
{ }
{ Copyright(c) 1995-2011 Embarcadero Technologies, Inc. }
{ }
{*******************************************************}
unit System.DebugUtils;
interface
//type
// DebugCode = class(TCustomAttribute)
// end;
//[DebugCode]
///
/// Conditionally outputs a formatted string to the debugging output. The condition
/// is controlled by the environment variable <code>DEBUG_CLASS</code>.
procedure DebugPrint(Cond: string; Fmt: string; const Args: array of const); overload;
//[DebugCode]
procedure DebugPrint(Cond: string; Fmt: string); overload
implementation
uses System.Generics.Collections, System.SysUtils, System.StrUtils;
const
{$IFDEF MACOS}
EnvSeparator: string = ':';
{$ENDIF MACOS}
{$IFDEF LINUX}
EnvSeparator: string = ':';
{$ENDIF LINUX}
{$IFDEF MSWINDOWS}
EnvSeparator: string = ';';
{$ENDIF MSWINDOWS}
var
EnabledConditionMap: TDictionary<string, Boolean>;
UnenabledConditionMap: TDictionary<string, Boolean>;
DEBUG_CLASS: TArray<string>;
procedure ParseEnv(Env: string);
begin
SetLength(DEBUG_CLASS, 2);
DEBUG_CLASS := TArray<string>(SplitString(Env, EnvSeparator));
// DEBUG_CLASS := TArray<string>.Create;
end;
///
/// Compares a category to a condition. If the strings are identical, we
/// return True. If the strings are not, we look for wildcards in the category.
/// If we find one, we match the strings up to that point. If they match,
/// we're done, and we return True. Otherwise we return False.<p>
///
/// Examples:
/// Cond = a.b.c Category = a.b.c.d -> False
/// Cond = a.b.c Category = a.b.c -> True
/// Cond = a.b.c Category = a.b.* -> True
/// Cond = a.b.c Category = a.* -> True
/// Cond = a.blueberry.c Category = a.blue* -> True
/// Cond = a.blueberry.c Category = a.blueberry -> False
function SubMatch(Cond: string; Category: string): Boolean;
var
P: Integer;
I: Integer;
begin
Result := False;
if Cond = Category then
Exit(True);
P := Pos('*', Category);
// a.b.c vs x.y.nn*
if P > 0 then
begin
if P > Length(Cond) - 1 then
Exit(False);
for I:= 1 to P - 1 do
if Cond[I] <> Category[I] then
Exit(False);
Exit(True);
end;
end;
function Match(Cond: string): Boolean;
var
S: string;
begin
Result := False;
for S in DEBUG_CLASS do
if SubMatch(Cond, S) then
Exit(True);
end;
function CheckDebugClass(Cond: string): Boolean;
begin
if (EnabledConditionMap.ContainsKey(Cond)) then
Exit(True);
if (UnenabledConditionMap.ContainsKey(Cond)) then
Exit(False);
// Exit(False);
if Match(Cond) then
begin
Result := True;
EnabledConditionMap.Add(Cond, True);
end
else
begin
Result := False;
UnenabledConditionMap.Add(Cond, True);
end;
end;
procedure DebugPrint(Cond: string; Fmt: string; const Args: array of const); overload;
begin
if not CheckDebugClass(Cond) then Exit;
Write(Cond + ': ');
Writeln(Format(Fmt, Args));
end;
procedure DebugPrint(Cond: string; Fmt: string); overload
begin
if not CheckDebugClass(Cond) then Exit;
Writeln(Cond + ': ' + Fmt);
end;
initialization
EnabledConditionMap := TDictionary<string, Boolean>.Create;
UnenabledConditionMap := TDictionary<string, Boolean>.Create;
ParseEnv(GetEnvironmentVariable('DEBUG_CLASS'));
finalization
EnabledConditionMap.Free;
UnenabledConditionMap.Free;
end.
|
{$mode objfpc}{$H+}{$J-}
program showcolor;
// Обидва модулі - Graphics й GoogleMapsEngine визначають тип TColor.
uses
Graphics, GoogleMapsEngine;
var
{ Не не спрацює так, як ми хочемо, оскільки TColor в підсумку
визначений в модулі GoogleMapsEngine. }
// Color: TColor;
{ Це працює. }
Color: Graphics.TColor;
begin
Color := clYellow;
WriteLn(Red(Color), ' ', Green(Color), ' ', Blue(Color));
end.
|
unit uRedactor;
interface
uses
uTypes, Graphics;
/// <summary>Процедура для установки имени для темы</summary>
procedure SetTemeName(Name: string);
/// <summary>Процедура для установки заставки</summary>
procedure ChangeDesktop(ImagePath: string; WallpaperStyle: TWallpaperStyle);
/// <summary>Процедура для установки заставки приветсвия</summary>
procedure ChangeLogWallpaper(ImagePath: string);
/// <summary>Процедура для изминения иконки</summary>
/// <param name="Icon">Тип иконки</param>
/// <param name="Value">Значения иконки</param>
procedure ChangeIcon(Icon: TIcon_type; Value: string);
/// <summary>Процедура для изминения курсора</summary>
/// <param name="Cursor">Названия курсора для изминения</param>
/// <param name="Value">путь к файлу</param>
procedure ChangeCursor(Cursor: string; Value: string);
/// <summary>Процедура для изминения цветовой схемы</summary>
/// <param name="Color">Названия цвета для изминения</param>
/// <param name="Value">Цвет</param>
procedure ChangeColor(Color: String; Value: TColor);
/// <summary>Процедура для изминения цветовой схемы темы</summary>
/// <param name="Color">HEX код цвета</param>///
procedure ChangeThemeColor(Value: TColor);
/// <summary>Процедура для изминения звуковой схемы</summary>
/// <param name="Color">Названия звука для изминения</param>
/// <param name="Value">путь к файлу</param>
procedure ChangeSound(Sound: String; Value: string);
implementation
uses
Windows, SysUtils, uWin7_redactor;
/// <summary>Процедура для опредиления типа ОС</summary>
function DetectWinVersion: TWinVersion;
var
OSVersionInfo: TOSVersionInfo;
begin
Result := wvUnknown;
OSVersionInfo.dwOSVersionInfoSize := sizeof(TOSVersionInfo);
if GetVersionEx(OSVersionInfo) then
begin
case OSVersionInfo.DwMajorVersion of
3: Result := wvNT3;
4: case OSVersionInfo.DwMinorVersion of
0: if OSVersionInfo.dwPlatformId = VER_PLATFORM_WIN32_NT then
Result := wvNT4
else
Result := wv95;
10: Result := wv98;
90: Result := wvME;
end;
5: case OSVersionInfo.DwMinorVersion of
0: Result := wvW2K;
1: Result := wvXP;
end;
6: Result := wvW7;
7: Result := wvW8;
end;
end;
end;
procedure SetTemeName(Name: string);
begin
SetTemeName_win7(Name);
end;
procedure ChangeDesktop(ImagePath: string; WallpaperStyle: TWallpaperStyle);
begin
ChangeDesktop_win7(ImagePath, WallpaperStyle);
end;
procedure ChangeLogWallpaper(ImagePath: string);
begin
ChangeLogWallpaper_win7(ImagePath);
end;
procedure ChangeIcon(Icon: TIcon_type; Value: string);
begin
ChangeIcon_win7(Icon, Value);
end;
procedure ChangeCursor(Cursor: string; Value: string);
begin
ChangeCursor_win7(Cursor, Value);
end;
procedure ChangeColor(Color: String; Value: TColor);
begin
ChangeColor_win7(Color, Value);
end;
procedure ChangeThemeColor(Value: TColor);
begin
ChangeThemeColor_win7(Value);
end;
procedure ChangeSound(Sound: String; Value: string);
begin
ChangeSound_win7(Sound, Value);
end;
end.
|
unit ScrollBoxImpl1;
interface
uses
Windows, ActiveX, Classes, Controls, Graphics, Menus, Forms, StdCtrls,
ComServ, StdVCL, AXCtrls, DelCtrls_TLB;
type
TScrollBoxX = class(TActiveXControl, IScrollBoxX)
private
{ Private declarations }
FDelphiControl: TScrollBox;
FEvents: IScrollBoxXEvents;
procedure CanResizeEvent(Sender: TObject; var NewWidth, NewHeight: Integer;
var Resize: Boolean);
procedure ClickEvent(Sender: TObject);
procedure ConstrainedResizeEvent(Sender: TObject; var MinWidth, MinHeight,
MaxWidth, MaxHeight: Integer);
procedure DblClickEvent(Sender: TObject);
procedure ResizeEvent(Sender: TObject);
protected
{ Protected declarations }
procedure DefinePropertyPages(DefinePropertyPage: TDefinePropertyPage); override;
procedure EventSinkChanged(const EventSink: IUnknown); override;
procedure InitializeControl; override;
function ClassNameIs(const Name: WideString): WordBool; safecall;
function DrawTextBiDiModeFlags(Flags: Integer): Integer; safecall;
function DrawTextBiDiModeFlagsReadingOnly: Integer; safecall;
function Get_AutoScroll: WordBool; safecall;
function Get_AutoSize: WordBool; safecall;
function Get_BiDiMode: TxBiDiMode; safecall;
function Get_BorderStyle: TxBorderStyle; safecall;
function Get_Color: OLE_COLOR; safecall;
function Get_Ctl3D: WordBool; safecall;
function Get_Cursor: Smallint; safecall;
function Get_DockSite: WordBool; safecall;
function Get_DoubleBuffered: WordBool; safecall;
function Get_DragCursor: Smallint; safecall;
function Get_DragMode: TxDragMode; safecall;
function Get_Enabled: WordBool; safecall;
function Get_Font: IFontDisp; safecall;
function Get_ParentColor: WordBool; safecall;
function Get_ParentCtl3D: WordBool; safecall;
function Get_ParentFont: WordBool; safecall;
function Get_Visible: WordBool; safecall;
function GetControlsAlignment: TxAlignment; safecall;
function IsRightToLeft: WordBool; safecall;
function UseRightToLeftAlignment: WordBool; safecall;
function UseRightToLeftReading: WordBool; safecall;
function UseRightToLeftScrollBar: WordBool; safecall;
procedure _Set_Font(const Value: IFontDisp); safecall;
procedure AboutBox; safecall;
procedure DisableAutoRange; safecall;
procedure EnableAutoRange; safecall;
procedure FlipChildren(AllLevels: WordBool); safecall;
procedure InitiateAction; safecall;
procedure Set_AutoScroll(Value: WordBool); safecall;
procedure Set_AutoSize(Value: WordBool); safecall;
procedure Set_BiDiMode(Value: TxBiDiMode); safecall;
procedure Set_BorderStyle(Value: TxBorderStyle); safecall;
procedure Set_Color(Value: OLE_COLOR); safecall;
procedure Set_Ctl3D(Value: WordBool); safecall;
procedure Set_Cursor(Value: Smallint); safecall;
procedure Set_DockSite(Value: WordBool); safecall;
procedure Set_DoubleBuffered(Value: WordBool); safecall;
procedure Set_DragCursor(Value: Smallint); safecall;
procedure Set_DragMode(Value: TxDragMode); safecall;
procedure Set_Enabled(Value: WordBool); safecall;
procedure Set_Font(const Value: IFontDisp); safecall;
procedure Set_ParentColor(Value: WordBool); safecall;
procedure Set_ParentCtl3D(Value: WordBool); safecall;
procedure Set_ParentFont(Value: WordBool); safecall;
procedure Set_Visible(Value: WordBool); safecall;
end;
implementation
uses ComObj, About28;
{ TScrollBoxX }
procedure TScrollBoxX.DefinePropertyPages(DefinePropertyPage: TDefinePropertyPage);
begin
{ Define property pages here. Property pages are defined by calling
DefinePropertyPage with the class id of the page. For example,
DefinePropertyPage(Class_ScrollBoxXPage); }
end;
procedure TScrollBoxX.EventSinkChanged(const EventSink: IUnknown);
begin
FEvents := EventSink as IScrollBoxXEvents;
end;
procedure TScrollBoxX.InitializeControl;
begin
FDelphiControl := Control as TScrollBox;
FDelphiControl.OnCanResize := CanResizeEvent;
FDelphiControl.OnClick := ClickEvent;
FDelphiControl.OnConstrainedResize := ConstrainedResizeEvent;
FDelphiControl.OnDblClick := DblClickEvent;
FDelphiControl.OnResize := ResizeEvent;
end;
function TScrollBoxX.ClassNameIs(const Name: WideString): WordBool;
begin
Result := FDelphiControl.ClassNameIs(Name);
end;
function TScrollBoxX.DrawTextBiDiModeFlags(Flags: Integer): Integer;
begin
Result := FDelphiControl.DrawTextBiDiModeFlags(Flags);
end;
function TScrollBoxX.DrawTextBiDiModeFlagsReadingOnly: Integer;
begin
Result := FDelphiControl.DrawTextBiDiModeFlagsReadingOnly;
end;
function TScrollBoxX.Get_AutoScroll: WordBool;
begin
Result := FDelphiControl.AutoScroll;
end;
function TScrollBoxX.Get_AutoSize: WordBool;
begin
Result := FDelphiControl.AutoSize;
end;
function TScrollBoxX.Get_BiDiMode: TxBiDiMode;
begin
Result := Ord(FDelphiControl.BiDiMode);
end;
function TScrollBoxX.Get_BorderStyle: TxBorderStyle;
begin
Result := Ord(FDelphiControl.BorderStyle);
end;
function TScrollBoxX.Get_Color: OLE_COLOR;
begin
Result := OLE_COLOR(FDelphiControl.Color);
end;
function TScrollBoxX.Get_Ctl3D: WordBool;
begin
Result := FDelphiControl.Ctl3D;
end;
function TScrollBoxX.Get_Cursor: Smallint;
begin
Result := Smallint(FDelphiControl.Cursor);
end;
function TScrollBoxX.Get_DockSite: WordBool;
begin
Result := FDelphiControl.DockSite;
end;
function TScrollBoxX.Get_DoubleBuffered: WordBool;
begin
Result := FDelphiControl.DoubleBuffered;
end;
function TScrollBoxX.Get_DragCursor: Smallint;
begin
Result := Smallint(FDelphiControl.DragCursor);
end;
function TScrollBoxX.Get_DragMode: TxDragMode;
begin
Result := Ord(FDelphiControl.DragMode);
end;
function TScrollBoxX.Get_Enabled: WordBool;
begin
Result := FDelphiControl.Enabled;
end;
function TScrollBoxX.Get_Font: IFontDisp;
begin
GetOleFont(FDelphiControl.Font, Result);
end;
function TScrollBoxX.Get_ParentColor: WordBool;
begin
Result := FDelphiControl.ParentColor;
end;
function TScrollBoxX.Get_ParentCtl3D: WordBool;
begin
Result := FDelphiControl.ParentCtl3D;
end;
function TScrollBoxX.Get_ParentFont: WordBool;
begin
Result := FDelphiControl.ParentFont;
end;
function TScrollBoxX.Get_Visible: WordBool;
begin
Result := FDelphiControl.Visible;
end;
function TScrollBoxX.GetControlsAlignment: TxAlignment;
begin
Result := TxAlignment(FDelphiControl.GetControlsAlignment);
end;
function TScrollBoxX.IsRightToLeft: WordBool;
begin
Result := FDelphiControl.IsRightToLeft;
end;
function TScrollBoxX.UseRightToLeftAlignment: WordBool;
begin
Result := FDelphiControl.UseRightToLeftAlignment;
end;
function TScrollBoxX.UseRightToLeftReading: WordBool;
begin
Result := FDelphiControl.UseRightToLeftReading;
end;
function TScrollBoxX.UseRightToLeftScrollBar: WordBool;
begin
Result := FDelphiControl.UseRightToLeftScrollBar;
end;
procedure TScrollBoxX._Set_Font(const Value: IFontDisp);
begin
SetOleFont(FDelphiControl.Font, Value);
end;
procedure TScrollBoxX.AboutBox;
begin
ShowScrollBoxXAbout;
end;
procedure TScrollBoxX.DisableAutoRange;
begin
FDelphiControl.DisableAutoRange;
end;
procedure TScrollBoxX.EnableAutoRange;
begin
FDelphiControl.EnableAutoRange;
end;
procedure TScrollBoxX.FlipChildren(AllLevels: WordBool);
begin
FDelphiControl.FlipChildren(AllLevels);
end;
procedure TScrollBoxX.InitiateAction;
begin
FDelphiControl.InitiateAction;
end;
procedure TScrollBoxX.Set_AutoScroll(Value: WordBool);
begin
FDelphiControl.AutoScroll := Value;
end;
procedure TScrollBoxX.Set_AutoSize(Value: WordBool);
begin
FDelphiControl.AutoSize := Value;
end;
procedure TScrollBoxX.Set_BiDiMode(Value: TxBiDiMode);
begin
FDelphiControl.BiDiMode := TBiDiMode(Value);
end;
procedure TScrollBoxX.Set_BorderStyle(Value: TxBorderStyle);
begin
FDelphiControl.BorderStyle := TBorderStyle(Value);
end;
procedure TScrollBoxX.Set_Color(Value: OLE_COLOR);
begin
FDelphiControl.Color := TColor(Value);
end;
procedure TScrollBoxX.Set_Ctl3D(Value: WordBool);
begin
FDelphiControl.Ctl3D := Value;
end;
procedure TScrollBoxX.Set_Cursor(Value: Smallint);
begin
FDelphiControl.Cursor := TCursor(Value);
end;
procedure TScrollBoxX.Set_DockSite(Value: WordBool);
begin
FDelphiControl.DockSite := Value;
end;
procedure TScrollBoxX.Set_DoubleBuffered(Value: WordBool);
begin
FDelphiControl.DoubleBuffered := Value;
end;
procedure TScrollBoxX.Set_DragCursor(Value: Smallint);
begin
FDelphiControl.DragCursor := TCursor(Value);
end;
procedure TScrollBoxX.Set_DragMode(Value: TxDragMode);
begin
FDelphiControl.DragMode := TDragMode(Value);
end;
procedure TScrollBoxX.Set_Enabled(Value: WordBool);
begin
FDelphiControl.Enabled := Value;
end;
procedure TScrollBoxX.Set_Font(const Value: IFontDisp);
begin
SetOleFont(FDelphiControl.Font, Value);
end;
procedure TScrollBoxX.Set_ParentColor(Value: WordBool);
begin
FDelphiControl.ParentColor := Value;
end;
procedure TScrollBoxX.Set_ParentCtl3D(Value: WordBool);
begin
FDelphiControl.ParentCtl3D := Value;
end;
procedure TScrollBoxX.Set_ParentFont(Value: WordBool);
begin
FDelphiControl.ParentFont := Value;
end;
procedure TScrollBoxX.Set_Visible(Value: WordBool);
begin
FDelphiControl.Visible := Value;
end;
procedure TScrollBoxX.CanResizeEvent(Sender: TObject; var NewWidth,
NewHeight: Integer; var Resize: Boolean);
var
TempNewWidth: Integer;
TempNewHeight: Integer;
TempResize: WordBool;
begin
TempNewWidth := Integer(NewWidth);
TempNewHeight := Integer(NewHeight);
TempResize := WordBool(Resize);
if FEvents <> nil then FEvents.OnCanResize(TempNewWidth, TempNewHeight, TempResize);
NewWidth := Integer(TempNewWidth);
NewHeight := Integer(TempNewHeight);
Resize := Boolean(TempResize);
end;
procedure TScrollBoxX.ClickEvent(Sender: TObject);
begin
if FEvents <> nil then FEvents.OnClick;
end;
procedure TScrollBoxX.ConstrainedResizeEvent(Sender: TObject; var MinWidth,
MinHeight, MaxWidth, MaxHeight: Integer);
var
TempMinWidth: Integer;
TempMinHeight: Integer;
TempMaxWidth: Integer;
TempMaxHeight: Integer;
begin
TempMinWidth := Integer(MinWidth);
TempMinHeight := Integer(MinHeight);
TempMaxWidth := Integer(MaxWidth);
TempMaxHeight := Integer(MaxHeight);
if FEvents <> nil then FEvents.OnConstrainedResize(TempMinWidth, TempMinHeight, TempMaxWidth, TempMaxHeight);
MinWidth := Integer(TempMinWidth);
MinHeight := Integer(TempMinHeight);
MaxWidth := Integer(TempMaxWidth);
MaxHeight := Integer(TempMaxHeight);
end;
procedure TScrollBoxX.DblClickEvent(Sender: TObject);
begin
if FEvents <> nil then FEvents.OnDblClick;
end;
procedure TScrollBoxX.ResizeEvent(Sender: TObject);
begin
if FEvents <> nil then FEvents.OnResize;
end;
initialization
TActiveXControlFactory.Create(
ComServer,
TScrollBoxX,
TScrollBox,
Class_ScrollBoxX,
28,
'{695CDBAF-02E5-11D2-B20D-00C04FA368D4}',
OLEMISC_SIMPLEFRAME or OLEMISC_ACTSLIKELABEL,
tmApartment);
end.
|
////////////////////////////////////////////////////////////////////////////////
//
//
// FileName : SUIButton.pas
// Creator : Shen Min
// Date : 2002-05-30 V1-V3
// 2003-06-14 V4
// Comment :
//
// Copyright (c) 2002-2003 Sunisoft
// http://www.sunisoft.com
// Email: support@sunisoft.com
//
////////////////////////////////////////////////////////////////////////////////
unit SUIButton;
interface
{$I SUIPack.inc}
uses Windows, Messages, Classes, Controls, ExtCtrls, Graphics, Buttons,
StdCtrls, Math, ComCtrls, SysUtils, Forms, ActnList,
SUIThemes, SUIMgr;
type
TsuiCustomButton = class(TCustomControl)
private
m_AutoSize : Boolean;
m_Caption : TCaption;
m_Cancel : Boolean;
m_Default : Boolean;
m_Transparent : Boolean;
m_ModalResult : TModalResult;
m_UIStyle : TsuiUIStyle;
m_FileTheme : TsuiFileTheme;
m_BoldFont : Boolean;
m_PicTransparent: Boolean;
m_Timer : TTimer;
m_MouseContinuouslyDownInterval : Integer;
m_FocusedRectMargin : Integer;
m_Active : Boolean;
m_OnMouseEnter : TNotifyEvent;
m_OnMouseExit : TNotifyEvent;
m_OnMouseContinuouslyDown : TNotifyEvent;
procedure MouseLeave(var Msg : TMessage); message CM_MOUSELEAVE;
procedure MouseEnter(var Msg : TMessage); message CM_MOUSEENTER;
procedure CMFONTCHANGED(var Msg : TMessage); message CM_FONTCHANGED;
procedure CMDialogKey(var Message: TCMDialogKey); message CM_DIALOGKEY;
procedure WMERASEBKGND(var Msg : TMessage); message WM_ERASEBKGND;
procedure CMDialogChar (var Msg : TCMDialogChar); message CM_DIALOGCHAR;
procedure WMKeyDown (var Msg : TWMKeyDown); message WM_KEYDOWN;
procedure WMKeyUp (var Msg : TWMKeyUp); message WM_KEYUP;
procedure WMKillFocus (var Msg : TWMKillFocus); message WM_KILLFOCUS;
procedure WMSetFocus (var Msg: TWMSetFocus); message WM_SETFOCUS;
procedure CMFocusChanged(var Msg: TCMFocusChanged); message CM_FOCUSCHANGED;
procedure CMTextChanged(var Msg : TMessage); message CM_TEXTCHANGED;
procedure OnTimer(Sender : TObject);
procedure SetAutoSize2(const Value: Boolean);
procedure SetCaption2(const Value : TCaption);
procedure SetDefault(const Value: Boolean);
procedure SetUIStyle(const Value : TsuiUIStyle);
procedure SetPicTransparent(const Value: Boolean);
procedure SetFileTheme(const Value: TsuiFileTheme);
procedure SetTransparent(const Value: Boolean);
function GetTabStop() : Boolean;
procedure SetTabStop(Value : Boolean);
procedure SetFocusedRectMargin(const Value: Integer);
protected
m_MouseIn : Boolean;
m_MouseDown : Boolean;
procedure AutoSizeChanged(); virtual;
procedure CaptionChanged(); virtual;
procedure FontChanged(); virtual;
procedure TransparentChanged(); virtual;
procedure EnableChanged(); virtual;
procedure UIStyleChanged(); virtual;
procedure PaintPic(ACanvas : TCanvas; Bitmap : TBitmap); virtual;
procedure PaintText(ACanvas : TCanvas; Text : String); virtual;
procedure PaintFocus(ACanvas : TCanvas); virtual;
procedure PaintButtonNormal(Buf : TBitmap); virtual;
procedure PaintButtonMouseOn(Buf : TBitmap); virtual;
procedure PaintButtonMouseDown(Buf : TBitmap); virtual;
procedure PaintButtonDisabled(Buf : TBitmap); virtual;
procedure PaintButton(ThemeIndex, Count, Index : Integer; const Buf : TBitmap);
procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;
procedure MouseMove(Shift: TShiftState; X, Y: Integer); override;
procedure ActionChange(Sender: TObject; CheckDefaults: Boolean); override;
procedure SetEnabled(Value : Boolean); override;
procedure Paint(); override;
procedure Notification(AComponent: TComponent; Operation: TOperation); override;
procedure CreateWnd; override;
property FileTheme : TsuiFileTheme read m_FileTheme write SetFileTheme;
property UIStyle : TsuiUIStyle read m_UIStyle write SetUIStyle;
property Transparent : Boolean read m_Transparent write SetTransparent;
property ModalResult : TModalResult read m_ModalResult write m_ModalResult;
property PicTransparent : Boolean read m_PicTransparent write SetPicTransparent;
property FocusedRectMargin : Integer read m_FocusedRectMargin write SetFocusedRectMargin;
public
constructor Create(AOwner : TComponent); override;
procedure Click(); override;
property MouseContinuouslyDownInterval : Integer read m_MouseContinuouslyDownInterval write m_MouseContinuouslyDownInterval;
property Cancel : Boolean read m_Cancel write m_Cancel default false;
property Default : Boolean read m_Default write SetDefault default false;
property OnMouseEnter : TNotifyEvent read m_OnMouseEnter write m_OnMouseEnter;
property OnMouseExit : TNotifyEvent read m_OnMouseExit write m_OnMouseExit;
property OnMouseContinuouslyDown : TNotifyEvent read m_OnMouseContinuouslyDown write m_OnMouseContinuouslyDown;
published
property BiDiMode;
property Anchors;
property ParentColor;
property Font;
property PopupMenu;
property ShowHint;
property Caption : TCaption read m_Caption write SetCaption2 stored true;
property AutoSize : Boolean read m_AutoSize write SetAutoSize2;
property Visible;
property ParentShowHint;
property ParentBiDiMode;
property ParentFont;
property TabStop read GetTabStop write SetTabStop default True;
property OnEnter;
property OnExit;
end;
TsuiImageButton = class(TsuiCustomButton)
private
m_PicNormal : TPicture;
m_PicMouseOn : TPicture;
m_PicMouseDown : TPicture;
m_PicDisabled : TPicture;
m_Stretch: Boolean;
m_DrawFocused : Boolean;
procedure SetPicDisabledF(const Value: TPicture);
procedure SetPicMouseDownF(const Value: TPicture);
procedure SetPicMouseOnF(const Value: TPicture);
procedure SetPicNormalF(const Value: TPicture);
procedure SetStretch(const Value: Boolean);
procedure SetDrawFocused(const Value: Boolean);
function GetUIStyle2() : TsuiUIStyle;
protected
procedure AutoSizeChanged(); override;
procedure PaintButtonNormal(Buf : TBitmap); override;
procedure PaintButtonMouseOn(Buf : TBitmap); override;
procedure PaintButtonMouseDown(Buf : TBitmap); override;
procedure PaintButtonDisabled(Buf : TBitmap); override;
procedure PaintFocus(ACanvas : TCanvas); override;
procedure PaintPic(ACanvas : TCanvas; Bitmap : TBitmap); override;
public
constructor Create(AOwner : TComponent); override;
destructor Destroy(); override;
published
property UIStyle read GetUIStyle2;
property DrawFocused : Boolean read m_DrawFocused write SetDrawFocused;
property FocusedRectMargin;
property PicNormal : TPicture read m_PicNormal write SetPicNormalF;
property PicMouseOn : TPicture read m_PicMouseOn write SetPicMouseOnF;
property PicMouseDown : TPicture read m_PicMouseDown write SetPicMouseDownF;
property PicDisabled : TPicture read m_PicDisabled write SetPicDisabledF;
property Stretch : Boolean read m_Stretch write SetStretch;
property Cancel;
property Default;
property MouseContinuouslyDownInterval;
property Action;
property Caption;
property Font;
property Enabled;
property TabOrder;
property Transparent;
property ModalResult;
property AutoSize;
property OnClick;
property OnMouseMove;
property OnMouseDown;
property OnMouseUp;
property OnKeyDown;
property OnKeyUp;
property OnKeyPress;
property OnMouseEnter;
property OnMouseExit;
property OnMouseContinuouslyDown;
end;
TsuiControlButton = class(TsuiCustomButton)
private
m_PicIndex : Integer;
m_PicCount : Integer;
m_ThemeID : Integer;
m_FileTheme : TsuiFileTheme;
procedure SetThemeID(const Value: Integer);
procedure SetPicIndex(const Value: Integer);
procedure SetPicCount(const Value: Integer);
procedure WMERASEBKGND(var Msg : TMessage); message WM_ERASEBKGND;
protected
procedure PaintButtonNormal(Buf : TBitmap); override;
procedure PaintButtonMouseOn(Buf : TBitmap); override;
procedure PaintButtonMouseDown(Buf : TBitmap); override;
procedure PaintButtonDisabled(Buf : TBitmap); override;
procedure PaintPic(ACanvas : TCanvas; Bitmap : TBitmap); override;
public
constructor Create(AOwner : TComponent); override;
published
property UIStyle;
property FileTheme;
property ThemeID : Integer read m_ThemeID write SetThemeID;
property PicIndex : Integer read m_PicIndex write SetPicIndex;
property PicCount : Integer read m_PicCount write SetPicCount;
property PicTransparent;
property MouseContinuouslyDownInterval;
property Action;
property Caption;
property Font;
property Enabled;
property TabOrder;
property Transparent;
property ModalResult;
property AutoSize;
property OnClick;
property OnMouseMove;
property OnMouseDown;
property OnMouseUp;
property OnKeyDown;
property OnKeyUp;
property OnKeyPress;
property OnMouseEnter;
property OnMouseExit;
property OnMouseContinuouslyDown;
end;
TsuiToolBarSpeedButton = class(TCustomPanel)
private
m_MouseIn : Boolean;
m_Glyph : TBitmap;
procedure MouseLeave(var Msg : TMessage); message CM_MOUSELEAVE;
procedure MouseEnter(var Msg : TMessage); message CM_MOUSEENTER;
procedure SetGlyph(const Value: TBitmap);
procedure WMERASEBKGND(var Msg : TMessage); message WM_ERASEBKGND;
protected
procedure Paint(); override;
public
constructor Create(AOwner : TComponent); override;
destructor Destroy(); override;
published
property Glyph : TBitmap read m_Glyph write SetGlyph;
property Color;
property OnClick;
end;
TsuiButton = class(TsuiCustomButton)
private
m_Glyph : TBitmap;
m_Layout : TButtonLayout;
m_TextPoint : TPoint;
m_Spacing : Integer;
procedure SetGlyph(const Value: TBitmap);
procedure SetLayout(const Value: TButtonLayout);
procedure SetSpacing(const Value: Integer);
function GetResHandle: Cardinal;
procedure SetResHandle(const Value: THandle);
protected
procedure ActionChange(Sender: TObject; CheckDefaults: Boolean); override;
procedure PaintPic(ACanvas : TCanvas; Bitmap : TBitmap); override;
procedure PaintText(ACanvas : TCanvas; Text : String); override;
procedure PaintFocus(ACanvas : TCanvas); override;
procedure UIStyleChanged(); override;
public
constructor Create(AOwner : TComponent); override;
destructor Destroy(); override;
published
property FileTheme;
property UIStyle;
property Cancel;
property Default;
property Action;
property Caption;
property Font;
property Enabled;
property TabOrder;
property Transparent;
property ModalResult;
property AutoSize;
property FocusedRectMargin;
property Glyph : TBitmap read m_Glyph write SetGlyph;
property Layout : TButtonLayout read m_Layout write SetLayout;
property Spacing : Integer read m_Spacing write SetSpacing;
property MouseContinuouslyDownInterval;
property OnClick;
property OnMouseMove;
property OnMouseDown;
property OnMouseUp;
property OnKeyDown;
property OnKeyUp;
property OnKeyPress;
property OnMouseEnter;
property OnMouseExit;
property OnMouseContinuouslyDown;
// no use, keep for compatible with V3
property ResHandle : Cardinal read GetResHandle write SetResHandle;
end;
// -------------- TsuiCheckBox (Button for CheckBox)-----------
TsuiCheckBox = class(TCustomControl)
private
m_Checked : Boolean;
m_UIStyle : TsuiUIStyle;
m_FileTheme : TsuiFileTheme;
m_Transparent : Boolean;
m_AutoSize : Boolean;
m_OnClick : TNotifyEvent;
function GetState: TCheckBoxState;
procedure SetState(const Value: TCheckBoxState);
procedure SetFileTheme(const Value: TsuiFileTheme);
procedure SetUIStyle(const Value: TsuiUIStyle);
procedure SetChecked(const Value: Boolean);
procedure SetTransparent(const Value: Boolean);
procedure SetAutoSize2(const Value: Boolean);
procedure CMFONTCHANGED(var Msg : TMessage); message CM_FONTCHANGED;
procedure WMERASEBKGND(var Msg : TMessage); message WM_ERASEBKGND;
procedure CMDialogChar (var Msg : TCMDialogChar); message CM_DIALOGCHAR;
procedure WMKillFocus (var Msg : TWMKillFocus); message WM_KILLFOCUS;
procedure WMSetFocus (var Msg: TWMSetFocus); message WM_SETFOCUS;
procedure CMFocusChanged(var Msg: TCMFocusChanged); message CM_FOCUSCHANGED;
procedure WMKeyUp (var Msg : TWMKeyUp); message WM_KEYUP;
procedure CMTextChanged(var Msg : TMessage); message CM_TEXTCHANGED;
protected
procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;
function NeedDrawFocus() : Boolean; virtual;
procedure Paint(); override;
function GetPicTransparent() : Boolean; virtual;
function GetPicThemeIndex() : Integer; virtual;
procedure CheckStateChanged(); virtual;
procedure Notification(AComponent: TComponent; Operation: TOperation); override;
procedure Toggle; virtual;
procedure DoClick(); virtual;
function WantKeyUp() : Boolean; virtual;
procedure SetEnabled(Value : Boolean); override;
public
constructor Create(AOwner : TComponent); override;
procedure Click(); override;
published
property UIStyle : TsuiUIStyle read m_UIStyle write SetUIStyle;
property FileTheme : TsuiFileTheme read m_FileTheme write SetFileTheme;
property BiDiMode;
property Anchors;
property PopupMenu;
property ShowHint;
property Visible;
property ParentShowHint;
property ParentBiDiMode;
property ParentFont;
property AutoSize : Boolean read m_AutoSize write SetAutoSize2;
property Checked : Boolean read m_Checked write SetChecked;
property Caption;
property Enabled;
property Font;
property Color;
property TabOrder;
property TabStop;
property ParentColor;
property State : TCheckBoxState read GetState write SetState;
property Transparent : Boolean read m_Transparent write SetTransparent;
property OnClick read m_OnClick write m_OnClick;
property OnDblClick;
property OnMouseMove;
property OnMouseDown;
property OnMouseUp;
property OnKeyDown;
property OnKeyUp;
property OnKeyPress;
property OnContextPopup;
property OnDragDrop;
property OnDragOver;
property OnEndDock;
property OnEndDrag;
property OnEnter;
property OnExit;
property OnStartDock;
property OnStartDrag;
end;
// -------------- TsuiRadioButton (Button for RadioButton)-----------
TsuiRadioButton = class(TsuiCheckBox)
private
m_GroupIndex : Integer;
procedure UnCheckGroup();
procedure WMSetFocus (var Msg: TWMSetFocus); message WM_SETFOCUS;
protected
function WantKeyUp() : Boolean; override;
procedure DoClick(); override;
function GetPicTransparent() : Boolean; override;
function GetPicThemeIndex() : Integer; override;
procedure CheckStateChanged(); override;
public
constructor Create(AOwner : TComponent); override;
published
property GroupIndex : Integer read m_GroupIndex write m_GroupIndex;
end;
TsuiArrowButtonType = (suiUp, suiDown);
TsuiArrowButton = class(TsuiCustomButton)
private
m_Arrow: TsuiArrowButtonType;
procedure SetArrow(const Value: TsuiArrowButtonType);
protected
procedure UIStyleChanged(); override;
procedure PaintPic(ACanvas : TCanvas; Bitmap : TBitmap); override;
procedure PaintText(ACanvas : TCanvas; Text : String); override;
published
property Arrow: TsuiArrowButtonType read m_Arrow write SetArrow;
property FileTheme;
property UIStyle;
property MouseContinuouslyDownInterval;
property OnClick;
property OnMouseMove;
property OnMouseDown;
property OnMouseUp;
property OnKeyDown;
property OnKeyUp;
property OnKeyPress;
property OnMouseEnter;
property OnMouseExit;
property OnMouseContinuouslyDown;
end;
implementation
uses SUIResDef, SUIToolBar, SUIPublic{$IFDEF DB}, SUIDBCtrls{$ENDIF};
{ TsuiCustomButton }
constructor TsuiCustomButton.Create(AOwner: TComponent);
begin
inherited;
ControlStyle := ControlStyle - [csDoubleClicks];
ControlStyle := ControlStyle - [csAcceptsControls];
m_Timer := nil;
m_MouseContinuouslyDownInterval := 100;
m_BoldFont := false;
inherited OnClick := nil;
inherited Caption := '';
m_MouseIn := false;
m_MouseDown := false;
ModalResult := mrNone;
TabStop := true;
m_AutoSize := false;
m_FocusedRectMargin := 2;
UIStyle := GetSUIFormStyle(AOwner);
end;
procedure TsuiCustomButton.MouseDown(Button: TMouseButton; Shift: TShiftState; X,
Y: Integer);
begin
if Button = mbLeft then
begin
m_MouseDown := true;
if m_Timer = nil then
begin
m_Timer := TTimer.Create(nil);
m_Timer.OnTimer := OnTimer;
m_Timer.Interval := Max(m_MouseContinuouslyDownInterval, 0);
m_Timer.Enabled := true;
end;
if TabStop and CanFocus() and Enabled and Visible then
try
SetFocus();
except end;
Repaint();
end;
inherited;
end;
procedure TsuiCustomButton.MouseEnter(var Msg: TMessage);
begin
inherited;
if csDesigning in ComponentState then
Exit;
m_MouseIn := true;
Repaint();
if Assigned(m_OnMouseEnter) then
m_OnMouseEnter(self);
end;
procedure TsuiCustomButton.MouseLeave(var Msg: TMessage);
begin
inherited;
m_MouseIn := false;
m_MouseDown := false;
if m_Timer <> nil then
begin
m_Timer.Free();
m_Timer := nil;
end;
Repaint();
if Assigned(m_OnMouseExit) then
m_OnMouseExit(self);
end;
procedure TsuiCustomButton.Paint;
var
Buf : TBitmap;
BufImage : TBitmap;
begin
Buf := TBitmap.Create();
BufImage := TBitmap.Create();
try
if not Enabled then
PaintButtonDisabled(BufImage)
else if m_MouseDown then
PaintButtonMouseDown(BufImage)
else if not m_MouseIn then
PaintButtonNormal(BufImage)
else
PaintButtonMouseOn(BufImage);
except
BufImage.Width := 74;
BufImage.Height := 21;
end;
BufImage.Transparent := m_PicTransparent;
Buf.PixelFormat := pfDevice;
Buf.Width := Width;
Buf.Height := Height;
if m_Transparent then
begin
if Parent <> nil then
begin
if Parent is TTabSheet then
DoTrans(Buf.Canvas, Parent)
{$IFDEF DB}
else if Parent is TsuiDBNavigator then
DoTrans(Buf.Canvas, Parent)
{$ENDIF}
else if Parent is TsuiToolBar then
DoTrans(Buf.Canvas, Parent)
else
DoTrans(Buf.Canvas, self);
end
else
DoTrans(Buf.Canvas, self);
end
else
begin
Buf.Canvas.Brush.Color := Color;
Buf.Canvas.FillRect(ClientRect);
end;
PaintPic(Buf.Canvas, BufImage);
BufImage.Free();
if Focused and TabStop then
PaintFocus(Buf.Canvas);
Buf.Canvas.Font := Font;
Canvas.Font := Font;
if Trim(m_Caption) <> '' then
PaintText(Buf.Canvas, m_Caption);
Canvas.CopyRect(ClientRect, Buf.Canvas, ClientRect);
Buf.Free();
end;
procedure TsuiCustomButton.SetAutoSize2(const Value: Boolean);
begin
m_AutoSize := Value;
AutoSizeChanged();
RePaint();
end;
procedure TsuiCustomButton.CMDialogChar(var Msg: TCMDialogChar);
begin
inherited;
if IsAccel(Msg.CharCode, m_Caption) and Enabled then
begin
Click();
Msg.Result := 1;
end
else
Msg.Result := 0;
end;
procedure TsuiCustomButton.WMKeyDown(var Msg: TWMKeyDown);
begin
inherited;
if (
((Msg.CharCode = VK_SPACE) or (Msg.CharCode = VK_RETURN)) and
Focused
) then
begin
if Enabled then
begin
m_MouseDown := true;
Repaint();
end;
end;
end;
procedure TsuiCustomButton.WMKeyUp(var Msg: TWMKeyUp);
begin
inherited;
if (
((Msg.CharCode = VK_SPACE) or (Msg.CharCode = VK_RETURN)) and
Focused and
(m_MouseDown)
) then
begin
if Enabled then
begin
m_MouseDown := false;
Repaint();
Click();
end;
end;
end;
procedure TsuiCustomButton.WMKillFocus(var Msg: TWMKillFocus);
begin
inherited;
Repaint();
end;
procedure TsuiCustomButton.WMSetFocus(var Msg: TWMSetFocus);
begin
inherited;
Repaint();
end;
procedure TsuiCustomButton.SetCaption2(const Value: TCaption);
begin
m_Caption := Value;
inherited Caption := Value;
CaptionChanged();
Repaint();
end;
procedure TsuiCustomButton.SetEnabled(Value: Boolean);
begin
inherited;
EnableChanged();
Repaint();
end;
procedure TsuiCustomButton.Click;
begin
if m_MouseDown then
begin
if m_Timer <> nil then
begin
m_Timer.Free();
m_Timer := nil;
end;
m_MouseDown := false;
Repaint();
end;
if Parent <> nil then
GetParentForm(self).ModalResult := m_ModalResult;
inherited;
end;
procedure TsuiCustomButton.MouseMove(Shift: TShiftState; X, Y: Integer);
begin
inherited;
if (
(X < 0) or
(Y < 0) or
(X > Width) or
(Y > Height)
) then
begin
m_MouseIn := false;
m_MouseDown := false;
Repaint();
end;
end;
procedure TsuiCustomButton.SetTransparent(const Value: Boolean);
begin
inherited;
m_Transparent := Value;
TransparentChanged();
Repaint();
end;
procedure TsuiCustomButton.WMERASEBKGND(var Msg: TMessage);
begin
// do nothing
end;
procedure TsuiCustomButton.CMFocusChanged(var Msg: TCMFocusChanged);
begin
Inherited;
with Msg do
if Sender is TsuiButton then
m_Active := Sender = Self
else
m_Active := m_Default;
Repaint();
end;
procedure TsuiCustomButton.PaintPic(ACanvas: TCanvas; Bitmap: TBitmap);
var
ImageList : TImageList;
TransColor : TColor;
begin
if (Bitmap.Width = 0) or (Bitmap.Height = 0) then
Exit;
TransColor := Bitmap.Canvas.Pixels[0, 0];
ImageList := TImageList.CreateSize(Bitmap.Width, Bitmap.Height);
try
if PicTransparent then
ImageList.AddMasked(Bitmap, TransColor)
else
ImageList.Add(Bitmap, nil);
ImageList.Draw(ACanvas, 0, 0, 0, Enabled);
finally
ImageList.Free();
end;
end;
procedure TsuiCustomButton.SetUIStyle(const Value: TsuiUIStyle);
begin
m_UIStyle := Value;
UIStyleChanged();
Repaint();
end;
procedure TsuiCustomButton.PaintText(ACanvas: TCanvas; Text: String);
var
R, RText : TRect;
DespX, DespY : integer;
begin
ACanvas.Brush.Style := bsClear;
R := ClientRect;
ACanvas.Font := Font;
if m_BoldFont then
ACanvas.Font.Style := ACanvas.Font.Style + [fsBold];
if not Enabled then
begin
R := Rect(R.Left + 1, R.Top + 1, R.Right + 1, R.Bottom + 1);
ACanvas.Font.Color := clWhite;
// DrawText(ACanvas.Handle, PChar(Caption), -1, R, DT_CENTER or DT_SINGLELINE or DT_VCENTER);
RText := R;
DrawText(ACanvas.Handle, PChar(Caption),Length(Caption), RText, DT_EXPANDTABS or DT_CALCRECT or DT_WORDBREAK);
DespX := ((R.Right - R.Left) - (RText.Right - RText.Left)) div 2;
DespY := ((R.Bottom - R.Top) - (RText.Bottom - RText.Top)) div 2;
OffsetRect(RText,DespX, DespY);
DrawText(ACanvas.Handle, PChar(Caption),-1, RText, DT_CENTER);
R := ClientRect;
ACanvas.Font.Color := clGray;
end
else
begin
if m_MouseDown then
R := Rect(R.Left + 1, R.Top + 1, R.Right + 1, R.Bottom + 1);
end;
// DrawText(ACanvas.Handle, PChar(Caption), -1, R, DT_CENTER or DT_SINGLELINE or DT_VCENTER);
RText := R;
DrawText(ACanvas.Handle, PChar(Caption),Length(Caption), RText, DT_EXPANDTABS or DT_CALCRECT or DT_WORDBREAK);
DespX := ((R.Right - R.Left) - (RText.Right - RText.Left)) div 2;
DespY := ((R.Bottom - R.Top) - (RText.Bottom - RText.Top)) div 2;
OffsetRect(RText,DespX, DespY);
DrawText(ACanvas.Handle, PChar(Caption),-1, RText, DT_CENTER);
m_BoldFont := false;
end;
procedure TsuiCustomButton.UIStyleChanged;
begin
end;
procedure TsuiCustomButton.AutoSizeChanged;
var
Temp : TBitmap;
begin
if m_AutoSize then
begin
Temp := TBitmap.Create();
GetInsideThemeBitmap(m_UIStyle, SUI_THEME_BUTTON_IMAGE, Temp);
if Temp.Height = 0 then
Temp.Height := 21;
if Temp.Width = 0 then
Temp.Width := 74;
Height := Temp.Height;
Width := Temp.Width div 3;
Temp.Free();
end;
end;
procedure TsuiCustomButton.CaptionChanged;
begin
// do nothing
end;
procedure TsuiCustomButton.CMFONTCHANGED(var Msg: TMessage);
begin
FontChanged();
end;
procedure TsuiCustomButton.FontChanged;
begin
Canvas.Font := Font;
Repaint();
end;
procedure TsuiCustomButton.SetPicTransparent(const Value: Boolean);
begin
m_PicTransparent := Value;
Repaint();
end;
procedure TsuiCustomButton.TransparentChanged;
begin
PicTransparent := Transparent;
end;
procedure TsuiCustomButton.PaintFocus(ACanvas: TCanvas);
var
R : TRect;
begin
R := Rect(m_FocusedRectMargin, m_FocusedRectMargin, ClientWidth - m_FocusedRectMargin, ClientHeight - m_FocusedRectMargin);
ACanvas.Brush.Style := bsSolid;
ACanvas.DrawFocusRect(R);
end;
procedure TsuiCustomButton.EnableChanged;
begin
// Do nothing
end;
procedure TsuiCustomButton.ActionChange(Sender: TObject;
CheckDefaults: Boolean);
begin
inherited;
Caption := inherited Caption;
end;
procedure TsuiCustomButton.PaintButtonDisabled(Buf: TBitmap);
begin
PaintButton(SUI_THEME_BUTTON_IMAGE, 3, 1, Buf);
end;
procedure TsuiCustomButton.PaintButtonMouseDown(Buf: TBitmap);
begin
PaintButton(SUI_THEME_BUTTON_IMAGE, 3, 3, Buf);
end;
procedure TsuiCustomButton.PaintButtonMouseOn(Buf: TBitmap);
begin
PaintButton(SUI_THEME_BUTTON_IMAGE, 3, 2, Buf);
end;
procedure TsuiCustomButton.PaintButtonNormal(Buf: TBitmap);
begin
PaintButton(SUI_THEME_BUTTON_IMAGE, 3, 1, Buf);
end;
procedure TsuiCustomButton.OnTimer(Sender: TObject);
begin
if Assigned(m_OnMouseContinuouslyDown) then
m_OnMouseContinuouslyDown(self);
end;
procedure TsuiCustomButton.SetDefault(const Value: Boolean);
var
Form: TCustomForm;
begin
m_Default := Value;
if HandleAllocated then
begin
Form := GetParentForm(Self);
if Form <> nil then
Form.Perform(CM_FOCUSCHANGED, 0, Longint(Form.ActiveControl));
end;
end;
procedure TsuiCustomButton.CMDialogKey(var Message: TCMDialogKey);
begin
with Message do
if (((CharCode = VK_RETURN) and m_Active) or
((CharCode = VK_ESCAPE) and m_Cancel)) and
(KeyDataToShiftState(Message.KeyData) = []) and CanFocus then
begin
Click;
Result := 1;
end else
inherited;
end;
function TsuiCustomButton.GetTabStop: Boolean;
begin
Result := inherited TabStop;
end;
procedure TsuiCustomButton.SetTabStop(Value: Boolean);
begin
inherited TabStop := Value;
end;
procedure TsuiCustomButton.SetFileTheme(const Value: TsuiFileTheme);
begin
m_FileTheme := Value;
SetUIStyle(m_UIStyle);
end;
procedure TsuiCustomButton.Notification(AComponent: TComponent;
Operation: TOperation);
begin
inherited;
if (
(Operation = opRemove) and
(AComponent = m_FileTheme)
)then
begin
m_FileTheme := nil;
SetUIStyle(SUI_THEME_DEFAULT);
end;
end;
procedure TsuiCustomButton.PaintButton(ThemeIndex, Count, Index : Integer; const Buf : TBitmap);
var
OutUIStyle : TsuiUIStyle;
begin
if UsingFileTheme(m_FileTheme, m_UIStyle, OutUIStyle) then
m_FileTheme.GetBitmap(ThemeIndex, Buf, Count, Index)
else
GetInsideThemeBitmap(OutUIStyle, ThemeIndex, Buf, Count, Index);
end;
procedure TsuiCustomButton.CMTextChanged(var Msg: TMessage);
begin
Caption := inherited Caption;
end;
procedure TsuiCustomButton.SetFocusedRectMargin(const Value: Integer);
begin
m_FocusedRectMargin := Value;
Repaint();
end;
procedure TsuiCustomButton.CreateWnd;
begin
inherited;
m_Active := m_Default;
end;
{ TsuiButton }
procedure TsuiButton.ActionChange(Sender: TObject; CheckDefaults: Boolean);
begin
inherited;
if Sender is TCustomAction then
with TCustomAction(Sender) do
begin
if (
(Glyph.Empty) and
(ActionList <> nil) and
(ActionList.Images <> nil) and
(ImageIndex >= 0) and
(ImageIndex < ActionList.Images.Count)
) then
begin
ActionList.Images.GetBitmap(ImageIndex, m_Glyph);
Repaint();
end;
end;
end;
constructor TsuiButton.Create(AOwner: TComponent);
begin
inherited;
Height := 27;
Width := 80;
m_Spacing := 4;
m_Glyph := TBitmap.Create();
end;
destructor TsuiButton.Destroy;
begin
m_Glyph.Free();
m_Glyph := nil;
inherited;
end;
function TsuiButton.GetResHandle: Cardinal;
begin
Result := 0;
end;
procedure TsuiButton.PaintFocus(ACanvas: TCanvas);
begin
if {$IFDEF RES_MACOS} (UIStyle = MacOS) {$ELSE} false {$ENDIF} or
{$IFDEF RES_BLUEGLASS} (UIStyle = BlueGlass) {$ELSE} false {$ENDIF} then
begin
m_BoldFont := true;
Exit;
end;
inherited
end;
procedure TsuiButton.PaintPic(ACanvas: TCanvas; Bitmap: TBitmap);
var
CapWidth : Integer;
CapHeight : Integer;
GlyphLeft : Integer;
GlyphTop : Integer;
GlyphWidth : Integer;
GlyphHeight : Integer;
ImageList : TImageList;
IncludedDisable : Boolean;
begin
ACanvas.Font := Font;
SpitDraw(Bitmap, ACanvas, ClientRect, PicTransparent);
if m_Glyph.Empty then
Exit;
CapWidth := ACanvas.TextWidth(Caption);
CapHeight := ACanvas.TextHeight(Caption);
GlyphLeft := 0;
GlyphTop := 0;
GlyphWidth := m_Glyph.Width;
GlyphHeight := m_Glyph.Height;
IncludedDisable := false;
if GlyphWidth = GlyphHeight * 2 then
begin
GlyphWidth := GlyphHeight;
IncludedDisable := true;
end;
case m_Layout of
blGlyphLeft :
begin
GlyphLeft := (Width - (CapWidth + GlyphWidth + m_Spacing)) div 2;
GlyphTop := (Height - GlyphHeight) div 2;
m_TextPoint := Point(GlyphLeft + GlyphWidth + m_Spacing, (Height - CapHeight) div 2);
end;
blGlyphRight :
begin
GlyphLeft := (Width + CapWidth + m_Spacing - GlyphWidth) div 2;
// (Width - (CapWidth + GlyphWidth + GLYPH_TEXT)) div 2 + CapWidth + GLYPH_TEXT;
GlyphTop := (Height - GlyphHeight) div 2;
m_TextPoint := Point(GlyphLeft - CapWidth - m_Spacing, (Height - CapHeight) div 2);
end;
blGlyphTop :
begin
GlyphLeft := (Width - GlyphWidth) div 2;
GlyphTop := (Height - (CapHeight + GlyphHeight + m_Spacing)) div 2;
m_TextPoint := Point((Width - CapWidth) div 2, GlyphTop + GlyphHeight + m_Spacing);
end;
blGlyphBottom :
begin
GlyphLeft := (Width - GlyphWidth) div 2;
GlyphTop := (Height + CapHeight + m_Spacing - GlyphHeight) div 2;
m_TextPoint := Point((Width - CapWidth) div 2, GlyphTop - CapHeight - m_Spacing);
end;
end; // case
if m_MouseDown then
begin
Inc(GlyphLeft);
Inc(GlyphTop);
end;
ImageList := TImageList.CreateSize(GlyphWidth, GlyphHeight);
try
ImageList.AddMasked(m_Glyph, m_Glyph.Canvas.Pixels[0, 0]);
if not IncludedDisable then
ImageList.Draw(ACanvas, GlyphLeft, GlyphTop, 0, Enabled)
else
ImageList.Draw(ACanvas, GlyphLeft, GlyphTop, Integer(not Enabled));
finally
ImageList.Free();
end;
end;
procedure TsuiButton.PaintText(ACanvas: TCanvas; Text: String);
var
R : TRect;
begin
if m_Glyph.Empty then
begin
inherited;
Exit;
end;
ACanvas.Brush.Style := bsClear;
ACanvas.Font := Font;
if not Enabled then
begin
ACanvas.Font.Color := clWhite;
R := Rect(m_TextPoint.X + 1, m_TextPoint.Y + 1, Width, Height);
DrawText(ACanvas.Handle, PChar(Caption), -1, R, DT_LEFT or DT_TOP or DT_SINGLELINE);
ACanvas.Font.Color := clGray;
end
else
begin
if m_MouseDown then
begin
Inc(m_TextPoint.X);
Inc(m_TextPoint.Y);
end;
end;
R := Rect(m_TextPoint.X, m_TextPoint.Y, Width, Height);
DrawText(ACanvas.Handle, PChar(Caption), -1, R, DT_LEFT or DT_TOP or DT_SINGLELINE);
end;
procedure TsuiButton.SetGlyph(const Value: TBitmap);
begin
m_Glyph.Assign(Value);
Repaint();
end;
procedure TsuiButton.SetLayout(const Value: TButtonLayout);
begin
m_Layout := Value;
Repaint();
end;
procedure TsuiButton.SetResHandle(const Value: THandle);
begin
// do nothing
end;
procedure TsuiButton.SetSpacing(const Value: Integer);
begin
m_Spacing := Value;
Repaint();
end;
procedure TsuiButton.UIStyleChanged;
var
OutUIStyle : TsuiUIStyle;
begin
if UsingFileTheme(m_FileTheme, m_UIStyle, OutUIStyle) then
Transparent := m_FileTheme.GetBool(SUI_THEME_BUTTON_TRANSPARENT_BOOL)
else
Transparent := GetInsideThemeBool(OutUIStyle, SUI_THEME_BUTTON_TRANSPARENT_BOOL);
end;
{ TsuiCheckBox }
procedure TsuiCheckBox.CheckStateChanged;
begin
if csLoading in ComponentState then
Exit;
if Assigned(OnClick) then
OnClick(self);
end;
procedure TsuiCheckBox.Click;
begin
DoClick();
inherited;
end;
procedure TsuiCheckBox.CMDialogChar(var Msg: TCMDialogChar);
begin
inherited;
if IsAccel(Msg.CharCode, Caption) and Enabled then
begin
if CanFocus() and Enabled and Visible then
try
SetFocus();
except end;
Click();
Msg.Result := 1;
end
else
Msg.Result := 0;
end;
procedure TsuiCheckBox.CMFocusChanged(var Msg: TCMFocusChanged);
begin
inherited;
Repaint();
end;
procedure TsuiCheckBox.CMFONTCHANGED(var Msg: TMessage);
begin
Repaint();
end;
procedure TsuiCheckBox.CMTextChanged(var Msg: TMessage);
begin
Repaint();
end;
constructor TsuiCheckBox.Create(AOwner: TComponent);
begin
inherited;
Checked := false;
m_Transparent := false;
AutoSize := true;
Height := 17;
Width := 93;
ControlStyle := ControlStyle - [csDoubleClicks];
TabStop := true;
UIStyle := GetSUIFormStyle(AOwner);
end;
procedure TsuiCheckBox.DoClick;
begin
Toggle();
Checked := not Checked;
end;
function TsuiCheckBox.GetPicThemeIndex: Integer;
begin
Result := SUI_THEME_CHECKBOX_IMAGE;
end;
function TsuiCheckBox.GetPicTransparent: Boolean;
begin
Result := false;
end;
function TsuiCheckBox.GetState: TCheckBoxState;
begin
if Checked then
Result := cbChecked
else
Result := cbUnchecked
end;
procedure TsuiCheckBox.MouseDown(Button: TMouseButton; Shift: TShiftState;
X, Y: Integer);
begin
inherited;
if (Button = mbLeft) and CanFocus() and Enabled and Visible then
try
SetFocus();
except end;
end;
function TsuiCheckBox.NeedDrawFocus: Boolean;
begin
Result := TabStop and Focused;
end;
procedure TsuiCheckBox.Notification(AComponent: TComponent;
Operation: TOperation);
begin
inherited;
if AComponent = nil then
Exit;
if (
(Operation = opRemove) and
(AComponent = m_FileTheme)
)then
begin
m_FileTheme := nil;
SetUIStyle(SUI_THEME_DEFAULT);
end;
end;
procedure TsuiCheckBox.Paint;
var
Buf, Bmp : TBitmap;
OutUIStyle : TsuiUIStyle;
Index : Integer;
R : TRect;
X, Y : Integer;
begin
Buf := TBitmap.Create();
Bmp := TBitmap.Create();
Bmp.Transparent := GetPicTransparent();
if m_Checked then
begin
if Enabled then
Index := 1
else
Index := 3;
end
else
begin
if Enabled then
Index := 2
else
Index := 4;
end;
Buf.Canvas.Font.Assign(Font);
if UsingFileTheme(m_FileTheme, m_UIStyle, OutUIStyle) then
m_FileTheme.GetBitmap(GetPicThemeIndex(), Bmp, 4, Index)
else
GetInsideThemeBitmap(OutUIStyle, GetPicThemeIndex(), Bmp, 4, Index);
if m_AutoSize then
begin
Height := Max(Buf.Canvas.TextHeight('W') + 2, Bmp.Height) + 4;
Width := Bmp.Width + 8 + Buf.Canvas.TextWidth(Caption);
end;
Buf.Height := Height;
Buf.Width := Width;
if Transparent then
begin
if Parent <> nil then
begin
if Parent is TTabSheet then
DoTrans(Buf.Canvas, Parent)
else
DoTrans(Buf.Canvas, self);
end
else
DoTrans(Buf.Canvas, self);
end
else
begin
Buf.Canvas.Brush.Color := Color;
Buf.Canvas.FillRect(ClientRect);
end;
Buf.Canvas.Brush.Style := bsClear;
Y := (ClientHeight - Buf.Canvas.TextHeight('W')) div 2;
if (BidiMode = bdRightToLeft) and SysLocale.MiddleEast then
begin
Buf.Canvas.Draw(Width - Bmp.Width - 1, (ClientHeight - Bmp.Height) div 2, Bmp);
X := Bmp.Width + 4;
R := Rect(0, Y, Width - X, Height);
DrawText(Buf.Canvas.Handle, PChar(Caption), -1, R, DT_RIGHT or DT_TOP or DT_SINGLELINE);
end
else
begin
Buf.Canvas.Draw(1, (ClientHeight - Bmp.Height) div 2, Bmp);
X := Bmp.Width + 4;
R := Rect(X, Y, Width, Height);
DrawText(Buf.Canvas.Handle, PChar(Caption), -1, R, DT_LEFT or DT_TOP or DT_SINGLELINE);
end;
if NeedDrawFocus() then
begin
if (BidiMode = bdRightToLeft) and SysLocale.MiddleEast then
R := Rect(0, Y, Width - X + 2, Y + Buf.Canvas.TextHeight('W') + 2)
else
R := Rect(X - 1, Y, Width, Y + Buf.Canvas.TextHeight('W') + 2);
Buf.Canvas.Brush.Style := bsSolid;
Buf.Canvas.DrawFocusRect(R);
end;
Canvas.Draw(0, 0, Buf);
Bmp.Free();
Buf.Free();
end;
procedure TsuiCheckBox.SetAutoSize2(const Value: Boolean);
begin
m_AutoSize := Value;
Repaint();
end;
procedure TsuiCheckBox.SetChecked(const Value: Boolean);
begin
if m_Checked = Value then
Exit;
m_Checked := Value;
Repaint();
CheckStateChanged();
end;
procedure TsuiCheckBox.SetEnabled(Value: Boolean);
begin
inherited;
Repaint();
end;
procedure TsuiCheckBox.SetFileTheme(const Value: TsuiFileTheme);
begin
m_FileTheme := Value;
SetUIStyle(m_UIStyle);
end;
procedure TsuiCheckBox.SetState(const Value: TCheckBoxState);
begin
if Value = cbChecked then
Checked := true
else
Checked := false;
end;
procedure TsuiCheckBox.SetTransparent(const Value: Boolean);
begin
m_Transparent := Value;
Repaint();
end;
procedure TsuiCheckBox.SetUIStyle(const Value: TsuiUIStyle);
begin
m_UIStyle := Value;
Repaint();
end;
procedure TsuiCheckBox.Toggle;
begin
end;
function TsuiCheckBox.WantKeyUp: Boolean;
begin
Result := True;
end;
procedure TsuiCheckBox.WMERASEBKGND(var Msg: TMessage);
begin
// do nothing
end;
procedure TsuiCheckBox.WMKeyUp(var Msg: TWMKeyUp);
begin
inherited;
if not WantKeyUp() then
Exit;
if (
((Msg.CharCode = VK_SPACE) or (Msg.CharCode = VK_RETURN)) and
Focused
) then
begin
if Enabled then
begin
Repaint();
Click();
end;
end;
end;
procedure TsuiCheckBox.WMKillFocus(var Msg: TWMKillFocus);
begin
inherited;
Repaint();
end;
procedure TsuiCheckBox.WMSetFocus(var Msg: TWMSetFocus);
begin
inherited;
Repaint();
end;
{ TsuiRadioButton }
procedure TsuiRadioButton.CheckStateChanged;
begin
if Checked then
begin
UnCheckGroup();
if csLoading in ComponentState then
Exit;
if Assigned(OnClick) then
OnClick(self);
end;
end;
constructor TsuiRadioButton.Create(AOwner: TComponent);
begin
inherited;
ControlStyle := ControlStyle + [csDoubleClicks];
end;
procedure TsuiRadioButton.DoClick;
begin
if not Checked then
Checked := true;
end;
function TsuiRadioButton.GetPicThemeIndex: Integer;
begin
Result := SUI_THEME_RADIOBUTTON_IMAGE;
end;
function TsuiRadioButton.GetPicTransparent: Boolean;
begin
Result := true;
end;
procedure TsuiRadioButton.UnCheckGroup;
var
i : Integer;
begin
if Parent = nil then
Exit;
for i := 0 to Parent.ControlCount - 1 do
begin
if not (Parent.Controls[i] is TsuiRadioButton) then
continue;
if (Parent.Controls[i] as TsuiRadioButton).GroupIndex <> GroupIndex then
continue;
if (Parent.Controls[i] = self) then
continue;
(Parent.Controls[i] as TsuiRadioButton).Checked := false;
end;
end;
function TsuiRadioButton.WantKeyUp: Boolean;
begin
Result := False;
end;
procedure TsuiRadioButton.WMSetFocus(var Msg: TWMSetFocus);
var
Buf : array[0..MAX_PATH - 1] of Char;
begin
inherited;
GetClassName(Msg.FocusedWnd, Buf, MAX_PATH);
if (Buf = 'TsuiRadioGroupButton') and (Msg.FocusedWnd <> Handle) then
Click();
end;
{ TsuiImageButton }
procedure TsuiImageButton.AutoSizeChanged;
begin
if Parent = nil then
Exit;
if not m_AutoSize then
Exit;
if (m_PicNormal.Graphic <> nil) then
begin
Height := m_PicNormal.Height;
Width := m_PicNormal.Width;
end;
end;
constructor TsuiImageButton.Create(AOwner: TComponent);
begin
inherited;
m_PicDisabled := TPicture.Create();
m_PicNormal := TPicture.Create();
m_PicMouseDown := TPicture.Create();
m_PicMouseOn := TPicture.Create();
m_Stretch := false;
m_DrawFocused := false;
end;
destructor TsuiImageButton.Destroy;
begin
m_PicMouseOn.Free();
m_PicMOuseOn := nil;
m_PicMouseDown.Free();
m_PicMouseDown := nil;
m_PicNormal.Free();
m_PicMouseDown := nil;
m_PicDisabled.Free();
m_PicDisabled := nil;
inherited;
end;
function TsuiImageButton.GetUIStyle2: TsuiUIStyle;
begin
Result := FromThemeFile;
end;
procedure TsuiImageButton.PaintButtonDisabled(Buf: TBitmap);
begin
if m_PicDisabled.Graphic <> nil then
Buf.Assign(m_PicDisabled)
else if m_PicNormal.Graphic <> nil then
Buf.Assign(m_PicNormal);
end;
procedure TsuiImageButton.PaintButtonMouseDown(Buf: TBitmap);
begin
if m_PicMouseDown.Graphic <> nil then
Buf.Assign(m_PicMouseDown)
else if m_PicNormal.Graphic <> nil then
Buf.Assign(m_PicNormal);
end;
procedure TsuiImageButton.PaintButtonMouseOn(Buf: TBitmap);
begin
if m_PicMouseOn.Graphic <> nil then
Buf.Assign(m_PicMouseOn)
else if m_PicNormal.Graphic <> nil then
Buf.Assign(m_PicNormal);
end;
procedure TsuiImageButton.PaintButtonNormal(Buf: TBitmap);
begin
if m_PicNormal.Graphic <> nil then
Buf.Assign(m_PicNormal);
end;
procedure TsuiImageButton.PaintFocus(ACanvas: TCanvas);
begin
if m_DrawFocused then
inherited
end;
procedure TsuiImageButton.PaintPic(ACanvas: TCanvas; Bitmap: TBitmap);
begin
if Bitmap = nil then
Exit;
if (Bitmap.Width = 0) or (Bitmap.Height = 0) then
Exit;
Bitmap.TransparentColor := Bitmap.Canvas.Pixels[0, 0];
if m_Stretch then
Acanvas.StretchDraw(rect(0, 0, Width, Height), Bitmap)
else
ACanvas.Draw(0, 0, Bitmap);
end;
procedure TsuiImageButton.SetDrawFocused(const Value: Boolean);
begin
m_DrawFocused := Value;
Repaint();
end;
procedure TsuiImageButton.SetPicDisabledF(const Value: TPicture);
begin
m_PicDisabled.Assign(Value);
AutoSizeChanged();
Repaint();
end;
procedure TsuiImageButton.SetPicMouseDownF(const Value: TPicture);
begin
m_PicMouseDown.Assign(Value);
AutoSizeChanged();
Repaint();
end;
procedure TsuiImageButton.SetPicMouseOnF(const Value: TPicture);
begin
m_PicMouseOn.Assign(Value);
AutoSizeChanged();
Repaint();
end;
procedure TsuiImageButton.SetPicNormalF(const Value: TPicture);
begin
m_PicNormal.Assign(Value);
AutoSizeChanged();
Repaint();
end;
procedure TsuiImageButton.SetStretch(const Value: Boolean);
begin
m_Stretch := Value;
Repaint();
end;
{ TsuiControlButton }
constructor TsuiControlButton.Create(AOwner: TComponent);
begin
inherited;
m_ThemeID := 0;
m_PicIndex := 0;
m_PicCount := 0;
TabStop := false;
UIStyle := SUI_THEME_DEFAULT;
FileTheme := nil;
end;
procedure TsuiControlButton.PaintButtonDisabled(Buf: TBitmap);
var
OutUIStyle : TsuiUIStyle;
begin
if UsingFileTheme(FileTheme, UIStyle, OutUIStyle) then
m_FileTheme.GetBitmap(m_ThemeID, Buf, m_PicCount, m_PicIndex)
else
GetInsideThemeBitmap(OutUIStyle, m_ThemeID, Buf, m_PicCount, m_PicIndex);
end;
procedure TsuiControlButton.PaintButtonMouseDown(Buf: TBitmap);
var
OutUIStyle : TsuiUIStyle;
begin
if UsingFileTheme(FileTheme, UIStyle, OutUIStyle) then
m_FileTheme.GetBitmap(m_ThemeID, Buf, m_PicCount, m_PicIndex)
else
GetInsideThemeBitmap(OutUIStyle, m_ThemeID, Buf, m_PicCount, m_PicIndex);
end;
procedure TsuiControlButton.PaintButtonMouseOn(Buf: TBitmap);
var
OutUIStyle : TsuiUIStyle;
begin
if UsingFileTheme(FileTheme, UIStyle, OutUIStyle) then
m_FileTheme.GetBitmap(m_ThemeID, Buf, m_PicCount, m_PicIndex + 1)
else
GetInsideThemeBitmap(OutUIStyle, m_ThemeID, Buf, m_PicCount, m_PicIndex + 1);
end;
procedure TsuiControlButton.PaintButtonNormal(Buf: TBitmap);
var
OutUIStyle : TsuiUIStyle;
begin
if UsingFileTheme(FileTheme, UIStyle, OutUIStyle) then
m_FileTheme.GetBitmap(m_ThemeID, Buf, m_PicCount, m_PicIndex)
else
GetInsideThemeBitmap(OutUIStyle, m_ThemeID, Buf, m_PicCount, m_PicIndex);
Height := Buf.Height;
Width := Buf.Width;
end;
procedure TsuiControlButton.PaintPic(ACanvas: TCanvas; Bitmap: TBitmap);
begin
if Bitmap = nil then
Exit;
if (Bitmap.Width = 0) or (Bitmap.Height = 0) then
Exit;
Bitmap.TransparentColor := Bitmap.Canvas.Pixels[0, 0];
ACanvas.Draw(0, 0, Bitmap);
Width := Bitmap.Width;
Height := Bitmap.Height;
end;
procedure TsuiControlButton.SetPicCount(const Value: Integer);
begin
m_PicCount := Value;
Repaint();
end;
procedure TsuiControlButton.SetPicIndex(const Value: Integer);
begin
m_PicIndex := Value;
Repaint();
end;
procedure TsuiControlButton.SetThemeID(const Value: Integer);
begin
m_ThemeID := Value;
Repaint();
end;
procedure TsuiControlButton.WMERASEBKGND(var Msg: TMessage);
begin
// Do nothing
end;
{ TsuiToolBarSpeedButton }
constructor TsuiToolBarSpeedButton.Create(AOwner: TComponent);
begin
inherited;
m_Glyph := TBitmap.Create();
Height := 18;
Width := 18;
end;
destructor TsuiToolBarSpeedButton.Destroy;
begin
m_Glyph.Free();
inherited;
end;
procedure TsuiToolBarSpeedButton.MouseEnter(var Msg: TMessage);
begin
m_MouseIn := true;
Repaint();
end;
procedure TsuiToolBarSpeedButton.MouseLeave(var Msg: TMessage);
begin
m_MouseIn := false;
Repaint();
end;
procedure TsuiToolBarSpeedButton.Paint;
var
Buf : TBitmap;
begin
Glyph.Transparent := true;
Buf := TBitmap.Create();
Buf.Width := Width;
Buf.Height := Height;
Buf.Canvas.Brush.Color := Color;
Buf.Canvas.FillRect(ClientRect);
if not Glyph.Empty then
begin
if m_MouseIn then
begin
Buf.Canvas.Brush.Color := clBlack;
Buf.Canvas.FrameRect(ClientRect);
end;
Buf.Canvas.Draw(1, 1, Glyph);
end;
Canvas.Draw(0, 0, Buf);
Buf.Free();
end;
procedure TsuiToolBarSpeedButton.SetGlyph(const Value: TBitmap);
begin
m_Glyph.Assign(Value);
end;
procedure TsuiToolBarSpeedButton.WMERASEBKGND(var Msg: TMessage);
begin
// do nothing
end;
{ TsuiArrowButton }
procedure TsuiArrowButton.PaintPic(ACanvas: TCanvas; Bitmap: TBitmap);
var
W, H: Integer;
begin
SpitDraw(Bitmap, ACanvas, ClientRect, PicTransparent);
ACanvas.Brush.Color := clBlack;
ACanvas.Pen.Color := clBlack;
W := (Width - 6) div 2;
H := (Height - 3) div 2;
if m_Arrow = suiUp then
ACanvas.Polygon([Point(W, H + 3), Point(W + 3, H), Point(W + 6, H + 3)]);
if m_Arrow = suiDown then
ACanvas.Polygon([Point(W, H), Point(W + 3, H + 3), Point(W + 6, H)]);
end;
procedure TsuiArrowButton.PaintText(ACanvas: TCanvas; Text: String);
begin
// do nothing
end;
procedure TsuiArrowButton.SetArrow(const Value: TsuiArrowButtonType);
begin
m_Arrow := Value;
Repaint();
end;
procedure TsuiArrowButton.UIStyleChanged;
var
OutUIStyle : TsuiUIStyle;
begin
if UsingFileTheme(m_FileTheme, m_UIStyle, OutUIStyle) then
Transparent := m_FileTheme.GetBool(SUI_THEME_BUTTON_TRANSPARENT_BOOL)
else
Transparent := GetInsideThemeBool(OutUIStyle, SUI_THEME_BUTTON_TRANSPARENT_BOOL);
end;
end.
|
{
This file contains a basic engine for Petris - YATC.
It is the engine to handle all Petris related game states. By connecting this to a
client front end (LCL, SDL etc.) it is relatively easy to create a working Tetris clone.
This is an engine for demonstration purposes only.
Copyright (C) 2018 ENY (eny_fpc@ziggo.nl)
This source is free software; you can redistribute it and/or modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later
version.
This code is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details.
A copy of the GNU General Public License is available on the World Wide Web at
<http://www.gnu.org/copyleft/gpl.html>. You can also obtain it by writing to the Free Software Foundation, Inc., 51
Franklin Street - Fifth Floor, Boston, MA 02110-1335, USA.
}
unit PetrisEngine;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils;
const
C_BOARD_WIDTH = 10;
C_BOARD_PLAYHEIGHT = 20;
C_BOARD_HEIGHT = C_BOARD_PLAYHEIGHT + 2;
C_HISTORY_STACK = 4;
C_HISTORY_RETRY = 5;
C_ROWS_TO_NEXT_LEVEL = 10;
type
TPetrisGameState = ( gsReady, gsFalling, gsLockDown, gsEnded );
TPetriminoOrientation = ( poNorth, poEast, poSouth, poWest );
TPetriminoType = ( pmtO, pmtI, pmtT, pmtL, pmtJ, pmtS, pmtZ );
TPetrisCellState = ( pssOpen, pssMino, pssOccupied );
TPetrisMatrixCell = record
CellState: TPetrisCellState;
MinoType: TPetriminoType;
end;
TPetrisMatrix = array[1..C_BOARD_WIDTH, 1..C_BOARD_HEIGHT] of TPetrisMatrixCell;
TPetriminoCountArray = array[TPetriminoType] of integer;
TPetriminoStack = array[0..C_HISTORY_STACK-1] of TPetriminoType;
{ TPetrimino }
TMinosArray = array[0..3] of TPoint;
TPetrimino = class
private
FOrientation: TPetriminoOrientation;
FPetriminoType: TPetriminoType;
FMinos: TMinosArray;
FTopLeft: TPoint;
procedure SetUpMinos;
procedure SetOrientation(pValue: TPetriminoOrientation);
procedure SetPetriminoType(pValue: TPetriminoType);
public
procedure MoveDown;
procedure MoveRel( const pDeltaX, pDeltaY: integer );
function Position( const pMino: integer): TPoint;
property Orientation: TPetriminoOrientation read FOrientation write SetOrientation;
property PetriminoType: TPetriminoType read FPetriminoType write SetPetriminoType;
property TopLeft: TPoint read FTopLeft write FTopLeft;
end;
{ TPetrisGame }
TPetrisGame = class;
TPetrisGameNotifyEvent = procedure( pGame: TPetrisGame ) of object;
TPetrisGame = class
private
FMatrix: TPetrisMatrix;
FCurrent: TPetrimino;
FOnPipelineChanged: TPetrisGameNotifyEvent;
FPipeLine: TPetrimino;
FInternalGameState: TPetrisGameState;
FScore: integer;
FLevel: integer;
FOnEnterFallingPhase: TPetrisGameNotifyEvent;
FOnEnterLockPhase: TPetrisGameNotifyEvent;
FOnGameEnded: TPetrisGameNotifyEvent;
FOnMatrixChanged: TPetrisGameNotifyEvent;
FHistory: TPetriminoStack;
FPetriminoCount: TPetriminoCountArray;
FRowsDeleted: integer;
procedure BlockToBoard( const pBlock: TPetrimino; const pNewState: TPetrisCellState = pssMino);
procedure BlockFromBoard( const pBlock: TPetrimino);
function GetMatrixCell(const pCol, pRow: integer): TPetrisMatrixCell;
procedure NextInPipeline;
procedure SetInternalGameState(pValue: TPetrisGameState);
procedure GenerateNextPetrimino;
procedure CheckEnterLockPhase;
function CurrentCanMoveDown: boolean;
procedure MoveBlock( const pDeltaX, pDeltaY: integer);
procedure MoveHorizontal( const pDeltaX: integer );
procedure MoveVertical;
procedure FixateBlock;
procedure GetNextBlock;
procedure Execute( const pNotifyEvent: TPetrisGameNotifyEvent );
function OrientationOK(const pNewOrientation: TPetriminoOrientation): boolean;
procedure IncreaseScore(const pPoints: integer);
procedure CheckForPatterns;
property InternalGameState: TPetrisGameState read FInternalGameState write SetInternalGameState;
public
constructor Create;
destructor Destroy; override;
procedure Next;
function GameState: TPetrisGameState;
procedure MoveLeft;
procedure MoveRight;
procedure RotateClockwise;
procedure DropBlockDown;
function PetriminoCount( const pType: TPetriminoType ): integer;
property Level: integer read FLevel write FLevel;
property Score: integer read FScore;
property Mino[const pCol, pRow: integer]: TPetrisMatrixCell read GetMatrixCell; default;
property PipeLine: TPetrimino read FPipeLine;
// Notify events for the GUI
property OnMatrixChanged: TPetrisGameNotifyEvent read FOnMatrixChanged write FOnMatrixChanged;
property OnEnterFallingPhase: TPetrisGameNotifyEvent read FOnEnterFallingPhase write FOnEnterFallingPhase;
property OnEnterLockPhase: TPetrisGameNotifyEvent read FOnEnterLockPhase write FOnEnterLockPhase;
property OnEndGame: TPetrisGameNotifyEvent read FOnGameEnded write FOnGameEnded;
property OnPipelineChanged: TPetrisGameNotifyEvent read FOnPipelineChanged write FOnPipelineChanged;
end;
const
C_PETRIMINOS: array[TPetriminoType, TPetriminoOrientation ] of integer =
(
( %0110011000000000, %0110011000000000, %0110011000000000, %0110011000000000 ), // O
( %0000111100000000, %0010001000100010, %0000000011110000, %0100010001000100 ), // I
( %0100111000000000, %0100011001000000, %0000111001000000, %0100110001000000 ), // T
( %0010111000000000, %0100010001100000, %0000111010000000, %1100010001000000 ), // L
( %1000111000000000, %0110010001000000, %0000111000100000, %0100010011000000 ), // J
( %0110110000000000, %0100011000100000, %0000011011000000, %1000110001000000 ), // S
( %1100011000000000, %0010011001000000, %0000110001100000, %0100110010000000 ) // Z
);
implementation
{ TPetrimino }
procedure TPetrimino.MoveRel(const pDeltaX, pDeltaY: integer);
begin
with FTopLeft do
begin
inc(X, pDeltaX);
inc(Y, pDeltaY)
end;
end;
function TPetrimino.Position(const pMino: integer): TPoint;
begin
with result do
begin
X := FTopLeft.X + FMinos[pMino].x;
Y := FTopLeft.Y + FMinos[pMino].y;
end;
end;
procedure TPetrimino.SetUpMinos;
var MinoMask: integer;
Col,Row : integer;
MinoNum : integer;
begin
MinoMask := C_PETRIMINOS[PetriminoType, Orientation];
MinoNum := 0;
for row := 0 to 3 do
if MinoNum < 4 then
for col := 0 to 3 do
begin
// Mino position found?
if MinoMask and (%1000000000000000) = %1000000000000000 then
begin
FMinos[MinoNum] := Point(col,-row); // Note that rows count down hence minus
inc(MinoNum);
if MinoNum = 4 then break;
end;
// Next bit position
MinoMask := MinoMask shl 1;
end
end;
procedure TPetrimino.SetOrientation(pValue: TPetriminoOrientation);
begin
if FOrientation = pValue then Exit;
FOrientation := pValue;
SetUpMinos;
end;
procedure TPetrimino.SetPetriminoType(pValue: TPetriminoType);
begin
if FPetriminoType = pValue then Exit;
FPetriminoType := pValue;
SetUpMinos;
end;
procedure TPetrimino.MoveDown;
begin
MoveRel(0, -1)
end;
{ TPetrisGame }
constructor TPetrisGame.Create;
begin
// Init some values
FInternalGameState := gsReady;
FLevel := 1;
fillchar(FMatrix, sizeof(FMatrix), 0);
fillchar(FPetriminoCount, sizeof(FPetriminoCount), 0);
FCurrent := TPetrimino.Create; // Petrimino to control by the user
FPipeLine := TPetrimino.Create; // Pipeline (next petrimino)
// Start history: try not to start with any of the shapes below
FHistory[0] := pmtS;
FHistory[1] := pmtZ;
FHistory[2] := pmtS;
FHistory[2] := pmtZ;
end;
destructor TPetrisGame.Destroy;
begin
FPipeLine.Free;
FCurrent.Free;
inherited Destroy;
end;
function TPetrisGame.GameState: TPetrisGameState;
begin
result := InternalGameState;
end;
procedure TPetrisGame.SetInternalGameState(pValue: TPetrisGameState);
begin
if FInternalGameState = pValue then Exit;
FInternalGameState := pValue;
end;
procedure TPetrisGame.Execute(const pNotifyEvent: TPetrisGameNotifyEvent);
begin
if assigned(pNotifyEvent) then
pNotifyEvent( self );
end;
procedure TPetrisGame.IncreaseScore(const pPoints: integer);
begin
inc(FScore, pPoints)
end;
function TPetrisGame.OrientationOK(const pNewOrientation: TPetriminoOrientation): boolean;
var CurrentOrientation: TPetriminoOrientation;
i: integer;
begin
// Keep the current orientation for backup and set to the new one for testing
CurrentOrientation := FCurrent.Orientation;
FCurrent.Orientation := pNewOrientation;
// Check if all new positions are within the board and fit
result := true; // Assume all is ok
for i := 0 to 3 do
with FCurrent.Position(i) do
if (X < 1) or
(X > C_BOARD_WIDTH) or (Y < 1) or
(Mino[X,Y].CellState = pssOccupied)
then
begin
result := false;
break
end;
// Reset orientation
FCurrent.Orientation := CurrentOrientation;
end;
procedure TPetrisGame.CheckForPatterns;
var row, col : integer;
WorldRow : integer;
uprow : integer;
RowsDeleted: integer;
RowFull : boolean;
begin
// Check for the max 4 rows of the current block
RowsDeleted := 0;
for row := 0 to 3 do
begin
// Translate relative row number to number in the matrix and check if valid
WorldRow := FCurrent.TopLeft.y - row;
if WorldRow < 1 then break;
RowFull := true; // Assume the row is full
for col := 1 to 10 do
if Mino[col, WorldRow].CellState <> pssOccupied then
begin
// An empty cell was found --> stop checking the row is not full
RowFull := false;
break
end;
// Row to delete?
if RowFull then
begin
inc(RowsDeleted);
for uprow := WorldRow to C_BOARD_HEIGHT-1 do
for col := 1 to 10 do
FMatrix[col, uprow].CellState := Mino[col, uprow+1].CellState;
end;
end;
// When rows deleted add to the score and signal a board change
if RowsDeleted > 0 then
begin
inc(FRowsDeleted, RowsDeleted);
if FRowsDeleted > C_ROWS_TO_NEXT_LEVEL then
begin
inc(Flevel);
FRowsDeleted := 0;
end;
IncreaseScore(level * 20 * (RowsDeleted * RowsDeleted));
Execute( FOnMatrixChanged );
end;
end;
procedure TPetrisGame.BlockToBoard(const pBlock: TPetrimino; const pNewState: TPetrisCellState);
var i: integer;
begin
for i := 0 to 3 do
with pBlock.Position(i) do
begin
FMatrix[X,Y].CellState := pNewState;
FMatrix[X,Y].MinoType := pBlock.FPetriminoType;
end;
end;
procedure TPetrisGame.BlockFromBoard(const pBlock: TPetrimino);
var i: integer;
begin
for i := 0 to 3 do
with pBlock.Position(i) do
FMatrix[ X,Y].CellState := pssOpen
end;
function TPetrisGame.GetMatrixCell(const pCol, pRow: integer): TPetrisMatrixCell;
begin
result := FMatrix[pCol, pRow]
end;
procedure TPetrisGame.NextInPipeline;
var j,h: integer;
InHistory: boolean;
NextPT: TPetriminoType;
begin
j := C_HISTORY_RETRY;
repeat
// Next index - check if it is in the history
NextPT := TPetriminoType(random(7));
InHistory := false;
for h := 0 to C_HISTORY_STACK-1 do
if FHistory[h] = NextPT then
begin
// Found the new block in the history - skip it
dec(j);
InHistory := true;
break;
end;
// If not in history then the block type can be chosen
if not InHistory then j := 0;
until j = 0;
FPipeLine.PetriminoType := TPetriminoType(NextPT);
Execute( FOnPipelineChanged );
// Update the history
for h := C_HISTORY_STACK-1 downto 1 do
FHistory[h] := FHistory[h-1];
FHistory[0] := NextPT;
end;
procedure TPetrisGame.GenerateNextPetrimino;
begin
// Get the next block in line; add it to the board above the matrix and drop one down
// so it falls in view (top line of the matrix).
GetNextBlock;
BlockToBoard(FCurrent);
InternalGameState := gsFalling;
MoveVertical;
end;
function TPetrisGame.CurrentCanMoveDown: boolean;
var i: integer;
begin
// Check if all minos in the current block can go down one position
result := false; // Assume it will fail
for i := 0 to 3 do
with FCurrent.Position(i) do
if (y = 1) or (Mino[X, Y-1].CellState = pssOccupied) then
exit;
// All has gone well: the block can drop
result := true;
end;
procedure TPetrisGame.MoveBlock(const pDeltaX, pDeltaY: integer);
begin
// Execute the block movement
BlockFromBoard(FCurrent);
FCurrent.MoveRel(pDeltaX, pDeltaY);
BlockToBoard(FCurrent);
// Notify the GUI about the update
Execute( FOnMatrixChanged );
// Check if the movement resulted in a lock state (hit another block below)
CheckEnterLockPhase;
end;
procedure TPetrisGame.MoveVertical;
begin
if not CurrentCanMoveDown then
InternalGameState := gsEnded
else
begin
// Update score here, move the block and check if the block has entered the falling state
IncreaseScore(Level); // Simple scoring mechanism
MoveBlock(0, -1);
if InternalGameState = gsFalling then
Execute( FOnEnterFallingPhase );
end;
end;
procedure TPetrisGame.CheckEnterLockPhase;
begin
// Check if the block can move down one square. If not, trigger the lock down delay
if CurrentCanMoveDown then
InternalGameState := gsFalling
else
if InternalGameState <> gsLockDown then // Only trigger if not yet in locked state
begin;
InternalGameState := gsLockDown;
Execute( OnEnterLockPhase )
end;
end;
procedure TPetrisGame.FixateBlock;
begin
BlockToBoard(FCurrent, pssOccupied);
CheckForPatterns;
GenerateNextPetrimino;
end;
procedure TPetrisGame.GetNextBlock;
begin
// Move the next block from the pipeline to the active one
FCurrent.PetriminoType := PipeLine.PetriminoType;
FCurrent.TopLeft := Point((C_BOARD_WIDTH div 2) - 1, C_BOARD_PLAYHEIGHT + 2);
Fcurrent.Orientation := poNorth;
// Update the block count for statistical reasons (gui can show the blocks used so far)
FPetriminoCount[FCurrent.PetriminoType] := FPetriminoCount[FCurrent.PetriminoType] + 1;
// Put a new block in the pipeline
NextInPipeline;
end;
procedure TPetrisGame.MoveHorizontal(const pDeltaX: integer);
var i : integer;
NewCol : integer;
OldState: TPetrisGameState;
begin
// Abort if the block would violate the board constraints or ends on a fixed cell
for i := 0 to 3 do
with FCurrent.Position(i) do
begin
NewCol := X + pDeltaX;
if (NewCol < 1) or (NewCol > C_BOARD_WIDTH) then
exit;
// Is the position in the board occupied?
if Mino[NewCol, Y].CellState = pssOccupied then
exit;
end;
// Store the current state
OldState := InternalGameState;
// Move the block
MoveBlock(pDeltaX, 0);
// If the state went form locked to falling, trigger the event
if (OldState = gsLockDown) and (InternalGameState = gsFalling) then
Execute( OnEnterFallingPhase );
end;
procedure TPetrisGame.RotateClockwise;
var NewOrientation: TPetriminoOrientation;
begin
// Determine what the next orientation is
if FCurrent.Orientation = high(TPetriminoOrientation) then
NewOrientation := low(TPetriminoOrientation)
else
NewOrientation := succ(FCurrent.Orientation);
// Check if the new orientation is possible
if OrientationOK(NewOrientation) then
begin
// Rotate the block on the board
BlockFromBoard(FCurrent);
FCurrent.Orientation := NewOrientation;
BlockToBoard(FCurrent);
// Notify the GUI about the update
Execute( FOnMatrixChanged );
// Check if the block movement resulted in a lock state (hit another block below)
CheckEnterLockPhase;
end;
end;
procedure TPetrisGame.MoveLeft;
begin
MoveHorizontal( -1 )
end;
procedure TPetrisGame.MoveRight;
begin
MoveHorizontal( +1 )
end;
procedure TPetrisGame.DropBlockDown;
begin
while CurrentCanMoveDown do
begin
IncreaseScore(Level);
MoveBlock(0, -1);
end;
FixateBlock;
end;
function TPetrisGame.PetriminoCount(const pType: TPetriminoType): integer;
begin
result := FPetriminoCount[pType]
end;
procedure TPetrisGame.Next;
begin
case InternalGameState of
gsReady : begin
NextInPipeline;
GenerateNextPetrimino;
end;
gsFalling : MoveVertical;
gsLockDown : FixateBlock;
end;
// Game ended?
if InternalGameState = gsEnded then
Execute( FOnGameEnded );
end;
end.
|
unit CCHint;
interface
uses
SysUtils, Windows, Messages, Classes, Graphics, Controls,
Forms, Dialogs;
Const
Sqrt2 = 1.4142135624;
type
TDrawHint =
procedure (Sender : TObject; Canvas : TCanvas; var R : TRect) of object;
TOnHint =
procedure (Sender : TObject; Hint : string) of object;
TCCHint = class(TComponent)
private
{ Private declarations }
FHintPauseTime : Integer;
FFontColor : TColor;
FHintColor : TColor;
FPen : TPen;
FBrush : TBrush;
fFont : TFont;
fDrawHint : TDrawHint;
fOnShowHint : TShowHintEvent;
fOnHint : TOnHint;
procedure SetHintPauseTime(Value:Integer);
Procedure SetPen(Value : TPen);
Procedure SetBrush(Value : TBrush);
procedure fSetFont(Font : TFont);
procedure DoOnShowHint(var HintStr: string; var CanShow:
Boolean; var HintInfo: THintInfo);
procedure DoOnHint(Sender: TObject);
protected
{ Protected declarations }
public
{ Public declarations }
constructor Create(AOwner:TComponent); Override;
destructor Destroy; Override;
published
{ Published declarations }
property HintPauseTime : Integer read FHintPauseTime
write SetHintPauseTime default 600;
property Pen : TPen Read FPen Write SetPen;
property Brush : TBrush Read FBrush Write SetBrush;
property FontColor : TColor Read FFontColor
Write FFontColor Default clBlack;
property HintColor : TColor Read FHintColor
Write FHintColor Default clYellow;
property Font : TFont read fFont write fSetFont;
property OnDrawHint : TDrawHint read fDrawHint write fDrawHint;
property OnHint : TOnHint read fOnHint write fOnHint;
property OnShowHint : TShowHintEvent read fOnShowHint write fOnShowHint;
end;
TNxHintWindow = class(THintWindow)
private
{ Private declarations }
FNxHint : TCCHint;
function FindNxHint : TCCHint;
protected
{ Protected declarations }
procedure Paint; Override;
procedure CreateParams(var Params: TCreateParams); Override;
public
{ Public declarations }
procedure ActivateHint(Rect: TRect; const AHint: string); Override;
published
{ Published declarations }
end;
procedure Register;
implementation
var
MemBmp : TBitmap;
procedure Register;
begin
RegisterComponents('CÀïÀ̳×', [TCCHint]);
end;
Constructor TCCHint.Create(AOwner:TComponent);
begin
inherited Create(AOwner);
FPen := TPen.Create;
FBrush := TBrush.Create;
fFont := TFont.Create;
FBrush.Color := clYellow;
FFontColor := clBlack;
FHintColor := clYellow;
FHintPauseTime := 600;
if not (csReading in ComponentState) then
begin
Application.OnShowHint := DoOnShowHint;
Application.OnHint := DoOnHint;
Application.HintPause := FHintPauseTime;
HintWindowClass := TNxHintWindow;
Application.ShowHint := not Application.ShowHint;
Application.ShowHint := not Application.ShowHint;
end;
end;
destructor TCCHint.Destroy;
begin
FPen.Free;
FBrush.Free;
fFont.Free;
inherited Destroy;
end;
Procedure TCCHint.fSetFont(Font : TFont);
begin
fFont := Font;
end;
Procedure TCCHint.SetHintPauseTime(Value : Integer);
Begin
If (Value <> FHintPauseTime) Then Begin
FHintPauseTime := Value;
Application.HintPause := Value;
End;
End;
Procedure TCCHint.SetPen(Value : TPen);
Begin
FPen.Assign(Value);
End;
Procedure TCCHint.SetBrush(Value : TBrush);
Begin
FBrush.Assign(Value);
End;
Function TNxHintWindow.FindNxHint : TCCHint;
var
I : Integer;
begin
Result := nil;
For I := 0 To Application.MainForm.ComponentCount-1 Do
If Application.MainForm.Components[I] Is TCCHint Then Begin
Result := TCCHint(Application.MainForm.Components[I]);
Exit;
End;
End;
procedure TNxHintWindow.CreateParams(var Params : TCreateParams);
begin
inherited CreateParams(Params);
Params.Style := Params.Style-WS_BORDER;
end;
procedure TNxHintWindow.Paint;
var
R : TRect;
OfstX,OfstY : Integer;
begin
R := ClientRect;
With MemBMP.Canvas Do Begin
Pen.Assign(FNxHint.FPen);
Brush.Assign(FNxHint.FBrush);
Font.Assign(FNxHint.FFont);
Brush.Color := FNxHint.FHintColor;
Font.Color := FNxHint.FFontColor;
OfstX := (R.Right-R.Left-TextWidth(Caption)) Div 2;
OfstY := (R.Bottom-R.Top-TextHeight(Caption)) Div 2;
if Assigned (FNxHint.fDrawHint) then
FNxHint.fDrawHint(self, MemBMP.Canvas, R)
else
begin
Ellipse(R.Left,R.Top,R.Right,R.Bottom);
{
RoundRect( R.Left,R.Top,R.Right,R.Bottom,
(R.Bottom - R.Right) div 3, (R.Bottom - R.Right) div 3);
}
end;
Brush.Style := bsClear;
TextOut(R.Left+OfstX,R.Top+OfstY,Caption);
End;
Canvas.CopyMode:=cmSrcCopy;
Canvas.CopyRect(ClientRect,MemBmp.Canvas,ClientRect);
MemBmp.Free;
end;
procedure TNxHintWindow.ActivateHint(Rect: TRect; const AHint: string);
var
ScreenDC : HDC;
Pnt : TPoint;
OfstX,OfstY : Integer;
begin
MemBmp := TBitmap.Create;
Caption := AHint;
FNxHint := FindNxHint;
MemBmp.Canvas.Font := FNxHint.FFont ;
Rect.Right := Rect.Left + MemBmp.Canvas.TextWidth(AHint);
Rect.Bottom := Rect.Top + MemBmp.Canvas.TextHeight(AHint);
OfstX := Round((Rect.Right-Rect.Left-4)*(Sqrt2-1)*0.5);
OfstY := Round((Rect.Bottom-Rect.Top-4)*(Sqrt2-1)*0.5);
With Rect Do Begin
Top := Top-OfstY;
Left := Left-OfstX;
Right := Right+OfstX;
Bottom := Bottom+OfstY;
End;
BoundsRect := Rect;
MemBmp.Width := Width;
MemBmp.Height := Height;
ScreenDC := CreateDC('DISPLAY',nil,nil,nil);
Pnt.X := 0;
Pnt.Y := 0;
Pnt := ClientToScreen(Pnt);
BitBlt(MemBmp.Canvas.Handle,0,0,Width,Height,ScreenDC,Pnt.X,Pnt.Y,SRCCOPY);
SetWindowPos(Handle,HWND_TOPMOST,Pnt.X,Pnt.Y,0,0,
SWP_SHOWWINDOW or SWP_NOACTIVATE or SWP_NOSIZE);
BitBlt(Canvas.Handle,0,0,Width,Height,MemBmp.Canvas.Handle,0,0,SRCCOPY);
DeleteDC(ScreenDC);
end;
procedure TCCHint.DoOnShowHint(var HintStr: string; var CanShow: Boolean;
var HintInfo: THintInfo);
begin
if Assigned(fOnShowHint) then fOnShowHint(HintStr, CanShow, HintInfo);
end;
procedure TCCHint.DoOnHint(Sender: TObject);
begin
if Assigned(fOnHint) then fOnHint(Sender, Application.Hint);
end;
end.
|
Unit PascalCoin.FMX.DataModule;
Interface
Uses
System.SysUtils, System.Classes, System.ImageList, FMX.ImgList,
PascalCoin.Wallet.Interfaces, PascalCoin.FMX.Wallet.Shared, Data.DB,
Datasnap.DBClient, Spring, PascalCoin.Update.Interfaces,
PascalCoin.RPC.Interfaces, FireDAC.Stan.Intf, FireDAC.Stan.Option,
FireDAC.Stan.Param, FireDAC.Stan.Error, FireDAC.DatS, FireDAC.Phys.Intf,
FireDAC.DApt.Intf, FireDAC.Comp.DataSet, FireDAC.Comp.Client,
PascalCoin.Utils.Interfaces, FMX.Types;
Type
TPascalCoinNodeChange = Procedure(NodeRec: TStringPair;
NodeStatus: IPascalCoinNodeStatus) Of Object;
TMainDataModule = Class(TDataModule)
ImageList: TImageList;
AccountsData: TFDMemTable;
AccountsDataAccountNumber: TIntegerField;
AccountsDataCheckSum: TIntegerField;
AccountsDataAccountName: TStringField;
AccountsDataBalance: TCurrencyField;
AccountsDataAccountNumChkSum: TStringField;
AccountsDataNOps: TIntegerField;
AccountsDataAccountState: TStringField;
LockTimer: TTimer;
Procedure AccountsDataCalcFields(DataSet: TDataSet);
Procedure DataModuleCreate(Sender: TObject);
private
FInitialising: boolean;
FConfig: IPascalCoinWalletConfig;
FAPI: IPascalCoinAPI;
FUtils: IPascalCoinTools;
FWallet: IWallet;
FSettingsName: String;
FAccountUpdate: IFetchAccountData;
FPascBalance: Currency;
FStoredAccount: Integer;
FOnBalanceChangeEvent: Event<TPascalCoinCurrencyEvent>;
FNodeChangeEvent: Event<TPascalCoinNodeChange>;
FInitComplete: Event<TNotifyEvent>;
FOnAccountsUpdated: Event<TNotifyEvent>;
FSelectedNodeURI: String;
FSelectedNodeName: String;
FKeyTools: IKeyTools;
Function GetWallet: IWallet;
Procedure LoadSettings;
Function GetPascBalance: Currency;
Function GetBalanceChangeEvent: IEvent<TPascalCoinCurrencyEvent>;
Procedure SetPascBalance(Const Value: Currency);
procedure AccountsUpdated(Value: IUpdatedAccounts);
Procedure SetNodeURI(Const Value: String);
Function GetNodeChangeEvent: IEvent<TPascalCoinNodeChange>;
Function GetInitCompleteEvent: IEvent<TNotifyEvent>;
Function GetHasAccounts: boolean;
Function GetAPI: IPascalCoinAPI;
Function GetOnAccountsUpdated: IEvent<TNotifyEvent>;
Procedure UnlockTimeChanged(Const Value: Integer);
function CalcBalance: Currency;
public
{ Public declarations }
Settings: TWalletAppSettings;
Procedure SaveSettings;
Function TryUnlock: boolean;
Procedure DisableAccountData;
Procedure EnableAccountData;
Procedure ResetLockTimer;
Procedure StartAccountUpdates;
function NewAPI(const AURI: String = ''): IPascalCoinAPI;
procedure UpdatesPause;
procedure UpdatesRestart;
Property Config: IPascalCoinWalletConfig read FConfig;
Property Wallet: IWallet read GetWallet;
Property PascBalance: Currency read FPascBalance write SetPascBalance;
Property NodeURI: String write SetNodeURI;
Property SelectedNodeName: String read FSelectedNodeName;
Property SelectedNodeURI: String read FSelectedNodeURI;
Property HasAccounts: boolean read GetHasAccounts;
Property Utils: IPascalCoinTools read FUtils;
Property KeyTools: IKeyTools read FKeyTools;
Property API: IPascalCoinAPI read GetAPI;
Property OnBalanceChangeEvent: IEvent<TPascalCoinCurrencyEvent>
read GetBalanceChangeEvent;
Property OnNodeChange: IEvent<TPascalCoinNodeChange>
read GetNodeChangeEvent;
Property OnInitComplete: IEvent<TNotifyEvent> read GetInitCompleteEvent;
Property OnAccountsUpdated: IEvent<TNotifyEvent> read GetOnAccountsUpdated;
End;
Var
MainDataModule: TMainDataModule;
Implementation
{%CLASSGROUP 'FMX.Controls.TControl'}
Uses System.IOUtils, System.StrUtils, Rest.JSON;
{$R *.dfm}
Procedure TMainDataModule.AccountsDataCalcFields(DataSet: TDataSet);
Begin
If DataSet.State In [dsCalcFields, dsInternalCalc] Then
Begin
AccountsDataAccountNumChkSum.Value := AccountsDataAccountNumber.AsString +
'-' + AccountsDataCheckSum.AsString;
End;
End;
Procedure TMainDataModule.DataModuleCreate(Sender: TObject);
Var
TS: TStringList;
Begin
FInitialising := True;
FormatSettings.CurrencyString := 'Ƿ'; // U+01F7 Ƿ
FormatSettings.CurrencyFormat := 0;
FormatSettings.CurrencyDecimals := 4;
FWallet := Nil;
AccountsData.CreateDataSet;
FConfig := UConfig;
FUtils := FConfig.Container.Resolve<IPascalCoinTools>;
FKeyTools := FConfig.Container.Resolve<IKeyTools>;
FWallet := FConfig.Container.Resolve<IWallet>;
FSettingsName := TPath.Combine
(TPath.GetDirectoryName(FWallet.GetWalletFileName), 'PascalCoinFMX.json');
LoadSettings;
FAccountUpdate := FConfig.Container.Resolve<IFetchAccountData>;
FAccountUpdate.NodeURI := FSelectedNodeURI;
FAccountUpdate.OnSync.Add(AccountsUpdated);
TS := TStringList.Create;
Try
FWallet.PublicKeysToStrings(TS, TKeyEncoding.Base58);
FAccountUpdate.KeyStyle := TKeyStyle.ksB58Key;
FAccountUpdate.AddPublicKeys(TS);
Finally
TS.Free;
End;
End;
Procedure TMainDataModule.DisableAccountData;
Begin
AccountsData.DisableControls;
FStoredAccount := AccountsDataAccountNumber.Value;
End;
Procedure TMainDataModule.EnableAccountData;
Begin
AccountsData.Locate('AccountNumber', FStoredAccount, []);
FStoredAccount := 0;
AccountsData.EnableControls;
End;
Function TMainDataModule.GetAPI: IPascalCoinAPI;
Begin
if not Assigned(FAPI) then
begin
FAPI := NewAPI;
end;
result := FAPI;
End;
Function TMainDataModule.GetBalanceChangeEvent
: IEvent<TPascalCoinCurrencyEvent>;
Begin
result := FOnBalanceChangeEvent;
End;
Function TMainDataModule.GetHasAccounts: boolean;
Begin
result := AccountsData.RecordCount > 0;
End;
Function TMainDataModule.GetInitCompleteEvent: IEvent<TNotifyEvent>;
Begin
result := FInitComplete;
End;
Function TMainDataModule.GetNodeChangeEvent: IEvent<TPascalCoinNodeChange>;
Begin
result := FNodeChangeEvent;
End;
Function TMainDataModule.GetOnAccountsUpdated: IEvent<TNotifyEvent>;
Begin
result := FOnAccountsUpdated;
End;
Function TMainDataModule.GetPascBalance: Currency;
Begin
result := FPascBalance;
End;
Function TMainDataModule.GetWallet: IWallet;
Begin
result := FWallet;
End;
Procedure TMainDataModule.LoadSettings;
Var
lNode: TNodeRecord;
Begin
Settings := TWalletAppSettings.Create;
If TFile.Exists(FSettingsName) Then
Begin
Settings.AsJSON := TFile.ReadAllText(FSettingsName);
End;
Settings.OnUnlockTimeChange.Add(UnlockTimeChanged);
LockTimer.Interval := Settings.UnlockTime * 1000;
If Settings.Nodes.Count = 0 Then
Begin
{$IFDEF TESTNET}
Settings.Nodes.Add(TNodeRecord.Create('LocalHost TestNet',
'http://127.0.0.1:4103', 'ntTestNet'));
Settings.SelectedNodeURI := 'http://127.0.0.1:4103';
{$ELSE}
Settings.Nodes.Add(TNodeRecord.Create('LocalHost Live',
'http://127.0.0.1:4003', 'ntLive'));
Settings.SelectedNodeURI := 'http://127.0.0.1:4003';
{$ENDIF}
End;
NodeURI := Settings.SelectedNodeURI;
End;
function TMainDataModule.NewAPI(const AURI: String): IPascalCoinAPI;
begin
Result := FConfig.Container.Resolve<IPascalCoinAPI>.URI(IfThen(AURI <> '', AURI, FSelectedNodeURI));
end;
Procedure TMainDataModule.ResetLockTimer;
Begin
If Not LockTimer.Enabled Then
Exit;
LockTimer.Enabled := False;
LockTimer.Enabled := True;
End;
Procedure TMainDataModule.AccountsUpdated(Value: IUpdatedAccounts);
Var
I, lAccounts, lAccount: Integer;
lBalance: Currency;
Begin
lBalance := 0;
If Value = Nil Then
Begin
If FInitialising Then
Begin
// NOT initialised so
// FInitialising := False;
FInitComplete.Invoke(Self);
End;
Exit;
End;
if not AccountsData.IsEmpty then
FStoredAccount := AccountsDataAccountNumber.Value
else
FStoredAccount := -1;
lAccounts := Value.Count;
AccountsData.DisableControls;
Try
For I := 0 To Value.Count - 1 Do
Begin
lAccount := Value[I].account.account;
If AccountsData.Locate('AccountNumber', lAccount, []) Then
Begin
case Value[I].Status of
TAccountUpdateStatus.NoChange: begin
Continue;
end;
TAccountUpdateStatus.Changed: AccountsData.Edit;
TAccountUpdateStatus.Added:Continue;//?? need to trap this
TAccountUpdateStatus.Deleted:begin
AccountsData.Delete;
end;
end;
End
Else if Value[I].Status = TAccountUpdateStatus.Added then
Begin
AccountsData.Insert;
AccountsDataAccountNumber.Value := Value[I].Account.account;
AccountsDataCheckSum.Value := FUtils.AccountNumberCheckSum
(Value[I].Account.account);
End
Else
Continue;
AccountsDataBalance.Value := Value[I].Account.balance;
AccountsDataNOps.Value := Value[I].Account.n_operation;
AccountsDataAccountState.Value := Value[I].Account.State;
AccountsDataAccountName.Value := Value[I].Account.name;
AccountsData.Post;
End;
If FInitialising Then
Begin
FInitialising := False;
FInitComplete.Invoke(Self);
End;
FOnAccountsUpdated.Invoke(Self);
PascBalance := CalcBalance;
if (FStoredAccount = -1) or (Not AccountsData.Locate('AccountNumber', FStoredAccount, [])) then
AccountsData.First;
FStoredAccount := 0;
Finally
AccountsData.EnableControls;
End;
End;
function TMainDataModule.CalcBalance: Currency;
begin
// Result := AccountsData.Aggregates.Items[0].Value;
// Exit;
Result := 0;
AccountsData.First;
while not AccountsData.Eof do
begin
Result := Result + AccountsDataBalance.Value;
AccountsData.Next;
end;
end;
Procedure TMainDataModule.SaveSettings;
Begin
// interfaces not supported so, we'll do it the hard way
TFile.WriteAllText(FSettingsName, Settings.AsJSON);
End;
Procedure TMainDataModule.SetNodeURI(Const Value: String);
Var
lNode: TNodeRecord;
Begin
For lNode In Settings.Nodes Do
Begin
If SameText(lNode.URI, Value) Then
Begin
Settings.SelectedNodeURI := lNode.URI;
FSelectedNodeURI := lNode.URI;
FSelectedNodeName := lNode.name;
FNodeChangeEvent.Invoke(TStringPair.Create(lNode.name, lNode.URI),
API.URI(lNode.URI).CurrenNodeStatus);
End;
End;
End;
Procedure TMainDataModule.SetPascBalance(Const Value: Currency);
Begin
FPascBalance := Value;
FOnBalanceChangeEvent.Invoke(FPascBalance);
End;
Procedure TMainDataModule.StartAccountUpdates;
Begin
If FAccountUpdate.IsRunning Then
Exit;
FAccountUpdate.Execute;
End;
Function TMainDataModule.TryUnlock: boolean;
Begin
result := Not FWallet.Locked;
If result Then
Exit;
If Wallet.State = esPlainText Then
Exit(Wallet.Unlock(''));
result := False;
End;
Procedure TMainDataModule.UnlockTimeChanged(Const Value: Integer);
Begin
If Value = 0 Then
LockTimer.Enabled := False;
LockTimer.Interval := Value * 1000;
End;
procedure TMainDataModule.UpdatesPause;
begin
FAccountUpdate.Pause := True;
end;
procedure TMainDataModule.UpdatesRestart;
begin
FAccountUpdate.Pause := False;
end;
End.
|
unit LTClasses;
interface
uses
LTConst,
Generics.Collections,
Forms, Classes, SysUtils;
type
{ Exception }
ELevelTest = class(Exception)
end;
{ Form }
TLTForm = class(TForm)
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
end;
TFormList = class(TList)
private
FOnNotify: TNotifyEvent;
protected
procedure Notify(Ptr: Pointer; Action: TListNotification); override;
public
procedure GoMain;
property OnNotify: TNotifyEvent read FOnNotify write FOnNotify;
end;
ICheckable = interface
['{230F9C4C-ABD8-400B-847A-D6112611B75A}']
procedure CheckAnswer;
end;
{ enum }
TMemberKind = (mkGuest, mkStudent, mkTeacher, mkAcademy, mkBranch);
TQuizKind = (qkSpeaking, qkReading, qkListening, qkWriting);
{ Containers }
TQuiz = class
protected
function GetKind: TQuizKind; virtual; abstract;
public
QuizNumber: integer;
Quiz: string;
CheckAnswer: string;
TestIdx: integer;
property Kind: TQuizKind read GetKind;
end;
TLRQuiz = class(TQuiz)
public
QuizIdx: integer;
A, B, C, D: string;
Answer: string;
end;
TReadingQuiz = class(TLRQuiz)
protected
function GetKind: TQuizKind; override;
end;
TReading = class(TLRQuiz)
protected
function GetKind: TQuizKind; override;
public
ExampleIdx: integer;
ExampleNumber: integer;
ExampleText: string;
QuizList: TObjectList<TLRQuiz>;
constructor Create;
destructor Destroy; override;
end;
TListening = class(TLRQuiz)
protected
function GetKind: TQuizKind; override;
public
SoundAdress: string;
end;
TSpeaking = class(TQuiz)
protected
function GetKind: TQuizKind; override;
public
QuizIdx: integer;
SoundAdress: string;
ResponseTime: integer;
end;
TWriting = class(TQuiz)
protected
function GetKind: TQuizKind; override;
public
ExampleText: string;
SoundAdress: string;
end;
TTest = class
public
Idx: integer;
Title: string;
TestIndex: integer;
ReadingList: TObjectList<TReading>;
ListeningList: TObjectList<TListening>;
SpeakingList: TObjectList<TSpeaking>;
WritingList: TObjectList<TWriting>;
CurrentIndex: integer;
// 모든 퀴즈를 가지고 있는 리스트
QuizList: TList<TQuiz>;
constructor Create;
destructor Destroy; override;
procedure Initialize;
function HasNextQuiz: Boolean;
procedure Next;
function GetCurrentQuiz: TQuiz;
function Count: integer;
end;
TAcademy = class
public
Code: integer;
Name: string;
procedure Assign(Source: TAcademy);
end;
TUser = class
private
function GetMemberKind: TMemberKind;
public
Academy: TAcademy;
TeacherId: string;
UserId: string;
UserPassword: string;
Level: integer;
Name: string;
relation : integer;
auth : string;
constructor Create;
destructor Destroy; override;
procedure Assign(User: TUser); virtual;
published
property MemberKind: TMemberKind read GetMemberKind;
end;
TGuest = class(TUser)
public
Phone: string;
School: string;
Grade: string;
procedure Assign(Guest: TGuest);
end;
TTestResult = class
ResultIndex: integer;
UserID: string;
TestIndex: integer;
StartTime: TDateTime;
EndTime: TDateTime;
Right: integer;
Wrong: integer;
Score: integer;
Mark: integer;
end;
TTestResultDetail = class
Index: integer;
Section: TQuizKind;
QuizNumber: integer;
Answer: string;
Point: integer;
Correct: integer;
GetPoint: integer;
end;
TLevelTestCheck = class
Index: integer;
Title: string;
Permission: integer;
ResultIndex: integer;
end;
var
FormList: TFormList = nil;
implementation
{ TLTForm }
constructor TLTForm.Create(AOwner: TComponent);
begin
inherited;
FormList.Add(Self);
end;
destructor TLTForm.Destroy;
begin
Assert(FormList.Remove(Self) > -1, 'FormList.Remove');
inherited;
end;
{ TFormList }
procedure TFormList.GoMain;
var
I: integer;
begin
for I := Count - 1 downto 0 do
TForm(Items[I]).Free;
end;
procedure TFormList.Notify(Ptr: Pointer; Action: TListNotification);
begin
if Assigned(FOnNotify) then
FOnNotify(Self);
end;
procedure TUser.Assign(User: TUser);
begin
TeacherId := User.TeacherId;
UserId := User.UserId;
UserPassword := User.UserPassword;
Level := User.Level;
Name := User.Name;
Academy.Code := User.Academy.Code;
Academy.Name := User.Academy.Name;
end;
constructor TUser.Create;
begin
Academy := TAcademy.Create;
end;
destructor TUser.Destroy;
begin
Academy.Free;
inherited;
end;
function TUser.GetMemberKind: TMemberKind;
begin
case Level of
AUTH_STUDENT_BEGIN .. AUTH_STUDENT_END:
Result := mkStudent;
AUTH_TEACHER:
Result := mkTeacher;
AUTH_ACADEMY:
Result := mkAcademy;
AUTH_BRANCH:
Result := mkBranch;
else
Result := mkGuest;
end;
end;
{ TAcademy }
procedure TAcademy.Assign(Source: TAcademy);
begin
Name := Source.Name;
Code := Source.Code;
end;
{ TGuest }
procedure TGuest.Assign(Guest: TGuest);
begin
inherited Assign(Guest);
Self.Phone := Guest.Phone;
Self.School := Guest.School;
Self.Grade := Guest.Grade;
end;
{ TReading }
constructor TReading.Create;
begin
QuizList := TObjectList<TLRQuiz>.Create;
end;
destructor TReading.Destroy;
begin
QuizList.Free;
inherited;
end;
function TReading.GetKind: TQuizKind;
begin
Result := qkReading;
end;
{ TTest }
function TTest.Count: integer;
begin
Result := QuizList.Count;
end;
constructor TTest.Create;
begin
QuizList := TList<TQuiz>.Create;
CurrentIndex := 0;
end;
destructor TTest.Destroy;
begin
QuizList.Free;
ListeningList.Free;
SpeakingList.Free;
ReadingList.Free;
WritingList.Free;
inherited;
end;
function TTest.HasNextQuiz: Boolean;
begin
Result := CurrentIndex + 1 < Count;
end;
procedure TTest.Initialize;
var
I: integer;
begin
for I := 0 to ListeningList.Count - 1 do
QuizList.Add(ListeningList.Items[I]);
for I := 0 to SpeakingList.Count - 1 do
QuizList.Add(SpeakingList.Items[I]);
for I := 0 to ReadingList.Count - 1 do
QuizList.Add(ReadingList.Items[I]);
for I := 0 to WritingList.Count - 1 do
QuizList.Add(WritingList.Items[I]);
end;
procedure TTest.Next;
begin
CurrentIndex := CurrentIndex + 1;
end;
function TTest.GetCurrentQuiz: TQuiz;
begin
Result := QuizList.Items[CurrentIndex];
end;
{ TListening }
function TListening.GetKind: TQuizKind;
begin
Result := qkListening;
end;
{ TSpeaking }
function TSpeaking.GetKind: TQuizKind;
begin
Result := qkSpeaking;
end;
{ TWriting }
function TWriting.GetKind: TQuizKind;
begin
Result := qkWriting;
end;
{ TReadingQuiz }
function TReadingQuiz.GetKind: TQuizKind;
begin
Result := qkReading;
end;
initialization
FormList := TFormList.Create;
finalization
FormList.Free;
end.
|
{
AD.A.P.T. Library
Copyright (C) 2014-2018, Simon J Stuart, All Rights Reserved
Original Source Location: https://github.com/LaKraven/ADAPT
Subject to original License: https://github.com/LaKraven/ADAPT/blob/master/LICENSE.md
}
unit ADAPT.Comparers.Abstract;
{$I ADAPT.inc}
interface
uses
{$IFDEF ADAPT_USE_EXPLICIT_UNIT_NAMES}
System.Classes, System.SysUtils,
{$ELSE}
Classes, SysUtils,
{$ENDIF ADAPT_USE_EXPLICIT_UNIT_NAMES}
ADAPT.Intf, ADAPT,
ADAPT.Comparers.Intf;
{$I ADAPT_RTTI.inc}
type
/// <summary><c>Abstract Base Class for Generic Comparers.</c></summary>
TADComparer<T> = class abstract(TADObject, IADComparer<T>)
public
function AEqualToB(const A, B: T): Boolean; virtual; abstract;
function AGreaterThanB(const A, B: T): Boolean; virtual; abstract;
function AGreaterThanOrEqualToB(const A, B: T): Boolean; virtual; abstract;
function ALessThanB(const A, B: T): Boolean; virtual; abstract;
function ALessThanOrEqualToB(const A, B: T): Boolean; virtual; abstract;
end;
/// <summary><c>Abstract Base Class for Generic Ordinal Comparers.</c></summary>
TADOrdinalComparer<T> = class abstract(TADComparer<T>, IADOrdinalComparer<T>)
public
function Add(const A, B: T): T; virtual; abstract;
function AddAll(const Values: Array of T): T;
function Difference(const A, B: T): T;
function Divide(const A, B: T): T; virtual; abstract;
function Multiply(const A, B: T): T; virtual; abstract;
function Subtract(const A, B: T): T; virtual; abstract;
end;
implementation
{ TADOrdinalComparer<T> }
function TADOrdinalComparer<T>.AddAll(const Values: array of T): T;
var
I: Integer;
begin
Result := Default(T);
for I := Low(Values) to High(Values) do
if I = Low(Values) then
Result := Values[I]
else
Result := Add(Result, Values[I]);
end;
function TADOrdinalComparer<T>.Difference(const A, B: T): T;
begin
Result := Subtract(A, B);
end;
end.
|
(*
Ejercicio 14
Matemáticamente, ln(a^b) = b * ln(a) y e^ln(x) = x
Use estas propiedades, el operador de multiplicación ( * )
y las funciones estándar de Pascal ln y exp
para escribir una expresión en Pascal que produzca el valor de a^b.
no puede usar funciones ni nada mas avanzado que imprimir.
*)
PROGRAM p;
CONST a = 2.0;
b = 11.0;
BEGIN
writeln(exp(ln(a)*b):4:1); {2048.0}
END. |
unit uuserutils;
{DESKRIPSI : Berisi fungsi (F01, F02, F15) yang berhubungan dengan tipe data user}
{REFERENSI : -}
interface
uses
ucsvwrapper,
uuser, k03_kel3_md5, crt;
{PUBLIC, FUNCTION, PROCEDURE}
procedure setToDefaultUser(ptr : psingleuser);
procedure registerUserUtil(pnewUser : psingleuser; ptruser: puser); {F01}
procedure loginUtil(ptr : psingleuser; ptruser: puser); {F02}
procedure findUserUtil(targetUsername : string; ptr: puser); {F15}
implementation
{FUNGSI dan PROSEDUR}
procedure setToDefaultUser(ptr : psingleuser);
{DESKRIPSI : Mengeset user target menjadi default - Anonymous}
{PARAMETER : user yang ingin diset menjadi default}
{RETURN : default User}
{ALGORITMA}
begin
ptr^.fullname := wraptext('Anonymous');
ptr^.address := wraptext('');
ptr^.username := wraptext('Anonymous');
ptr^.password := hashMD5('12345678');
ptr^.isAdmin := false;
end;
procedure registerUserUtil(pnewUser : psingleuser; ptruser: puser);
{DESKRIPSI : (F01) melakukan registrasi akun user oleh admin}
{I.S. : array of User terdefinisi}
{F.S. : keberhasilan registrasi ditampilkan di layar}
{Proses : Menanyakan nama lengkap, alamat, username dan password user, dan layar menampilkan keberhasilan registrasi}
{ALGORITMA}
begin
ptruser^[userNeff + 1] := pnewUser^;
userNeff += 1;
writeln('Pengunjung ', unwraptext(pnewUser^.fullname) , ' berhasil terdaftar sebagai user.');
end;
procedure loginUtil(ptr : psingleuser; ptruser: puser);
{DESKRIPSI : (F02) melakukan login dari akun user yang telah dibuat}
{I.S. : array of User terdefinisi}
{F.S. : berhasil atau gagalnya login}
{Proses : User menginput username dan password, layar akan menampilkan keberhasilan login jika username dan password cocok
dengan yang sudah terdaftar}
{KAMUS LOKAL}
var
found : boolean;
i : integer;
{ALGORITMA}
begin
{skema pencarian dengan boolean}
found := false;
i := 1;
while ((i <= userNeff) and (not Found)) do begin
if ((ptr^.username = ptruser^[i].username) and (ptr^.password = ptruser^[i].password)) then begin
found := true;
ptr^ := ptruser^[i];
end;
i += 1;
end; { i > userNeff or Found }
if (not found) then begin
setToDefaultUser(ptr);
end;
clrscr;
if (ptr^.username <> wraptext('Anonymous')) then begin
writeln('Berhasil login.');
writeln ('Selamat datang ', unwraptext(ptr^.fullname) , '!');
end else begin
writeln ('Username / password salah! Silakan coba lagi.');
end;
end;
procedure findUserUtil(targetUsername : string; ptr: puser);
{DESKRIPSI : (F15) Mencari username yang sesuai dengan targetUsername}
{I.S. : array of User terdefinisi}
{F.S. : data nama dan alamat user sesuai dengan input tertampil di layar}
{Proses : mencari user dengan username yang sesuai input pada array, lalu menampilkan datanya di layar}
{KAMUS LOKAL}
var
i : integer;
found : boolean;
{ALGORITMA}
begin
{skema pencarian sequential dengan boolean}
found := false;
i := 1;
while ((not found) and (i <= userNeff)) do begin
if (ptr^[i].username = targetUsername) then begin
writeln('Nama Anggota : ', unwraptext(ptr^[i].fullname));
writeln('Alamat anggota : ', unwraptext(ptr^[i].address));
found := true;
end;
i += 1;
end;
if (not found) then begin
writeln('User dengan username ', unwraptext(targetUsername), ' tidak ditemukan.')
end;
end;
end.
|
{(*}
(*------------------------------------------------------------------------------
Delphi Code formatter source code
The Original Code is frClarify.pas, released April 2000.
The Initial Developer of the Original Code is Anthony Steele.
Portions created by Anthony Steele are Copyright (C) 1999-2008 Anthony Steele.
All Rights Reserved.
Contributor(s): Anthony Steele.
The contents of this file are subject to the Mozilla Public License Version 1.1
(the "License"). you may not use this file except in compliance with the License.
You may obtain a copy of the License at http://www.mozilla.org/NPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied.
See the License for the specific language governing rights and limitations
under the License.
Alternatively, the contents of this file may be used under the terms of
the GNU General Public License Version 2 or later (the "GPL")
See http://www.gnu.org/licenses/gpl.html
------------------------------------------------------------------------------*)
{*)}
unit frClarifyLongLineBreaker;
{$I JcfGlobal.inc}
interface
uses
{ delphi }
Classes, Controls, Forms,
StdCtrls, ExtCtrls,
{ JVCL }
JvEdit, JvExStdCtrls, JvValidateEdit,
{ local}
frmBaseSettingsFrame;
type
TfClarifyLongLineBreaker = class(TfrSettingsFrame)
edtMaxLineLength: TJvValidateEdit;
Label3: TLabel;
rgRebreakLongLines: TRadioGroup;
procedure cbRebreakLinesClick(Sender: TObject);
private
public
constructor Create(AOwner: TComponent); override;
procedure Read; override;
procedure Write; override;
end;
implementation
{$ifdef FPC}
{$R *.lfm}
{$else}
{$R *.dfm}
{$endif}
uses JcfSettings, SetReturns, JcfHelp;
constructor TfClarifyLongLineBreaker.Create(AOwner: TComponent);
begin
inherited;
fiHelpContext := HELP_CLARIFY_LONG_LINES;
end;
{-------------------------------------------------------------------------------
worker procs }
procedure TfClarifyLongLineBreaker.Read;
begin
with JcfFormatSettings.Returns do
begin
{ line breaking }
edtMaxLineLength.Value := MaxLineLength;
rgRebreakLongLines.ItemIndex := Ord(RebreakLines);
end;
end;
procedure TfClarifyLongLineBreaker.Write;
begin
with JcfFormatSettings.Returns do
begin
{ line breaking }
MaxLineLength := edtMaxLineLength.Value;
RebreakLines := TWhenToRebreakLines(rgRebreakLongLines.ItemIndex);
end;
end;
{-------------------------------------------------------------------------------
event handlers }
procedure TfClarifyLongLineBreaker.cbRebreakLinesClick(Sender: TObject);
begin
edtMaxLineLength.Enabled := (rgRebreakLongLines.ItemIndex > 0);
end;
end.
|
unit NtUtils.Strings;
interface
uses
Winapi.WinNt, Ntapi.ntdef, DelphiUtils.Strings, NtUtils.Security.Sid;
const
GroupAttributeFlags: array [0..5] of TFlagName = (
(Value: SE_GROUP_MANDATORY; Name: 'Mandatory'),
(Value: SE_GROUP_OWNER; Name: 'Owner'),
(Value: SE_GROUP_INTEGRITY; Name: 'Integrity'),
(Value: SE_GROUP_RESOURCE; Name: 'Resource'),
(Value: SE_GROUP_LOGON_ID; Name: 'Logon Id'),
(Value: SE_GROUP_USE_FOR_DENY_ONLY; Name: 'Use for deny only')
);
ObjAttributesFlags: array [0..1] of TFlagName = (
(Value: OBJ_PERMANENT; Name: 'Permanent'),
(Value: OBJ_EXCLUSIVE; Name: 'Exclusive')
);
TokenFlagsNames: array [0..15] of TFlagName = (
(Value: TOKEN_WRITE_RESTRICTED; Name: 'Write-only restricted'),
(Value: TOKEN_IS_RESTRICTED; Name: 'Restricted'),
(Value: TOKEN_SESSION_NOT_REFERENCED; Name: 'Session not referenced'),
(Value: TOKEN_SANDBOX_INERT; Name: 'Sandbox inert'),
(Value: TOKEN_VIRTUALIZE_ALLOWED; Name: 'Virtualization allowed'),
(Value: TOKEN_VIRTUALIZE_ENABLED; Name: 'Virtualization enabled'),
(Value: TOKEN_IS_FILTERED; Name: 'Filtered'),
(Value: TOKEN_UIACCESS; Name: 'UIAccess'),
(Value: TOKEN_NOT_LOW; Name: 'Not low'),
(Value: TOKEN_LOWBOX; Name: 'Lowbox'),
(Value: TOKEN_HAS_OWN_CLAIM_ATTRIBUTES; Name: 'Has own claim attributes'),
(Value: TOKEN_PRIVATE_NAMESPACE; Name: 'Private namespace'),
(Value: TOKEN_DO_NOT_USE_GLOBAL_ATTRIBS_FOR_QUERY; Name: 'Don''t use global attributes for query'),
(Value: TOKEN_NO_CHILD_PROCESS; Name: 'No child process'),
(Value: TOKEN_NO_CHILD_PROCESS_UNLESS_SECURE; Name: 'No child process unless secure'),
(Value: TOKEN_AUDIT_NO_CHILD_PROCESS; Name: 'Audit no child process')
);
function ElevationToString(Value: TTokenElevationType): String;
function IntegrityToString(Rid: Cardinal): String;
function StateOfGroupToString(Value: Cardinal): String;
function StateOfPrivilegeToString(Value: Cardinal): String;
function NativeTimeToString(NativeTime: TLargeInteger): String;
implementation
uses
System.SysUtils;
function ElevationToString(Value: TTokenElevationType): String;
begin
case Value of
TokenElevationTypeDefault: Result := 'N/A';
TokenElevationTypeFull: Result := 'Full';
TokenElevationTypeLimited: Result := 'Limited';
else
Result := OutOfBound(Integer(Value));
end;
end;
function IntegrityToString(Rid: Cardinal): String;
begin
case Rid of
SECURITY_MANDATORY_UNTRUSTED_RID: Result := 'Untrusted';
SECURITY_MANDATORY_LOW_RID: Result := 'Low';
SECURITY_MANDATORY_MEDIUM_RID: Result := 'Medium';
SECURITY_MANDATORY_MEDIUM_PLUS_RID: Result := 'Medium +';
SECURITY_MANDATORY_HIGH_RID: Result := 'High';
SECURITY_MANDATORY_SYSTEM_RID: Result := 'System';
SECURITY_MANDATORY_PROTECTED_PROCESS_RID: Result := 'Protected';
else
Result := IntToHexEx(Rid, 4);
end;
end;
function StateOfGroupToString(Value: Cardinal): String;
begin
if Contains(Value, SE_GROUP_ENABLED) then
begin
if Contains(Value, SE_GROUP_ENABLED_BY_DEFAULT) then
Result := 'Enabled'
else
Result := 'Enabled (modified)';
end
else
begin
if Contains(Value, SE_GROUP_ENABLED_BY_DEFAULT) then
Result := 'Disabled (modified)'
else
Result := 'Disabled';
end;
if Contains(Value, SE_GROUP_INTEGRITY_ENABLED) then
begin
if Contains(Value, SE_GROUP_ENABLED) or
Contains(Value, SE_GROUP_ENABLED_BY_DEFAULT) then
Result := 'Integrity Enabled, Group ' + Result
else
Exit('Integrity Enabled');
end;
end;
function StateOfPrivilegeToString(Value: Cardinal): String;
begin
if Contains(Value, SE_PRIVILEGE_ENABLED) then
begin
if Contains(Value, SE_PRIVILEGE_ENABLED_BY_DEFAULT) then
Result := 'Enabled'
else
Result := 'Enabled (modified)';
end
else
begin
if Contains(Value, SE_PRIVILEGE_ENABLED_BY_DEFAULT) then
Result := 'Disabled (modified)'
else
Result := 'Disabled';
end;
if Contains(Value, SE_PRIVILEGE_REMOVED) then
Result := 'Removed, ' + Result;
if Contains(Value, SE_PRIVILEGE_USED_FOR_ACCESS) then
Result := 'Used for access, ' + Result;
end;
function NativeTimeToString(NativeTime: TLargeInteger): String;
begin
if NativeTime.QuadPart = 0 then
Result := 'Never'
else if NativeTime.QuadPart = Int64.MaxValue then
Result := 'Infinite'
else
Result := DateTimeToStr(NativeTime.ToDateTime);
end;
end.
|
unit rhlTests;
interface
uses
Classes,
rhlCore,
rhlMD2, rhlMD4, rhlMD5,
rhlHAS160,
rhlSHA0, rhlSHA1,
rhlSHA224, rhlSHA256,
rhlSHA384, rhlSHA512,
rhlSHA512_224, rhlSHA512_256,
rhlKeccak,
rhlRIPEMD, rhlRIPEMD128, rhlRIPEMD160, rhlRIPEMD256, rhlRIPEMD320,
rhlHAVAL128, rhlHAVAL160, rhlHAVAL192, rhlHAVAL224, rhlHAVAL256,
rhlTiger, rhlTiger2,
rhlWhirlpool,
rhlTMDPA, rhlPanama, rhlGost, rhlGostCryptoPro,
rhlGrindahl256, rhlGrindahl512,
rhlRadioGatun32, rhlRadioGatun64,
rhlSnefru,
rhlAdler32, rhlCRC32, rhlCRC64,
rhlAP, rhlBernstein, rhlBernstein1, rhlBKDR, rhlDEK, rhlDJB,
rhlELF, rhlFNV, rhlFNV1a, rhlJenkins3, rhlJS, rhlMurmur2, rhlMurmur3,
rhlOneAtTime, rhlPJW, rhlRotating, rhlRS, rhlSDBM, rhlShiftAndXor,
rhlSuperFast,
rhlFNV1a64, rhlFNV64, rhlMurmur2_64, rhlSipHash, rhlMurmur3_128;
const
st: array[0..359] of record
obj: TrhlHashClass;
hash: ansistring;
plain: ansistring;
end = (
(obj: TrhlSHA224; hash: 'd14a028c2a3a2bc9476102bb288234c415a2b01f828ea62ac5b3e42f'; plain: ''),
(obj: TrhlSHA224; hash: '23097d223405d8228642a477bda255b32aadbce4bda0b3f7e36c9da7'; plain: 'abc'),
(obj: TrhlSHA224; hash: '75388b16512776cc5dba5da1fd890150b0c6455cb4f58b1952522525'; plain: 'abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq'),
(obj: TrhlSHA256; hash: 'E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855'; plain: ''),
(obj: TrhlSHA256; hash: 'CA978112CA1BBDCAFAC231B39A23DC4DA786EFF8147C4E72B9807785AFEE48BB'; plain: 'a'),
(obj: TrhlSHA256; hash: 'BA7816BF8F01CFEA414140DE5DAE2223B00361A396177A9CB410FF61F20015AD'; plain: 'abc'),
(obj: TrhlSHA256; hash: 'F7846F55CF23E14EEBEAB5B4E1550CAD5B509E3348FBC4EFA3A1413D393CB650'; plain: 'message digest'),
(obj: TrhlSHA256; hash: '71C480DF93D6AE2F1EFAD1447C66C9525E316218CF51FC8D9ED832F2DAF18B73'; plain: 'abcdefghijklmnopqrstuvwxyz'),
(obj: TrhlSHA256; hash: '248D6A61D20638B8E5C026930C3E6039A33CE45964FF2167F6ECEDD419DB06C1'; plain: 'abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq'),
(obj: TrhlSHA384; hash: '38b060a751ac96384cd9327eb1b1e36a21fdb71114be07434c0cc7bf63f6e1da274edebfe76f65fbd51ad2f14898b95b'; plain: ''),
(obj: TrhlSHA384; hash: 'cb00753f45a35e8bb5a03d699ac65007272c32ab0eded1631a8b605a43ff5bed8086072ba1e7cc2358baeca134c825a7'; plain: 'abc'),
(obj: TrhlSHA384; hash: '09330c33f71147e83d192fc782cd1b4753111b173b3b05d22fa08086e3b0f712fcc7c71a557e2db966c3e9fa91746039'; plain: 'abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu'),
(obj: TrhlSHA512; hash: 'cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e'; plain: ''),
(obj: TrhlSHA512; hash: 'ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39a2192992a274fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f'; plain: 'abc'),
(obj: TrhlSHA512; hash: '8e959b75dae313da8cf4f72814fc143f8f7779c6eb9f7fa17299aeadb6889018501d289e4900f7e4331b99dec4b5433ac7d329eeb6dd26545e96e55b874be909'; plain: 'abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu'),
(obj: TrhlSHA512_224; hash: '6ed0dd02806fa89e25de060c19d3ac86cabb87d6a0ddd05c333b84f4'; plain: ''),
(obj: TrhlSHA512_224; hash: '4634270f707b6a54daae7530460842e20e37ed265ceee9a43e8924aa'; plain: 'abc'),
(obj: TrhlSHA512_224; hash: '23fec5bb94d60b23308192640b0c453335d664734fe40e7268674af9'; plain: 'abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu'),
(obj: TrhlSHA512_256; hash: 'c672b8d1ef56ed28ab87c3622c5114069bdd3ad7b8f9737498d0c01ecef0967a'; plain: ''),
(obj: TrhlSHA512_256; hash: '53048e2681941ef99b2e29b76b4c7dabe4c2d0c634fc6d46e0e2f13107e7af23'; plain: 'abc'),
(obj: TrhlSHA512_256; hash: '3928e184fb8690f840da3988121d31be65cb9d3ef83ee6146feac861e19b563a'; plain: 'abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu'),
(obj: TrhlMD2; hash: '8350e5a3e24c153df2275c9f80692773'; plain:''),
(obj: TrhlMD2; hash: '32ec01ec4a6dac72c0ab96fb34c0b5d1'; plain:'a'),
(obj: TrhlMD2; hash: 'da853b0d3f88d99b30283a69e6ded6bb'; plain:'abc'),
(obj: TrhlMD2; hash: 'ab4f496bfb2a530b219ff33031fe06b0'; plain:'message digest'),
(obj: TrhlMD2; hash: '4e8ddff3650292ab5a4108c3aa47940b'; plain:'abcdefghijklmnopqrstuvwxyz'),
(obj: TrhlMD2; hash: 'da33def2a42df13975352846c30338cd'; plain:'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'),
(obj: TrhlMD2; hash: 'd5976f79d83d3a0dc9806c3c66f3efd8'; plain:'12345678901234567890123456789012345678901234567890123456789012345678901234567890'),
(obj: TrhlMD4; hash: '31d6cfe0d16ae931b73c59d7e0c089c0'; plain:''),
(obj: TrhlMD4; hash: 'bde52cb31de33e46245e05fbdbd6fb24'; plain:'a'),
(obj: TrhlMD4; hash: 'a448017aaf21d8525fc10ae87aa6729d'; plain:'abc'),
(obj: TrhlMD4; hash: 'd9130a8164549fe818874806e1c7014b'; plain:'message digest'),
(obj: TrhlMD4; hash: 'd79e1c308aa5bbcdeea8ed63df412da9'; plain:'abcdefghijklmnopqrstuvwxyz'),
(obj: TrhlMD4; hash: '043f8582f241db351ce627e153e7f0e4'; plain:'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'),
(obj: TrhlMD4; hash: 'e33b4ddc9c38f2199c3e7b164fcc0536'; plain:'12345678901234567890123456789012345678901234567890123456789012345678901234567890'),
(obj: TrhlMD5; hash: 'd41d8cd98f00b204e9800998ecf8427e'; plain:''),
(obj: TrhlMD5; hash: '0cc175b9c0f1b6a831c399e269772661'; plain:'a'),
(obj: TrhlMD5; hash: '900150983cd24fb0d6963f7d28e17f72'; plain:'abc'),
(obj: TrhlMD5; hash: 'f96b697d7cb7938d525a2f31aaf161d0'; plain:'message digest'),
(obj: TrhlMD5; hash: 'c3fcd3d76192e4007dfb496cca67e13b'; plain:'abcdefghijklmnopqrstuvwxyz'),
(obj: TrhlMD5; hash: 'd174ab98d277d9f5a5611c2c9f419d9f'; plain:'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'),
(obj: TrhlMD5; hash: '57edf4a22be3c955ac49da2e2107b67a'; plain:'12345678901234567890123456789012345678901234567890123456789012345678901234567890'),
(obj: TrhlHAS160; hash: '307964EF34151D37C8047ADEC7AB50F4FF89762D'; plain: ''),
(obj: TrhlHAS160; hash: '4872BCBC4CD0F0A9DC7C2F7045E5B43B6C830DB8'; plain: 'a'),
(obj: TrhlHAS160; hash: '975E810488CF2A3D49838478124AFCE4B1C78804'; plain: 'abc'),
(obj: TrhlHAS160; hash: '2338DBC8638D31225F73086246BA529F96710BC6'; plain: 'message digest'),
(obj: TrhlHAS160; hash: '596185C9AB6703D0D0DBB98702BC0F5729CD1D3C'; plain: 'abcdefghijklmnopqrstuvwxyz'),
(obj: TrhlHAS160; hash: 'CB5D7EFBCA2F02E0FB7167CABB123AF5795764E5'; plain: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'),
(obj: TrhlHAS160; hash: '07F05C8C0773C55CA3A5A695CE6ACA4C438911B5'; plain: '12345678901234567890123456789012345678901234567890123456789012345678901234567890'),
(obj: TrhlSHA0; hash: 'f96cea198ad1dd5617ac084a3d92c6107708c0ef'; plain:''),
(obj: TrhlSHA0; hash: '0164b8a914cd2a5e74c4f7ff082c4d97f1edf880'; plain:'abc'),
(obj: TrhlSHA0; hash: 'c1b0f222d150ebb9aa36a40cafdc8bcbed830b14'; plain:'message digest'),
(obj: TrhlSHA0; hash: 'b40ce07a430cfd3c033039b9fe9afec95dc1bdcd'; plain:'abcdefghijklmnopqrstuvwxyz'),
(obj: TrhlSHA0; hash: '79e966f7a3a990df33e40e3d7f8f18d2caebadfa'; plain:'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'),
(obj: TrhlSHA0; hash: '4aa29d14d171522ece47bee8957e35a41f3e9cff'; plain:'12345678901234567890123456789012345678901234567890123456789012345678901234567890'),
(obj: TrhlSHA1; hash: 'da39a3ee5e6b4b0d3255bfef95601890afd80709'; plain:''),
(obj: TrhlSHA1; hash: 'a9993e364706816aba3e25717850c26c9cd0d89d'; plain:'abc'),
(obj: TrhlSHA1; hash: 'c12252ceda8be8994d5fa0290a47231c1d16aae3'; plain:'message digest'),
(obj: TrhlSHA1; hash: '32d10c7b8cf96570ca04ce37f2a19d84240d3a89'; plain:'abcdefghijklmnopqrstuvwxyz'),
(obj: TrhlSHA1; hash: '761c457bf73b14d27e9e9265c46f4b4dda11f940'; plain:'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'),
(obj: TrhlSHA1; hash: '50abf5706a150990a08b2c5ea40fa0e585554732'; plain:'12345678901234567890123456789012345678901234567890123456789012345678901234567890'),
(obj: TrhlRIPEMD; hash: '9F73AA9B372A9DACFB86A6108852E2D9'; plain: ''),
(obj: TrhlRIPEMD; hash: '34AA8697522EBEC0248EF2428F392B7B'; plain: '@'),
(obj: TrhlRIPEMD; hash: 'xFFFFFFF0F4BB0FA597BBD7F58AEF7180'; plain: '48DE5F4845276C8F'),
(obj: TrhlRIPEMD128; hash: 'CDF26213A150DC3ECB610F18F6B38B46'; plain: ''),
(obj: TrhlRIPEMD128; hash: 'DFED3A8461263CDEC125424D8E646560'; plain: '@'),
(obj: TrhlRIPEMD128; hash: 'x66C28CD3F685CAC671FA99C9F059D144'; plain: '48DE5F4845276C8F'),
(obj: TrhlRIPEMD160; hash: '9C1185A5C5E9FC54612808977EE8F548B2258D31'; plain: ''),
(obj: TrhlRIPEMD160; hash: 'B59A38CB7BC1A6D5AB448CE5DBB8F7F20B95E719'; plain: '@'),
(obj: TrhlRIPEMD160; hash: 'xEE047999AB7687F2E62F1EDC68B30D12D7229169'; plain: '48DE5F4845276C8F'),
(obj: TrhlRIPEMD256; hash: '02BA4C4E5F8ECD1877FC52D64D30E37A2D9774FB1E5D026380AE0168E3C5522D'; plain: ''),
(obj: TrhlRIPEMD256; hash: '39AEE15C5A6B271E6F6204960DFB0A8EC3986D17BD4DF5E1EADF6C18FACE5899'; plain: '@'),
(obj: TrhlRIPEMD256; hash: 'x1A8CE32A19A34BD3DAD60B911E99ED91403255F2256EF062DBD3606444921264'; plain: '48DE5F4845276C8F'),
(obj: TrhlRIPEMD320; hash: '22D65D5661536CDC75C1FDF5C6DE7B41B9F27325EBC61E8557177D705A0EC880151C3A32A00899B8'; plain: ''),
(obj: TrhlRIPEMD320; hash: '25994AF50AF825CA6755F72F1895B503BCFDAF398E189C69188A06878C55C952671EADE03F42DFCB'; plain: '@'),
(obj: TrhlRIPEMD320; hash: 'x432A4D1C06881198DDF765562125E2EBF52AA84BAEE228BF2FDDA6C9BD8ABFC78D417BBAAF787090'; plain: '48DE5F4845276C8F'),
(obj: TrhlHAVAL128r3p1; hash: 'c68f39913f901f3ddf44c707357a7d70'; plain: ''),
(obj: TrhlHAVAL160r3p1; hash: 'd353c3ae22a25401d257643836d7231a9a95f953'; plain: ''),
(obj: TrhlHAVAL192r3p1; hash: 'e9c48d7903eaf2a91c5b350151efcb175c0fc82de2289a4e'; plain: ''),
(obj: TrhlHAVAL224r3p1; hash: 'c5aae9d47bffcaaf84a8c6e7ccacd60a0dd1932be7b1a192b9214b6d'; plain: ''),
(obj: TrhlHAVAL256r3p1; hash: '4f6938531f0bc8991f62da7bbd6f7de3fad44562b8c6f4ebf146d5b4e46f7c17'; plain: ''),
(obj: TrhlHAVAL128r4p1; hash: 'ee6bbf4d6a46a679b3a856c88538bb98'; plain: ''),
(obj: TrhlHAVAL160r4p1; hash: '1d33aae1be4146dbaaca0b6e70d7a11f10801525'; plain: ''),
(obj: TrhlHAVAL192r4p1; hash: '4a8372945afa55c7dead800311272523ca19d42ea47b72da'; plain: ''),
(obj: TrhlHAVAL224r4p1; hash: '3e56243275b3b81561750550e36fcd676ad2f5dd9e15f2e89e6ed78e'; plain: ''),
(obj: TrhlHAVAL256r4p1; hash: 'c92b2e23091e80e375dadce26982482d197b1a2521be82da819f8ca2c579b99b'; plain: ''),
(obj: TrhlHAVAL128r5p1; hash: '184b8482a0c050dca54b59c7f05bf5dd'; plain: ''),
(obj: TrhlHAVAL160r5p1; hash: '255158cfc1eed1a7be7c55ddd64d9790415b933b'; plain: ''),
(obj: TrhlHAVAL192r5p1; hash: '4839d0626f95935e17ee2fc4509387bbe2cc46cb382ffe85'; plain: ''),
(obj: TrhlHAVAL224r5p1; hash: '4a0513c032754f5582a758d35917ac9adf3854219b39e3ac77d1837e'; plain: ''),
(obj: TrhlHAVAL256r5p1; hash: 'be417bb4dd5cfb76c7126f4f8eeb1553a449039307b1a3cd451dbfdc0fbbe330'; plain: ''),
(obj: TrhlHAVAL128r3p1; hash: '9e40ed883fb63e985d299b40cda2b8f2'; plain: 'abc'),
(obj: TrhlHAVAL160r3p1; hash: 'b21e876c4d391e2a897661149d83576b5530a089'; plain: 'abc'),
(obj: TrhlHAVAL192r3p1; hash: 'a7b14c9ef3092319b0e75e3b20b957d180bf20745629e8de'; plain: 'abc'),
(obj: TrhlHAVAL224r3p1; hash: '5bc955220ba2346a948d2848eca37bdd5eca6ecca7b594bd32923fab'; plain: 'abc'),
(obj: TrhlHAVAL256r3p1; hash: '8699f1e3384d05b2a84b032693e2b6f46df85a13a50d93808d6874bb8fb9e86c'; plain: 'abc'),
(obj: TrhlHAVAL128r4p1; hash: '6f2132867c9648419adcd5013e532fa2'; plain: 'abc'),
(obj: TrhlHAVAL160r4p1; hash: '77aca22f5b12cc09010afc9c0797308638b1cb9b'; plain: 'abc'),
(obj: TrhlHAVAL192r4p1; hash: '7e29881ed05c915903dd5e24a8e81cde5d910142ae66207c'; plain: 'abc'),
(obj: TrhlHAVAL224r4p1; hash: '124c43d2ba4884599d013e8c872bfea4c88b0b6bf6303974cbe04e68'; plain: 'abc'),
(obj: TrhlHAVAL256r4p1; hash: '8f409f1bb6b30c5016fdce55f652642261575bedca0b9533f32f5455459142b5'; plain: 'abc'),
(obj: TrhlHAVAL128r5p1; hash: 'd054232fe874d9c6c6dc8e6a853519ea'; plain: 'abc'),
(obj: TrhlHAVAL160r5p1; hash: 'ae646b04845e3351f00c5161d138940e1fa0c11c'; plain: 'abc'),
(obj: TrhlHAVAL192r5p1; hash: 'd12091104555b00119a8d07808a3380bf9e60018915b9025'; plain: 'abc'),
(obj: TrhlHAVAL224r5p1; hash: '8081027a500147c512e5f1055986674d746d92af4841abeb89da64ad'; plain: 'abc'),
(obj: TrhlHAVAL256r5p1; hash: '976cd6254c337969e5913b158392a2921af16fca51f5601d486e0a9de01156e7'; plain: 'abc'),
(obj: TrhlHAVAL128r3p128; hash: '1BDC556B29AD02EC09AF8C66477F2A87'; plain: ''),
(obj: TrhlHAVAL160r3p128; hash: '5E1610FCED1D3ADB0BB18E92AC2B11F0BD99D8ED'; plain: 'a'),
(obj: TrhlHAVAL192r4p128; hash: '74AA31182FF09BCCE453A7F71B5A7C5E80872FA90CD93AE4'; plain: 'HAVAL'),
(obj: TrhlHAVAL224r4p128; hash: '144CB2DE11F05DF7C356282A3B485796DA653F6B702868C7DCF4AE76'; plain: '0123456789'),
(obj: TrhlHAVAL256r5p128; hash: '1A1DC8099BDAA7F35B4DA4E805F1A28FEE909D8DEE920198185CBCAED8A10A8D'; plain: 'abcdefghijklmnopqrstuvwxyz'),
(obj: TrhlHAVAL256r5p128; hash: 'C5647FC6C1877FFF96742F27E9266B6874894F41A08F5913033D9D532AEDDB39'; plain: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'),
(obj: TrhlTiger128r4; hash: '20b5d50b5a43931546fb8b52c5c42d3a'; plain: '@'),
(obj: TrhlTiger160r4; hash: '20b5d50b5a43931546fb8b52c5c42d3ae20d223d'; plain: '@'),
(obj: TrhlTiger192r4; hash: '20B5D50B5A43931546FB8B52C5C42D3AE20D223D2CD7F93D'; plain: '@'),
(obj: TrhlTiger128r4so; hash: '1593435A0BD5B5203A2DC4C5528BFB46'; plain: '@'),
(obj: TrhlTiger160r4so; hash: '1593435A0BD5B5203A2DC4C5528BFB463DF9D72C'; plain: '@'),
(obj: TrhlTiger192r3so; hash: '24F0130C63AC933216166E76B1BB925FF373DE2D49584E7A'; plain: ''),
(obj: TrhlTiger192r3so; hash: '70E3BEABBFD83AF341B6D8C82F5CBD812EAE6AF4AF2140F9'; plain: '@'),
(obj: TrhlTiger192r3so; hash: '87FB2A9083851CF7470D2CF810E6DF9EB586445034A5A386'; plain: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-'),
(obj: TrhlTiger192r3so; hash: '0C410A042968868A1671DA5A3FD29A725EC1E457D3CDB303'; plain: 'Tiger - A Fast New Hash Function, by Ross Anderson and Eli Biham'),
(obj: TrhlTiger192r4so; hash: '4635FFF6A778CC243DA15C69594E98E79451256E680B4E80'; plain: ''),
(obj: TrhlTiger192r4so; hash: '1593435A0BD5B5203A2DC4C5528BFB463DF9D72C3D220DE2'; plain: '@'),
(obj: TrhlTiger192r4so; hash: 'x73A0C8CB154681F9B3B69C65BB02B89CE68C281E4A8E962F'; plain: '48DE5F4845276C8F'),
(obj: TrhlTiger2; hash: '4441BE75F6018773C206C22745374B924AA8313FEF919F41'; plain: ''),
(obj: TrhlTiger2; hash: 'D4EE31FD5944E597ED01A4900A6BCD6AF9A367E5758A8849'; plain: '@'),
(obj: TrhlTiger2; hash: 'xEEFE8BF3B1ABCA7B4F654FF6E8D33D15556CBA2FC42ACF24'; plain: '48DE5F4845276C8F'),
(obj: TrhlKeccak224; hash: 'F71837502BA8E10837BDD8D365ADB85591895602FC552B48B7390ABD'; plain: ''),
(obj: TrhlKeccak224; hash: 'DFD04E56166EA802104B1F4E39E90E8DB402B35A185332619F6448F4'; plain: '@'),
(obj: TrhlKeccak224; hash: 'x9498C25868FB850EDB233D4B861E8DB72FE1F767D9541A50C70FADBC'; plain: '48DE5F4845276C8F'),
(obj: TrhlKeccak256; hash: 'C5D2460186F7233C927E7DB2DCC703C0E500B653CA82273B7BFAD8045D85A470'; plain: ''),
(obj: TrhlKeccak256; hash: 'E724D40619441CED66A271E59627B7BCD39C77447A4315561B4D21E7B7C9321C'; plain: '@'),
(obj: TrhlKeccak256; hash: 'x7D82C1F33F243B107047C0EFCA14645B5960572598248C6F1FE4D4A44D9C5DED'; plain: '48DE5F4845276C8F'),
(obj: TrhlKeccak384; hash: '2C23146A63A29ACF99E73B88F8C24EAA7DC60AA771780CCC006AFBFA8FE2479B2DD2B21362337441AC12B515911957FF'; plain: ''),
(obj: TrhlKeccak384; hash: '7EB3824FDB247F5E404D7BBD8AB243D58D1C1E4FF538785CE8EB5723B79076EF280E6B2FBC240E855EB69F01005C4D51'; plain: '@'),
(obj: TrhlKeccak384; hash: 'x9D894160D3F91066D3C4A6BD2FBCAAD5BD47A7D9C389E7F1133BDA6DAF130E48069920100A63FB39AB55FABD7E36CE68'; plain: '48DE5F4845276C8F'),
(obj: TrhlKeccak512; hash: '0EAB42DE4C3CEB9235FC91ACFFE746B29C29A8C366B7C60E4E67C466F36A4304C00FA9CAF9D87976BA469BCBE06713B435F091EF2769FB160CDAB33D3670680E'; plain: ''),
(obj: TrhlKeccak512; hash: '64E501C5ACF2CE6271883AA40939D63AFB632F64E243D46FE9307CE89D25E9F0156A5EC3BEE387C2CA7301DEF64FAC374F6AF95ED99B2911448266E73BDC873C'; plain: '@'),
(obj: TrhlKeccak512; hash: 'x73208FCE8A27823C459800F753D2DDCEDF76A5FAD7F3689BFC5CAAE156983E54B0B071B8C0FC24221210315A3CD8CD1205BA0E95A579AED8CC16D643BF07BFDE'; plain: '48DE5F4845276C8F'),
(obj: TrhlWhirlpool; hash: '19FA61D75522A4669B44E39C1D2E1726C530232130D407F89AFEE0964997F7A73E83BE698B288FEBCF88E3E03C4F0757EA8964E59B63D93708B138CC42A66EB3'; plain: ''),
(obj: TrhlWhirlpool; hash: '818D938EA6C8CEE1BF4CA4192FA5E3EEB107F6891602E29751BD5EC9174FB31DF87CACDD6E81A333A0DB11683763DD55EBE686CA5E1F722398758074805E33AC'; plain: '@'),
(obj: TrhlWhirlpool; hash: 'x0ECF1574D4C4A1C04B787F9C4A840618129E82BD21AC658994AE628F47B13A0F5ACC23C792310AE65B4E540828D47D4AEA54DFFA13F90F00EBB77466AD6EA649'; plain: '48DE5F4845276C8F'),
(obj: TrhlTMDPA; hash: '0BD132AA831C56AC1F92E61084A342D2'; plain: ''),
(obj: TrhlTMDPA; hash: 'D60FDA092A2E5C668499FD8F044E1491'; plain: '@'),
(obj: TrhlTMDPA; hash: 'EDFA9FA760E7F6E274F83ABDF465CE96'; plain: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'),
(obj: TrhlTMDPA; hash: '0FC11CE66D917431F1D63088521A39F0'; plain: '12345678901234567890123456789012345678901234567890123456789012345678901234567890'),
(obj: TrhlPanama; hash: 'AA0CC954D757D7AC7779CA3342334CA471ABD47D5952AC91ED837ECD5B16922B'; plain: ''),
(obj: TrhlPanama; hash: 'F1CD0FC6C0284CF1FD491733CA71DA7DB0C47B8F0D1C0DF10C38979B85F50A2C'; plain: '@'),
(obj: TrhlPanama; hash: 'x6C70B396E8BFC4B023B28C2ABAC149CD91C5599388F0DD73B0BA1FC7FCD7CEB4'; plain: '48DE5F4845276C8F'),
(obj: TrhlGost; hash: 'CE85B99CC46752FFFEE35CAB9A7B0278ABB4C2D2055CFF685AF4912C49490F8D'; plain: ''),
(obj: TrhlGost; hash: 'B00F1B1E2A8D2072369F75A0C4BD823D0B098B84BE2139CFC74E1A4E14A15483'; plain: '@'),
(obj: TrhlGost; hash: 'x2A199A246A114562758362A036F1BF81FC5BB0638B7FB5544D9156B91BB37529'; plain: '48DE5F4845276C8F'),
(obj: TrhlGostCryptoPro; hash: '981e5f3ca30c841487830f84fb433e13ac1101569b9c13584ac483234cd656c0'; plain: ''),
(obj: TrhlGostCryptoPro; hash: 'e74c52dd282183bf37af0079c9f78055715a103f17e3133ceff1aacf2f403011'; plain: 'a'),
(obj: TrhlGostCryptoPro; hash: 'b285056dbf18d7392d7677369524dd14747459ed8143997e163b2986f92fd42c'; plain: 'abc'),
(obj: TrhlGostCryptoPro; hash: 'bc6041dd2aa401ebfa6e9886734174febdb4729aa972d60f549ac39b29721ba0'; plain: 'message digest'),
(obj: TrhlGostCryptoPro; hash: '9004294a361a508c586fe53d1f1b02746765e71b765472786e4770d565830a76'; plain: 'The quick brown fox jumps over the lazy dog'),
(obj: TrhlGostCryptoPro; hash: '73b70a39497de53a6e08c67b6d4db853540f03e9389299d9b0156ef7e85d0f61'; plain: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'),
(obj: TrhlGostCryptoPro; hash: '6bc7b38989b28cf93ae8842bf9d752905910a7528a61e5bce0782de43e610c90'; plain: '12345678901234567890123456789012345678901234567890123456789012345678901234567890'),
(obj: TrhlGrindahl256; hash: '45A7600159AF54AE110FCB6EA0F38AD57875EAC814F74D2CBC247D28C89923E6'; plain: ''),
(obj: TrhlGrindahl256; hash: '5F361D0E8F41497CCD40EEB2773E3B091EC2055028E04C536CF971986A95EB17'; plain: '@'),
(obj: TrhlGrindahl256; hash: 'x61BB943A12C620E7CC0EF3523216CB6CE0DA24AEACD7D55FDEC96C2D70477E2E'; plain: '48DE5F4845276C8F'),
(obj: TrhlGrindahl512; hash: 'EE0BA85F90B6D232430BA43DD0EDD008462591816962A355602ED214FAAE54A9A4607D6F577CE950421FF58AEA53F51A7A9F5CCA894C3776104D43568FEA1207'; plain: ''),
(obj: TrhlGrindahl512; hash: '5104726C9D699FA0BB1002BD5908FF566DCCDEAB4CD59C2FB01F18E8229AD8516F5DC6D1724F3E1BAEB5366017682DEFD0C71DFCC20A36CCD21CCCC0033C2DDC'; plain: '@'),
(obj: TrhlGrindahl512; hash: 'x8F799124979EAF92A90B7C63A95C292D8E733EB639BA119C37EB42991E8445949F8A62CD637E60CE963CA1B194B3411CFB66A2852574E0CAC1613E2169F1FD08'; plain: '48DE5F4845276C8F'),
(obj: TrhlRadioGatun32; hash: 'F30028B54AFAB6B3E55355D277711109A19BEDA7091067E9A492FB5ED9F20117'; plain: ''),
(obj: TrhlRadioGatun32; hash: '137A45B055A771A7E8C26DA438DD9A3141B29D6050B40EC587704EF01B452ADF'; plain: '@'),
(obj: TrhlRadioGatun32; hash: 'x12FF40C48ABF3A7FBC1EF1E3FD52AF874D6F78966C7D050E563E5D92BCCF8FA1'; plain: '48DE5F4845276C8F'),
(obj: TrhlRadioGatun64; hash: '64A9A7FA139905B57BDAB35D33AA216370D5EAE13E77BFCDD85513408311A584'; plain: ''),
(obj: TrhlRadioGatun64; hash: 'EB1DAF43BB7785A5B743260EE7093000F3A94F7C8BE236B5880B6557449E680D'; plain: '@'),
(obj: TrhlRadioGatun64; hash: 'x8752C29F30809F30AEF2114A567610167C0A02A1D3E7E62333D2E9A0B87E4932'; plain: '48DE5F4845276C8F'),
(obj: TrhlSnefru128r4; hash: 'C22A5255C0310CA2FB86286C70FB4434'; plain: ''),
(obj: TrhlSnefru128r4; hash: 'D1DEE4876CCE6EE39B3703DC3BDCC143'; plain: '@'),
(obj: TrhlSnefru128r4; hash: 'xE6747E75FF906E2F06F25F57221EF6A4'; plain: '48DE5F4845276C8F'),
(obj: TrhlSnefru256r4; hash: 'F1B1BCE4285633DBBDCDB34710A469008F958063235CC893D0E281451DB67131'; plain: ''),
(obj: TrhlSnefru256r4; hash: '49ACC90AD7A151725CC3EBED1137EE3E4465876EFCE3A0D0F8DAA0F70628B557'; plain: '@'),
(obj: TrhlSnefru256r4; hash: 'x4A9DC879589177F0D426170F7ED4E6DD66F5A8596367E52AC4AE6057BB123ADC'; plain: '48DE5F4845276C8F'),
(obj: TrhlSnefru128r8; hash: 'AA2532A1422095F6E8DBFF85FD6EF2BC'; plain: ''),
(obj: TrhlSnefru128r8; hash: 'E77E9F09CC4AF48309614980A1A198B0'; plain: '@'),
(obj: TrhlSnefru128r8; hash: 'x46B037D10414597DFBD76FD33582526E'; plain: '48DE5F4845276C8F'),
(obj: TrhlSnefru256r8; hash: 'A4DF4C0A4AF3DAD3B7E9F4200144F74D6F44F875AB32715F5664119D676F8D19'; plain: ''),
(obj: TrhlSnefru256r8; hash: 'E9EF2666CDB8D94AEBF72A98DB2E03AEFB9531D3798EAC055601F1FD5628EAEA'; plain: '@'),
(obj: TrhlSnefru256r8; hash: 'xE24F23FCB6A202860B72E40D711920FC1020506EC8F0E244FDF2F6D8616273AE'; plain: '48DE5F4845276C8F'),
(obj: TrhlAdler32; hash: '01000000'; plain: ''),
(obj: TrhlAdler32; hash: '41004100'; plain: '@'),
(obj: TrhlAdler32; hash: 'xC900FB00'; plain: '3197'),
(obj: TrhlAdler32; hash: 'x4F010D02'; plain: '4D22DF'),
(obj: TrhlAdler32; hash: 'x24021805'; plain: '6CCD13D7'),
(obj: TrhlCRC32_IEEE_802_3; hash: '00000000'; plain: ''),
(obj: TrhlCRC32_IEEE_802_3; hash: '1DAEDEA4'; plain: '@'),
(obj: TrhlCRC32_IEEE_802_3; hash: 'xAA13EFE9'; plain: '3197'),
(obj: TrhlCRC32_IEEE_802_3; hash: 'xE44EDD36'; plain: '4D22DF'),
(obj: TrhlCRC32_IEEE_802_3; hash: 'x51949BB0'; plain: '6CCD13D7'),
(obj: TrhlCRC32_Koopman; hash: '00000000'; plain: ''),
(obj: TrhlCRC32_Koopman; hash: '65C0CA4A'; plain: '@'),
(obj: TrhlCRC32_Koopman; hash: 'x248220B6'; plain: '3197'),
(obj: TrhlCRC32_Koopman; hash: 'x098B6051'; plain: '4D22DF'),
(obj: TrhlCRC32_Koopman; hash: 'x9838DBAA'; plain: '6CCD13D7'),
(obj: TrhlCRC32_Castagnoli; hash: '00000000'; plain: ''),
(obj: TrhlCRC32_Castagnoli; hash: 'ED4E0613'; plain: '@'),
(obj: TrhlCRC32_Castagnoli; hash: 'xDA65EFE4'; plain: '3197'),
(obj: TrhlCRC32_Castagnoli; hash: 'x6125C171'; plain: '4D22DF'),
(obj: TrhlCRC32_Castagnoli; hash: 'xDD7135FA'; plain: '6CCD13D7'),
(obj: TrhlCRC32_Q; hash: '00000000'; plain: ''),
(obj: TrhlCRC32_Q; hash: 'C0C33537'; plain: '@'),
(obj: TrhlCRC32_Q; hash: 'x1C12DB79'; plain: '3197'),
(obj: TrhlCRC32_Q; hash: 'x20F4E183'; plain: '4D22DF'),
(obj: TrhlCRC32_Q; hash: 'x3CC3ADCE'; plain: '6CCD13D7'),
(obj: TrhlCRC64_ISO; hash: '0000000000000000'; plain: ''),
(obj: TrhlCRC64_ISO; hash: '0000000000009003'; plain: '@'),
(obj: TrhlCRC64_ISO; hash: 'x000000000020C3A8'; plain: '3197'),
(obj: TrhlCRC64_ISO; hash: 'x0000000060F95AC9'; plain: '4D22DF'),
(obj: TrhlCRC64_ISO; hash: 'x000000D05E91F6C4'; plain: '6CCD13D7'),
(obj: TrhlCRC64_ECMA182; hash: '0000000000000000'; plain: ''),
(obj: TrhlCRC64_ECMA182; hash: 'F8B8A48FB98A1B7B'; plain: '@'),
(obj: TrhlCRC64_ECMA182; hash: 'xD49B3BAEA1F7B8FE'; plain: '3197'),
(obj: TrhlCRC64_ECMA182; hash: 'xD37446DDE80C16C0'; plain: '4D22DF'),
(obj: TrhlCRC64_ECMA182; hash: 'xA86E9982AFA6605C'; plain: '6CCD13D7'),
(obj: TrhlAP; hash: '00000000'; plain: ''),
(obj: TrhlAP; hash: '40000000'; plain: '@'),
(obj: TrhlAP; hash: 'x5877FEFF'; plain: '3197'),
(obj: TrhlAP; hash: 'xBFECC91E'; plain: '4D22DF'),
(obj: TrhlAP; hash: 'x1C105084'; plain: '6CCD13D7'),
(obj: TrhlBernstein; hash: '05150000'; plain: ''),
(obj: TrhlBernstein; hash: 'E5B50200'; plain: '@'),
(obj: TrhlBernstein; hash: 'x2D715900'; plain: '3197'),
(obj: TrhlBernstein; hash: 'xB3FF870B'; plain: '4D22DF'),
(obj: TrhlBernstein; hash: 'xC8B39B7C'; plain: '6CCD13D7'),
(obj: TrhlBernstein1; hash: '05150000'; plain: ''),
(obj: TrhlBernstein1; hash: 'E5B50200'; plain: '@'),
(obj: TrhlBernstein1; hash: 'x83685900'; plain: '3197'),
(obj: TrhlBernstein1; hash: 'xD5CC870B'; plain: '4D22DF'),
(obj: TrhlBernstein1; hash: 'x40896D7C'; plain: '6CCD13D7'),
(obj: TrhlBKDR; hash: '00000000'; plain: ''),
(obj: TrhlBKDR; hash: '40000000'; plain: '@'),
(obj: TrhlBKDR; hash: 'xAA190000'; plain: '3197'),
(obj: TrhlBKDR; hash: 'xFA3B1400'; plain: '4D22DF'),
(obj: TrhlBKDR; hash: 'x2976AE0E'; plain: '6CCD13D7'),
(obj: TrhlDEK; hash: '00000000'; plain: ''),
(obj: TrhlDEK; hash: '60000000'; plain: '@'),
(obj: TrhlDEK; hash: 'xB70E0000'; plain: '3197'),
(obj: TrhlDEK; hash: 'x9FB00000'; plain: '4D22DF'),
(obj: TrhlDEK; hash: 'xB7367500'; plain: '6CCD13D7'),
(obj: TrhlDJB; hash: '05150000'; plain: ''),
(obj: TrhlDJB; hash: 'E5B50200'; plain: '@'),
(obj: TrhlDJB; hash: 'x2D715900'; plain: '3197'),
(obj: TrhlDJB; hash: 'xB3FF870B'; plain: '4D22DF'),
(obj: TrhlDJB; hash: 'xC8B39B7C'; plain: '6CCD13D7'),
(obj: TrhlELF; hash: '00000000'; plain: ''),
(obj: TrhlELF; hash: '40000000'; plain: '@'),
(obj: TrhlELF; hash: 'xA7030000'; plain: '3197'),
(obj: TrhlELF; hash: 'xFF4F0000'; plain: '4D22DF'),
(obj: TrhlELF; hash: 'x078F0700'; plain: '6CCD13D7'),
(obj: TrhlFNV; hash: 'C59D1C81'; plain: ''),
(obj: TrhlFNV; hash: '5F5D0C05'; plain: '@'),
(obj: TrhlFNV; hash: 'xFDAF7620'; plain: '3197'),
(obj: TrhlFNV; hash: 'x03892FFB'; plain: '4D22DF'),
(obj: TrhlFNV; hash: 'x9A5218C6'; plain: '6CCD13D7'),
(obj: TrhlFNV1a; hash: 'C59D1C81'; plain: ''),
(obj: TrhlFNV1a; hash: '5FF80BC5'; plain: '@'),
(obj: TrhlFNV1a; hash: 'xD1BFEB7A'; plain: '3197'),
(obj: TrhlFNV1a; hash: 'x43EA0C9D'; plain: '4D22DF'),
(obj: TrhlFNV1a; hash: 'x2C331A24'; plain: '6CCD13D7'),
(obj: TrhlJenkins3; hash: 'x00000000'; plain: ''),
(obj: TrhlJenkins3; hash: 'x6ECACBFB'; plain: '40'),
(obj: TrhlJenkins3; hash: 'x73A267D7'; plain: '3197'),
(obj: TrhlJenkins3; hash: 'x08E978AF'; plain: '4D22DF'),
(obj: TrhlJenkins3; hash: 'x1704142A'; plain: '6CCD13D7'),
(obj: TrhlJenkins3; hash: 'x0661DF9C'; plain: 'D8D9C639AE'),
(obj: TrhlJenkins3; hash: 'xDE1734CF'; plain: 'FBC4AB9E4B2F'),
(obj: TrhlJenkins3; hash: 'xB2991C9D'; plain: 'D19BEB74934639'),
(obj: TrhlJenkins3; hash: 'x80225BAB'; plain: '48DE5F4845276C8F'),
(obj: TrhlJenkins3; hash: 'x55D6ABD0'; plain: '8E854990BC47A07EAA'),
(obj: TrhlJenkins3; hash: 'x3C7AC54E'; plain: '4EB0FE433C6B87F34B29'),
(obj: TrhlJenkins3; hash: 'x53D5BF82'; plain: 'BE497843C5834987519441'),
(obj: TrhlJenkins3; hash: 'xEFC35F97'; plain: '8331CA2956433A094249FDBE'),
(obj: TrhlJenkins3; hash: 'x376B8A59'; plain: 'BF62FA2EECBE87D080E92C37EB'),
(obj: TrhlJenkins3; hash: 'x64DFDF02'; plain: '4A8BAE394046AFBC47D690224CB9'),
(obj: TrhlJenkins3; hash: 'xF4063FFD'; plain: '78D9CE79AFC1E0C41E2A48278E4B4B'),
(obj: TrhlJenkins3; hash: 'x54B9346D'; plain: '816B650FB50D8E848DB94034628FC520'),
(obj: TrhlJenkins3; hash: 'xB3CF81AA'; plain: '629768E3633858B4D23D04773DA28CBCFB'),
(obj: TrhlJenkins3; hash: 'xEC7BCF2D'; plain: '55462FF88CDF40292838C888B71D16EA5D88'),
(obj: TrhlJenkins3; hash: 'xBEDAB10B'; plain: 'C69924B3A64312DB5808B1C3AD05C05413E958'),
(obj: TrhlJenkins3; hash: 'x095853E1'; plain: '5A6462CE04496BA8DCF67799EE4CAB353E337A47'),
(obj: TrhlJenkins3; hash: 'x7A04804E'; plain: '99F397D1268B57091AA4A299685C3826FC77196E21'),
(obj: TrhlJenkins3; hash: 'xA30093B9'; plain: '7A78E5E46E36837950F3D53061C0789B90F5374CEC88'),
(obj: TrhlJenkins3; hash: 'x7DEF29B3'; plain: 'A0DAC9754045558650DA891AFB3EC312CCF85D3300D426'),
(obj: TrhlJenkins3; hash: 'x8F3195F2'; plain: '0B69E8AA8DEED1859D2B7FF78D07DCEDE826A872E66E0AE1'),
(obj: TrhlJenkins3; hash: 'x866C0FE4'; plain: '3ECD10659E510DD8F28C8DDABAA5790C640A77C8243F958C9C'),
(obj: TrhlJenkins3; hash: 'x68959A91'; plain: '2618CDDCA206E42E247BE6474224E5A634377B9AD6C4BAC621D6'),
(obj: TrhlJenkins3; hash: 'xCB29B29A'; plain: '55314A0198F4C4623A364C3B81F45D079EDA66F50C44BB33E8279F'),
(obj: TrhlJenkins3; hash: 'xB0F975F3'; plain: 'FCED8CDC4690D5F10121060934800A4B881DE2CA9B1F206C76658D0C'),
(obj: TrhlJenkins3; hash: 'x07FD2158'; plain: 'C89186812C99D936B8751D6901CA1892C03D8FB0B72B60A7A87BA20A93'),
(obj: TrhlJenkins3; hash: 'xC672603A'; plain: '1915A470840704DA66E2384473A79AB5D98924B7EDB4FD6329975F0A49D3'),
(obj: TrhlJenkins3; hash: 'x4C04EEB0'; plain: '3C256BF4BC51F5BD41B1480C641BF721630AC4165B490CA14E324E49136D9F'),
(obj: TrhlJenkins3; hash: 'xF8A2637F'; plain: '2E86993AA9577E0176DEE507BF649F9358EEBE67CEAFA2D4C10ACE8D4BE895AD'),
(obj: TrhlJenkins3; hash: 'x364C456E'; plain: '015ECA91AB59E81C9486D97C079CBE1867834BD5B03C3AE3C65A9FBB842643FD84'),
(obj: TrhlJenkins3; hash: 'x3D2B32D7'; plain: 'EBECF3C5A7476DBB35D348DBEC5A0EB7B3A5499BE07B8FCD489A7B56E07F0A91D196'),
(obj: TrhlJenkins3; hash: 'x9040BD1A'; plain: '4971FB343551CA6D29F63D2260F4158E2467304ECE74DF2CA1410B338726BF3ED9BB4B'),
(obj: TrhlJenkins3; hash: 'x32E67B62'; plain: 'F5E91932E0D1AE09905D4680BD42ECC7FBEC8A21C96EB71DFA0C6062BE8E9C6B187E3B81'),
(obj: TrhlJenkins3; hash: 'x916CA386'; plain: '9C4F0FBE8D3A23204B11E776E474D359626D5BCEEA3F4C9A3F9F939CEA88F7CBF71E99A8D5'),
(obj: TrhlJS; hash: 'x'+'A7C6674E'; plain: ''),
(obj: TrhlJS; hash: 'x'+'6E00F5AE'; plain: '40'),
(obj: TrhlJS; hash: 'x'+'2344A8A4'; plain: '3197'),
(obj: TrhlJS; hash: 'x'+'65949B1A'; plain: '4D22DF'),
(obj: TrhlJS; hash: 'x'+'DAF0BB40'; plain: '6CCD13D7'),
(obj: TrhlOneAtTime; hash: 'x'+'00000000'; plain: ''),
(obj: TrhlOneAtTime; hash: 'x'+'6DA7BF93'; plain: '40'),
(obj: TrhlOneAtTime; hash: 'x'+'02D4B205'; plain: '3197'),
(obj: TrhlOneAtTime; hash: 'x'+'29CE3489'; plain: '4D22DF'),
(obj: TrhlOneAtTime; hash: 'x'+'9D5163D0'; plain: '6CCD13D7'),
(obj: TrhlPJW; hash: 'x'+'00000000'; plain: ''),
(obj: TrhlPJW; hash: 'x'+'40000000'; plain: '40'),
(obj: TrhlPJW; hash: 'x'+'A7030000'; plain: '3197'),
(obj: TrhlPJW; hash: 'x'+'FF4F0000'; plain: '4D22DF'),
(obj: TrhlPJW; hash: 'x'+'078F0700'; plain: '6CCD13D7'),
(obj: TrhlRotating; hash: 'x'+'00000000'; plain: ''),
(obj: TrhlRotating; hash: 'x'+'40000000'; plain: '40'),
(obj: TrhlRotating; hash: 'x'+'87030000'; plain: '3197'),
(obj: TrhlRotating; hash: 'x'+'FF4F0000'; plain: '4D22DF'),
(obj: TrhlRotating; hash: 'x'+'E70C0600'; plain: '6CCD13D7'),
(obj: TrhlRS; hash: 'x'+'00000000'; plain: ''),
(obj: TrhlRS; hash: 'x'+'40000000'; plain: '40'),
(obj: TrhlRS; hash: 'x'+'16DFF80E'; plain: '3197'),
(obj: TrhlRS; hash: 'x'+'1C13536C'; plain: '4D22DF'),
(obj: TrhlRS; hash: 'x'+'8B87CA50'; plain: '6CCD13D7'),
(obj: TrhlSDBM; hash: 'x'+'00000000'; plain: ''),
(obj: TrhlSDBM; hash: 'x'+'40000000'; plain: '40'),
(obj: TrhlSDBM; hash: 'x'+'A60C3100'; plain: '3197'),
(obj: TrhlSDBM; hash: 'x'+'0AB30C26'; plain: '4D22DF'),
(obj: TrhlSDBM; hash: 'x'+'6580E505'; plain: '6CCD13D7'),
(obj: TrhlShiftAndXor; hash: 'x'+'00000000'; plain: ''),
(obj: TrhlShiftAndXor; hash: 'x'+'40000000'; plain: '40'),
(obj: TrhlShiftAndXor; hash: 'x'+'F2060000'; plain: '3197'),
(obj: TrhlShiftAndXor; hash: 'x'+'DD3F0100'; plain: '4D22DF'),
(obj: TrhlShiftAndXor; hash: 'x'+'4B7F3800'; plain: '6CCD13D7'),
(obj: TrhlSuperFast; hash: 'x'+'00000000'; plain: ''),
(obj: TrhlSuperFast; hash: 'x'+'15C33F97'; plain: '40'),
(obj: TrhlSuperFast; hash: 'x'+'7A45AEC2'; plain: '3197'),
(obj: TrhlSuperFast; hash: 'x'+'F31EFBA2'; plain: '4D22DF'),
(obj: TrhlSuperFast; hash: 'x'+'6615B0B5'; plain: '6CCD13D7'),
(obj: TrhlSuperFast; hash: 'x'+'E721642C'; plain: 'D8D9C639AE'),
(obj: TrhlSuperFast; hash: 'x'+'97688774'; plain: 'FBC4AB9E4B2F'),
(obj: TrhlSuperFast; hash: 'x'+'B42B4CB9'; plain: 'D19BEB74934639'),
(obj: TrhlSuperFast; hash: 'x'+'C01FB003'; plain: '48DE5F4845276C8F'),
(obj: TrhlSuperFast; hash: 'x'+'6C9F5EF8'; plain: '8E854990BC47A07EAA'),
(obj: TrhlSuperFast; hash: 'x'+'633D75D2'; plain: '4EB0FE433C6B87F34B29'),
(obj: TrhlSuperFast; hash: 'x'+'E6360E5E'; plain: 'BE497843C5834987519441'),
(obj: TrhlSuperFast; hash: 'x'+'FD6AC728'; plain: '8331CA2956433A094249FDBE'),
(obj: TrhlSuperFast; hash: 'x'+'A17E7005'; plain: 'BF62FA2EECBE87D080E92C37EB'),
(obj: TrhlFNV1a64; hash: 'x'+'25232284E49CF2CB'; plain: ''),
(obj: TrhlFNV1a64; hash: 'x'+'9F2402864CFD63AF'; plain: '40'),
(obj: TrhlFNV1a64; hash: 'x'+'D163B9B40731F807'; plain: '3197'),
(obj: TrhlFNV1a64; hash: 'x'+'03D06FB41912421D'; plain: '4D22DF'),
(obj: TrhlFNV1a64; hash: 'x'+'CC29A152AFEBF71F'; plain: '6CCD13D7'),
(obj: TrhlFNV64; hash: 'x'+'25232284E49CF2CB'; plain: ''),
(obj: TrhlFNV64; hash: 'x'+'9FB701864CBD63AF'; plain: '40'),
(obj: TrhlFNV64; hash: 'x'+'FD89EBB407973208'; plain: '3197'),
(obj: TrhlFNV64; hash: 'x'+'830F316B188247D8'; plain: '4D22DF'),
(obj: TrhlFNV64; hash: 'x'+'1A5D0AC87EE77FD2'; plain: '6CCD13D7')
);
stwk: array[0..69] of record
obj: TrhlHashWithKeyClass;
hash: ansistring;
key: ansistring;
plain: ansistring;
end = (
(obj: TrhlMurmur2; hash: 'x'+'00000000'; key: '7B1A8FC5'; plain: ''),
(obj: TrhlMurmur2; hash: 'x'+'A8E8A4CE'; key: '7B1A8FC5'; plain: '40'),
(obj: TrhlMurmur2; hash: 'x'+'CAD35951'; key: '7B1A8FC5'; plain: '974D'),
(obj: TrhlMurmur2; hash: 'x'+'B9C68D6F'; key: '7B1A8FC5'; plain: '6CCD13'),
(obj: TrhlMurmur2; hash: 'x'+'D0FBB8CA'; key: '7B1A8FC5'; plain: 'C639AEFB'),
(obj: TrhlMurmur2; hash: 'x'+'EE56909A'; key: '7B1A8FC5'; plain: '2FD19BEB74'),
(obj: TrhlMurmur2; hash: 'x'+'00000000'; key: 'E60E3263'; plain: ''),
(obj: TrhlMurmur2; hash: 'x'+'71F0AC63'; key: 'E60E3263'; plain: '31'),
(obj: TrhlMurmur2; hash: 'x'+'2BB8BEA4'; key: 'E60E3263'; plain: '22DF'),
(obj: TrhlMurmur2; hash: 'x'+'4168073E'; key: 'E60E3263'; plain: 'D7D8D9'),
(obj: TrhlMurmur2; hash: 'x'+'C21B8F10'; key: 'E60E3263'; plain: 'C4AB9E4B'),
(obj: TrhlMurmur2; hash: 'x'+'FEF0CB7C'; key: 'E60E3263'; plain: '93463948DE'),
(obj: TrhlMurmur3; hash: 'x'+'86991F82'; key: '7B1A8FC5'; plain: ''),
(obj: TrhlMurmur3; hash: 'x'+'EBD052D6'; key: '7B1A8FC5'; plain: '40'),
(obj: TrhlMurmur3; hash: 'x'+'C1B4E96C'; key: '7B1A8FC5'; plain: '974D'),
(obj: TrhlMurmur3; hash: 'x'+'2ED5BB6A'; key: '7B1A8FC5'; plain: '6CCD13'),
(obj: TrhlMurmur3; hash: 'x'+'EA9F514F'; key: '7B1A8FC5'; plain: 'C639AEFB'),
(obj: TrhlMurmur3; hash: 'x'+'8B960B1C'; key: '7B1A8FC5'; plain: '2FD19BEB74'),
(obj: TrhlMurmur3; hash: 'x'+'A1F371BB'; key: '24B0B688'; plain: ''),
(obj: TrhlMurmur3; hash: 'x'+'CBFF3699'; key: '24B0B688'; plain: '31'),
(obj: TrhlMurmur3; hash: 'x'+'8A80C26F'; key: '24B0B688'; plain: '22DF'),
(obj: TrhlMurmur3; hash: 'x'+'09C1C637'; key: '24B0B688'; plain: 'D7D8D9'),
(obj: TrhlMurmur3; hash: 'x'+'B2DE2BE4'; key: '24B0B688'; plain: 'C4AB9E4B'),
(obj: TrhlMurmur3; hash: 'x'+'D15391EC'; key: '24B0B688'; plain: '93463948DE'),
(obj: TrhlMurmur2_64; hash: 'x'+'0000000000000000'; key: '7B1A8FC5'; plain: ''),
(obj: TrhlMurmur2_64; hash: 'x'+'8587975F5F7E7E51'; key: '7B1A8FC5'; plain: '40'),
(obj: TrhlMurmur2_64; hash: 'x'+'E024B75CAD1A49C2'; key: '7B1A8FC5'; plain: '974D'),
(obj: TrhlMurmur2_64; hash: 'x'+'CE282A81392E8D5C'; key: '7B1A8FC5'; plain: '6CCD13'),
(obj: TrhlMurmur2_64; hash: 'x'+'2A6913486D8BD97D'; key: '7B1A8FC5'; plain: 'C639AEFB'),
(obj: TrhlMurmur2_64; hash: 'x'+'296AD7D13920DE29'; key: '7B1A8FC5'; plain: '2FD19BEB74'),
(obj: TrhlMurmur2_64; hash: 'x'+'198CC78B144DA2F5'; key: '7B1A8FC5'; plain: '5F4845276C8F'),
(obj: TrhlMurmur2_64; hash: 'x'+'96BEA7667042193D'; key: '7B1A8FC5'; plain: 'A07EAA4EB0FE43'),
(obj: TrhlMurmur2_64; hash: 'x'+'2780296C30C62DA0'; key: '7B1A8FC5'; plain: '497843C583498751'),
(obj: TrhlMurmur2_64; hash: 'x'+'4C6EEA6B53AD751F'; key: '7B1A8FC5'; plain: '3A094249FDBEBF62FA'),
(obj: TrhlMurmur2_64; hash: 'x'+'EB949B263B616965'; key: '7B1A8FC5'; plain: 'EB4A8BAE394046AFBC47'),
(obj: TrhlMurmur2_64; hash: 'x'+'5352AD98D33C3D2F'; key: '7B1A8FC5'; plain: 'C1E0C41E2A48278E4B4B81'),
(obj: TrhlMurmur2_64; hash: 'x'+'64E1A45F3C971ED9'; key: '7B1A8FC5'; plain: '628FC520629768E3633858B4'),
(obj: TrhlMurmur2_64; hash: 'x'+'8831CCCA73CFFF0C'; key: '7B1A8FC5'; plain: 'F88CDF40292838C888B71D16EA'),
(obj: TrhlMurmur2_64; hash: 'x'+'FDC402E1FD7F8687'; key: '7B1A8FC5'; plain: 'C3AD05C05413E9585A6462CE0449'),
(obj: TrhlMurmur2_64; hash: 'x'+'9AD3A516A28E82F0'; key: '7B1A8FC5'; plain: '99F397D1268B57091AA4A299685C38'),
(obj: TrhlMurmur2_64; hash: 'x'+'6224A70764AF7D3F'; key: '7B1A8FC5'; plain: 'F3D53061C0789B90F5374CEC88A0DAC9'),
(obj: TrhlMurmur2_64; hash: 'x'+'F30864CC62A09F17'; key: '7B1A8FC5'; plain: '3300D4260B69E8AA8DEED1859D2B7FF78D'),
(obj: TrhlMurmur2_64; hash: 'x'+'8FBE346FF1137921'; key: '7B1A8FC5'; plain: '0DD8F28C8DDABAA5790C640A77C8243F958C'),
(obj: TrhlMurmur2_64; hash: 'x'+'FD0068FC9D210DE4'; key: 'E60E3263'; plain: 'B7B3A5499BE07B8FCD489A7B56E07F0A91D1964971FB3435'),
(obj: TrhlSipHash; hash: 'x'+'310E0EDD47DB6F72'; key: '000102030405060708090A0B0C0D0E0F'; plain: ''),
(obj: TrhlSipHash; hash: 'x'+'9C58AD7C50BB3826'; key: '175710446750988ED9A8D2B460D23F85'; plain: ''),
(obj: TrhlSipHash; hash: 'x'+'6872F312481CF16F'; key: '000102030405060708090A0B0C0D0E0F'; plain: '40'),
(obj: TrhlSipHash; hash: 'x'+'6CC07811ADFC5222'; key: '175710446750988ED9A8D2B460D23F85'; plain: '31'),
(obj: TrhlSipHash; hash: 'x'+'DBCACE3C2E078894'; key: '000102030405060708090A0B0C0D0E0F'; plain: '974D'),
(obj: TrhlSipHash; hash: 'x'+'2D80286A224BACB0'; key: '000102030405060708090A0B0C0D0E0F'; plain: '497843C583498751'),
(obj: TrhlMurmur3_128; hash: 'x'+'6E4718DF51C270B92DAD702FF62D055F'; key: '7B1A8FC5'; plain: ''),
(obj: TrhlMurmur3_128; hash: 'x'+'8231C291DB6D160C806D7487EBC68F92'; key: '7B1A8FC5'; plain: '40'),
(obj: TrhlMurmur3_128; hash: 'x'+'056951A64E2DBFB2C198161C6EAAC683'; key: '7B1A8FC5'; plain: '974D'),
(obj: TrhlMurmur3_128; hash: 'x'+'3C0346B6359803CB06CAC722E8B438FF'; key: '7B1A8FC5'; plain: '6CCD13'),
(obj: TrhlMurmur3_128; hash: 'x'+'321BC94F197860E6AC1656F35BF54980'; key: '7B1A8FC5'; plain: 'C639AEFB'),
(obj: TrhlMurmur3_128; hash: 'x'+'FADFA1837804DE4B7B9A0AF214C73CA2'; key: '7B1A8FC5'; plain: '2FD19BEB74'),
(obj: TrhlMurmur3_128; hash: 'x'+'B8C77BB8AA41056A039B0214BAAF7CB9'; key: '7B1A8FC5'; plain: '5F4845276C8F'),
(obj: TrhlMurmur3_128; hash: 'x'+'319C703C68351759C874816547C79C21'; key: '7B1A8FC5'; plain: 'A07EAA4EB0FE43'),
(obj: TrhlMurmur3_128; hash: 'x'+'DAF8F0FF5D72E060A178C836B2683432'; key: '7B1A8FC5'; plain: '497843C583498751'),
(obj: TrhlMurmur3_128; hash: 'x'+'582EF5AB34209E4F4503981056B3F419'; key: '7B1A8FC5'; plain: '3A094249FDBEBF62FA'),
(obj: TrhlMurmur3_128; hash: 'x'+'09BCE3208780D6079E845339A8B224B5'; key: '7B1A8FC5'; plain: 'EB4A8BAE394046AFBC47'),
(obj: TrhlMurmur3_128; hash: 'x'+'FA2CDFFFBC13169DEA2A53CF1D9EF1A4'; key: '7B1A8FC5'; plain: 'C1E0C41E2A48278E4B4B81'),
(obj: TrhlMurmur3_128; hash: 'x'+'2BDC63CFBC9B45F5FEBF6C2854559907'; key: '7B1A8FC5'; plain: '628FC520629768E3633858B4'),
(obj: TrhlMurmur3_128; hash: 'x'+'A437DC70D1671625A257C89ACF0EC507'; key: '7B1A8FC5'; plain: 'F88CDF40292838C888B71D16EA'),
(obj: TrhlMurmur3_128; hash: 'x'+'E47D7451AF14496D09B6A8CED70C8EFC'; key: '7B1A8FC5'; plain: 'C3AD05C05413E9585A6462CE0449'),
(obj: TrhlMurmur3_128; hash: 'x'+'25F64356FFED8222AFD2BB709E0194E9'; key: '7B1A8FC5'; plain: '99F397D1268B57091AA4A299685C38'),
(obj: TrhlMurmur3_128; hash: 'x'+'B3E72C110948C8C9D9257A94798A8F56'; key: '7B1A8FC5'; plain: 'F3D53061C0789B90F5374CEC88A0DAC9'),
(obj: TrhlMurmur3_128; hash: 'x'+'FDA965D783B39A586CFF2BE3E760A612'; key: '7B1A8FC5'; plain: '3300D4260B69E8AA8DEED1859D2B7FF78D'),
(obj: TrhlMurmur3_128; hash: 'x'+'F075CC9D21C52901F529243DD229524D'; key: '7B1A8FC5'; plain: '0DD8F28C8DDABAA5790C640A77C8243F958C'),
(obj: TrhlMurmur3_128; hash: 'x'+'2D33081A712AF21969491E8EA1F0F6D1'; key: 'BA6BF557'; plain: 'B7B3A5499BE07B8FCD489A7B56E07F0A91D1964971FB3435')
);
function RHLSelfTest(ALog: TStrings = nil): Boolean;
implementation
uses
sysutils, strutils, Dialogs;
function StringToHexString(s: string; separator: string = ':'): string;
var
i, j: integer;
begin
Result := '';
j := Length(s);
for i := 1 to j do
begin
Result := Result + Format('%.2x', [byte(s[i])]);
if i < j then
Result := Result + separator;
end;
end;
function HexStringToString(s: string; separator: string = ''): string;
var
i: integer;
begin
if Length(separator) > 0 then
begin
Result := '';
for i := 1 to Length(s) do
if s[i] <> separator[1] then
Result := Result + s[i];
s := Result;
end;
Result := '';
for i := 1 to Length(s) div 2 do
Result := Result + char(Hex2Dec(s[i * 2 - 1] + s[i * 2]));
end;
function RHLSelfTest(ALog: TStrings): Boolean;
var
i: Integer;
s, p, h, k: ansistring;
b: Boolean;
begin
Result := True;
// st
for i := Low(st) to High(st) do
begin
h := st[i].hash;
if Pos('x', h) = 1 then
begin
p := HexStringToString(st[i].plain);
Delete(h, 1, 1);
end
else
begin
p := st[i].plain;
end;
h := HexStringToString(h);
s := rhlHash(p, st[i].obj);
b := s = h;
Result := Result and b;
if Assigned(ALog) then
begin
ALog.Append(Format('%-40s %s', [st[i].obj.ClassName, BoolToStr(b, 'OK', 'FAIL')]));
if not b then
begin
ALog.Append(Format('%s<>%s', [StringToHexString(h, ''), StringToHexString(s, '')]));
end;
end;
end;
// stwk
for i := Low(stwk) to High(stwk) do
begin
h := stwk[i].hash;
if Pos('x', h) = 1 then
begin
p := HexStringToString(stwk[i].plain);
k := HexStringToString(stwk[i].key);
Delete(h, 1, 1);
end
else
begin
k := '';
p := stwk[i].plain;
end;
h := HexStringToString(h);
s := rhlHash(p, k, stwk[i].obj);
b := s = h;
Result := Result and b;
if Assigned(ALog) then
begin
ALog.Append(Format('%-40s %s', [stwk[i].obj.ClassName, BoolToStr(b, 'OK', 'FAIL')]));
if not b then
begin
ALog.Append(Format('%s<>%s', [StringToHexString(h, ''), StringToHexString(s, '')]));
end;
end;
end;
end;
end.
|
unit Fontlist;
interface
uses Windows, Classes, Graphics, Forms, Controls, StdCtrls;
type
TForm1 = class(TForm)
ListBox1: TListBox;
Label1: TLabel;
FontLabel: TLabel;
procedure FormCreate(Sender: TObject);
procedure ListBox1Click(Sender: TObject);
procedure DrawItem(Control: TWinControl; Index: Integer; Rect: TRect;
State: TOwnerDrawState);
procedure ListBox1MeasureItem(Control: TWinControl; Index: Integer;
var Height: Integer);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
Listbox1.Items := Screen.Fonts;
end;
procedure TForm1.ListBox1Click(Sender: TObject);
begin
FontLabel.Caption := ListBox1.Items[ListBox1.ItemIndex];
end;
procedure TForm1.DrawItem(Control: TWinControl; Index: Integer;
Rect: TRect; State: TOwnerDrawState);
begin
with ListBox1.Canvas do
begin
FillRect(Rect);
Font.Name := ListBox1.Items[Index];
Font.Size := 0; // use font's preferred size
TextOut(Rect.Left+1, Rect.Top+1, ListBox1.Items[Index]);
end;
end;
procedure TForm1.ListBox1MeasureItem(Control: TWinControl; Index: Integer;
var Height: Integer);
begin
with ListBox1.Canvas do
begin
Font.Name := Listbox1.Items[Index];
Font.Size := 0; // use font's preferred size
Height := TextHeight('Wg') + 2; // measure ascenders and descenders
end;
end;
end.
|
unit TAudioSineDemo;
{
This just demostrates some of the functions of the TSoundOut component
1) How to Fill Buffers.
2) How to Start, Stop at once, Stop gracefully.
3) How to pause and resume playout.
4) Using OnStart and OnStop.
}
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Menus, StdCtrls, Buttons,
ExtCtrls, ComCtrls, AudioIO;
type
TForm1 = class(TForm)
StartButton: TButton;
RunStatusLabel: TLabel;
StopButton: TButton;
Panel1: TPanel;
SoundOutButton: TSpeedButton;
BufferStatusLabel: TLabel;
TimeStatusLabel: TLabel;
Timer1: TTimer;
BufferEdit: TEdit;
BufferLabel: TLabel;
FreqLabel: TLabel;
TrackBar1: TTrackBar;
PauseButton: TButton;
AudioOut1: TAudioOut;
procedure StartButtonClick(Sender: TObject);
function AudioOut1FillBuffer(Buffer: PAnsiChar; Var N: Integer): Boolean;
procedure StopButtonClick(Sender: TObject);
procedure AudioOut1Stop(Sender: TObject);
procedure SoundOutButtonClick(Sender: TObject);
Procedure UpdateStatus;
procedure Timer1Timer(Sender: TObject);
procedure BufferEditExit(Sender: TObject);
procedure AudioOut1Start(Sender: TObject);
procedure TrackBar1Change(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure PauseButtonClick(Sender: TObject);
private
{ Private declarations }
TotalBuffers : Integer;
Freq : Integer;
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.StartButtonClick(Sender: TObject);
Var
iErr : Integer;
begin
Val(BufferEdit.Text, TotalBuffers, iErr);
If (Not AudioOut1.Start(AudioOut1)) Then ShowMessage('Audio Out failed because: ' + ^M + AudioOut1.ErrorMessage);
end;
function TForm1.AudioOut1FillBuffer(Buffer: PChar; Var N: Integer): Boolean;
{
Whenever the component needs another buffer, this routine is called,
N is the number of BYTES required, B the the address of the buffer.
}
Var
NW, i, ts : Integer;
P : ^SmallInt;
begin
{ See if we want to quit. Process TotalBuffers except if TotalBuffer
is <= 0, then process forever. }
If (AudioOut1.QueuedBuffers >= TotalBuffers) and (TotalBuffers > 0) Then
Begin
{ Stop processing by just returning FALSE }
Result := FALSE;
Exit;
End;;
{ First step, cast the buffer as the proper data size, if this output
was 8 bits, then the cast would be to ^Byte. N now represents the
total number of 16 bit words to process. }
P := Pointer(Buffer);
NW := N div 2;
{ Now create a sine wave, because the buffer may not align with the end
of a full sine cycle, we must compute it using the total number of
points processed. FilledBuffers give the total number of buffer WE
have filled, so we know the number of point WE processed }
ts := NW*AudioOut1.FilledBuffers;
{ Note: Freq is set from the TrackBar }
For i := 0 to NW-1 Do
Begin
P^ := Round(8192*Sin((ts+i)/AudioOut1.FrameRate*3.14159*2*Freq));
Inc(P);
End;
{ True will continue Processing }
Result := True;
end;
procedure TForm1.StopButtonClick(Sender: TObject);
begin
AudioOut1.StopGraceFully;
end;
procedure TForm1.AudioOut1Stop(Sender: TObject);
begin
SoundOutButton.Down := FALSE;
end;
procedure TForm1.SoundOutButtonClick(Sender: TObject);
begin
If (Not SoundOutButton.Down) Then
AudioOut1.StopAtOnce
Else
StartButtonClick(Sender);
end;
Procedure TForm1.UpdateStatus;
begin
With AudioOut1 Do
If (AudioOut1.Active) Then
Begin
If (Not AudioOut1.Paused) Then
RunStatusLabel.Caption := 'Playing Out'
Else
RunStatusLabel.Caption := 'Started, Paused';
BufferStatusLabel.Caption := Format('Queued: %d; Processed: %d',[QueuedBuffers, ProcessedBuffers]);
TimeStatusLabel.Caption := Format('Seconds %.3n',[ElapsedTime]);
End
Else
Begin
If (AudioOut1.Paused) Then
RunStatusLabel.Caption := 'Not Started, Paused'
Else
RunStatusLabel.Caption := 'Not Started';
BufferStatusLabel.Caption := '';
TimeStatusLabel.Caption := '';
End;
If (AudioOut1.Paused) Then
PauseButton.Caption := '&Resume'
Else
PauseButton.Caption := '&Pause';
End;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
UpdateStatus;
end;
procedure TForm1.BufferEditExit(Sender: TObject);
Var
iErr : Integer;
begin
Val(BufferEdit.Text, TotalBuffers, iErr);
If (iErr <> 0) Then ShowMessage('Buffer value must be an integer');
end;
procedure TForm1.AudioOut1Start(Sender: TObject);
begin
SoundOutButton.Down := TRUE;
end;
procedure TForm1.TrackBar1Change(Sender: TObject);
begin
Freq := TrackBar1.Position;
FreqLabel.Caption := Format('Frequency %d',[Freq]);
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
TrackBar1Change(Sender);
end;
procedure TForm1.PauseButtonClick(Sender: TObject);
begin
AudioOut1.Paused := Not AudioOut1.Paused;
end;
end.
|
FUNCTION SendBlock(blockNum : BYTE; data : DataBlock; length : INTEGER; crcMode : BOOLEAN) : ResponseType;
CONST
SOH = ^A;
STX = ^B;
GetSetUser = 32;
VAR
chksum : BYTE;
crc,i,retries : INTEGER;
c : CHAR;
response : ResponseType;
BEGIN
retries := RETRIES_MAX;
REPEAT
IF length = 128 THEN
Write(Aux,SOH)
ELSE
Write(Aux,STX);
Write(Aux,Chr(blockNum),Chr(NOT blockNum));
chksum := 0;
crc := 0;
FOR i := 0 TO length - 1 DO BEGIN
Write(Aux,Chr(data[i]));
IF crcMode THEN
crc := updcrc(data[i],crc)
ELSE
chksum := chksum + data[i];
END;
crc := updcrc(0,updcrc(0,crc));
{ purge any noise in input buffer before sending checksum/CRC }
WHILE ModemInReady DO
Read(Aux,c);
IF crcMode THEN
Write(Aux,Chr(Hi(crc)),Chr(Lo(crc)))
ELSE
Write(Aux,Chr(chksum));
{ Get ACK/NAK/CAN/timeout }
response := GetACK(5);
retries := Pred(retries);
UNTIL (response <> GotNAK) OR (retries = 0);
IF retries = 0 THEN
SendBlock := GotTIMEOUT
ELSE
SendBlock := response;
END;
|
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, jpeg, Buttons;
type
TForm1 = class(TForm)
Label1: TLabel;
Timer1: TTimer;
Label2: TLabel;
SpeedButton1: TSpeedButton;
SpeedButton2: TSpeedButton;
Image1: TImage;
procedure FormCreate(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure Timer1Timer(Sender: TObject);
procedure SpeedButton1Click(Sender: TObject);
procedure BgImgMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure SpeedButton2Click(Sender: TObject);
private
{ Private declarations }
HrImg: Array [1..6] of TImage;
MinImg: Array [1..6] of TImage;
SecImg: Array [1..6] of TImage;
Procedure FindHour(hr: Word);
Procedure FindMin(Min: Word);
Procedure FindSec(Sec: Word);
public
{ Public declarations }
end;
var
Form1: TForm1;
Hr,Min,sec,mSec: Word;
Const
Nr1: Array [1..60] of String = ('100000','010000','110000','001000', //1,2,3,4
'101000','011000','111000','000100', //5,6,7,8
'100100','010100','110100','001100', //9,10,11,12
'101100','011100','111100','000010', //13-
'100010','010010','110010','001010',
'101010','011010','111010','000110',
'100110','010110','110110','001110',
'101110','011110','111110','000001',
'100001','010001','110001','001001', //36
'101001','011001','111001','000101', //40
'100101','010101','110101','001101', //44
'101101','011101','111101','000011', //48
'100011','010011','110011','001011', //52
'101011','011011','111011','000111', //56
'100111','010111','110111','001111'); //60
implementation
uses Unit2;
{$R *.dfm}
{$R images.res}
Procedure TForm1.FindHour(hr: Word);
Var i:Byte;
begin
if hr>12 then hr:=hr-12;
For i:=1 to 6 do
if Nr1[hr,i]='1' then HrImg[i].Picture.Bitmap.LoadFromResourceName(hinstance,'ledOn')
else HrImg[i].Picture.Bitmap.LoadFromResourceName(hinstance,'ledOff');
end;
Procedure TForm1.FindMin(min: Word);
Var i:Byte;
begin
For i:=1 to 6 do
if Nr1[Min,i]='1' then MinImg[i].Picture.Bitmap.LoadFromResourceName(hinstance,'ledOn')
else MinImg[i].Picture.Bitmap.LoadFromResourceName(hinstance,'ledOff');
end;
Procedure TForm1.FindSec(Sec: Word);
Var i:Byte;
begin
For i:=1 to 6 do
if Nr1[sec,i]='1' then SecImg[i].Picture.Bitmap.LoadFromResourceName(hinstance,'ledOn')
else SecImg[i].Picture.Bitmap.LoadFromResourceName(hinstance,'ledOff');
end;
procedure TForm1.FormCreate(Sender: TObject);
Var i: Byte;
L,T: Integer;
begin
Form1.AutoSize:=True;
L:=8;
T:=37;
for i:=1 to 6 do begin
HrImg[i]:=TImage.Create(Self);
HrImg[i].Name:='HrImg'+IntToStr(i);
HrImg[i].Parent:=Form1;
HrImg[i].Left:=L;
HrImg[i].Top:=T;
HrImg[i].Width:=16;
HrImg[i].Height:=16;
HrImg[i].OnMouseDown:=BgImgMouseDown;
L:=L+16;
end;
L:=8;
T:=T+16;
for i:=1 to 6 do begin
MinImg[i]:=TImage.Create(Self);
MinImg[i].Name:='MinImg'+IntToStr(i);
MinImg[i].Parent:=Form1;
MinImg[i].Left:=L;
MinImg[i].Top:=T;
MinImg[i].Width:=16;
MinImg[i].Height:=16;
MinImg[i].OnMouseDown:=BgImgMouseDown;
L:=L+16;
end;
L:=8;
T:=T+16;
for i:=1 to 6 do begin
SecImg[i]:=TImage.Create(Self);
SecImg[i].Name:='SecShape'+IntToStr(i);
SecImg[i].Parent:=Form1;
SecImg[i].Left:=L;
SecImg[i].Top:=T;
SecImg[i].Width:=16;
SecImg[i].Height:=16;
SecImg[i].OnMouseDown:=BgImgMouseDown;
L:=L+16;
end;
Label1.Caption:=FormatDateTime('hh:mm:ss',Time);
Label2.Caption:=FormatDateTime('dd.mm.yyyy',Date);
DecodeTime(TIme,hr,min,sec,msec);
FindHour(hr);
FindMin(min);
FindSec(Sec);
end;
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
Var i:Byte;
begin
for i:=Low(HrImg) to High(HrImg) do begin
HrImg[i].Free;
MinImg[i].Free;
SecImg[i].Free;
end;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
Label1.Caption:=FormatDateTime('hh:mm:ss',Time);
Sec:=Sec+1;
if Sec>60 then begin
sec:=1;
Min:=Min+1;
FindMin(Min);
if Min>60 then begin
Min:=1;
Hr:=Hr+1;
FindHour(Hr);
end;
end;
FindSec(Sec);
end;
procedure TForm1.SpeedButton1Click(Sender: TObject);
begin
Close;
end;
procedure TForm1.BgImgMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
ReleaseCapture;
Form1.Perform(WM_SysCommand,$f012,1);
end;
procedure TForm1.SpeedButton2Click(Sender: TObject);
begin
HelpFrm.ShowModal;
end;
end.
|
unit Getter.DriveList;
interface
uses
Windows, SysUtils, Classes,
OSFile.ForInternal;
type
TDriveList = TStringList;
TDriveSet = Set of DRIVE_UNKNOWN..DRIVE_RAMDISK;
TDriveListGetter = class abstract(TOSFileForInternal)
public
function GetDriveList: TDriveList;
protected
function GetDriveTypeToGet: TDriveSet; virtual; abstract;
private
SpecifiedDriveList: TDriveList;
LogicalDriveString: Array of WideChar;
CurrentCharPosition: Cardinal;
procedure SetLogicalDriveInConcatString;
procedure ConcatStringToTDriveList;
procedure AddNextDrive;
function GoToNextCharIfInDriveOrFalse: Boolean;
function IsThisCharNullChar: Boolean;
function IsThisPointOverLimit: Boolean;
procedure IfNotFixedDelete(var CurrentDrive: Cardinal);
procedure LeaveOnlySpecifiedDrives;
procedure TryToGetDriveList;
end;
implementation
procedure TDriveListGetter.SetLogicalDriveInConcatString;
var
LengthOfLogicalDriveString: Cardinal;
begin
SetLength(LogicalDriveString, 1);
LengthOfLogicalDriveString :=
GetLogicalDriveStrings(0, @LogicalDriveString[0]);
SetLength(LogicalDriveString, LengthOfLogicalDriveString);
GetLogicalDriveStrings(LengthOfLogicalDriveString, @LogicalDriveString[0]);
end;
function TDriveListGetter.IsThisPointOverLimit: Boolean;
begin
result :=
CurrentCharPosition = Cardinal(Length(LogicalDriveString));
end;
function TDriveListGetter.IsThisCharNullChar: Boolean;
begin
result := LogicalDriveString[CurrentCharPosition] = #0;
end;
function TDriveListGetter.GoToNextCharIfInDriveOrFalse: Boolean;
begin
result := true;
if IsThisPointOverLimit then
result := false
else if IsThisCharNullChar then
result := false
else
Inc(CurrentCharPosition, 1);
end;
procedure TDriveListGetter.AddNextDrive;
procedure Nothing;
begin
//Nothing, but NOP procedure for infinite loop
end;
var
StartingPoint: Cardinal;
begin
StartingPoint := CurrentCharPosition;
while GoToNextCharIfInDriveOrFalse do
Nothing;
if CurrentCharPosition <> StartingPoint then
SpecifiedDriveList.Add(
PChar(@LogicalDriveString[StartingPoint]));
Inc(CurrentCharPosition, 1);
end;
procedure TDriveListGetter.ConcatStringToTDriveList;
begin
SpecifiedDriveList := TDriveList.Create;
CurrentCharPosition := 0;
while CurrentCharPosition <
Cardinal(Length(LogicalDriveString)) do
AddNextDrive;
end;
procedure TDriveListGetter.IfNotFixedDelete(var CurrentDrive: Cardinal);
var
DriveType: Cardinal;
begin
DriveType := GetDriveType(PChar(SpecifiedDriveList[CurrentDrive]));
if not (DriveType in GetDriveTypeToGet) then
SpecifiedDriveList.Delete(CurrentDrive)
else
CurrentDrive := CurrentDrive + 1;
end;
procedure TDriveListGetter.LeaveOnlySpecifiedDrives;
var
CurrentDrive: Cardinal;
begin
CurrentDrive := 0;
while Integer(CurrentDrive) <= SpecifiedDriveList.Count - 1 do
IfNotFixedDelete(CurrentDrive);
end;
procedure TDriveListGetter.TryToGetDriveList;
begin
SetLogicalDriveInConcatString;
ConcatStringToTDriveList;
LeaveOnlySpecifiedDrives;
end;
function TDriveListGetter.GetDriveList: TDriveList;
begin
try
TryToGetDriveList;
except
FreeAndNil(SpecifiedDriveList);
end;
result := SpecifiedDriveList;
end;
end.
|
{*******************************************************}
{ }
{ Delphi Runtime Library }
{ }
{ Copyright(c) 1995-2018 Embarcadero Technologies, Inc. }
{ All rights reserved }
{ }
{*******************************************************}
{ *************************************************************************** }
{ }
{ Licensees holding a valid Borland No-Nonsense License for this Software may }
{ use this file in accordance with such license, which appears in the file }
{ license.txt that came with this Software. }
{ }
{ *************************************************************************** }
unit Web.CopyPrsr;
interface
uses System.Classes;
const
toEOL = UTF8Char(5);
toEOF = UTF8Char(0);
toSymbol = UTF8Char(1);
toString = UTF8Char(2);
toInteger = UTF8Char(3);
toFloat = UTF8Char(4);
type
{ TCopyParser }
TCopyParser = class(TObject)
private
FStream: TStream;
FOutStream: TStream;
FOrigin: Int64;
FBuffer: PUTF8Char;
FBufPtr: PUTF8Char;
FBufEnd: PUTF8Char;
FSourcePtr: PUTF8Char;
FSourceEnd: PUTF8Char;
FTokenPtr: PUTF8Char;
FStringPtr: PUTF8Char;
FSourceLine: Integer;
FSaveChar: UTF8Char;
FToken: UTF8Char;
procedure ReadBuffer;
procedure SkipBlanks(DoCopy: Boolean);
function SkipToNextToken(CopyBlanks, DoCopy: Boolean): UTF8Char;
function CopySkipTo(Length: Integer; DoCopy: Boolean): UTF8String;
function CopySkipToToken(AToken: UTF8Char; DoCopy: Boolean): UTF8String;
function CopySkipToEOL(DoCopy: Boolean): UTF8String;
function CopySkipToEOF(DoCopy: Boolean): UTF8String;
procedure UpdateOutStream(StartPos: PUTF8Char);
public
constructor Create(Stream, OutStream: TStream);
destructor Destroy; override;
procedure CheckToken(T: UTF8Char);
procedure CheckTokenSymbol(const S: UTF8String);
function CopyTo(Length: Integer): UTF8String;
function CopyToToken(AToken: UTF8Char): UTF8String;
function CopyToEOL: UTF8String;
function CopyToEOF: UTF8String;
procedure CopyTokenToOutput;
procedure Error(const Ident: string);
procedure ErrorFmt(const Ident: string; const Args: array of const);
procedure ErrorStr(const Message: string);
function NextToken: UTF8Char;
function SkipToken(CopyBlanks: Boolean): UTF8Char;
procedure SkipEOL;
function SkipTo(Length: Integer): UTF8String;
function SkipToToken(AToken: UTF8Char): UTF8String;
function SkipToEOL: UTF8String;
function SkipToEOF: UTF8String;
function SourcePos: Int64;
function TokenComponentIdent: UTF8String;
function TokenFloat: Extended;
function TokenInt: Longint;
function TokenString: UTF8String;
function TokenSymbolIs(const S: UTF8String): Boolean;
property SourceLine: Integer read FSourceLine;
property Token: UTF8Char read FToken;
property OutputStream: TStream read FOutStream write FOutStream;
end;
implementation
uses
{$IFDEF POSIX}
Posix.String_,
{$ENDIF POSIX}
System.SysUtils,
System.RTLConsts;
{ TCopyParser }
const
ParseBufSize = 4096;
function LineStart(Buffer, BufPos: PUTF8Char): PUTF8Char;
var
C: NativeInt;
begin
Result := Buffer;
C := (BufPos - Buffer) - 1;
while (C > 0) and (Buffer[C] <> #10) do
Dec(C);
if C > 0 then
Result := @Buffer[C + 1];
end;
function StrComp(const Str1, Str2: PUTF8Char): Integer;
var
P1, P2: PUTF8Char;
begin
P1 := Str1;
P2 := Str2;
while True do
begin
if (P1^ <> P2^) or (P1^ = #0) then
Exit(Ord(P1^) - Ord(P2^));
Inc(P1);
Inc(P2);
end;
end;
constructor TCopyParser.Create(Stream, OutStream: TStream);
var
I: Integer;
begin
FStream := Stream;
FOutStream := OutStream;
GetMem(FBuffer, ParseBufSize * sizeof(UTF8Char));
for I := ParseBufSize-1 downto 0 do // testing
FBuffer[I] := #0;
FBuffer[0] := #0;
FBufPtr := FBuffer;
FBufEnd := FBuffer + ParseBufSize;
FSourcePtr := FBuffer;
FSourceEnd := FBuffer;
FTokenPtr := FBuffer;
FSourceLine := 1;
SkipToken(True);
end;
destructor TCopyParser.Destroy;
begin
if FBuffer <> nil then
begin
FStream.Seek(IntPtr(FTokenPtr) - IntPtr(FBufPtr), soCurrent);
FreeMem(FBuffer, ParseBufSize);
end;
end;
procedure TCopyParser.CheckToken(T: UTF8Char);
begin
if Token <> T then
case T of
toSymbol:
Error(SIdentifierExpected);
Web.CopyPrsr.toString:
Error(SStringExpected);
toInteger, toFloat:
Error(SNumberExpected);
else
ErrorFmt(SCharExpected, [T]);
end;
end;
procedure TCopyParser.CheckTokenSymbol(const S: UTF8String);
begin
if not TokenSymbolIs(S) then ErrorFmt(SSymbolExpected, [S]);
end;
function TCopyParser.CopySkipTo(Length: Integer; DoCopy: Boolean): UTF8String;
var
P: PUTF8Char;
Temp: UTF8String;
begin
Result := '';
repeat
P := FTokenPtr;
while (Length > 0) and (P^ <> #0) do
begin
Inc(P);
Dec(Length);
end;
if DoCopy and (FOutStream <> nil) then
FOutStream.WriteBuffer(FTokenPtr^, P - FTokenPtr);
SetString(Temp, FTokenPtr, P - FTokenPtr);
Result := Result + Temp;
if Length > 0 then ReadBuffer;
until (Length = 0) or (Token = toEOF);
FSourcePtr := P;
end;
function TCopyParser.CopySkipToEOL(DoCopy: Boolean): UTF8String;
var
P: PUTF8Char;
begin
P := FTokenPtr;
while not (P^ in [#13, #10, #0]) do Inc(P);
SetString(Result, FTokenPtr, P - FTokenPtr);
if P^ = #13 then Inc(P);
FSourcePtr := P;
if DoCopy then UpdateOutStream(FTokenPtr);
NextToken;
end;
function TCopyParser.CopySkipToEOF(DoCopy: Boolean): UTF8String;
var
P: PUTF8Char;
Temp: UTF8String;
begin
repeat
P := FTokenPtr;
while P^ <> #0 do Inc(P);
FSourcePtr := P;
SetString(Temp, FTokenPtr, P - FTokenPtr);
Result := Result + Temp;
if DoCopy then
begin
UpdateOutStream(FTokenPtr);
NextToken;
end else SkipToken(False);
FTokenPtr := FSourcePtr;
until Token = toEOF;
end;
function TCopyParser.CopySkipToToken(AToken: UTF8Char; DoCopy: Boolean): UTF8String;
var
S: PUTF8Char;
Temp: UTF8String;
procedure InternalSkipBlanks;
begin
while True do
begin
case FSourcePtr^ of
#0:
begin
SetString(Temp, S, FSourcePtr - S);
Result := Result + Temp;
if DoCopy then UpdateOutStream(S);
ReadBuffer;
if FSourcePtr^ = #0 then Exit;
S := FSourcePtr;
Continue;
end;
#10:
Inc(FSourceLine);
#33..#255:
Break;
end;
Inc(FSourcePtr);
end;
if DoCopy then UpdateOutStream(S);
end;
var
InSingleQuote, InDoubleQuote: Boolean;
Found: Boolean;
begin
InSingleQuote := False;
InDoubleQuote := False;
Found := False;
Result := '';
while (not Found) and (Token <> toEOF) do
begin
S := FSourcePtr;
InternalSkipBlanks;
if S <> FSourcePtr then
begin
SetString(Temp, S, FSourcePtr - S);
Result := Result + Temp;
end;
SkipToNextToken(DoCopy, DoCopy);
if Token = '"' then
InDoubleQuote := not InDoubleQuote and not InSingleQuote
else if Token = '''' then
InSingleQuote := not InSingleQuote and not InDoubleQuote;
Found := (Token = AToken) and
(((Token = '"') and (not InSingleQuote)) or
((Token = '''') and (not InDoubleQuote)) or
not (InDoubleQuote or InSingleQuote));
if not Found then
begin
SetString(Temp, FTokenPtr, FSourcePtr - FTokenPtr);
Result := Result + Temp;
end;
end;
end;
function TCopyParser.CopyTo(Length: Integer): UTF8String;
begin
Result := CopySkipTo(Length, True);
end;
function TCopyParser.CopyToToken(AToken: UTF8Char): UTF8String;
begin
Result := CopySkipToToken(AToken, True);
end;
function TCopyParser.CopyToEOL: UTF8String;
begin
Result := CopySkipToEOL(True);
end;
function TCopyParser.CopyToEOF: UTF8String;
begin
Result := CopySkipToEOF(True);
end;
procedure TCopyParser.CopyTokenToOutput;
begin
UpdateOutStream(FTokenPtr);
end;
procedure TCopyParser.Error(const Ident: string);
begin
ErrorStr(Ident);
end;
procedure TCopyParser.ErrorFmt(const Ident: string; const Args: array of const);
begin
ErrorStr(Format(Ident, Args));
end;
procedure TCopyParser.ErrorStr(const Message: string);
begin
raise EParserError.CreateResFmt(@SParseError, [Message, FSourceLine]);
end;
function TCopyParser.NextToken: UTF8Char;
begin
Result := SkipToNextToken(True, True);
end;
function TCopyParser.SkipTo(Length: Integer): UTF8String;
begin
Result := CopySkipTo(Length, False);
end;
function TCopyParser.SkipToToken(AToken: UTF8Char): UTF8String;
begin
Result := CopySkipToToken(AToken, False);
end;
function TCopyParser.SkipToEOL: UTF8String;
begin
Result := CopySkipToEOL(False);
end;
function TCopyParser.SkipToEOF: UTF8String;
begin
Result := CopySkipToEOF(False);
end;
function TCopyParser.SkipToNextToken(CopyBlanks, DoCopy: Boolean): UTF8Char;
var
P, StartPos: PUTF8Char;
begin
SkipBlanks(CopyBlanks);
P := FSourcePtr;
FTokenPtr := P;
case P^ of
'A'..'Z', 'a'..'z', '_':
begin
Inc(P);
while P^ in ['A'..'Z', 'a'..'z', '0'..'9', '_'] do Inc(P);
Result := toSymbol;
end;
#10:
begin
Inc(P);
Inc(FSourceLine);
Result := toEOL;
end;
else
Result := P^;
if Result <> toEOF then Inc(P);
end;
StartPos := FSourcePtr;
FSourcePtr := P;
if DoCopy then UpdateOutStream(StartPos);
FToken := Result;
end;
function TCopyParser.SkipToken(CopyBlanks: Boolean): UTF8Char;
begin
Result := SkipToNextToken(CopyBlanks, False);
end;
procedure TCopyParser.ReadBuffer;
var
Count: Integer;
begin
Inc(FOrigin, FSourcePtr - FBuffer);
FSourceEnd[0] := FSaveChar;
Count := FBufPtr - FSourcePtr;
if Count <> 0 then Move(FSourcePtr[0], FBuffer[0], Count);
FBufPtr := FBuffer + Count;
Inc(FBufPtr, FStream.Read(FBufPtr[0], (FBufEnd - FBufPtr) * sizeof(UTF8Char)));
FSourcePtr := FBuffer;
FSourceEnd := FBufPtr;
if FSourceEnd = FBufEnd then
begin
FSourceEnd := LineStart(FBuffer, FSourceEnd - 1);
if FSourceEnd = FBuffer then Error(SLineTooLong);
end;
FSaveChar := FSourceEnd[0];
FSourceEnd[0] := #0;
end;
procedure TCopyParser.SkipBlanks(DoCopy: Boolean);
var
Start: PUTF8Char;
begin
Start := FSourcePtr;
while True do
begin
case FSourcePtr^ of
#0:
begin
if DoCopy then UpdateOutStream(Start);
ReadBuffer;
if FSourcePtr^ = #0 then Exit;
Start := FSourcePtr;
Continue;
end;
#10:
Inc(FSourceLine);
#33..#255:
Break;
end;
Inc(FSourcePtr);
end;
if DoCopy then UpdateOutStream(Start);
end;
function TCopyParser.SourcePos: Int64;
begin
Result := FOrigin + (FTokenPtr - FBuffer);
end;
procedure TCopyParser.SkipEOL;
begin
if Token = toEOL then
begin
while FTokenPtr^ in [#13, #10] do Inc(FTokenPtr);
FSourcePtr := FTokenPtr;
if FSourcePtr^ <> #0 then
NextToken
else FToken := #0;
end;
end;
function TCopyParser.TokenFloat: Extended;
begin
Result := StrToFloat(string(TokenString));
end;
function TCopyParser.TokenInt: Longint;
begin
Result := StrToInt(string(TokenString));
end;
function TCopyParser.TokenString: UTF8String;
var
L: Int64;
begin
if FToken = Web.CopyPrsr.toString then
L := FStringPtr - FTokenPtr else
L := FSourcePtr - FTokenPtr;
SetString(Result, FTokenPtr, L);
end;
function TCopyParser.TokenSymbolIs(const S: UTF8String): Boolean;
begin
Result := (Token = toSymbol) and (StrComp(PUTF8Char(S), PUTF8Char(TokenString)) = 0);
end;
function TCopyParser.TokenComponentIdent: UTF8String;
var
P: PUTF8Char;
begin
CheckToken(toSymbol);
P := FSourcePtr;
while P^ = '.' do
begin
Inc(P);
if not (P^ in ['A'..'Z', 'a'..'z', '_']) then
Error(SIdentifierExpected);
repeat
Inc(P)
until not (P^ in ['A'..'Z', 'a'..'z', '0'..'9', '_']);
end;
FSourcePtr := P;
Result := TokenString;
end;
procedure TCopyParser.UpdateOutStream(StartPos: PUTF8Char);
begin
if FOutStream <> nil then
FOutStream.WriteBuffer(StartPos^, FSourcePtr - StartPos);
end;
end.
|
program Ved (Input, Output);
uses
Crt;
const
MAX_LINES = 512;
type
filename = string [80];
linestr = string [128];
lineptr = ^linestr;
var
termWidth, termHeight : integer;
x, y : integer; { cursor coordinates }
offset : integer;
status : string [70];
linecount : integer;
lines : array [1..MAX_LINES] of lineptr;
cmd : string [10];
{ Uncomment this function for TP 3
function ReadKey : char;
var
ch : char;
begin
repeat Read(Kbd, ch) until ch <> #0;
ReadKey := ch;
end;
}
{
Get Screen Size for TP7 and FPC
}
procedure GetScreenSize;
begin
{ TP7 }
termWidth := Lo(WindMax) - Lo(WindMin) + 1;
termHeight := Hi(WindMax) - Hi(WindMin) + 1;
{ FPC }
termWidth := WindMaxX - WindMinX + 1;
termHeight := WindMaxY - WindMinY + 1;
end;
{
Render functions
}
procedure RenderText(startln : integer);
var
screenln : integer;
begin
screenln := startln - offset;
GotoXY(1, screenln);
repeat
ClrEol;
if startln <= linecount then
begin
Writeln(lines[startln]^);
startln := Succ(startln);
end;
screenln := Succ(screenln);
until (screenln > termHeight - 1);
end;
procedure RenderLn(lnr : integer);
begin
GotoXY(1, lnr - offset);
ClrEol;
Writeln(lines[lnr]^);
GotoXY(x, y - offset);
end;
procedure RenderCurLn;
begin
RenderLn(y);
end;
procedure RenderStatus;
var
percent : integer;
percentstr : string [4];
begin
GotoXY(1, termHeight);
TextBackground(White);
TextColor(Black);
ClrEol;
if Length(cmd) <> 0 then
begin
Write(cmd);
end
else
begin
Write(status);
end;
if offset = 0 then
begin
percentstr := 'Top';
end
else
begin
percent := Trunc(((offset + termHeight) / linecount) * 100);
Str(percent, percentstr);
percentstr := percentstr + '%';
end;
GotoXY(termWidth - Length(percentstr) - 1, termHeight);
Write(percentstr);
NormVideo;
end;
procedure RenderCursor;
var
newx, len : integer;
begin
{ If x is more than line length, goto end of line }
newx := x;
len := Length(lines[y]^);
if x > len then newx := len;
if len = 0 then newx := 1;
GotoXY(newx, y - offset);
end;
procedure Render;
begin
RenderText(offset + 1); { Render all }
RenderStatus;
RenderCursor;
end;
procedure RenderDown;
begin
RenderText(y); { Render from current row down }
RenderStatus;
RenderCursor;
end;
procedure PrintStatus(msg : linestr);
begin
status := msg;
RenderStatus;
GotoXY(x, y - offset);
end;
{
Movement functions
}
procedure AdjustEol;
var
len : integer;
begin
len := Length(lines[y]^);
if x > len then x := len;
if x = 0 then x := 1;
end;
procedure GoLeft;
begin
AdjustEol;
if x <> 1 then x := Pred(x);
RenderCursor;
end;
procedure GoRight;
begin
AdjustEol;
if x < Length(lines[y]^) then x := Succ(x);
RenderCursor;
end;
procedure GoUp;
begin
if y <> 1 then
begin
y := Pred(y);
if (offset > 0) and
(y - offset = 0) then
begin
offset := Pred(offset);
Render;
end;
RenderCursor;
end
end;
procedure GoDown;
begin
if y < linecount then
begin
y := Succ(y);
if (y - offset) > termHeight - 1 then
begin
offset := Succ(offset);
Render;
end;
RenderCursor;
end;
end;
procedure GoToBottom;
begin
y := linecount;
if linecount > termHeight - 1 then
begin
offset := linecount - termHeight + 1;
end;
Render;
end;
procedure GoFarRight;
begin
x := Length(lines[y]^);
if x = 0 then x := 1;
RenderCursor;
end;
procedure GoFarLeft;
begin
x := 1;
RenderCursor;
end;
function EndOfLine : boolean;
begin
if x >= Length(lines[y]^) then
begin
EndOfLine := True;
end
else
begin
EndOfLine := False;
end;
end;
{
Buffer modification functions
}
procedure DeleteLn(lnr : integer);
var
i : integer;
begin
Dispose(lines[lnr]);
if lnr <> linecount then
for i := lnr to linecount do
lines[i] := lines[i+1];
linecount := Pred(linecount);
end;
procedure InsertLine(lnr : integer; value : linestr);
var
i : integer;
begin
lnr := Succ(lnr);
for i := linecount downto lnr do
lines[i+1] := lines[i];
linecount := Succ(linecount);
New(lines[lnr]);
lines[lnr]^ := value;
end;
procedure BreakLn(lnr, index : integer);
var
len : integer;
begin
len := Length(lines[lnr]^) - index + 1;
InsertLine(y, Copy(lines[lnr]^, index, len));
Delete(lines[y]^, index, len);
end;
procedure ConcatLn(lnr : integer);
begin
if lnr < linecount then
begin
Insert(lines[Succ(lnr)]^, lines[lnr]^, Length(lines[lnr]^) + 1);
DeleteLn(Succ(lnr));
end;
end;
procedure CropLn(lnr, index : integer);
begin
lines[y]^[0] := Chr(Pred(index));
end;
procedure DeleteChar(lnr, index: integer);
begin
if Length(lines[lnr]^) <> 0 then
Delete(lines[lnr]^, index, 1);
end;
procedure InsertChr(lnr, index : integer; ch : char);
begin
Insert(ch, lines[lnr]^, index);
end;
{
Start of program
}
procedure JumpToNewLn(value : linestr);
begin
InsertLine(y, value);
x := 1;
GoDown;
RenderDown;
end;
procedure ReadInsert;
var
ch : char;
begin
PrintStatus('-- INSERT --');
repeat
ch := ReadKey;
case ch of
#8 : begin { Backspace }
if x > 0 then begin
x := Pred(x);
DeleteChar(y, x);
RenderCurLn;
GotoXY(x, y - offset);
end;
end;
#13 : begin { Line feed }
if EndOfLine then
begin
JumpToNewLn('');
end
else
begin
BreakLn(y, x);
x := 1;
RenderDown;
GoDown;
end;
end;
#27 : begin end;
else begin { Character }
InsertChr(y, x, ch);
RenderCurLn;
x := Succ(x);
GotoXY(x, y - offset);
end;
end;
until ch = #27;
if x > 1 then x := Pred(x);
PrintStatus('');
end;
procedure NewDoc;
begin
New(lines[1]);
lines[1]^ := 'New file. Thank you for using this editor.';
linecount := 1;
end;
function FileExists(name : filename) : boolean;
var
f : file;
exists : boolean;
begin
Assign(f, name);
{$I-}
Reset(f);
{$I+}
exists := IOResult = 0;
if exists then Close(f);
FileExists := exists;
end;
procedure LoadFile(name : filename);
var
f : text;
i : integer;
countstr : string [4];
begin
Assign(f, name);
if not FileExists(name) then
begin
PrintStatus('Editing new file');
NewDoc;
Exit;
end;
Reset(f);
i := 1;
while not Eof(f) and (i < MAX_LINES) do
begin
New(lines[i]);
Readln(f, lines[i]^);
i := Succ(i);
end;
Close(f);
linecount := i - 1;
if linecount = 0 then NewDoc;
Str(linecount, countstr);
PrintStatus(countstr + ' lines read from ''' + name + '''');
end;
procedure SaveFile(name : filename);
var
f : text;
i : integer;
countstr : string [4];
begin
Assign(f, name);
Rewrite(f);
for i := 1 to linecount do Writeln(f, lines[i]^);
Close(f);
Str(linecount, countstr);
PrintStatus(countstr + ' lines saved to ''' + name + '''');
end;
procedure ReadCommand;
var
ch : char;
begin
cmd := ':';
status := '';
RenderStatus;
GotoXY(2, termHeight);
repeat
ch := ReadKey;
if (ch <> #13) and (ch <> #27) then
Insert(ch, cmd, Length(cmd) + 1);
RenderStatus;
until (ch = #27) or (ch = #13);
if (ch = #27) or (cmd = ':') then
begin
cmd := '';
RenderStatus;
Exit;
end;
{ Quit }
if cmd = ':q' then
begin
Halt;
end
{ Save }
else if cmd = ':w' then
begin
cmd := '';
SaveFile(ParamStr(1));
end
{ Save and quit }
else if cmd = ':wq' then
begin
SaveFile(ParamStr(1));
Halt;
end
else
begin
cmd := '';
PrintStatus('Unknown command');
end;
end;
procedure ShowHelp(prgname : filename);
begin
Writeln('Usage: ', prgname, ' filename');
end;
procedure StartEditor;
var
ch : char;
begin
repeat
ch := ReadKey;
case ch of
#104 : GoLeft; { h }
#108 : GoRight; { l }
#106 : GoDown; { j }
#107 : GoUp; { k }
#111 : begin { o }
JumpToNewLn('');
ReadInsert;
ch := #0;
end;
#120 : begin { x }
AdjustEol;
DeleteChar(y, x);
RenderCurLn;
AdjustEol;
RenderCursor;
end;
#68 : begin { D }
AdjustEol;
if Length(lines[y]^) > 1 then
begin
CropLn(y, x);
RenderCurLn;
RenderCursor;
end;
end;
#105 : begin { i }
AdjustEol;
ReadInsert;
ch := #0;
end;
#73 : begin { I }
GoFarLeft;
ReadInsert;
ch := #0;
end;
#97 : begin { a }
AdjustEol;
if Length(lines[y]^) <> 0 then x := Succ(x);
ReadInsert;
ch := #0;
end;
#65 : begin { A }
GoFarRight;
if Length(lines[y]^) <> 0 then x := Succ(x);
ReadInsert;
ch := #0;
end;
#74 : begin { J }
ConcatLn(y);
RenderDown;
end;
#71 : begin { G }
GoToBottom;
end;
#0 : begin { NULL }
ch := ReadKey;
case ch of
#75 : GoLeft;
#77 : GoRight;
end;
end;
#58 : ReadCommand;
end;
until ch = #127;
end;
{ Program start }
begin
if (ParamCount <> 1) then
begin
ShowHelp(ParamStr(0));
Halt;
end;
x := 1;
y := 1;
offset := 0;
cmd := '';
GetScreenSize;
ClrScr;
LoadFile(ParamStr(1));
Render;
StartEditor;
end.
|
{*******************************************************}
{ }
{ Delphi Visual Component Library }
{ }
{ Copyright(c) 1995-2011 Embarcadero Technologies, Inc. }
{ }
{*******************************************************}
unit Vcl.RibbonGalleryBar;
interface
uses
Vcl.ActnPopup, Vcl.ActnMan, Vcl.ActnMenus, Vcl.ActnCtrls, Winapi.Windows, System.Types, Vcl.Graphics,
Vcl.Controls, System.Classes, Vcl.ActnList, Vcl.Menus, Winapi.Messages, Vcl.XPActnCtrls, Vcl.RibbonActnMenus;
type
TCustomRibbonGalleryPopupBar = class(TRibbonActionPopupMenu)
private
FItemsPerRow: Integer;
FRowWidth: Integer;
procedure AlignGalleryControls;
protected
procedure SetColorMap(const Value: TCustomActionBarColorMap); override;
protected
procedure AlignControls(AControl: TControl; var Rect: TRect); override;
function DoGetControlClass(AnItem: TActionClientItem): TCustomActionControlClass; override;
procedure CreateControls; override;
end;
TRibbonGalleryPopupBar = class(TCustomRibbonGalleryPopupBar)
end;
TCustomRibbonGalleryBar = class(TActionToolBar)
private
FShowItemCaptions: Boolean;
FItemsPerRow: Integer;
procedure SetItemsPerRow(const Value: Integer);
procedure SetShowItemCaptions(const Value: Boolean);
protected
procedure AlignControls(AControl: TControl; var Rect: TRect); override;
public
constructor Create(AOwner: TComponent); override;
function CreateControl(AnItem: TActionClientItem): TCustomActionControl; override;
procedure DoDropCategory(Source: TCategoryDragObject; const X: Integer; const Y: Integer); override;
property ShowItemCaptions: Boolean read FShowItemCaptions write SetShowItemCaptions default False;
property ItemsPerRow: Integer read FItemsPerRow write SetItemsPerRow default 3;
published
property Align default alNone;
end;
TRibbonGalleryBar = class(TCustomRibbonGalleryBar)
published
property Items;
property ShowItemCaptions;
property ItemsPerRow;
end;
TRibbonPopupGalleryBar = class(TRibbonGalleryBar)
protected
procedure CreateParams(var Params: TCreateParams); override;
public
procedure Assign(Source: TPersistent); override;
procedure DisplayGallery(AX, AY: Integer);
end;
implementation
uses
System.Math, Vcl.Forms, Vcl.RibbonActnCtrls;
type
TCategoryItem = class
private
FItems: TList;
public
CategoryName: string;
Control: TControl;
procedure AddItems(AControl: TControl);
constructor Create;
destructor Destroy; override;
end;
{ TCustomRibbonGalleryBar }
procedure TCustomRibbonGalleryBar.AlignControls(AControl: TControl; var Rect: TRect);
var
I, J: Integer;
LY: Integer;
LX: Integer;
LRowCnt: Integer;
LCategoryList: TStringList;
LItem: TCategoryItem;
LCategory: string;
LIdx: Integer;
LControl: TCustomActionControl;
LPrevHeight: Integer;
LCtrlWidth: Integer;
begin
LY := 0;
LX := 0;
LRowCnt := 1;
LPrevHeight := 44;
LCategoryList := TStringList.Create;
try
for I := 0 to ControlCount - 1 do
begin
if Controls[I].Action <> nil then
LCategory := StripHotKey(TCustomAction(Controls[I].Action).Category)
else
LCategory := StripHotKey(TCustomActionControl(Controls[I]).Caption);
LIdx := LCategoryList.IndexOf(LCategory);
if LIdx = -1 then
begin
LItem := TCategoryItem.Create;
LItem.CategoryName := LCategory;
LCategoryList.AddObject(LCategory, LItem);
end
else
LItem := TCategoryItem(LCategoryList.Objects[LIdx]);
if TCustomActionControl(Controls[I]).Action = nil then
LItem.Control := TCustomActionControl(Controls[I])
else
LItem.AddItems(Controls[I]);
end;
for I := 0 to LCategoryList.Count - 1 do
begin
LItem := TCategoryItem(LCategoryList.Objects[I]);
if LRowCnt <> 1 then
begin
Inc(LY, LPrevHeight);
LX := 0;
end;
if LItem.Control <> nil then
begin
LItem.Control.Top := LY;
LItem.Control.Left := LX;
LItem.Control.Width := Width;
Inc(LY, LItem.Control.Height + 2);
LRowCnt := 1;
for J := 0 to LItem.FItems.Count - 1 do
begin
LControl := TCustomActionControl(LItem.FItems[J]);
begin
if LRowCnt = FItemsPerRow + 1 then
begin
LRowCnt := 1;
Inc(LY, LControl.Height);
LX := 0;
end;
begin
Inc(LRowCnt);
LControl.CalcBounds;
LControl.Top := LY;
LControl.Width := LControl.Width;
LControl.Left := LX;
LPrevHeight := LControl.Height;
Inc(LX, LControl.Width);
end;
end;
end;
end;
end;
if LCategoryList.Count > 0 then
begin
if TCategoryItem(LCategoryList.Objects[0]).FItems.Count > 0 then
begin
LCtrlWidth := TControl(TCategoryItem(LCategoryList.Objects[0]).FItems[0]).Width;
Width := Max(Width, FItemsPerRow * LCtrlWidth);
end;
end;
finally
LCategoryList.Free;
end;
end;
constructor TCustomRibbonGalleryBar.Create(AOwner: TComponent);
begin
inherited;
FShowItemCaptions := False;
FItemsPerRow := 3;
Align := alNone;
end;
function TCustomRibbonGalleryBar.CreateControl(
AnItem: TActionClientItem): TCustomActionControl;
begin
Result := inherited CreateControl(AnItem);
AnItem.ShowCaption := FShowItemCaptions;
end;
procedure TCustomRibbonGalleryBar.DoDropCategory(Source: TCategoryDragObject; const X,
Y: Integer);
var
I: Integer;
Idx: Integer;
Ctrl: TCustomActionControl;
lItem: TActionClientItem;
begin
Idx := 0;
Ctrl := FindNearestControl(Point(X, Y));
if Assigned(Ctrl) then
Idx := Ctrl.ActionClient.Index;
for i := Source.ActionCount - 1 downto 0 do
TActionClientItem(ActionClient.Items.Insert(Idx)).Action := Source.Actions[I];
lItem := ActionClient.Items.Insert(0) as TActionClientItem;
lItem.Action := nil;
lItem.Caption := Source.Category;
lItem.Tag := -1;
end;
procedure TCustomRibbonGalleryBar.SetItemsPerRow(const Value: Integer);
begin
if FItemsPerRow <> Value then
begin
FItemsPerRow := Value;
Realign;
end;
end;
procedure TCustomRibbonGalleryBar.SetShowItemCaptions(const Value: Boolean);
begin
if FShowItemCaptions <> Value then
begin
FShowItemCaptions := Value;
RecreateControls;
end;
end;
{ TCategoryItem }
procedure TCategoryItem.AddItems(AControl: TControl);
begin
FItems.Add(AControl);
end;
constructor TCategoryItem.Create;
begin
inherited;
FItems := TList.Create;
end;
destructor TCategoryItem.Destroy;
begin
FItems.Free;
inherited;
end;
{ TRibbonPopupGalleryBar }
procedure TRibbonPopupGalleryBar.Assign(Source: TPersistent);
begin
Items.Assign((Source as TRibbonGalleryBar).Items);
end;
procedure TRibbonPopupGalleryBar.CreateParams(var Params: TCreateParams);
begin
inherited CreateParams(Params);
with Params do
begin
if not (Parent is TCustomForm) then
Style := Style and not WS_CHILD or WS_POPUP or WS_CLIPSIBLINGS or
WS_CLIPCHILDREN or WS_OVERLAPPED;
WindowClass.Style := CS_SAVEBITS or CS_DBLCLKS or not (CS_HREDRAW or not CS_VREDRAW);
// CS_DROPSHADOW requires Windows XP or above
// if CheckWin32Version(5, 1) and Shadow then
// WindowClass.Style := WindowClass.style or CS_DROPSHADOW;
if not DesignMode then
ExStyle := ExStyle or WS_EX_TOPMOST;
end;
end;
procedure TRibbonPopupGalleryBar.DisplayGallery(AX, AY: Integer);
begin
if not HasItems then
Exit;
ParentWindow := Application.Handle;
SetBounds(AX, AY, Width, Height);
PersistentHotKeys := True;
ColorMap := Self.ColorMap;
Visible := True;
end;
{ TCustomRibbonGalleryPopupBar }
procedure TCustomRibbonGalleryPopupBar.AlignControls(AControl: TControl; var Rect: TRect);
var
LProps: TGalleryProperties;
begin
LProps := TGalleryProperties(ParentControl.ActionClient.CommandProperties);
if LProps.GalleryType = gtDropDown then
begin
inherited;
Exit;
end;
FItemsPerRow := LProps.ItemsPerRow;
if AControl = nil then
AlignGalleryControls;
if AControl is TRibbonSeparator then
AControl.Width := Width;
end;
procedure TCustomRibbonGalleryPopupBar.AlignGalleryControls;
var
I, J: Integer;
LY: Integer;
LX: Integer;
LRowCnt: Integer;
LCategoryList: TStringList;
LItem: TCategoryItem;
LCategory: string;
LIdx: Integer;
LControl: TCustomActionControl;
LPrevHeight: Integer;
LCtrlWidth: Integer;
begin
if FItemsPerRow <= 0 then
FItemsPerRow := 4; // default value
LY := 0;
LX := 0;
LRowCnt := 1;
LPrevHeight := 44;
LCategoryList := TStringList.Create;
try
for I := 0 to ControlCount - 1 do
begin
if Controls[I].Action <> nil then
LCategory := StripHotKey(TCustomAction(Controls[I].Action).Category)
else
LCategory := StripHotKey(TCustomActionControl(Controls[I]).Caption);
LIdx := LCategoryList.IndexOf(LCategory);
if LIdx = -1 then
begin
LItem := TCategoryItem.Create;
LItem.CategoryName := LCategory;
LCategoryList.AddObject(LCategory, LItem);
end
else
LItem := TCategoryItem(LCategoryList.Objects[LIdx]);
if TCustomActionControl(Controls[I]).Action = nil then
LItem.Control := TCustomActionControl(Controls[I])
else
LItem.AddItems(Controls[I]);
end;
for I := 0 to LCategoryList.Count - 1 do
begin
LItem := TCategoryItem(LCategoryList.Objects[I]);
if LRowCnt <> 1 then
begin
Inc(LY, LPrevHeight);
LX := 0;
end;
if LItem.Control <> nil then
begin
LItem.Control.Top := LY;
LItem.Control.Left := LX;
LItem.Control.Width := Width;
Inc(LY, LItem.Control.Height + 2);
LRowCnt := 1;
for J := 0 to LItem.FItems.Count - 1 do
begin
lControl := TCustomActionControl(LItem.FItems[J]);
begin
if LRowCnt = FItemsPerRow + 1 then
begin
LRowCnt := 1;
Inc(LY, lControl.Height);
LX := 0;
end;
begin
Inc(LRowCnt);
lControl.CalcBounds;
LControl.SetBounds(LX, LY, LControl.Width, LControl.Height);
LPrevHeight := LControl.Height;
Inc(LX, lControl.Width);
if FRowWidth = 0 then
FRowWidth := (FItemsPerRow * lControl.Width);
end;
end;
end;
end;
end;
if LCategoryList.Count > 0 then
begin
for I := 0 to LCategoryList.Count - 1 do
begin
if TCategoryItem(LCategoryList.Objects[I]).FItems.Count > 0 then
begin
LCtrlWidth := TControl(TCategoryItem(LCategoryList.Objects[I]).FItems[0]).Width;
Width := Max(Width, FItemsPerRow * LCtrlWidth);
Break;
end;
end;
end;
for I := 0 to LCategoryList.Count - 1 do
TCategoryItem(LCategoryList.Objects[I]).Free;
finally
LCategoryList.Free;
end;
end;
procedure TCustomRibbonGalleryPopupBar.CreateControls;
var
LProps: TGalleryProperties;
begin
inherited;
LProps := TGalleryProperties(ParentControl.ActionClient.CommandProperties);
if LProps.GalleryType = gtDropDown then
Exit;
AlignGalleryControls;
end;
function TCustomRibbonGalleryPopupBar.DoGetControlClass(AnItem: TActionClientItem): TCustomActionControlClass;
var
LProps: TGalleryProperties;
begin
LProps := TGalleryProperties(ParentControl.ActionClient.CommandProperties);
if AnItem.CommandStyle = csSeparator then
Result := TRibbonSeparator
else if (AnItem.CommandStyle = csMenu) and
(TMenuProperties(AnItem.CommandProperties).ShowRichContent) then
Result := TRibbonRichContentItem
else if not AnItem.ShowCaption then
Result := TRibbonGalleryMenuItem
else if LProps.GalleryType = gtGrid then
Result := TRibbonGalleryMenuItem
else
Result := TRibbonMenuItem;
end;
procedure TCustomRibbonGalleryPopupBar.SetColorMap(const Value: TCustomActionBarColorMap);
begin
inherited;
Width := FRowWidth;
Invalidate;
if HandleAllocated then
SendMessage(Handle, WM_NCPAINT, 1, 0);
end;
end.
|
{**********************************************************************}
{* Иллюстрация к книге "OpenGL в проектах Delphi" *}
{* Краснов М.В. softgl@chat.ru *}
{**********************************************************************}
unit frmMain;
interface
uses
Windows, Messages, Classes, Graphics, Forms, ExtCtrls, Menus,
Controls, Dialogs, SysUtils, StdCtrls,
OpenGL;
type
TfrmGL = class(TForm)
Memo1: TMemo;
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure FormMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
private
DC: HDC;
hrc: HGLRC;
Angle: GLfloat;
uTimerId : uint; // идентификатор таймера - необходимо запомнить
procedure SetDCPixelFormat;
procedure Print;
protected
procedure WMPaint(var Msg: TWMPaint); message WM_PAINT;
end;
var
frmGL: TfrmGL;
implementation
uses mmSystem;
{$R *.DFM}
{=======================================================================
Обработка таймера}
procedure FNTimeCallBack(uTimerID, uMessage: UINT;dwUser, dw1, dw2: DWORD) stdcall;
begin
// Каждый "тик" изменяется значение угла
With frmGL do begin
Angle := Angle + 0.1;
If Angle >= 360.0 then Angle := 0.0;
InvalidateRect(Handle, nil, False);
end;
end;
procedure TfrmGL.Print;
var
Viewport : Array [0..3] of GLInt;
mvMatrix, ProjMatrix : Array [0..15] of GLDouble;
wx, wy, wz : GLdouble;
begin
glGetIntegerv (GL_VIEWPORT, @Viewport);
glGetDoublev (GL_MODELVIEW_MATRIX, @mvMatrix);
glGetDoublev (GL_PROJECTION_MATRIX, @ProjMatrix);
gluProject (0, 0, -0.5, @mvMatrix, @ProjMatrix, @Viewport, wx, wy, wz);
Memo1.Clear;
Memo1.Lines.Add('');
Memo1.Lines.Add('Оконные координаты:');
Memo1.Lines.Add(' x = ' + FloatToStr (wx));
Memo1.Lines.Add(' y = ' + FloatToStr (ClientHeight - wy));
Memo1.Lines.Add(' z = ' + FloatToStr (wz));
end;
{=======================================================================
Перерисовка окна}
procedure TfrmGL.WMPaint(var Msg: TWMPaint);
var
ps : TPaintStruct;
begin
BeginPaint(Handle, ps);
glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT);
glLoadIdentity;
glRotatef(Angle, 1, 0, 0.1);
glColor3f(1, 1, 0);
glBegin(GL_POINTS);
glNormal3f(0, 0, -1);
glVertex3f(0, 0, -0.5);
glEnd;
Print;
SwapBuffers(DC); // конец работы
EndPaint(Handle, ps);
end;
{=======================================================================
Создание окна}
procedure TfrmGL.FormCreate(Sender: TObject);
const
position : Array [0..2] of GLFloat = (0, 0, -1);
diffuse : Array [0..3] of GLFloat = (1, 1, 1, 1);
ambient : Array [0..3] of GLFloat = (0.4, 0.4, 0.8, 1);
begin
Angle := 0;
DC := GetDC(Handle);
SetDCPixelFormat;
hrc := wglCreateContext(DC);
wglMakeCurrent(DC, hrc);
glViewport(0, 0, (ClientWidth - Memo1.Width), ClientHeight);
glEnable(GL_DEPTH_TEST);
glEnable(GL_COLOR_MATERIAL);
glPointSize(20);
glEnable(GL_POINT_SMOOTH);
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);
glLightfv(GL_LIGHT0, GL_POSITION, @position);
glLightfv(GL_LIGHT0, GL_DIFFUSE, @diffuse);
glLightfv(GL_LIGHT0, GL_AMBIENT, @ambient);
glClearColor (0.25, 0.75, 0.25, 0.0);
uTimerID := timeSetEvent (2, 0, @FNTimeCallBack, 0, TIME_PERIODIC);
end;
{=======================================================================
Устанавливаем формат пикселей}
procedure TfrmGL.SetDCPixelFormat;
var
nPixelFormat: Integer;
pfd: TPixelFormatDescriptor;
begin
FillChar(pfd, SizeOf(pfd), 0);
pfd.dwFlags := PFD_DRAW_TO_WINDOW or
PFD_SUPPORT_OPENGL or
PFD_DOUBLEBUFFER;
nPixelFormat := ChoosePixelFormat(DC, @pfd);
SetPixelFormat(DC, nPixelFormat, @pfd);
end;
{=======================================================================
Конец работы программы}
procedure TfrmGL.FormDestroy(Sender: TObject);
begin
timeKillEvent(uTimerID);
wglMakeCurrent(0, 0);
wglDeleteContext(hrc);
ReleaseDC(Handle, DC);
end;
procedure TfrmGL.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
If Key = VK_ESCAPE then Close;
end;
procedure TfrmGL.FormMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
Caption := IntToStr (X) + ' ' + IntToStr (Y)
end;
end.
|
unit Squall;
interface
uses windows;
const
// список ошибок
SQUALL_ERROR_NO_SOUND: Integer = -1; // в системе нет звукового устройства
SQUALL_ERROR_MEMORY: Integer = -2; // ошибка выделения памяти
SQUALL_ERROR_UNINITIALIZED: Integer = -3; // класс не инициализирован
SQUALL_ERROR_INVALID_PARAM: Integer = -4; // ошибка параметры не годяться
SQUALL_ERROR_CREATE_WINDOW: Integer = -5; // невозможно создать скрытое окно
SQUALL_ERROR_CREATE_DIRECT_SOUND: Integer = -6; // ошибка при создании DirectSound объекта
SQUALL_ERROR_CREATE_THREAD: Integer = -7; // ошибка создания потока
SQUALL_ERROR_SET_LISTENER_PARAM: Integer = -8; // ошибка установки параметром слушателя
SQUALL_ERROR_GET_LISTENER_PARAM: Integer = -9; // ошибка получения параметров слушателя
SQUALL_ERROR_NO_FREE_CHANNEL: Integer = -10; // ошибка нет свободного канала для воспроизведения
SQUALL_ERROR_CREATE_CHANNEL: Integer = -11; // ошибка создания 3х мерного звукового буфера
SQUALL_ERROR_CHANNEL_NOT_FOUND: Integer = -12; // ошибка создания 3х мерного звукового буфера
SQUALL_ERROR_SET_CHANNEL_PARAM: Integer = -13; // ошибка заполнения звукового буфера
SQUALL_ERROR_GET_CHANNEL_PARAM: Integer = -14; // ошибка установки уровня громкости канала
SQUALL_ERROR_METHOD: Integer = -15; // ошибка вызываетый метод не поддерживается
SQUALL_ERROR_ALGORITHM: Integer = -16; // ошибка 3D алгоритм не поддерживаеться
SQUALL_ERROR_NO_EAX: Integer = -17; // ошибка EAX не поддерживаеться
SQUALL_ERROR_EAX_VERSION: Integer = -18; // ошибка версия EAX не поддерживаеться
SQUALL_ERROR_SET_EAX_PARAM: Integer = -19; // ошибка установки EAX параметров слушателя
SQUALL_ERROR_GET_EAX_PARAM: Integer = -20; // ошибка получения EAX параметров слушателя
SQUALL_ERROR_NO_ZOOMFX: Integer = -21; // ошибка ZOOMFX не поддерживается
SQUALL_ERROR_SET_ZOOMFX_PARAM: Integer = -22; // ошибка установки ZOOMFX параметров буфера
SQUALL_ERROR_GET_ZOOMFX_PARAM: Integer = -23; // ошибка получения ZOOMFX параметров буфера
SQUALL_ERROR_UNKNOWN: Integer = -24; // неизвестная ошибка
SQUALL_ERROR_SAMPLE_INIT: Integer = -25; // ошибка инициализации звуковых данных
SQUALL_ERROR_SAMPLE_BAD: Integer = -26; // плохой семпл
SQUALL_ERROR_SET_MIXER_PARAM: Integer = -27; // ошибка установки параметров микшера
SQUALL_ERROR_GET_MIXER_PARAM: Integer = -28; // ошибка получения параметров микшера
// настройки слушателя
SQUALL_LISTENER_MODE_IMMEDIATE: Integer = 0; // настройки пересчитываются немедленно
SQUALL_LISTENER_MODE_DEFERRED: Integer = 1; // настройки пересчитываются только после вызова метода Listener_Update
// Способы обработки трехмерного звука
SQUALL_ALG_3D_DEFAULT: Integer = 0; // алгоритм по умолчанию
SQUALL_ALG_3D_OFF: Integer = 1; // 2D алгоритм
SQUALL_ALG_3D_FULL: Integer = 2; // полноценный 3D алгоритм
SQUALL_ALG_3D_LIGTH: Integer = 3; // облегченный 3D алгоритм
// флаги описывающие возможности устройства воспроизведения
SQUALL_DEVICE_CAPS_HARDWARE: Integer = $00000001; // устройство поддерживает аппаратное смешивание каналов
SQUALL_DEVICE_CAPS_HARDWARE_3D: Integer = $00000002; // устройство поддерживает аппаратное смешивание 3D каналов
SQUALL_DEVICE_CAPS_EAX10: Integer = $00000004; // устройство поддреживает EAX 1.0
SQUALL_DEVICE_CAPS_EAX20: Integer = $00000008; // устройство поддерживает EAX 2.0
SQUALL_DEVICE_CAPS_EAX30: Integer = $00000010; // устройство поддерживает EAX 3.0
SQUALL_DEVICE_CAPS_ZOOMFX: Integer = $00000100; // устройство поддерживает ZOOMFX
// флаги описывающие конфигурацию аккустики
SQUALL_SPEAKER_DEFAULT: Integer = $00000000; // аккустика по умолчанию
SQUALL_SPEAKER_HEADPHONE: Integer = $00000001; // наушники (головные телефоны)
SQUALL_SPEAKER_MONO: Integer = $00000002; // моно колонка (1.0)
SQUALL_SPEAKER_STEREO: Integer = $00000003; // стерео колонки (2.0)
SQUALL_SPEAKER_QUAD: Integer = $00000004; // квадро колонки (4.0)
SQUALL_SPEAKER_SURROUND: Integer = $00000005; // квадро система с буфером низких эффектов (4.1)
SQUALL_SPEAKER_5POINT1: Integer = $00000006; // пяти канальная система с буфером низких эффектов (5.1)
// статус канала
SQUALL_CHANNEL_STATUS_NONE: Integer = 0; // канала нет
SQUALL_CHANNEL_STATUS_PLAY: Integer = 1; // канал в режиме воспроизведения
SQUALL_CHANNEL_STATUS_PAUSE: Integer = 2; // канал в режиме паузы
SQUALL_CHANNEL_STATUS_PREPARED: Integer = 3; // канал в подготовленном состоянии
// значения флагов слушателя в EAX начиная с версии 2.0
SQUALL_EAX_LISTENER_FLAGS_DECAYTIMESCALE: Integer = $00000001;
SQUALL_EAX_LISTENER_FLAGS_REFLECTIONSSCALE: Integer = $00000002;
SQUALL_EAX_LISTENER_FLAGS_REFLECTIONSDELAYSCALE: Integer = $00000004;
SQUALL_EAX_LISTENER_FLAGS_REVERBSCALE: Integer = $00000008;
SQUALL_EAX_LISTENER_FLAGS_REVERBDELAYSCALE: Integer = $00000010;
SQUALL_EAX_LISTENER_FLAGS_DECAYHFLIMIT: Integer = $00000020;
// значения флагов слушателя в EAX начиная версии 3.0
SQUALL_EAX_LISTENER_FLAGS_ECHOTIMESCALE: Integer = $00000040;
SQUALL_EAX_LISTENER_FLAGS_MODULATIONTIMESCALE: Integer = $00000080;
// значение флагов слушателя в EAX начиная с версии 2.0 по умолчанию
SQUALL_EAX_LISTENER_FLAGS_DEFAULT: Integer = $0000003f;
// номера предустановленных значений EAX окружения
SQUALL_EAX_OFF: Integer = -1;
SQUALL_EAX_GENERIC: Integer = 0;
SQUALL_EAX_PADDEDCELL: Integer = 1;
SQUALL_EAX_ROOM: Integer = 2;
SQUALL_EAX_BATHROOM: Integer = 3;
SQUALL_EAX_LIVINGROOM: Integer = 4;
SQUALL_EAX_STONEROOM: Integer = 5;
SQUALL_EAX_AUDITORIUM: Integer = 6;
SQUALL_EAX_CONCERTHALL: Integer = 7;
SQUALL_EAX_CAVE: Integer = 8;
SQUALL_EAX_ARENA: Integer = 9;
SQUALL_EAX_HANGAR: Integer = 10;
SQUALL_EAX_CARPETEDHALLWAY: Integer = 11;
SQUALL_EAX_HALLWAY: Integer = 12;
SQUALL_EAX_STONECORRIDOR: Integer = 13;
SQUALL_EAX_ALLEY: Integer = 14;
SQUALL_EAX_FOREST: Integer = 15;
SQUALL_EAX_CITY: Integer = 16;
SQUALL_EAX_MOUNTAINS: Integer = 17;
SQUALL_EAX_QUARRY: Integer = 18;
SQUALL_EAX_PLAIN: Integer = 19;
SQUALL_EAX_PARKINGLOT: Integer = 20;
SQUALL_EAX_SEWERPIPE: Integer = 21;
SQUALL_EAX_UNDERWATER: Integer = 22;
SQUALL_EAX_DRUGGED: Integer = 23;
SQUALL_EAX_DIZZY: Integer = 24;
SQUALL_EAX_PSYCHOTIC: Integer = 25;
// значения флагов канала в EAX начиная с версии 2.0
SQUALL_EAX_CHANNEL_FLAGS_DIRECTHFAUTO: Integer = $00000001;
SQUALL_EAX_CHANNEL_FLAGS_ROOMAUTO: Integer = $00000002;
SQUALL_EAX_CHANNEL_FLAGS_ROOMHFAUTO: Integer = $00000004;
SQUALL_EAX_CHANNEL_FLAGS_DEFAULT: Integer = $00000007;
type
// структура для описания настроек двигателя
squall_parameters_t = record
Window: PHandle; // окно к которому нужно прикреплять двигатель
Device: Integer; // номер устройства воспроизведения
SampleRate: Integer; // частота дискретизации
BitPerSample: Integer; // количество бит на выборку
Channels: Integer; // максимальное количество каналов
UseHW2D: Integer; // использование аппаратной акселерации для рассеянных каналов
UseHW3D: Integer; // использование аппаратной акселерации для точечных каналов
UseAlg: Integer; // используемый трехмерный алгоритм
BufferSize: Integer; // размер вторичного буфера в миллисекундах
ListenerMode: Integer; // промежуток времени через который будет происходить обновление
DistanceFactor: Single; // фактор дистанции
RolloffFactor: Single; // фактор удаления
DopplerFactor: Single; // эффект Допплера
end;
// структура описывающая параметры звука по умолчанию
squall_sample_default_t = record
SampleGroupID: Integer; // принадлежность семпла к группе
Priority: Integer; // приоритет звука по умолчанию
Frequency: Integer; // частота звука по умолчанию
Volume: Integer; // громкость звука по умолчанию
Pan: Integer; // панорама звука по умолчанию
MinDist: Single; // минимальная граница слышимости по умолчанию
MaxDist: Single; // максимальная граница слышимости по умолчанию
end;
// структура описывающая текущее состояние каналов
squall_channels_t = record
Play: Integer; // количество воспроизводящихся рассеянных каналов
Pause: Integer; // количество стоящих в паузе рассеянных каналов
Prepare: Integer; // количество подготовленных рассеянных каналов
Play3D: Integer; // количество воспроизводящихся позиционных каналов
Pause3D: Integer; // количество стоящих в паузе позиционных каналов
Prepare3D: Integer; // количество подготовленных позиционных каналов
end;
// структура описывающая параметры устройства воспроизведения
squall_device_caps_t = record
Flags: Integer; // флаги определяющие свойства устройства
HardwareChannels: Integer; // количество аппаратных каналов
Hardware3DChannels: Integer; // количество аппаратных 3D каналов
end;
// структура параметров EAX слушателя
squall_eax_listener_t = record
case Integer of
0:
(// параметры EAX 1.0
eax1: record
Environment: Cardinal;
Volume: Single;
DecayTime_sec: Single;
Damping: Single;
end;
);
1:
(// параметры EAX 2.0
eax2: record
Room: Integer;
RoomHF: Integer;
RoomRolloffFactor: Single;
DecayTime: Single;
DecayHFRatio: Single;
Reflections: Integer;
ReflectionsDelay: Single;
Reverb: Integer;
ReverbDelay: Single;
Environment: Cardinal;
EnvironmentSize: Single;
EnvironmentDiffusion: Single;
AirAbsorptionHF: Single;
Flags: Cardinal;
end;
);
2:
(// параметры EAX 3.0
eax3: record
Environment: Cardinal;
EnvironmentSize: Single;
EnvironmentDiffusion: Single;
Room: Integer;
RoomHF: Integer;
RoomLF: Integer;
DecayTime: Single;
DecayHFRatio: Single;
DecayLFRatio: Single;
Reflections: Integer;
ReflectionsDelay: Single;
ReflectionsPan: array [0..2] of Single;
Reverb: Integer;
ReverbDelay: Single;
ReverbPan: array [0..2] of Single;
EchoTime: Single;
EchoDepth: Single;
ModulationTime: Single;
ModulationDepth: Single;
AirAbsorptionHF: Single;
HFReference: Single;
LFReference: Single;
RoomRolloffFactor: Single;
Flags: Cardinal;
end;
);
end;
// Cтруктура EAX параметров канала
squall_eax_channel_t = record
case Integer of
0:
(// EAX 1.0
eax1: record
Mix: Single;
end;
);
1:
(// EAX 2.0
eax2: record
Direct: Integer;
DirectHF: Integer;
Room: Integer;
RoomHF: Integer;
RoomRolloffFactor: Single;
Obstruction: Integer;
ObstructionLFRatio: Single;
Occlusion: Integer;
OcclusionLFRatio: Single;
OcclusionRoomRatio: Single;
OutsideVolumeHF: Integer;
AirAbsorptionFactor: Single;
Flags: Cardinal
end;
);
2:
(// EAX 3.0
eax3: record
Direct: Integer;
DirectHF: Integer;
Room: Integer;
RoomHF: Integer;
Obstruction: Integer;
ObstructionLFRatio: Single;
Occlusion: Integer;
OcclusionLFRatio: Single;
OcclusionRoomRatio: Single;
OcclusionDirectRatio: Single;
Exclusion: Integer;
ExclusionLFRatio: Single;
OutsideVolumeHF: Integer;
DopplerFactor: Single;
RolloffFactor: Single;
RoomRolloffFactor: Single;
AirAbsorptionFactor: Single;
Flags: Cardinal;
end;
);
end;
// структура ZOOMFX параметров источника звука
squall_zoomfx_channel_t = record
Min: array [0..2] of Single;
Max: array [0..2] of Single;
Front: array [0..2] of Single;
Top: array [0..2] of Single;
MacroFX: Integer;
end;
psquall_parameters_t = ^squall_parameters_t;
psquall_sample_default_t = ^squall_sample_default_t;
psquall_eax_listener_t = ^squall_eax_listener_t;
psquall_eax_channel_t = ^squall_eax_channel_t;
psquall_zoomfx_channel_t = ^squall_zoomfx_channel_t;
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// Методы инициализация / освобождения
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
//-----------------------------------------------------------------------------
// Инициализация звуковой системы Шквал
// на входе : SystemParam - указатель на структуру с параметрами
// звукового двигателя для инициализации.
// Если параметр будет равен 0 то звуковой
// двигатель создаст экземпляр объекта с
// следующими параметрами:
// Window = 0 (создать свое окно)
// Device = 0 (устройство по умолчанию)
// SampleRate = 44100
// BitPerSample = 16
// Channels = 16
// UseHW2D = true (использовать)
// UseHW3D = true (использовать)
// UseAlg = 0 (алгоритм по умолчанию)
// BufferSize = 200
// ListenerMode = 0 (немедленное применение)
// DistanceFactor = 1.0f
// RolloffFactor = 1.0f
// DopplerFactor = 1.0f
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
//-----------------------------------------------------------------------------
function SQUALL_Init(SystemParam: psquall_parameters_t): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Освобождение занятых звуковой системой ресурсов
// на входе : *
// на выходе : *
//-----------------------------------------------------------------------------
procedure SQUALL_Free();cdecl; external 'squall.dll';
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// Методы для управления двигателем
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
//-----------------------------------------------------------------------------
// Включение/выключение паузы всех звуковых каналов
// на входе : Pause - флаг включения/выключения паузы
// параметр может принимать слудующие значения
// true - включить паузу
// false - выключить паузу
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
//-----------------------------------------------------------------------------
function SQUALL_Pause(Pause: Integer): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Остановка всех звуковых каналов
// на входе : *
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
//-----------------------------------------------------------------------------
function SQUALL_Stop(): Integer; cdecl; external 'squall.dll';
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// Методы для настройки двигателя
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
//-----------------------------------------------------------------------------
// Установка нового устройства воспроизведения
// на входе : Num - номер нового устройства воспроизведения, значение
// параметра должно быть в пределах от 0 до значения
// полученного с помощью метода SQUALL_GetNumDevice.
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
//-----------------------------------------------------------------------------
function SQUALL_SetDevice(Num: Integer): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Получение номера текущего устройства воспроизведения
// на входе : *
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
// в случае успешного вызова результат содержит номер текущего
// устройства воспроизведения
//-----------------------------------------------------------------------------
function SQUALL_GetDevice(): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Включение/выключение использования аппаратной акселерации звука
// на входе : UseHW2D - флаг определяющий использование аппаратной
// акселерации рассеянных звуковых каналов,
// параметр может принимать следующие значения:
// true - использовать аппаратную акселерацию
// false - не использовать аппаратную акселерацию
// UseHW3D - флаг определяющий использование аппаратной
// акселерации позиционных звуковых каналов
// параметр может принимать следующие значения:
// true - использовать аппаратную акселерацию
// false - не использовать аппаратную акселерацию
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
//-----------------------------------------------------------------------------
function SQUALL_SetHardwareAcceleration(UseHW2D,UseHW3D: Integer): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Получение текущих настроек использования аппаратной акселерации звука
// на входе : UseHW2D - указатель на переменную в которую нужно поместить
// текущее значение использования аппаратной
// акселерации для рассеянных звуковых каналов
// UseHW3D - указатель на переменную в которую нужно поместить
// текущее значение использования аппаратной
// акселерации для позиционных звуковых каналов
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
//-----------------------------------------------------------------------------
function SQUALL_GetHardwareAcceleration(var UseHW2D, UseHW3D: Integer): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Установка режима аккустики
// на входе : Mode - аккустическая модель, параметр может принимать
// следуюшие значения:
// SQUALL_SPEAKER_DEFAULT - аккустика по умолчанию
// SQUALL_SPEAKER_HEADPHONE - наушники (головные телефоны)
// SQUALL_SPEAKER_MONO - моно колонка (1.0)
// SQUALL_SPEAKER_STEREO - стерео колонки (2.0)
// SQUALL_SPEAKER_QUAD - квадро колонки (4.0)
// SQUALL_SPEAKER_SURROUND - квадро система с буфером
// низких эффектов (4.1)
// SQUALL_SPEAKER_5POINT1 - пяти канальная система с
// буфером низких эффектов (5.1)
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
//-----------------------------------------------------------------------------
function SQUALL_SetSpeakerMode(Mode: Integer): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Получение текущего режима аккустики
// на входе : *
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
// в случае успешного вызова результат содержит номер текущего
// режима аккустики
//-----------------------------------------------------------------------------
function SQUALL_GetSpeakerMode(): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Установка алгоритма расчета трехмерного звука
// на входе : Algoritm - код применяемого алгоритма расчета звука
// параметр может принимать следуюшие значения:
// SQUALL_ALG_3D_DEFAULT - алгоритм по умолчанию
// SQUALL_ALG_3D_OFF - 2D алгоритм
// SQUALL_ALG_3D_FULL - полноценный 3D алгоритм
// SQUALL_ALG_3D_LIGTH - облегченный 3D алгоритм
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
//-----------------------------------------------------------------------------
function SQUALL_Set3DAlgorithm(Algorithm: Integer): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Получения текущего алгоритма расчета трехмерного звука
// на входе : *
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
// в случае успешного вызова результат содержит номер текущего
// алгоритма расчета трехмерного звука, результат может
// принимать слудующие значения:
// SQUALL_ALG_3D_DEFAULT - алгоритм по умолчанию
// SQUALL_ALG_3D_OFF - 2D алгоритм
// SQUALL_ALG_3D_FULL - полноценный 3D алгоритм
// SQUALL_ALG_3D_LIGTH - облегченный 3D алгоритм
//-----------------------------------------------------------------------------
function SQUALL_Get3DAlgorithm(): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Установка нового размера звукового буфера в милисекундах
// на входе : BufferSize - новый размер звукового буфера, в милисекундах
// параметр должен лежать в пределах от 200
// до 5000
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
//-----------------------------------------------------------------------------
function SQUALL_SetBufferSize(BufferSize: Integer): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Получение текущего размера звукового буфера в милисекундах
// на входе : *
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
// в случае успешного вызова результат содержит текущий размер
// звукового буфера в милисекундах
//-----------------------------------------------------------------------------
function SQUALL_GetBufferSize(): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Установка внешней системы работы с памятью
// на входе : UserAlloc - указатель на внешний метод выделения памяти
// UserFree - указатель на внешний метод освобождения памяти
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
//-----------------------------------------------------------------------------
function SQUALL_SetMemoryCallbacks(UserAlloc,UserFree: pointer): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Установка внешних методов для работы с файлами
// на входе : UserOpen - указатель на внешний метод открытия файлов
// UserSeek - указатель на внешний метод позиционирования
// в открытом файле
// UserRead - указатель на внешний метод чтения данных из
// открытого файла
// UserClose - указатель на внешний метод закрытия открытого
// файла
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
//-----------------------------------------------------------------------------
function SQUALL_SetFileCallbacks(UserOpen,UserSeek,UserRead,UserClose: Pointer): Integer; cdecl; external 'squall.dll';
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// Методы для получения информация о системе
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
//-----------------------------------------------------------------------------
// Получение количества устройств воспроизведения звука
// на входе : *
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки.
// в случае успешного вызова результат содержит количество
// устройств воспроизведения в системе. Если в системе нет
// устройств воспроизведения результат будет равен 0.
//-----------------------------------------------------------------------------
function SQUALL_GetNumDevice(): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Получение имени устройства по указаному номеру
// на входе : Num - номер устройства, значение параметра должно быть
// в пределах от 0 до значения полученного с помощью
// метода SQUALL_GetNumDevice.
// Buffer - указатель на буфер куда нужно поместить имя
// устройства воспроизведения
// Size - размер принимающего буфера в байтах
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
//-----------------------------------------------------------------------------
function SQUALL_GetDeviceName(Num: Integer; Buffer: PChar; Size: Integer): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Получение свойств устройства воспроизведения по указаному номеру
// на входе : Num - номер устройства, значение параметра должно быть в
// пределах от 0 до значения полученного с помощью
// метода SQUALL_GetNumDevice.
// Caps - указатель на структуру в которую нужно поместить
// свойства устройства воспроизведения
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
//-----------------------------------------------------------------------------
function SQUALL_GetDeviceCaps(Num: Integer; var Caps:squall_device_caps_t): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Получение используемой версии EAX интерфейса
// на входе : *
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
// в случае успешного вызова результат содержит максимально
// доступную версию EAX
//-----------------------------------------------------------------------------
function SQUALL_GetEAXVersion(): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Получение информации о каналах
// на входе : Info - указатель на структуру в которую нужно поместить
// информацию о состоянии каналов
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
//-----------------------------------------------------------------------------
function SQUALL_GetChannelsInfo(var info: squall_channels_t): Integer; cdecl; external 'squall.dll';
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// Методы для работы со слушателем
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
//-----------------------------------------------------------------------------
// Установка новых параметров слушателя
// на входе : Position - указатель на структуру с новыми координатами
// позиции слушателя. В случае если позицию слушателя
// изменять не нужно, то данный параметр должен
// содержать 0
// Front - указатель на структуру с новым вектором
// фронтального направления слушателя. В случае еслт
// вектор фронтального направления слушателя изменять
// не нужно, то данный парамерт должен содержать 0
// Top - указатель на структуру с новым вектором
// вертикального направления слушателя. В случае если
// вектор вертикального направления изменять не нужно,
// то данный параметр должен содержать 0
// Velocity - указатель на структуру с новым вектором
// скорости перемещения слушателя. В случае если
// скорость перемещения слушателя изменять не нужно,
// то данный параметр должен содержать 0.
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
//-----------------------------------------------------------------------------
function SQUALL_Listener_SetParameters(Position,Front,Top,Velocity: PSingle): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Получение текущих параметров слушателя
// на входе : Position - указатель на структуру в которую нужно
// поместить текущие координаты слушателя. В случае
// если значение координат слушателя не требуется
// определять, то данный параметр должен содержать 0.
// Front - указатель на структуру в которую нужно
// поместить текущий вектор фронтального
// направления слушателя. В случае если вектор
// фронтального направления слушателя не требуется
// определять, то данный параметр должен содержать 0.
// Top - указатель на структуру в которую нужно
// поместить текущий вектор вертикального
// направления слушателя. В случае если вектор
// вертикального направления слушателя не требуется
// определять, то данный параметр должен содержать 0.
// Velocity - указатель на структуру в которую нужно
// поместить текущий вектор скорости перемещения
// слушателя. В случае если скорость перемещения
// слушателя не требуется определять, то данный
// параметр должен содержать 0.
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
//-----------------------------------------------------------------------------
function SQUALL_Listener_GetParameters(var Position,Front,Top,Velocity: PSingle): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Установка новой скорости перемещения слушателя
// на входе : Velocity - указатель на структуру с новым вектором
// скорости перемещения слушателя.
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
//-----------------------------------------------------------------------------
function SQUALL_Listener_SetVelocity(Velocity: PSingle): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Получение текущей скорости перемещения слушателя
// на входе : Velocity - указатель на структуру в которую нужно
// поместить текущий вектор скорости перемещения
// слушателя.
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
//-----------------------------------------------------------------------------
function SQUALL_Listener_GetVelocity(var Velocity: PSingle): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Установка новой позиции слушателя в пространстве
// на входе : Position - указатель на структуру с новым вектором
// скорости перемещения слушателя.
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
//-----------------------------------------------------------------------------
function SQUALL_Listener_SetPosition(Position: PSingle): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Получение текущей позиции слушателя в пространстве
// на входе : Position - указатель на структуру в которую нужно
// поместить текущий вектор скорости перемещения
// слушателя.
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
//-----------------------------------------------------------------------------
function SQUALL_Listener_GetPosition(var Position: PSingle): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Установка нового коэффициента преобразования дистанции
// на входе : DistanceFactor - новый коэффициент преобразования дистанции
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
//-----------------------------------------------------------------------------
function SQUALL_Listener_SetDistanceFactor(DistanceFactor: Single): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Получение текущего коэффициента преобразования дистанции
// на входе : DistanceFactor - указатель на переменную в которую нужно
// поместить текущий коэффициент
// преобразования дистанции
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
//-----------------------------------------------------------------------------
function SQUALL_Listener_GetDistanceFactor(var DistanceFactor: Single): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Установка нового коэффициента затухания звука в зависимости от растояния
// на входе : RolloffFactor - новый коэффициент преобразования затухания
// звука, значение параметра должно быть
// в пределах от 0.1f до 10.0f
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
//-----------------------------------------------------------------------------
function SQUALL_Listener_SetRolloffFactor(RolloffFactor: Single): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Получение текущего коэффициента затухания звука в зависимости от растояния
// на входе : RolloffFactor - указатель на переменную в которую нужно
// поместить текущий коэффициент преобразования
// затухания звука
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
//-----------------------------------------------------------------------------
function SQUALL_Listener_GetRolloffFactor(var RolloffFactor: Single): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Установка нового коэффициента эффекта Допплера
// на входе : DopplerFactor - новый коэффициент эффекта Допплера, значение
// параметра должно быть в пределах от 0.1f
// до 10.0f
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
//-----------------------------------------------------------------------------
function SQUALL_Listener_SetDopplerFactor(DopplerFactor: Single): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Получение текущего коэффициента эффекта Допплера
// на входе : DopplerFactor - указатель на переменную в которую нужно
// поместить текущий коэффициент эффекта
// Допплера
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
//-----------------------------------------------------------------------------
function SQUALL_Listener_GetDopplerFactor(var DopplerFactor: Single): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Обновление трехмерных настроек
// на входе : *
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
// примечание : данный метод имеет смысл применять только в том случае когда
// слушатель настроен на принудительное обновление трехмерных
// настроек. По есть при инициализации двигателя слушатель
// переведен в режим SQUALL_LISTENER_MODE_DEFERRED
//-----------------------------------------------------------------------------
function SQUALL_Listener_Update(): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Установка предустановленных значения окружения
// на входе : Preset - номер предустановленного значения
// параметр может принимать следуюшие значения:
// SQUALL_EAX_OFF
// SQUALL_EAX_GENERIC
// SQUALL_EAX_PADDEDCELL
// SQUALL_EAX_ROOM
// SQUALL_EAX_BATHROOM
// SQUALL_EAX_LIVINGROOM
// SQUALL_EAX_STONEROOM
// SQUALL_EAX_AUDITORIUM
// SQUALL_EAX_CONCERTHALL
// SQUALL_EAX_CAVE
// SQUALL_EAX_ARENA
// SQUALL_EAX_HANGAR
// SQUALL_EAX_CARPETEDHALLWAY
// SQUALL_EAX_HALLWAY
// SQUALL_EAX_STONECORRIDOR
// SQUALL_EAX_ALLEY
// SQUALL_EAX_FOREST
// SQUALL_EAX_CITY
// SQUALL_EAX_MOUNTAINS
// SQUALL_EAX_QUARRY
// SQUALL_EAX_PLAIN
// SQUALL_EAX_PARKINGLOT
// SQUALL_EAX_SEWERPIPE
// SQUALL_EAX_UNDERWATER
// SQUALL_EAX_DRUGGED
// SQUALL_EAX_DIZZY
// SQUALL_EAX_PSYCHOTIC
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
//-----------------------------------------------------------------------------
function SQUALL_Listener_EAX_SetPreset(Preset: Integer): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Установка новых EAX параметров слушателя
// на входе : Version - номер версии EAX интерфейса
// Properties - указатель на структуру с новыми EAX параметрами
// слушателя
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
//-----------------------------------------------------------------------------
function SQUALL_Listener_EAX_SetProperties(Version: Integer;Properties: psquall_eax_listener_t): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Получение текущих EAX параметров слушателя
// на входе : Version - номер версии EAX интерфейса
// Properties - указатель на структуру куда надо поместить
// текущие EAX параметры слушателя
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
//-----------------------------------------------------------------------------
function SQUALL_Listener_EAX_GetProperties(Version: Integer;var Properties: squall_eax_listener_t): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Установка обработчика слушателя
// на входе : Worker - указатель на обработчик слушателя, в случае
// если параметр равен 0, предедущий обработчик
// будет удален.
// Param - указатель на данные пользователя, в случае
// данных пользователя нет, то данный параметр
// может содержать 0
// UpdateTime - промежуток времени через который нужно
// вызывать обработчик параметр должен лежать
// в пределах от 1 до 5000
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
//-----------------------------------------------------------------------------
function SQUALL_Listener_SetWorker(Worker,Param: Pointer;UpdateTime: Cardinal): Integer; cdecl; external 'squall.dll';
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// Общие методы для работы с каналами
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
//-----------------------------------------------------------------------------
// Начало воспроизведения подготовленного звукового канала
// на входе : ChannelID - идентификатор подготовленного канала
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
//-----------------------------------------------------------------------------
function SQUALL_Channel_Start(ChannelID: Integer): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Включение/выключение паузы звукового канала
// на входе : ChannelID - идентификатор звукового канала
// Pause - флаг включения/выключения паузы, параметр может
// принимать следующие значения:
// true - включить паузу
// false - выключить паузу
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
//-----------------------------------------------------------------------------
function SQUALL_Channel_Pause(ChannelID,Pause: Integer): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Остановка звукового канала по идентификатору
// на входе : ChannelID - идентификатор звукового канала
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
//-----------------------------------------------------------------------------
function SQUALL_Channel_Stop(ChannelID: Integer): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Получение статуса звукового канала
// на входе : ChannelID - идентификатор звукового канала
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
// в случае успешного вызова результат содержит статус канала,
// результат может принимать следующие значения:
// SQUALL_CHANNEL_STATUS_NONE - звукового канала с таким
// идентификатором нет
// SQUALL_CHANNEL_STATUS_PLAY - звуковой канал
// воспроизводится
// SQUALL_CHANNEL_STATUS_PAUSE - звуковой канал находится
// в режиме паузы
// SQUALL_CHANNEL_STATUS_PREPARED - звуковой канал
// подготовлен
//-----------------------------------------------------------------------------
function SQUALL_Channel_Status(ChannelID: Integer): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Установка нового уровня громкости звукового канала в процентах
// на входе : ChannelID - идентификатор звукового канала
// Volume - значение уровня громкости в провентах,
// значение ппараметра должно быть в пределах
// от 0 до 100
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
//-----------------------------------------------------------------------------
function SQUALL_Channel_SetVolume(ChannelID,Volume: Integer): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Получение текущего уровня громкости звукового канала в процентах
// на входе : ChannelID - идентификатор канала
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
// в случае успешного вызова результат содержит текущее значение
// громкости канала в процентах
//-----------------------------------------------------------------------------
function SQUALL_Channel_GetVolume(ChannelID: Integer): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Устанока новой частоты дискретизации звукового канала
// на входе : ChannelID - идентификатор звукового канала
// Frequency - новое значение частоты дискретизации, значение
// параметра должно быть в пределах от 100 Герц
// до 1000000 Герц
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
//-----------------------------------------------------------------------------
function SQUALL_Channel_SetFrequency(ChannelID,Frequency: Integer): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Получение текущей частоты дискретизации звукового канала
// на входе : ChannelID - идентификатор звукового канала
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
// в случае успешного вызова результат содержит текущее значение
// частоты дискретизации звукового канала
//-----------------------------------------------------------------------------
function SQUALL_Channel_GetFrequency(ChannelID: Integer): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Установка новой позиции воспроизведения звукового канала в семплах
// на входе : ChannelID - идентификатор звукового канала
// Position - новое значение позиции воспроизведения
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
//-----------------------------------------------------------------------------
function SQUALL_Channel_SetPlayPosition(ChannelID,Position: Integer): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Получение текущей позиции воспроизведения звукового канала в семплах
// на входе : ChannelID - идентификатор звукового канала
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
// в случае успешного вызова результат содержит текущую позицию
// воспроизведения
//-----------------------------------------------------------------------------
function SQUALL_Channel_GetPlayPosition(ChannelID: Integer): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Установка новой позиции воспроизведения звукового канала в миллисекундах
// на входе : ChannelID - идентификатор звукового канала
// Position - новое значение позиции воспроизведения,
// в миллисекундах
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
//-----------------------------------------------------------------------------
function SQUALL_Channel_SetPlayPositionMs(ChannelID,Position: Integer): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Получение текущей позиции воспроизведения звукового канала в миллисекундах
// на входе : ChannelID - идентификатор звукового канала
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
// в случае успешного вызова результат содержит текущую позицию
// воспроизведения
//-----------------------------------------------------------------------------
function SQUALL_Channel_GetPlayPositionMs(ChannelID: Integer): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Установка обработчика звукового канала
// на входе : ChannelID - идентификатор звукового канала
// Worker - указатель на обработчик звукового канала
// Param - указатель на данные пользователя, в случае
// если данных пользователя нет, параметр может
// содержать 0
// UpdateTime - промежуток времени в миллисекундах через
// который нужно вызывать обработчик, значение
// параметра должно быть в пределах от 1 до 5000
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
//-----------------------------------------------------------------------------
function SQUALL_Channel_SetWorker(ChannelID: Integer;Worker,Param: Pointer;UpdateTime: Cardinal): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Установка новых границ фрагмента звукового канала в семплах
// на входе : ChannelID - идентификатор звукового канала
// Start - начальная позиция фрагмента, в отсчетах
// End - конечная позиция фрагмента, в отсчетах
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
//-----------------------------------------------------------------------------
function SQUALL_Channel_SetFragment(ChannelID,Start,Endp: Integer): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Получение текущих границ фрагмента звукового канала в семплах
// на входе : ChannelID - идентификатор звукового канала
// Start - указатель на переменную в которую нужно
// поместить начальную позицию фрагмента в
// отсчетах
// End - указатель на переменную в которую нужно
// поместить конечную позицию фрагмента
// в отсчетах
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
//-----------------------------------------------------------------------------
function SQUALL_Channel_GetFragment(ChannelID: Integer; var Start,Endp: Integer): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Установка новых границ фрагмента звукового канала в миллисекундах
// на входе : ChannelID - идентификатор звукового канала
// Start - начальная позиция фрагмента, позиция в
// миллисекундах
// End - конечная позиция фрагмента, позиция в
// миллисекундах
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
//-----------------------------------------------------------------------------
function SQUALL_Channel_SetFragmentMs(ChannelID,Start,Endp: Integer): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Получение текущих границ фрагмента звукового канала в миллисекундах
// на входе : ChannelID - идентификатор звукового канала
// Start - указатель на переменную в которую нужно
// поместить начальную позицию фрагмента
// в миллисекундах
// End - указатель на переменную в которую нужно
// поместить конечную позицию фрагмента
// в миллисекундах
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
//-----------------------------------------------------------------------------
function SQUALL_Channel_GetFragmentMs(ChannelID: Integer; var Start,Endp: Integer): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Получение продолжительности исходных звуковых данных в семплах
// на входе : ChannelID - идентификатор звукового канала
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
// в случае успешного вызова результат содержит продолжительность
// исходных данных в семплах
//-----------------------------------------------------------------------------
function SQUALL_Channel_GetLength(ChannelID: Integer): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Получение продолжительности исходных звуковых данных в миллисекундах
// на входе : ChannelID - идентификатор звукового канала
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
// в случае успешного вызова результат содержит продолжительность
// исходных данных в милисекундах
//-----------------------------------------------------------------------------
function SQUALL_Channel_GetLengthMs(ChannelID: Integer): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Установка нового приоритета звукового канала
// на входе : ChannelID - идентификатор звукового канала
// Priority - новый приоритет канала, значение параметра
// должно быть в пределах от 0 (самый низший
// приоритет) до 65535 (самый высший приоритет)
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
//-----------------------------------------------------------------------------
function SQUALL_Channel_SetPriority(ChannelID,Priority: Integer): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Получение текущего приоритета звукового канала
// на входе : ChannelID - идентификатор звукового канала
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
// в случае успешного вызова результат содержит приоритет
// звукового канала
//-----------------------------------------------------------------------------
function SQUALL_Channel_GetPriority(ChannelID: Integer): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Получение текущего значения флага зацикленности воспроизведения звукового
// канала
// на входе : ChannelID - идентификатор звукового канала
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
// в случае успешного вызова результат содержит текущее значение
// флага зацикленности воспроизведения канала, результат может
// принимать следующие значения:
// true - звуковой канал воспроизводится бесконечно
// false - звуковой канал воспроизводится один раз
//-----------------------------------------------------------------------------
function SQUALL_Channel_GetLoop(ChannelID: Integer): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Установка нового значения флага зацикленности воспроизведения звукового
// канала
// на входе : ChannelID - идентификатор звукового канала
// Loop - флаг зацикленности канала, значение праметра
// может принимать следующие значения:
// true - бесконечное воспроизведение звукового
// канала
// false - воспроизведение звукового канала один
// раз
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
//-----------------------------------------------------------------------------
function SQUALL_Channel_SetLoop(ChannelID,Loop: Integer): Integer; cdecl; external 'squall.dll';
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// Методы для работы с рассеянными каналами
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
//-----------------------------------------------------------------------------
// Установка новой панорамы звукового канала
// на входе : ChannelID - идентификатор звукового канала
// Pan - новое значение панорамы, значение параметра
// должено быть в пределах от 0 (максимальное
// смещение стерео баланса влево) до 100
// (максимальное смещение стерео баланса вправо)
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
// примечание : данный метод не работает с позиционными каналами
//-----------------------------------------------------------------------------
function SQUALL_Channel_SetPan(ChannelID,Pan: Integer): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Получение текущей панорамы звукового канала
// на входе : ChannelID - идентификатор звукового канала
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
// в случае успешного вызова результат содержит текущее значение
// панорамы канала
// примечание : данный метод не работает с позиционными каналами
//-----------------------------------------------------------------------------
function SQUALL_Channel_GetPan(ChannelID: Integer): Integer; cdecl; external 'squall.dll';
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// Методы для работы с позиционными каналами
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
//-----------------------------------------------------------------------------
// Установка новой трехмерной позиции звукового канала в пространстве
// на входе : ChannelID - идентификатор звукового канала
// Position - указатель на структуру с новыми координатами
// канала в пространстве
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
// примечание : данный метод не работает с рассеянными каналами
//-----------------------------------------------------------------------------
function SQUALL_Channel_Set3DPosition(ChannelID: Integer;Position: PSingle): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Получение текущей трехмерной позиции звукового канала в пространстве
// на входе : ChannelID - идентификатор звукового канала
// Position - указатель на структуру в которую нужно
// поместить текущую трехмерную позицию звукового
// канала в пространстве
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
// примечание : данный метод не работает с рассеянными каналами
//-----------------------------------------------------------------------------
function SQUALL_Channel_Get3DPosition(ChannelID: Integer;Position: PSingle): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Установка новой скорости перемещения звукового канала
// на входе : ChannelID - идентификатор звукового канала
// Velocity - указатель на структуру с новым вектором
// скорости перемещения звукового канала
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
// примечание : данный метод не работает с рассеянными каналами
//-----------------------------------------------------------------------------
function SQUALL_Channel_SetVelocity(ChannelID: Integer;Velocity: PSingle): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Получение текущей скорости перемещения звукового канала
// на входе : ChannelID - идентификатор звукового канала
// Velocity - указатель на структуру в которую нужно
// поместить текущее значение вектора скорости
// звукового канала
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
// примечание : данный метод не работает с рассеянными каналами
//-----------------------------------------------------------------------------
function SQUALL_Channel_GetVelocity(ChannelID: Integer;Velocity: PSingle): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Установка нового минимального и максимального расстояния слышимости
// звукового канала
// на входе : ChannelID - идентификатор звукового канала
// MinDist - новое минимальное расстояние слышимости
// значение параметра должно быть в пределах
// от 0.01f до 1000000000.0f
// MaxDist - новое максимальное расстояние слышимости
// значение параметра должно быть в пределах
// от 0.01f до 1000000000.0f
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
// примечание : данный метод не работает с рассеянными каналами
//-----------------------------------------------------------------------------
function SQUALL_Channel_SetMinMaxDistance(ChannelID: Integer;MinDist,MaxDist: Single): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Получение текущего минимального растояния слышимости звукового канала
// на входе : ChannelID - идентификатор звукового канала
// MinDist - указатель на переменную в которую нужно
// поместить текущее минимальное растояние
// слышимости
// MinDist - указатель на переменную в которую нужно
// поместить текущее максимальное растояние
// слышимости
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
// примечание : данный метод не работает с рассеянными каналами
//-----------------------------------------------------------------------------
function SQUALL_Channel_GetMinMaxDistance(ChannelID: Integer;var MinDist,MaxDist: Single): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Установка параметров конуса распространения звукового канала
// на входе : ChannelID - идентификатор звукового канала
// Orientation - указатель на струкруру с вектором
// направления внутреннего и внешнего конуса,
// в случае если значение вектора направления
// внешнего и внутреннего конуса изменять
// не нужно, то данный параметр должен
// содержать 0
// InsideConeAngle - угол внутреннего звукового конуса, значение
// параметра должно быть в пределах от 1 до
// 360 градусов, в случае если значение
// угла внутреннего звукового конуса изненять
// не нужно, то данный параметр должен
// содержать 0
// OutsideConeAngle - угол внешнего звукового конуса, значение
// параметра должно быть в пределах от 1 до
// 360 градусов, в случае если значение
// угла внешнего звукового конуса изменять
// не нужно, то данный параметр должен
// содержать 0
// OutsideVolume - уровень громкости источника за пределами
// внешнего конуса, в процентах значение
// праметра должно быть в пределах от 0
// до 100
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
// примечание : данный метод не работает с рассеянными каналами
//-----------------------------------------------------------------------------
function SQUALL_Channel_SetConeParameters(ChannelID: Integer;Orientation: Single;InsideConeAngle, OutsideConeAngle, OutsideVolume: Integer): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Получение параметров конуса распространения звукового канала
// на входе : ChannelID - идентификатор звукового канала
// Orientation - указатель на струкруру в которую нужно
// поместить текущий вектор направления
// внешнего и внутреннего конуса, в случае
// если значение вектора внутреннего
// и внешнего конуса, получать не нужно,
// то данный параметр должен содержать 0
// InsideConeAngle - указатель на переменную в которую нужно
// поместить текущее значение угола внутреннего
// конуса в градусах, в случае если значение
// угла внутреннего конуса получать не нужно,
// то данный параметр должен содержать 0
// OutsideConeAngle - указатель на переменную в которую нужно
// поместить текущее значение угола внешнего
// конуса в градусах, в случае если значение
// угла внешнего конуса получать не нужно,
// то данный параметр должен содержать 0
// OutsideVolume - указатель на переменную в которую нужно
// поместить текущее значение уровеня громкости
// источника за пределами внешнего конуса, в
// процентах, в случае если значение уровня
// громкости за пределами внешего конуса
// получать не нужно, то данный параметр
// должен содержать 0
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
// примечание : данный метод не работает с рассеянными каналами
//-----------------------------------------------------------------------------
function SQUALL_Channel_GetConeParameters(ChannelID: Integer; var Orientation: Single; var InsideConeAngle, OutsideConeAngle, OutsideVolume: Integer): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Установка новых EAX параметров звукового канала
// на входе : ChannelID - идентификатор звукового канала
// Version - номер версии EAX, параметр определяет в каком
// формате передаются EAX параметры канала.
// Properties - указатель на структуру описывающую параметры
// EAX канала, параметры должны быть в формате
// указанном параметром Version
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
// примечание : данный метод не работает с рассеянными каналами
//-----------------------------------------------------------------------------
function SQUALL_Channel_EAX_SetProperties(ChannelID, Version: Integer; EAXProperty: psquall_eax_channel_t): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Получение текущих EAX параметров звукового канала
// на входе : ChannelID - идентификатор звукового канала
// Version - номер версии EAX, параметр определяет в каком
// формате получать EAX параметры канала.
// Properties - указатель на структуру куда нужно поместить
// текущие параметры EAX канала, структура будет
// заполнена параметрами в формате указанном
// параметром Version
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
// примечание : данный метод не работает с рассеянными каналами
//-----------------------------------------------------------------------------
function SQUALL_Channel_EAX_GetProperties(ChannelID, Version: Integer; var EAXProperty: squall_eax_channel_t): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Установка новых ZOOMFX параметров звукового канала
// на входе : ChannelID - идентификатор звукового канала
// Properties - указатель на структуру описывающую параметры
// ZOOMFX канала
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
// примечание : данный метод не работает с рассеянными каналами
//-----------------------------------------------------------------------------
function SQUALL_Channel_ZOOMFX_SetProperties(ChannelID: Integer; ZoomFXProperty: psquall_zoomfx_channel_t): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Получение текущих ZOOMFX параметров звукового канала
// на входе : ChannelID - идентификатор звукового канала
// Properties - указатель на структуру куда нужно поместить
// текущие параметры ZOOMFX канала
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
// примечание : данный метод не работает с рассеянными каналами
//-----------------------------------------------------------------------------
function SQUALL_Channel_ZOOMFX_GetProperties(ChannelID: Integer; var ZoomFXProperty: squall_zoomfx_channel_t): Integer; cdecl; external 'squall.dll';
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// Методы для работы с группами каналов
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
//-----------------------------------------------------------------------------
// Включение/выключение паузы группы каналов
// на входе : ChannelGroupID - идентификатор группы каналов
// Pause - флаг включения/выключения паузы, параметр
// может принимать слудующие значения:
// true - включить паузу
// false - выключить паузу
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
//-----------------------------------------------------------------------------
function SQUALL_ChannelGroup_Pause(ChannelGroupID, Pause: Integer): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Остановка группы каналов
// на входе : ChannelGroupID - идентификатор группы каналов
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
//-----------------------------------------------------------------------------
function SQUALL_ChannelGroup_Stop(ChannelGroupID: Integer): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Установка уровня громкости группы каналов в процентах
// на входе : ChannelGroupID - идентификатор группу каналов
// Volume - значение урокня громкости, значение должно
// лежать в пределах от 0 до 100
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
//-----------------------------------------------------------------------------
function SQUALL_ChannelGroup_SetVolume(ChannelGroupID, Volume: Integer): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Установка новой частоты дискретизации группы каналов
// на входе : ChannelGroupID - номер группы каналов
// Frequency - новое значение частоты дискретизации,
// значение параметра должно быть в пределах
// от 100 до 1000000 Герц
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
//-----------------------------------------------------------------------------
function SQUALL_ChannelGroup_SetFrequency(ChannelGroupID, Frequency: Integer): Integer; cdecl; external 'squall.dll';
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// Методы для работы с семплами
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
//-----------------------------------------------------------------------------
// Создание семпла из файла
// на входе : FileName - указатель на имя файла
// MemFlag - флаг определяющий расположение файла, параметр
// может принимать следующие значения:
// true - размещать данные файла в памяти
// false - разместить данные файла на диске
// Default - указатель на структуру параметров семпла по
// умолчанию, если параметр равен 0, загрузчик
// установит следующие параметры семпла по умолчанию:
// SampleGroupID - 0
// Priority - 0
// Frequency - 0
// Volume - 100
// Pan - 50
// MinDist - 1.0f
// MaxDist - 1000000000.0f
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
// в случае успешного вызова результат содержит идентификатор
// созданного семпла
//-----------------------------------------------------------------------------
function SQUALL_Sample_LoadFile(FileName: PChar;MemFlag: Integer; Default: psquall_sample_default_t): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Загрузка данных в хранилище из памяти
// на входе : MemoryPtr - указатель на память с данными файла
// MemorySize - размер памяти с данными файла
// NewMemory - флаг определяющий способ размещения данных
// true - выделить память и скопировать, то
// есть двигатель выделяет память и
// копирует данные указанные MemoryPtr.
// После выполнения память можно удалить
// false - использовать предлагаемую память, то
// есть передаваемую память нельзя удалять
// Default - указатель на структуру параметров семпла по
// умолчанию, если параметр равен 0, загрузчик
// установит следующие параметры семпла по умолчанию:
// SampleGroupID - 0
// Priority - 0
// Frequency - 0
// Volume - 100
// Pan - 50
// MinDist - 1.0f
// MaxDist - 1000000000.0f
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
// в случае успешного вызова результат содержит идентификатор
// созданного семпла
//-----------------------------------------------------------------------------
function SQUALL_Sample_LoadFromMemory(MemoryPtr: Pointer; MemorySize: Cardinal; NewMemory: Integer; Default: psquall_sample_default_t): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Освобождение всех семплов
// на входе : *
// на выходе : *
//-----------------------------------------------------------------------------
procedure SQUALL_Sample_UnloadAll() cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Освобождение указанного семпла
// на входе : SampleID - идентификатор семпла
// на выходе : *
//-----------------------------------------------------------------------------
procedure SQUALL_Sample_Unload(SampleID: Integer) cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Получение продолжительности данных звукового файла в отсчетах
// на входе : SampleID - идентификатор семпла
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
// в случае успешного вызова результат содержит продолжительность
// данных в отсчетах
//-----------------------------------------------------------------------------
function SQUALL_Sample_GetFileLength(SampleID: Integer): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Получение продолжительности данных звукового файла в миллисекундах
// на входе : SampleID - идентификатор семпла
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
// в случае успешного вызова результат содержит продолжительность
// данных в милисекундах
//-----------------------------------------------------------------------------
function SQUALL_Sample_GetFileLengthMs(SampleID: Integer): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Получение частоты дискретизации данных звукового файла
// на входе : SampleID - идентификатор семпла
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
// в случае успешного вызова результат содержит частоту
// дискретизации
//-----------------------------------------------------------------------------
function SQUALL_Sample_GetFileFrequency(SampleID: Integer): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Установка новых параметров семпла по умолчанию
// на входе : SampleID - идентификатор семпла
// Default - указатель на структуру с новыми параметрами семпла
// по умолчанию
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
//-----------------------------------------------------------------------------
function SQUALL_Sample_SetDefault(SampleID: Integer; Default: psquall_sample_default_t): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Получение текущих параметров семпла по умолчанию
// на входе : SampleID - идентификатор семпла
// Default - указатель на структуру в которую нужно поместить
// текущие параметры семпла по умолчанию
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
//-----------------------------------------------------------------------------
function SQUALL_Sample_GetDefault(SampleID: Integer; var Default: squall_sample_default_t): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Создание и воспроизведение рассеянного канала из указанного семпла, опираясь
// на параметры семпла по умолчанию
// на входе : SampleID - идентификатор семпла
// Loop - флаг зацикленности воспроизведения, параметр
// может принимать следующие значения:
// true - воспроизводить канал в цикле
// бесконечно
// false - воспроизвести канал один раз
// ChannelGroupID - принадлежность создаваемого канала к группе
// каналов, если значение параметра равно 0
// значит звуковой канал не принадлежит группе
// каналов.
// Start - флаг запуска звука по окончанию создания
// канала, параметр может принимать следующие
// значения:
// true - канал начнет воспроизводится сразу
// после создания
// false - канал будет только подготовлен,
// для того чтобы начать воспроизведение
// нужно вызвать метод
// SQUALL_Channel_Start()
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
// в случае успешного вызова результат содержит идентификатор
// созданного звукового канала
//-----------------------------------------------------------------------------
function SQUALL_Sample_Play(SampleID,Loop,Group,Start: Integer): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Создание и воспроизведение рассеянного канала из указанного семпла, опираясь
// на параметры семпла по умолчанию
// на входе : SampleID - идентификатор семпла
// Loop - флаг зацикленности воспроизведения, параметр
// может принимать следующие значения:
// true - воспроизводить канал в цикле
// бесконечно
// false - воспроизвести канал один раз
// ChannelGroupID - принадлежность создаваемого канала к группе
// каналов, если значение параметра равно 0
// значит звуковой канал не принадлежит группе
// каналов.
// Start - флаг запуска звука по окончанию создания
// канала, параметр может принимать следующие
// значения:
// true - канал начнет воспроизводится сразу
// после создания
// false - канал будет только подготовлен,
// для того чтобы начать воспроизведение
// нужно вызвать метод
// SQUALL_Channel_Start()
// Priority - приоритет создаваемого звукового канала,
// значение параметра должно лежать в пределах
// от 0 до 65535
// Volume - громкость создаваемого звукового канала,
// в процентах, значение параметра должно
// лежать в пределах от 0 до 100
// Frequency - частота дискретизации звукового канала,
// значение параметра должно лежать в пределах
// от 100 до 1000000000
// Pan - панорама создаваемого звукового канала,
// значение параметра должно лежать в пределах
// от 0 до 100
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
// в случае успешного вызова результат содержит идентификатор
// созданного звукового канала
//-----------------------------------------------------------------------------
function SQUALL_Sample_PlayEx(SampleID,Loop,Group,Start,Priority,Volume,Frequency,Pan: Integer): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Создание и воспроизведение позиционного (трехмерного) звукового канала из
// указаного семпла, опираясь на параметры семпла по умолчанию
// на входе : SampleID - идентификатор семпла
// Loop - флаг зацикленности воспроизведения, параметр
// может принимать следующие значения:
// true - воспроизводить канал в цикле
// бесконечно
// false - воспроизвести канал один раз
// ChannelGroupID - принадлежность создаваемого канала к группе
// каналов, если значение параметра равно 0
// значит звуковой канал не принадлежит группе
// каналов.
// Start - флаг запуска звука по окончанию создания
// канала, параметр может принимать следующие
// значения:
// true - канал начнет воспроизводится сразу
// после создания
// false - канал будет только подготовлен,
// для того чтобы начать воспроизведение
// нужно вызвать метод
// SQUALL_Channel_Start()
// Position - указатель на структуру c координатами
// источника звукового канала
// Velocity - указатель на вектор скорости источника
// звукового канала, в случае если значение
// вектора скорости устанавливать не надо,
// то данный параметр должен быть равен 0
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
// в случае успешного вызова результат содержит идентификатор
// созданного звукового канала
//-----------------------------------------------------------------------------
function SQUALL_Sample_Play3D(SampleID,Loop,Group,Start: Integer; Position,Velocity: PSingle): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Создание и воспроизведение позиционного (трехмерного) звукового канала из
// указаного семпла
// на входе : SampleID - идентификатор семпла
// Loop - флаг зацикленности воспроизведения, параметр
// может принимать следующие значения:
// true - воспроизводить канал в цикле
// бесконечно
// false - воспроизвести канал один раз
// ChannelGroupID - принадлежность создаваемого канала к группе
// каналов, если значение параметра равно 0
// значит звуковой канал не принадлежит группе
// каналов.
// Start - флаг запуска звука по окончанию создания
// канала, параметр может принимать следующие
// значения:
// true - канал начнет воспроизводится сразу
// после создания
// false - канал будет только подготовлен,
// для того чтобы начать воспроизведение
// нужно вызвать метод
// SQUALL_Channel_Start()
// Position - указатель на структуру c координатами
// источника звукового канала
// Velocity - указатель на вектор скорости источника
// звукового канала, в случае если значение
// вектора скорости устанавливать не надо,
// то данный параметр должен быть равен 0
// Priority - приоритет создаваемого звукового канала,
// значение параметра должно лежать в пределах
// от 0 до 65535
// Volume - громкость создаваемого звукового канала,
// в процентах, значение параметра должно
// лежать в пределах от 0 до 100
// Frequency - частота дискретизации звукового канала,
// значение параметра должно лежать в пределах
// от 100 до 1000000000
// MinDist - минимальное растояние слышимости звукового
// канала, значение параметра должно быть в
// пределах от 0.01f до 1000000000.0f
// MaxDist - максимальное растояние слышимости звукового
// канала, значение параметра должно быть в
// пределах от 0.01f до 1000000000.0f
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
// в случае успешного вызова результат содержит идентификатор
// созданного звукового канала
//-----------------------------------------------------------------------------
function SQUALL_Sample_Play3DEx(SampleID,Loop,Group,Start: Integer; Position,Velocity: PSingle;Priority,Volume,Frequency: Integer;MinDist,MaxDist: Single): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Включение/выключение паузы всех каналов использующих указаный семпл
// на входе : SampleID - указатель на данные звука
// Pause - флаг включения/выключения паузы, параметр может
// принимать следующие значения:
// true - включить паузу
// false - выключить паузу
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
//-----------------------------------------------------------------------------
function SQUALL_Sample_Pause(SampleID,Pause: Integer): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Остановка всех звуковых каналов использующих указанный семпл
// на входе : SampleID - идентификатор семпла
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
//-----------------------------------------------------------------------------
function SQUALL_Sample_Stop(SampleID: Integer): Integer; cdecl; external 'squall.dll';
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// Методы для работы с группами семплов
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
//-----------------------------------------------------------------------------
// Создание и воспроизведения рассеяного канала из группы семплов, опираясь
// на параметры семпла по умолчанию
// на входе : SampleGroupID - идентификатор группы семплов
// Loop - флаг зацикленности воспроизведения, параметр
// может принимать следующие значения:
// true - воспроизводить канал в цикле
// бесконечно
// false - воспроизвести канал один раз
// ChannelGroupID - принадлежность создаваемого канала к группе
// каналов, если значение параметра равно 0
// значит звуковой канал не принадлежит группе
// каналов.
// Start - флаг запуска звука по окончанию создания
// канала, параметр может принимать следующие
// значения:
// true - канал начнет воспроизводится сразу
// после создания
// false - канал будет только подготовлен,
// для того чтобы начать воспроизведение
// нужно вызвать метод
// SQUALL_Channel_Start()
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
// в случае успешного вызова результат содержит идентификатор
// созданного звукового канала
//-----------------------------------------------------------------------------
function SQUALL_SampleGroup_Play(SoundGroupID,Loop,Group,Start: Integer): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Создание и воспроизведения рассеяного канала из группы семплов
// на входе : SampleGroupID - идентификатор группы семплов
// Loop - флаг зацикленности воспроизведения, параметр
// может принимать следующие значения:
// true - воспроизводить канал в цикле
// бесконечно
// false - воспроизвести канал один раз
// ChannelGroupID - принадлежность создаваемого канала к группе
// каналов, если значение параметра равно 0
// значит звуковой канал не принадлежит группе
// каналов.
// Start - флаг запуска звука по окончанию создания
// канала, параметр может принимать следующие
// значения:
// true - канал начнет воспроизводится сразу
// после создания
// false - канал будет только подготовлен,
// для того чтобы начать воспроизведение
// нужно вызвать метод
// SQUALL_Channel_Start()
// Priority - приоритет создаваемого звукового канала,
// значение параметра должно лежать в пределах
// от 0 до 65535
// Volume - громкость создаваемого звукового канала,
// в процентах, значение параметра должно
// лежать в пределах от 0 до 100
// Frequency - частота дискретизации звукового канала,
// значение параметра должно лежать в пределах
// от 100 до 1000000000
// Pan - панорама создаваемого звукового канала,
// значение параметра должно лежать в пределах
// от 0 до 100
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
// в случае успешного вызова результат содержит идентификатор
// созданного звукового канала
//-----------------------------------------------------------------------------
function SQUALL_SampleGroup_PlayEx(SoundGroupID,Loop,Group,Start,Priority,Volume,Frequency,Pan: Integer): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Создание и воспроизведение позиционного (трехмерного) звукового канала из
// указаной группы семплов, опираясь на параметры семпла по умолчанию
// на входе : SampleGroupID - идентификатор группы семплов
// Loop - флаг зацикленности воспроизведения, параметр
// может принимать следующие значения:
// true - воспроизводить канал в цикле
// бесконечно
// false - воспроизвести канал один раз
// ChannelGroupID - принадлежность создаваемого канала к группе
// каналов, если значение параметра равно 0
// значит звуковой канал не принадлежит группе
// каналов.
// Start - флаг запуска звука по окончанию создания
// канала, параметр может принимать следующие
// значения:
// true - канал начнет воспроизводится сразу
// после создания
// false - канал будет только подготовлен,
// для того чтобы начать воспроизведение
// нужно вызвать метод
// SQUALL_Channel_Start()
// Position - указатель на структуру c координатами
// источника звукового канала
// Velocity - указатель на вектор скорости источника
// звукового канала, в случае если значение
// вектора скорости устанавливать не надо,
// то данный параметр должен быть равен 0
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
// в случае успешного вызова результат содержит идентификатор
// созданного звукового канала
//-----------------------------------------------------------------------------
function SQUALL_SampleGroup_Play3D(SoundGroupID,Loop,Group,Start: Integer; Position,Velocity: PSingle): Integer; cdecl; external 'squall.dll';
//-----------------------------------------------------------------------------
// Создание и воспроизведение позиционного (трехмерного) звукового канала из
// указаной группы семплов
// на входе : SampleGroupID - идентификатор группы семплов
// Loop - флаг зацикленности воспроизведения, параметр
// может принимать следующие значения:
// true - воспроизводить канал в цикле
// бесконечно
// false - воспроизвести канал один раз
// ChannelGroupID - принадлежность создаваемого канала к группе
// каналов, если значение параметра равно 0
// значит звуковой канал не принадлежит группе
// каналов.
// Start - флаг запуска звука по окончанию создания
// канала, параметр может принимать следующие
// значения:
// true - канал начнет воспроизводится сразу
// после создания
// false - канал будет только подготовлен,
// для того чтобы начать воспроизведение
// нужно вызвать метод
// SQUALL_Channel_Start()
// Position - указатель на структуру c координатами
// источника звукового канала
// Velocity - указатель на вектор скорости источника
// звукового канала, в случае если значение
// вектора скорости устанавливать не надо,
// то данный параметр должен быть равен 0
// Priority - приоритет создаваемого звукового канала,
// значение параметра должно лежать в пределах
// от 0 до 65535
// Volume - громкость создаваемого звукового канала,
// в процентах, значение параметра должно
// лежать в пределах от 0 до 100
// Frequency - частота дискретизации звукового канала,
// значение параметра должно лежать в пределах
// от 100 до 1000000000
// MinDist - минимальное растояние слышимости звукового
// канала, значение параметра должно быть в
// пределах от 0.01f до 1000000000.0f
// MaxDist - максимальное растояние слышимости звукового
// канала, значение параметра должно быть в
// пределах от 0.01f до 1000000000.0f
// на выходе : успешность, если возвращаемый результат больше либо равен 0,
// вызов состоялся, иначе результат содержит код ошибки
// в случае успешного вызова результат содержит идентификатор
// созданного звукового канала
//-----------------------------------------------------------------------------
function SQUALL_SampleGroup_Play3DEx(SoundGroupID,Loop,Group,Start: Integer; Position,Velocity: PSingle; Priority,Volume,Frequency: Integer;MinDist,MaxDist: Single): Integer; cdecl; external 'squall.dll';
implementation
end.
|
{-------------------------------------------------------------------------------
search and select a device in the broadcast list
(c) Bio-Logic company, 1997 - 2013
-------------------------------------------------------------------------------}
unit VMPFinddevice;
interface
uses
Windows, SysUtils, Classes, Graphics, Controls, Forms,
Dialogs, Grids, ExtCtrls, StdCtrls, Buttons,
JvExControls, JvSpeedButton, JvPageList;
type
TEventOnClickSelect = procedure of object;
TEventOnClickCancel = procedure of object;
TShowInfosFrm = procedure of object;
puInt32 = ^uInt32;
TBL_Find = function(aLstDev : PChar; aLength : puInt32; aNbDevice : puInt32) : Int32; stdcall;
TBL_SetCfg = function(aIP : PChar; aNewCfg : PChar) : Int32; stdcall;
TBL_GetErr = procedure(aErrCode : Int32; aErrMsg : PChar; aLength : puInt32); stdcall;
TBL_Init = procedure(wPath : PChar);
TfVMPadddevice = class(TForm)
PanelDevice: TPanel;
JvPageList1: TJvPageList;
btnRefresh: TSpeedButton;
StringGridDevices: TStringGrid;
lblOnLine: TLabel;
GroupBox5: TGroupBox;
JvStandardPage1: TJvStandardPage;
btnSelectDevice: TBitBtn;
btnClose: TBitBtn;
procedure FormCreate(Sender: TObject);
procedure btnRefreshClick(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure btnSelectDeviceClick(Sender: TObject);
private
{ Private declarations }
FFindUSBdevices : boolean; {Search USB device}
FSIPAdress : string;
FShowInfosFrm : TShowInfosFrm;
FSortInProgress : boolean; {sort in progress}
FPrevSelIP : shortstring; {previous IP selected}
FRefreshDone : boolean;
mHandleLibFind : integer;
FBL_FindEChemDev : TBL_Find;
FBL_FindEChemEthDev : TBL_Find;
FBL_Init_Path : TBL_Init;
FBL_SetCfg : TBL_SetCfg;
FBL_GetErrMsg : TBL_GetErr;
procedure ClearStringGridList;
procedure EnableStringGrid(enable: boolean);
function LoadFindLibrary : boolean;
procedure FreeFindLibrary;
public
{ Public declarations }
constructor Create( AOwner : TComponent;
aClickSelect : TEventOnClickSelect;
aClickCancel : TEventOnClickCancel;
aShowInfosFrm : TShowInfosFrm;
aLoadFlash : TEventOnClickCancel); reintroduce; overload;
destructor Destroy; override;
property FindUSBdevices: boolean read FFindUSBdevices write FFindUSBdevices;
property SIPAdress: string read FSIPAdress write FSIPAdress;
end;
var
fVMPadddevice: TfVMPadddevice;
function BLExtractStringsEmpty(Separators, WhiteSpace: TSysCharSet; Content: PChar; Strings: TStrings): Integer;
function IsTcpIpAddress(sIPAddress: ShortString): boolean; overload; {Test if IPAdress is a valid TCP/IP address}
implementation
{$R *.dfm}
const
SOFT_NAME = 'LibraryDemo';
{TCP/IP}
ETHERNET_STR = 'Ethernet';
USB_STR = 'USB';
NB_MAX_DEVICE_FOUND = 50;
LIGHT_GREEN = $C0FFC0;
ORANGE = $80C0FF;
{StringGridDevices columns}
COL_COMM = 0;
COL_ADDRESS = 1;
{Comm type}
COMM_NONE = 0;
COMM_TCPIP = 1;
COMM_USB = 2;
COMM_VIRTUAL = 3;
DO_BEEP = True;
NO_BEEP = False;
{dll Name}
BLFIND_DLL_DIR = '..\..\EC-Lab Development Package\';
{$IFDEF WIN64}
BLFIND_DLL_NAME = 'blfind64.dll';
{$ELSE}
BLFIND_DLL_NAME = 'blfind.dll';
{$ENDIF}
type
TByteArray16 = array [0..15] of byte;
TArray25ofString = array[1..NB_MAX_DEVICE_FOUND] of ansistring;
TArray25ofByte16 = array[1..NB_MAX_DEVICE_FOUND] of TByteArray16;
var
NbDeviceFound : integer;
DeviceFoundComm : TArray25ofString; {'USB' or 'ethernet'}
DeviceFoundIP : TArray25ofString;
DeviceFoundNM : TArray25ofString;
DeviceFoundGW : TArray25ofString;
DeviceFoundMAC : TArray25ofString;
DeviceFoundID : TArray25ofString;
DeviceFoundSerial : TArray25ofByte16;
DeviceFoundSerial_ : TArray25ofString;
DeviceFoundName : TArray25ofByte16;
DeviceFoundDevice : TArray25ofString;
modindex : integer;
EdtIPAddress_Text : ShortString;
{-------------------------------------------------------------------------------
Extract string
-------------------------------------------------------------------------------}
function BLExtractStringsEmpty(Separators, WhiteSpace: TSysCharSet; Content: PChar; Strings: TStrings): Integer;
var
Head, Tail: PChar;
EOS, InQuote: Boolean;
QuoteChar: Char;
Item: string;
begin
Result := 0;
if (Content = nil) or (Content^=#0) or (Strings = nil) then Exit;
Tail := Content;
InQuote := False;
QuoteChar := #0;
Strings.BeginUpdate;
try
repeat
while (CharInSet(Tail^, WhiteSpace + [#13, #10])) do
Tail := StrNextChar(Tail);
Head := Tail;
while True do
begin
while (InQuote and not CharInSet(Tail^, [QuoteChar, #0])) or
not (CharInSet(Tail^, Separators + [#0, #13, #10, '''', '"'])) do Tail := StrNextChar(Tail);
if CharInSet(Tail^, ['''', '"']) then
begin
if (QuoteChar <> #0) and (QuoteChar = Tail^) then
QuoteChar := #0
else if QuoteChar = #0 then
QuoteChar := Tail^;
InQuote := QuoteChar <> #0;
Tail := StrNextChar(Tail);
end else Break;
end;
EOS := Tail^ = #0;
if (Head^ <> #0) then
begin
if Strings <> nil then
begin
SetString(Item, Head, Tail - Head);
Strings.Add(Item);
end;
Inc(Result);
end;
Tail := StrNextChar(Tail);
until EOS;
finally
Strings.EndUpdate;
end;
end;
{-------------------------------------------------------------------------------
Test if sIPAdress is a valid TCP/IP address.
. IP address format : a.b.c.d with a,b,c,d in [0,255]
. convert sIPaddress into an int32
-------------------------------------------------------------------------------}
function IsTcpIpAddress(sIPaddress: ShortString; var i32IPAddress: uint32): boolean; overload;
{...........................................................................}
function ExtractFirstNum(var IPstr: ShortString; var firstNum: integer): boolean;
var dotPos: integer;
begin
result := false;
dotPos := pos('.',IPstr);
if (dotPos <= 1) or (dotPos >= 5) then exit;
firstNum := StrToIntDef(Copy(IPstr,0,dotPos - 1),-1);
if (firstNum < 0) or (firstNum > $ff) then exit;
IPstr := Copy(IPstr,dotPos + 1,length(IPstr));
result := true;
end;
{...........................................................................}
var a,b,c,d: integer;
begin
result := False;
i32IPAddress := 0;
if (length(sIPAddress) <= 0) or (length(sIPAddress) > 15) then exit;
if not ExtractFirstNum(sIPaddress,a) then exit;
if not ExtractFirstNum(sIPaddress,b) then exit;
if not ExtractFirstNum(sIPaddress,c) then exit;
if (pos('.',sIPaddress) > 0) then exit;
d := StrToIntDef(sIPaddress,-1);
if (d < 0) or (d > $ff) then exit;
i32IPAddress := (a shl 24)+ (b shl 16) + (c shl 8) + d;
result := true;
end;
{-------------------------------------------------------------------------------
Is TcpIp Address valid
-------------------------------------------------------------------------------}
function IsTcpIpAddress(sIPAddress: ShortString): boolean;
var i32IPAddress: uint32;
begin
result := IsTcpIpAddress(sIPAddress,i32IPAddress);
end;
{-------------------------------------------------------------------------------
Pascal message box (with strings instead of PAnsiChar).
-------------------------------------------------------------------------------}
function MsgBoxPas(ChMsg,ChTitle: UnicodeString; Flags: Word; DoBeep: boolean): integer; overload;
var WMsg,WTitle: WideString;
begin
if DoBeep then messageBeep(0);
WMsg := ChMsg;
WTitle := ChTitle;
result := Application.MessageBox(PWideChar(WMsg),PWideChar(WTitle),Flags);
end;
{-------------------------------------------------------------------------------
Message box
-------------------------------------------------------------------------------}
function MsgBoxPas(ChMsg,ChTitle: UnicodeString; Flags: Word): integer; overload;
begin
result := MsgBoxPas(ChMsg,ChTitle,Flags,DO_BEEP);
end;
{-------------------------------------------------------------------------------
string conversion
-------------------------------------------------------------------------------}
function blStrToPWideChar(var Ch: WideString): PWideChar;
var L: integer;
begin
L := Length(Ch);
if L = 0 then
begin
Ch := #0;
end
else if Ch[L] <> #0 then
begin
Ch := Ch + #0;
end;
result := @(Ch[1]);
end;
{-------------------------------------------------------------------------------
Create TfVMPadddevice object
-------------------------------------------------------------------------------}
constructor TfVMPadddevice.Create(AOwner : TComponent;
aClickSelect : TEventOnClickSelect;
aClickCancel : TEventOnClickCancel;
aShowInfosFrm : TShowInfosFrm;
aLoadFlash : TEventOnClickCancel);
begin
inherited Create(AOwner);
FShowInfosFrm := aShowInfosFrm;
FreeFindLibrary;
end;
{-------------------------------------------------------------------------------
Form Create
-------------------------------------------------------------------------------}
procedure TfVMPadddevice.FormCreate(Sender: TObject);
begin
NbDeviceFound := 0;
StringGridDevices.ColCount := 2;
StringGridDevices.Rows[0][0] := 'Comm';
StringGridDevices.Rows[0][1] := 'Address';
ClearStringGridList;
FFindUSBdevices := FALSE;
btnSelectDevice.Visible := True;
btnClose.Visible := True;
FSortInProgress := FALSE;
FPrevSelIP := '';
FRefreshDone := FALSE;
if LoadFindLibrary = false then
Exit;
end;
{-------------------------------------------------------------------------------
Form Show
-------------------------------------------------------------------------------}
procedure TfVMPadddevice.FormShow(Sender: TObject);
begin
btnSelectDevice.Enabled := FALSE;
ClearStringGridList;
btnRefreshClick(self);
btnRefresh.Enabled:=true;
btnSelectDevice.Enabled := TRUE;
end;
{-------------------------------------------------------------------------------
destroy TfVMPadddevice object
-------------------------------------------------------------------------------}
destructor TfVMPadddevice.destroy;
begin
FreeFindLibrary;
inherited;
end;
{-------------------------------------------------------------------------------
Select device
-------------------------------------------------------------------------------}
procedure TfVMPadddevice.btnSelectDeviceClick(Sender: TObject);
var
indx: integer;
DevCode: byte;
label errNoDevice, errInvalidIP, errInvalidSel;
begin
indx := StringGridDevices.Row;
if CompareText(string(DeviceFoundIP[indx]), StringGridDevices.Cells[COL_ADDRESS,indx]) <> 0 then
goto errInvalidSel;
if (indx < 1) or (indx >= StringGridDevices.RowCount) then
begin
goto errNoDevice;
end;
FSIPAdress := string(DeviceFoundIP[indx]);
Exit;
errNoDevice:
MsgBoxPas('No device selected !', 'Warning', MB_OK or MB_ICONWARNING);
Exit;
errInvalidIP:
MsgBoxPas('Invalid IP address selected !', 'Warning', MB_OK or MB_ICONWARNING);
Exit;
errInvalidSel:
MsgBoxPas('Invalid instrument selection !', 'Error', MB_OK or MB_ICONWARNING);
Exit;
end;
{-------------------------------------------------------------------------------
Refresh devices list
-------------------------------------------------------------------------------}
procedure TfVMPadddevice.btnRefreshClick(Sender: TObject);
var
bSelectLastIP : boolean;
vLstDev : TStringList;
vLstField : TStringList;
vIdx, i : integer;
vBuf : array of char;
vBufErrMsg : array[0..255] of char;
vNbDev : UInt32;
vBufSize : UInt32;
vErr : Int32;
begin
bSelectLastIP := False;
Screen.Cursor := crHourGlass;
try
FRefreshDone := FALSE;
EnableStringGrid(FALSE);
bSelectLastIP := (FPrevSelIP = '');
ClearStringGridList;
NbDeviceFound :=0;
modindex := 0;
zeromemory(@DeviceFoundComm, sizeof(DeviceFoundComm));
zeromemory(@DeviceFoundIP, sizeof(DeviceFoundIP));
zeromemory(@DeviceFoundNM, sizeof(DeviceFoundNM));
zeromemory(@DeviceFoundGW, sizeof(DeviceFoundGW));
zeromemory(@DeviceFoundMAC, sizeof(DeviceFoundMAC));
zeromemory(@DeviceFoundID, sizeof(DeviceFoundID));
zeromemory(@DeviceFoundSerial, sizeof(DeviceFoundSerial));
zeromemory(@DeviceFoundSerial_, sizeof(DeviceFoundSerial_));
zeromemory(@DeviceFoundName, sizeof(DeviceFoundName));
zeromemory(@DeviceFoundDevice, sizeof(DeviceFoundDevice));
SetLength(vBuf, 5120);
ZeroMemory(@vBuf[0], sizeof(vBuf));
if (mHandleLibFind = 0) then
begin
MsgBoxPas(BLFIND_DLL_NAME + ': file not found.', SOFT_NAME, MB_OK or MB_ICONEXCLAMATION);
Exit;
end;
if (@FBL_FindEChemDev = nil) or
(@FBL_FindEChemEthDev = nil) or
(@FBL_GetErrMsg = nil) then
begin
MsgBoxPas(BLFIND_DLL_NAME + ': incompatible file, functions missing.', SOFT_NAME, MB_OK or MB_ICONEXCLAMATION);
Exit;
end;
vBufSize := length(vBuf);
if FFindUSBdevices then
begin
vErr := FBL_FindEChemDev( @vBuf[0], @vBufSize, @vNbDev)
end
else
begin
vErr := FBL_FindEChemEthDev( @vBuf[0], @vBufSize, @vNbDev);
end;
if vErr < 0 then
begin
vBufSize := length(vBufErrMsg);
FBL_GetErrMsg(vErr, @vBufErrMsg[0], @vBufSize);
MsgBoxPas(vBufErrMsg, SOFT_NAME, MB_OK or MB_ICONEXCLAMATION);
Exit;
end;
vLstDev := TStringList.Create;
vLstField := TStringList.Create;
ExtractStrings(['%'], [], @vBuf[0], vLstDev);
vIdx := 0;
while ( vIdx < vLstDev.Count ) and ( NbDeviceFound < NB_MAX_DEVICE_FOUND ) do
begin
BLExtractStringsEmpty(['$'], [], @((vLstDev.Strings[vIdx])[1]), vLstField);
if vLstField.Count = 9 then
begin
Inc( NbDeviceFound );
DeviceFoundComm[NbDeviceFound] := shortstring( vLstField[0] );
DeviceFoundIP[NbDeviceFound] := shortstring( vLstField[1] );
DeviceFoundGW[NbDeviceFound] := shortstring( vLstField[2] );
DeviceFoundNM[NbDeviceFound] := shortstring( vLstField[3] );
DeviceFoundMAC[NbDeviceFound] := shortstring( vLstField[4] );
DeviceFoundID[NbDeviceFound] := shortstring( vLstField[5] );
DeviceFoundDevice[NbDeviceFound] := shortstring( vLstField[6] );
DeviceFoundSerial_[NbDeviceFound] := shortstring( vLstField[7] );
for i := 0 to length(vLstField[7]) - 1 do
DeviceFoundSerial[NbDeviceFound][i] := ord( vLstField[7][i+1] );
for i := 0 to length(vLstField[8]) - 1 do
DeviceFoundName[NbDeviceFound][i] := ord( vLstField[8][i+1] );
with StringGridDevices do
begin
if Rows[RowCount-1][0] <> '' then
RowCount := RowCount + 1;
Rows[RowCount-1][COL_COMM] := string( DeviceFoundComm[NbDeviceFound] );
Rows[RowCount-1][COL_ADDRESS] := string( DeviceFoundIP[NbDeviceFound] );
end;
end;
vLstField.Clear;
vIdx := vIdx + 1;
end;
vLstDev.Destroy;
vLstField.Destroy;
finally
EnableStringGrid(TRUE);
FRefreshDone := TRUE;
Screen.Cursor := crDefault;
end;
end;
{-------------------------------------------------------------------------------
Clear devices list
-------------------------------------------------------------------------------}
procedure TfVMPadddevice.ClearStringGridList;
var i, j: integer;
begin
for i := 1 to StringGridDevices.RowCount - 1 do
for j := 0 to StringGridDevices.ColCount - 1 do
StringGridDevices.Rows[i][j] := '';
StringGridDevices.RowCount := 2; {do not set RowCount := 1 otherwise FixedRows is set to 0}
end;
{-------------------------------------------------------------------------------
Enable Device selection
-------------------------------------------------------------------------------}
procedure TfVMPadddevice.EnableStringGrid(enable: boolean);
begin
StringGridDevices.Enabled := enable;
if enable then
begin
StringGridDevices.Font.Color := clBlack;
end
else
begin
StringGridDevices.Font.Color := clGrayText;
end;
end;
{-------------------------------------------------------------------------------
Load BLFind Library
-------------------------------------------------------------------------------}
function TfVMPadddevice.LoadFindLibrary : boolean;
var
vSeparator, vLibraryPath : string;
lwpath: WideString;
lpwpath: PWideChar;
begin
if mHandleLibFind <> 0 then
FreeFindLibrary;
try
vSeparator := '';
vLibraryPath := BLFIND_DLL_DIR + BLFIND_DLL_NAME;
mHandleLibFind := loadlibrary( @vLibraryPath[1] );
if mHandleLibFind <> 0 then
begin
@FBL_FindEChemDev := GetProcAddress(mHandleLibFind, 'BL_FindEChemDev');
@FBL_FindEChemEthDev := GetProcAddress(mHandleLibFind, 'BL_FindEChemEthDev');
@FBL_Init_Path := GetProcAddress(mHandleLibFind, 'BL_Init_Path');
lwpath := BLFIND_DLL_DIR;
lpwpath := blStrToPWideChar(lwpath);
FBL_Init_Path(lpwpath);
@FBL_SetCfg := GetProcAddress(mHandleLibFind, 'BL_SetConfig');
@FBL_GetErrMsg := GetProcAddress(mHandleLibFind, 'BL_GetErrorMsg');
if (@FBL_FindEChemDev = nil) or
(@FBL_FindEChemEthDev = nil) or
(@FBL_SetCfg = nil) or
(@FBL_GetErrMsg = nil) then
begin
Result := false;
end
else
Result := true;
end
else
Result := false;
except
Result := false;
end;
end;
{-------------------------------------------------------------------------------
Free BLFind Library
-------------------------------------------------------------------------------}
procedure TfVMPadddevice.FreeFindLibrary;
begin
try
@FBL_FindEChemDev := nil;
@FBL_FindEChemEthDev := nil;
@FBL_SetCfg := nil;
@FBL_GetErrMsg := nil;
if mHandleLibFind <> 0 then
FreeLibrary( mHandleLibFind );
mHandleLibFind := 0;
except
end;
end;
initialization
fVMPadddevice := nil;
finalization
end.
|
{ *******************************************************************************
Copyright 2016-2019 Daniele Spinetti
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
******************************************************************************** }
unit EventBus.Subscribers;
interface
uses
System.RTTI, Router4D.Props;
type
TSubscriberMethod = class(TObject)
private
FEventType: TClass;
FThreadMode: TThreadMode;
FMethod: TRttiMethod;
FContext: string;
procedure SetEventType(const Value: TClass);
procedure SetMethod(const Value: TRttiMethod);
procedure SetThreadMode(const Value: TThreadMode);
procedure SetContext(const Value: String);
public
constructor Create(ARttiMethod: TRttiMethod; AEventType: TClass;
AThreadMode: TThreadMode; const AContext: String = '';
APriority: Integer = 1);
destructor Destroy; override;
property EventType: TClass read FEventType write SetEventType;
property Method: TRttiMethod read FMethod write SetMethod;
property ThreadMode: TThreadMode read FThreadMode write SetThreadMode;
property Context: String read FContext write SetContext;
function Equals(Obj: TObject): Boolean; override;
end;
TSubscription = class(TObject)
private
FSubscriberMethod: TSubscriberMethod;
FSubscriber: TObject;
FActive: Boolean;
procedure SetActive(const Value: Boolean);
function GetActive: Boolean;
procedure SetSubscriberMethod(const Value: TSubscriberMethod);
procedure SetSubscriber(const Value: TObject);
function GetContext: String;
public
constructor Create(ASubscriber: TObject;
ASubscriberMethod: TSubscriberMethod);
destructor Destroy; override;
property Active: Boolean read GetActive write SetActive;
property Subscriber: TObject read FSubscriber write SetSubscriber;
property SubscriberMethod: TSubscriberMethod read FSubscriberMethod
write SetSubscriberMethod;
property Context: String read GetContext;
function Equals(Obj: TObject): Boolean; override;
end;
TSubscribersFinder = class(TObject)
class function FindSubscriberMethods(ASubscriberClass: TClass;
ARaiseExcIfEmpty: Boolean = false): TArray<TSubscriberMethod>;
end;
implementation
uses
RTTIUtilsU, System.SysUtils, System.TypInfo;
{ TSubscriberMethod }
constructor TSubscriberMethod.Create(ARttiMethod: TRttiMethod;
AEventType: TClass; AThreadMode: TThreadMode; const AContext: String = '';
APriority: Integer = 1);
begin
FMethod := ARttiMethod;
FEventType := AEventType;
FThreadMode := AThreadMode;
FContext := AContext;
end;
destructor TSubscriberMethod.Destroy;
begin
inherited;
end;
function TSubscriberMethod.Equals(Obj: TObject): Boolean;
var
OtherSubscriberMethod: TSubscriberMethod;
begin
if (inherited Equals(Obj)) then
exit(true)
else if (Obj is TSubscriberMethod) then
begin
OtherSubscriberMethod := TSubscriberMethod(Obj);
exit(OtherSubscriberMethod.Method.ToString = Method.ToString);
end
else
exit(false);
end;
procedure TSubscriberMethod.SetContext(const Value: String);
begin
FContext := Value;
end;
procedure TSubscriberMethod.SetEventType(const Value: TClass);
begin
FEventType := Value;
end;
procedure TSubscriberMethod.SetMethod(const Value: TRttiMethod);
begin
FMethod := Value;
end;
procedure TSubscriberMethod.SetThreadMode(const Value: TThreadMode);
begin
FThreadMode := Value;
end;
{ TSubscribersFinder }
class function TSubscribersFinder.FindSubscriberMethods(ASubscriberClass
: TClass; ARaiseExcIfEmpty: Boolean = false): TArray<TSubscriberMethod>;
var
LRttiType: TRttiType;
LSubscribeAttribute: SubscribeAttribute;
LRttiMethods: TArray<System.RTTI.TRttiMethod>;
LMethod: TRttiMethod;
LParamsLength: Integer;
LEventType: TClass;
LSubMethod: TSubscriberMethod;
begin
LRttiType := TRTTIUtils.ctx.GetType(ASubscriberClass);
LRttiMethods := LRttiType.GetMethods;
for LMethod in LRttiMethods do
if TRTTIUtils.HasAttribute<SubscribeAttribute>(LMethod, LSubscribeAttribute)
then
begin
LParamsLength := Length(LMethod.GetParameters);
if (LParamsLength <> 1) then
raise Exception.CreateFmt
('Method %s has Subscribe attribute but requires %d arguments. Methods must require a single argument.',
[LMethod.Name, LParamsLength]);
LEventType := LMethod.GetParameters[0].ParamType.Handle.TypeData.
ClassType;
LSubMethod := TSubscriberMethod.Create(LMethod, LEventType,
LSubscribeAttribute.ThreadMode, LSubscribeAttribute.Context);
{$IF CompilerVersion >= 28.0}
Result := Result + [LSubMethod];
{$ELSE}
SetLength(Result, Length(Result) + 1);
Result[High(Result)] := LSubMethod;
{$ENDIF}
end;
//if (Length(Result) < 1) and ARaiseExcIfEmpty then
// raise Exception.CreateFmt
// ('The class %s and its super classes have no public methods with the Subscribe attributes',
// [ASubscriberClass.QualifiedClassName]);
end;
{ TSubscription }
constructor TSubscription.Create(ASubscriber: TObject;
ASubscriberMethod: TSubscriberMethod);
begin
inherited Create;
FSubscriber := ASubscriber;
FSubscriberMethod := ASubscriberMethod;
FActive := true;
end;
destructor TSubscription.Destroy;
begin
if Assigned(FSubscriberMethod) then
FreeAndNil(FSubscriberMethod);
inherited;
end;
function TSubscription.Equals(Obj: TObject): Boolean;
var
LOtherSubscription: TSubscription;
begin
if (Obj is TSubscription) then
begin
LOtherSubscription := TSubscription(Obj);
exit((Subscriber = LOtherSubscription.Subscriber) and
(SubscriberMethod.Equals(LOtherSubscription.SubscriberMethod)));
end
else
exit(false);
end;
function TSubscription.GetActive: Boolean;
begin
TMonitor.Enter(self);
try
Result := FActive;
finally
TMonitor.exit(self);
end;
end;
function TSubscription.GetContext: String;
begin
Result := SubscriberMethod.Context;
end;
procedure TSubscription.SetActive(const Value: Boolean);
begin
TMonitor.Enter(self);
try
FActive := Value;
finally
TMonitor.exit(self);
end;
end;
procedure TSubscription.SetSubscriberMethod(const Value: TSubscriberMethod);
begin
FSubscriberMethod := Value;
end;
procedure TSubscription.SetSubscriber(const Value: TObject);
begin
FSubscriber := Value;
end;
end.
|
unit Unit9;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.Buttons;
type
TForm9 = class(TForm)
PrintDialog: TPrintDialog;
Button1: TButton;
cboPrinter: TComboBox;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
procedure PrintDocument(const documentToPrint : string);
end;
var
Form9: TForm9;
implementation
uses shellapi, printers;
{$R *.dfm}
procedure TForm9.PrintDocument(const documentToPrint : string);
var
printCommand : string;
printerInfo : string;
Device, Driver, Port: array[0..255] of Char;
hDeviceMode: THandle;
begin
if Printer.PrinterIndex = cboPrinter.ItemIndex then begin
printCommand := 'print'; printerInfo := '';
end else begin
printCommand := 'printto';
Printer.PrinterIndex := cboPrinter.ItemIndex;
Printer.GetPrinter(Device, Driver, Port, hDeviceMode) ;
printerInfo := Format('"%s" "%s" "%s"', [Device, Driver, Port]) ;
end;
ShellExecute( 0 {Application.Handle}, PChar(printCommand), PChar(documentToPrint), PChar(printerInfo), nil, SW_SHOWNORMAL) ;
end;
procedure TForm9.Button1Click(Sender: TObject);
var
OpenDialog : TOpenDialog;
begin
OpenDialog := TOpenDialog.Create(nil);
try
if OpenDialog.Execute then begin
PrintDocument(OpenDialog.FileName);
end;
finally
OpenDialog.Free;
end;
end;
procedure TForm9.FormCreate(Sender: TObject);
begin
cboPrinter.Items.Assign(printer.Printers);
end;
end.
|
program anime;
var c: char;
begin
c := 'f';
printf('Value of c is %c',c);
end |
unit UL.TURepositionLayout;
interface
uses
UL.Classes,
System.Classes, System.Types,
VCL.Controls, VCL.ExtCtrls, VCL.Dialogs;
type
TURepositionLayout = class(TPanel)
private
FPanelA: TPanel;
FPanelB: TPanel;
FMinWidth: Integer;
FMaxWidth: Integer;
FMaxHeight: Integer;
FLayout1: TULayout;
FLayout2: TULayout;
FLayout3: TULayout;
FLayout4: TULayout;
FCurrentLayout: Integer;
FOnSwitch: TNotifyEvent;
procedure ApplyLayout(APanel, BPanel: TPanel; const LayoutIndex: Integer);
protected
procedure Resize; override;
public
constructor Create(aOwner: TComponent); override;
destructor Destroy; override;
published
property PanelA: TPanel read FPanelA write FPanelA;
property PanelB: TPanel read FPanelB write FPanelB;
property MinWidth: Integer read FMinWidth write FMinWidth default 650;
property MaxWidth: Integer read FMaxWidth write FMaxWidth default 1000;
property MaxHeight: Integer read FMaxHeight write FMaxHeight default 700;
property Layout1: TULayout read FLayout1 write FLayout1;
property Layout2: TULayout read FLayout2 write FLayout2;
property Layout3: TULayout read FLayout3 write FLayout3;
property Layout4: TULayout read FLayout4 write FLayout4;
property CurrentLayout: Integer read FCurrentLayout;
property OnSwitch: TNotifyEvent read FOnSwitch write FOnSwitch;
end;
implementation
{ TTURepositionLayout }
constructor TURepositionLayout.Create(aOwner: TComponent);
begin
inherited Create(aOwner);
BevelOuter := bvNone;
Color := $E6E6E6;
ShowCaption := false;
FMinWidth := 650;
FMaxWidth := 1000;
FMaxHeight := 700;
FLayout1 := TULayout.Create;
FLayout2 := TULayout.Create;
FLayout3 := TULayout.Create;
FLayout4 := TULayout.Create;
FLayout1.AAlign := alClient;
FLayout1.BAlign := alBottom;
FLayout1.BHeight := 250;
FLayout2.AAlign := alClient;
FLayout2.BAlign := alRight;
FLayout2.BWidth := 300;
FLayout3.AAlign := alLeft;
FLayout3.AWidth := 900;
FLayout3.BAlign := alRight;
FLayout3.BWidth := 300;
FLayout4.AAlign := alTop;
FLayout4.AHeight := 550;
FLayout4.BAlign := alTop;
FLayout4.BHeight := 200;
FCurrentLayout := 0;
end;
destructor TURepositionLayout.Destroy;
begin
inherited;
FLayout1.Free;
FLayout2.Free;
FLayout3.Free;
FLayout4.Free;
end;
procedure TURepositionLayout.Resize;
begin
inherited;
if Width < MinWidth then
begin
if Height < MaxHeight then
ApplyLayout(PanelA, PanelB, 1)
else
ApplyLayout(PanelA, PanelB, 4);
end
else if Width < MaxWidth then
ApplyLayout(PanelA, PanelB, 2)
else
ApplyLayout(PanelA, PanelB, 3);
end;
procedure TURepositionLayout.ApplyLayout(APanel, BPanel: TPanel; const LayoutIndex: Integer);
var
Layout: TULayout;
begin
case LayoutIndex of
1: Layout := Layout1;
2: Layout := Layout2;
3: Layout := Layout3;
4: Layout := Layout4;
else
exit;
end;
if APanel <> nil then
begin
APanel.Align := Layout.AAlign;
APanel.Width := Layout.AWidth;
APanel.Height := Layout.AHeight;
end;
if BPanel <> nil then
begin
BPanel.Align := Layout.BAlign;
BPanel.Width := Layout.BWidth;
BPanel.Height := Layout.BHeight;
end;
FCurrentLayout := LayoutIndex;
if Assigned(FOnSwitch) then
FOnSwitch(Self);
end;
end.
|
unit LLVM.Imports.BitReader;
interface
//based on BitReader.h
uses
LLVM.Imports,
LLVM.Imports.Types;
//LLVMParseBitcode is deprecated, therefore we implement only LLVMParseBitcode2, but as LLVMParseBitcode
function LLVMParseBitcode(MemBuf: TLLVMMemoryBufferRef; out OutModule: TLLVMModuleRef; var OutMessage: PLLVMChar): TLLVMBool; cdecl; external CLLVMLibrary;
//* Builds a module from the bitcode in the specified memory buffer, returning a reference to the module via the OutModule parameter. Returns 0 on success. */
function LLVMParseBitcode2(MemBuf: TLLVMMemoryBufferRef; out OutModule: TLLVMModuleRef): TLLVMBool; cdecl; external CLLVMLibrary;
//LLVMParseBitcodeInContext is deprecated, therefore we implement only LLVMParseBitcodeInContext2, but as LLVMParseBitcodeInContext
function LLVMParseBitcodeInContext(ContextRef: TLLVMContextRef; MemBuf: TLLVMMemoryBufferRef; out OutModule: TLLVMModuleRef;OutMessage: PLLVMChar): TLLVMBool; cdecl; external CLLVMLibrary;
// but as LLVMParseBitcodeInContext
function LLVMParseBitcodeInContext2(ContextRef: TLLVMContextRef; MemBuf: TLLVMMemoryBufferRef; out OutModule: TLLVMModuleRef): TLLVMBool; cdecl; external CLLVMLibrary;
//same as with the other functions above, deprecated stuff etc
function LLVMGetBitcodeModuleInContext(ContextRef: TLLVMContextRef; MemBuf: TLLVMMemoryBufferRef; out OutM: TLLVMModuleRef;var OutMessage: PLLVMChar): TLLVMBool; cdecl; external CLLVMLibrary;
//** Reads a module from the specified path, returning via the OutMP parameter a module provider which performs lazy deserialization. Returns 0 on success. */
function LLVMGetBitcodeModuleInContext2(ContextRef: TLLVMContextRef; MemBuf: TLLVMMemoryBufferRef; out OutM: TLLVMModuleRef): TLLVMBool; cdecl; external CLLVMLibrary;
//yada yada deprecated
function LLVMGetBitcodeModule (MemBuf: TLLVMMemoryBufferRef; out OutM: TLLVMModuleRef; var OutMessage: PLLVMChar): TLLVMBool; cdecl; external CLLVMLibrary;
function LLVMGetBitcodeModule2(MemBuf: TLLVMMemoryBufferRef; out OutM: TLLVMModuleRef): TLLVMBool; cdecl; external CLLVMLibrary;
implementation
end.
|
unit ufrmSysUserMacAddressException;
interface
{$I ThsERP.inc}
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, ComCtrls, StrUtils, Vcl.Menus,
Vcl.AppEvnts,
Ths.Erp.Helper.Edit, Ths.Erp.Helper.ComboBox, Ths.Erp.Helper.Memo,
ufrmBase, ufrmBaseInputDB,
Ths.Erp.Database.Table.SysUser, Vcl.Samples.Spin;
type
TfrmSysUserMacAddressException = class(TfrmBaseInputDB)
cbbUserName: TComboBox;
edtIpAddress: TEdit;
lblIpAddress: TLabel;
lblUserName: TLabel;
private
public
vUser: TSysUser;
protected
published
procedure btnAcceptClick(Sender: TObject); override;
procedure FormCreate(Sender: TObject); override;
procedure FormDestroy(Sender: TObject); override;
procedure RefreshData; override;
end;
implementation
uses
Ths.Erp.Database.Singleton,
Ths.Erp.Database.Table.SysUserMacAddressException;
{$R *.dfm}
procedure TfrmSysUserMacAddressException.FormCreate(Sender: TObject);
var
n1: Integer;
begin
TSysUserMacAddressException(Table).UserName.SetControlProperty(Table.TableName, cbbUserName);
TSysUserMacAddressException(Table).IpAddress.SetControlProperty(Table.TableName, edtIpAddress);
inherited;
cbbUserName.Clear;
vUser := TSysUser.Create(TSingletonDB.GetInstance.DataBase);
try
vUser.SelectToList('', False, False);
for n1 := 0 to vUser.List.Count-1 do
cbbUserName.Items.Add(FormatedVariantVal(TSysUser(vUser.List[n1]).UserName.FieldType, TSysUser(vUser.List[n1]).UserName.Value));
finally
vUser.Free;
end;
end;
procedure TfrmSysUserMacAddressException.FormDestroy(Sender: TObject);
begin
inherited;
end;
procedure TfrmSysUserMacAddressException.RefreshData();
begin
//control içeriğini table class ile doldur
cbbUserName.Text := FormatedVariantVal(TSysUserMacAddressException(Table).UserName.FieldType, TSysUserMacAddressException(Table).UserName.Value);
edtIpAddress.Text := FormatedVariantVal(TSysUserMacAddressException(Table).IpAddress.FieldType, TSysUserMacAddressException(Table).IpAddress.Value);
end;
procedure TfrmSysUserMacAddressException.btnAcceptClick(Sender: TObject);
begin
if (FormMode = ifmNewRecord) or (FormMode = ifmCopyNewRecord) or (FormMode = ifmUpdate) then
begin
if (ValidateInput) then
begin
TSysUserMacAddressException(Table).UserName.Value := cbbUserName.Text;
TSysUserMacAddressException(Table).IpAddress.Value := edtIpAddress.Text;
inherited;
end;
end
else
inherited;
end;
end.
|
{*******************************************************}
{ }
{ Delphi Visual Component Library }
{ }
{ Copyright(c) 1995-2011 Embarcadero Technologies, Inc. }
{ }
{*******************************************************}
unit SiteConst;
interface
resourcestring
// Adapter errors
sFieldRequiresAValue = 'Field %s requires a value';
sFieldDoesNotAllowMultipleValues = '%s does not allow multiple values';
sFieldDoesNotAllowMultipleFiles = '%s does not allow multiple files';
sFieldRequiresAFile = '%s requires a file';
sFieldModificationNotPermitted = 'Modification of %s is not permitted';
sActionExecutionNotPermitted = 'Execution of action %s is not permitted';
sFieldViewNotPermitted = 'Field view not permitted';
sAdapterModificationNotPermitted = 'Data Modification is not permitted';
sFileUploadNotSupported = '%s does not support file upload';
sNoLoginPage = 'Login page is not defined';
sPageNotFound = 'Web Page not found: %s';
sPageContentNotProvided = 'Web Page does not provide content';
sImageNotProvided = 'Field %s did not provide an image';
// DataSetAdapter errors
sUnknownAdapterMode = 'Unknown Adapter mode: %s';
sNilAdapterDataSet = 'DataSet is nil';
sAdapterRowNotFound = 'Row not found in %s';
sFieldChangedByAnotherUser = 'Field %s changed by another user';
sAdapterFieldNotFound = 'Field not found: %s';
sDataSetPropertyIsNil = '%s: DataSet property is nil';
sDataSetUnknownKeyFields = '%0:s: Dataset %1:s unknown keyfields';
sDataSetNotActive = '%0:s: Dataset %1:s not active';
sValueFieldIsBlank = '%0:s: ValueField property value is blank';
// XSLPageProducer errors
SNoXMLData = 'Missing XML Data Component';
SNoXMLDocument = 'Could not create XMLDocument';
// Add Adapter Fields Editor
sAddAdapterData = 'Add Fields...';
sAddAllAdapterData = 'Add All Fields';
sAddAdapterDataDlgCaption = 'Add Fields';
sAddAdapterActions = 'Add Actions...';
sAddAllAdapterActions = 'Add All Actions';
sAddAdapterActionsDlgCaption = 'Add Actions';
sAdapterActionsPrefix = 'Action'; // Do not location
sAddCommands = 'Add Commands...';
sAddAllCommands = 'Add All Commands';
sAddCommandsDlgCaption = 'Add Commands';
sAddColumns = 'Add Columns...';
sAddAllColumns = 'Add All Columns';
sAddColumnsDlgCaption = 'Add Columns';
sAddFieldItems = 'Add Fields...';
sAddAllFieldItems = 'Add All Fields';
sAddFieldItemsDlgCaption = 'Add Fields';
// SitePageProducer errors
sAdapterPropertyIsNil = '%s: Adapter property is nil';
sAdapterFieldNameIsBlank = '%s: Fieldname is blank';
sCantFindAdapterField = '%0:s: Field %1:s not found in associated Adapter'; // 0 - Component name, 1 - Adapter Field name
sAdapterActionNameIsBlank = '%s: Action name is blank';
sCantFindAdapterAction = '%0:s: Action %1:s not found in associated Adapter'; // 0 - Component name, 1 - Adapter Action name
sDisplayComponentPropertyIsNil = '%s: DisplayComponent property is nil';
sNoHandler = 'No request handlers handled this request. ' +
'The WebAppComponents PageDispatcher, AdapterDispatcher or DispatchActions property may not be set.';
// LoginAdapter validation
sBlankPassword = 'Password must not be blank';
sBlankUserName = 'Username must not be blank';
// Dispatcher errors
sAdapterRequestNotHandled = 'Adapter Request not handled: %0:s, %1:s'; // 0 - Request identifier, 1 - object identifier
sDispatchBlankPageName = 'Dispatching blank page name';
sPageAccessDenied = 'Page access denied';
sPageDoesNotSupportRedirect = 'Web Page does not support redirect';
// Include errors
sCantFindIncludePage = 'Can''t find included page: %s';
sInclusionNotSupported = 'Page %s does not support inclusion';
sRecursiveIncludeFile = 'Include file %s includes itself';
// DB Image errors
sIncorrectImageFormat = 'Incorrect image format (%0:s) for field %1:s';
sFileExpected = 'Uploaded file expected for field %s';
// WebUserList names - must be valid identifiers
sWebUserName = 'UserName';
sWebUserPassword = 'Password';
sWebUserAccessRights = 'AccessRights';
// WebUserList errors
sUserIDNotFound = 'UserID not found';
sInvalidPassword = 'Invalid password';
sMissingPassword = 'Missing password';
sUnknownUserName = 'Unknown user name';
sMissingUserName = 'Missing user name';
// Script errors
sCannotCreateScriptEngine = 'Cannot create script engine: %s. Error: %x';
sCannotInitializeScriptEngine = 'Cannot initialize script engine';
sScriptEngineNotFound = 'Script engine not found: %s.';
sObjectParameterExpected = 'Script Object expected';
sIntegerParameterExpected = 'Integer parameter expected';
sUnexpectedParameterType = 'Unexpected parameter type';
sUnexpectedResultType = 'Unexpected return type';
sDuplicatePrototypeName = 'Duplication prototype name';
sBooleanParameterExpected = 'Boolean parameter expected';
sDoubleParameterExpected = 'Double parameter expected';
sUnexpectedScriptError = 'Unexpected script error';
// 0 - Error index number
// 1 - Error description
// 2 - Line number
// 3 - character position number
// 4 - source line text
sScriptErrorTemplate =
'<table width="95%%" border="1" cellspacing="0" bordercolor="#C0C0C0">' + SLineBreak +
'<tr>' + SLineBreak +
'<td colspan=2>' + SLineBreak +
'<font color="#727272"><b>Error[' + '%0:d' + ']:</b> ' + SLineBreak +
'%1:s' + SLineBreak +
'</font>' + SLineBreak +
'</td>' + SLineBreak +
'</tr>' + SLineBreak +
'<tr>' + SLineBreak +
'<td>' + SLineBreak +
'<font color="#727272"><b>Line:</b> ' + SLineBreak +
'%2:d' + SLineBreak +
'</font>' + SLineBreak +
'</td>' + SLineBreak +
'<td>' + SLineBreak +
'<font color="#727272"><b>Position:</b> ' + SLineBreak +
'%3:d' + SLineBreak +
'</font>' + SLineBreak +
'</td>' + SLineBreak +
'</tr>' + SLineBreak +
(* Don't display source text
'<tr>' + SLineBreak +
'<td colspan=2>' + SLineBreak +
'<font color="#727272"><b>Source Text:</b> ' + SLineBreak +
'%4:s' + SLineBreak +
'</font>' + SLineBreak +
'</td>' + SLineBreak +
'</tr>' + SLineBreak +
*)
'</table>' + SLineBreak;
sMaximumSessionsExceeded = 'Maximum sessions exceeded';
sVariableNotFound = 'Variable not found: %s';
sComponentDoesNotSupportScripting = 'Component does not support scripting. Class: %0:s, Name: %1:s';
sClassDoesNotSupportScripting = 'Object does not support scripting. Class: %0:s';
sParameterExpected = 'Parameter expected';
sStringParameterExpected = 'String parameter expected';
sInvalidImageSize = 'Invalid image (the size is less than 4 bytes long).';
// File include errors
sIncDblQuoteError = 'File include error on line %d: expecting "';
sIncEqualsError = 'File include error on line %d: expecting =';
sIncTypeError = 'File include error on line %d: expecting virtual, file, or page, but found %s.';
sUnknownImageType = 'unknown';
// WebSnapObjs.pas scripting errors
sComponentNotFound = 'Component %s not found';
sCountFromComponentsNotSupported = 'Getting the Count of a TComponentsEnumerator object is not supported';
sInterfaceCompRefExpected = 'Component was expected to implement IInterfaceComponentReference for ValuesList support';
sErrorsObjectNeedsIntf = 'Errors object must support the interface IIterateIntfSupport';
sActionDoesNotProvideResponse = 'Action does not provide response';
sActionCantRespondToUnkownHTTPMethod = 'Action can''t respond to unknown HTTP method';
sActionCantRedirectToBlankURL = 'Action can''t redirect to blank URL';
implementation
end.
|
{$A+,B-,D+,E-,F-,G+,I+,L+,N+,O-,P-,Q-,R-,S-,T-,V+,X+,Y+}
{$M 1024,0,0}
{
by Behdad Esfahbod
Algorithmic Problems Book
April '2000
Problem 68 O(N2) Dynamic Method Nim Value Calc.
}
program
PebblesGame;
const
MaxN = 100;
type
Arr = array [0 .. 1, 0 .. MaxN] of Integer;
var
N, K, I, J, Fr : Integer;
Cnt : Arr;
T, My, You : Integer;
procedure ReadInput;
begin
Write('Enter N > ');
Readln(N);
if not Odd(N) then
begin
Writeln('N must be an odd number.');
Halt;
end;
Write('Enter K > ');
Readln(K);
end;
function Min (A, B : Integer) : Integer;
begin
if A <= B then Min := A else Min := B;
end;
procedure FillIn (N : Integer);
var I, J : Integer;
begin
Cnt[0,0] := 1;
Cnt[1,0] := 0;
for I := 1 to N do
begin
Cnt[0,I] := 0;
for J := Min(K,I) downto 1 do
begin
if Cnt[(N - I) mod 2,I - J] = 0 then
begin
Cnt[0,I] := J;
Break;
end;
end;
Cnt[1,I] := 0;
for J := Min(K,I) downto 1 do
begin
if Cnt[(N - I + 1) mod 2 ,I - J] = 0 then
begin
Cnt[1,I] := J;
Break;
end;
end;
end;
end;
procedure Play (Nn, Fr : Integer);
begin
My := 0;
You := 0;
while Nn > 0 do
begin
if NN <> N then Writeln('Number of remaining pebbles = ', Nn);
if Fr = 2 then
begin
Write('How many pebbles do you take? ');
Readln(T);
if (T > K) or (T > Nn) then begin Writeln('Error'); Halt; end;
Dec(Nn, T);
Inc(You, T);
end
else
begin
if Cnt[My mod 2,Nn] = 0 then T := Min(random(K) + 1,Nn)
else T := Cnt[My mod 2,Nn];
Writeln('I take ', T, ' pebbles,');
Inc(My, T);
Dec(Nn, T);
end;
Fr := 3 - Fr;
end;
end;
procedure Solve;
begin
FillIn(N);
if Cnt[0,N] = 0 then T := 2 else T := 1;
case T of
1 : Writeln('The first player has a winning strategy.');
2 : Writeln('The second player has a winning strategy.');
end;
Play(N,T);
Writeln('Total number of your pebbles = ', You);
Writeln('Total number of my pebbles = ', My);
Writeln('I won!');
end;
begin
ReadInput;
Solve;
end.
|
unit ClassOCR;
interface
uses Controls, Windows, Graphics, Classes;
type PSec = ^TSec;
TSec = TRect;
TOcr = class
private
Secs : TList;
procedure FreeSecs;
procedure FindSections( Bmp : TBitmap );
function FindSection( Bmp : TBitmap; X , Y : integer ) : TSec;
function SecToChar( Bmp : TBitmap; Sec : PSec ) : char;
public
procedure Recognize( Bmp : TBitmap; Str : TStrings );
constructor Create( ImageList : TImageList );
destructor Destroy; override;
end;
var Ocr : TOcr;
implementation
uses ClassChars;
//==============================================================================
//==============================================================================
//
// Constructor
//
//==============================================================================
//==============================================================================
constructor TOcr.Create( ImageList : TImageList );
begin
inherited Create;
Chars := TChars.Create( ImageList );
Secs := TList.Create;
end;
//==============================================================================
//==============================================================================
//
// Destructor
//
//==============================================================================
//==============================================================================
procedure TOcr.FreeSecs;
var I : integer;
begin
for I := 0 to Secs.Count-1 do
Dispose( PSec( Secs[I] ) );
Secs.Clear;
end;
destructor TOcr.Destroy;
begin
FreeSecs;
Secs.Free;
Chars.Free;
inherited;
end;
//==============================================================================
//==============================================================================
//
// O C R
//
//==============================================================================
//==============================================================================
function TOcr.FindSection( Bmp : TBitmap; X , Y : integer ) : TSec;
procedure FloodFill( I , J : integer );
begin
Bmp.Canvas.Pixels[I,J] := clWhite;
if I < Result.Left then Result.Left := I;
if I > Result.Right then Result.Right := I;
if J < Result.Top then Result.Top := J;
if J > Result.Bottom then Result.Bottom := J;
// Doprava
if (I < Bmp.Width-1) then
if (Bmp.Canvas.Pixels[I+1,J] = clChar) then
FloodFill( I+1 , J );
// Dolava
if (I > 0) then
if (Bmp.Canvas.Pixels[I-1,J] = clChar) then
FloodFill( I-1 , J );
// Dole
if (J < Bmp.Height-1) then
if (Bmp.Canvas.Pixels[I,J+1] = clChar) then
FloodFill( I , J+1 );
// Hore
if (J > 0) then
if (Bmp.Canvas.Pixels[I,J-1] = clChar) then
FloodFill( I , J-1 );
// Doprava hore
if (I < Bmp.Width-1) and
(J > 0) then
if (Bmp.Canvas.Pixels[I+1,J-1] = clChar) then
FloodFill( I+1 , J-1 );
// Doprava dole
if (I < Bmp.Width-1) and
(J < Bmp.Height-1) then
if (Bmp.Canvas.Pixels[I+1,J+1] = clChar) then
FloodFill( I+1 , J+1 );
// Dolava dole
if (I > 0) and
(J < Bmp.Height-1) then
if (Bmp.Canvas.Pixels[I-1,J+1] = clChar) then
FloodFill( I-1 , J+1 );
// Dolava hore
if (I > 0) and
(J > 0) then
if (Bmp.Canvas.Pixels[I-1,J-1] = clChar) then
FloodFill( I-1 , J-1 );
end;
begin
with Result do
begin
Left := X;
Top := Y;
Right := X;
Bottom := Y;
end;
FloodFill( X , Y );
end;
procedure TOcr.FindSections( Bmp : TBitmap );
var I, J : integer;
PNewSec : PSec;
begin
FreeSecs;
for J := 0 to Bmp.Height-1 do
for I := 0 to Bmp.Width-1 do
if Bmp.Canvas.Pixels[I,J] = clChar then
begin
New( PNewSec );
Secs.Add( PNewSec );
PNewSec^ := FindSection( Bmp , I , J );
end;
end;
function TOcr.SecToChar( Bmp : TBitmap; Sec : PSec ) : char;
var I : integer;
function IsEqual( Data : TData ) : boolean;
var I, J : integer;
begin
Result := True;
for I := 0 to Data.BMP.Width-1 do
for J := 0 to Data.BMP.Height-1 do
if ((Data.BMP.Canvas.Pixels[I,J] = clChar) and
(Bmp.Canvas.Pixels[Sec^.Left+I,Sec^.Top+J] <> clChar)) or
((Data.BMP.Canvas.Pixels[I,J] <> clChar) and
(Bmp.Canvas.Pixels[Sec^.Left+I,Sec^.Top+J] = clChar)) then
begin
Result := False;
exit;
end;
end;
begin
Result := #0;
for I := 0 to Chars.Data.Count-1 do
if ((Sec^.Right - Sec^.Left)+1 = TData(Chars.Data[I]^).BMP.Width) and
((Sec^.Bottom - Sec^.Top)+1 = TData(Chars.Data[I]^).BMP.Height) then
if IsEqual( TData(Chars.Data[I]^) ) then
begin
Result := TData(Chars.Data[I]^).Value;
exit;
end;
end;
//==============================================================================
//==============================================================================
//
// I N T E R F A C E
//
//==============================================================================
//==============================================================================
procedure TOcr.Recognize( Bmp : TBitmap; Str : TStrings );
var I : integer;
C : char;
Zaloha : TBitmap;
S : string;
begin
if Bmp = nil then exit;
Str.Clear;
Zaloha := TBitmap.Create;
try
Zaloha.Assign( Bmp );
FindSections( Bmp );
Bmp.Assign( Zaloha );
finally
Zaloha.Free;
end;
S := '';
for I := 0 to Secs.Count-1 do
begin
C := SecToChar( Bmp , Secs[I] );
if C <> #0 then
if I = 0 then S := C
else
begin
if ((TSec( Secs[I]^ ).Top - TSec( Secs[I-1]^ ).Bottom) - 1) > 5 then
begin
if S <> '' then Str.Add( S );
S := '';
end;
if ((TSec( Secs[I]^ ).Left - TSec( Secs[I-1]^ ).Right) - 1) > 3 then
S := S+' '+C
else
S := S+C;
end;
end;
if S <> '' then Str.Add( S );
end;
end.
|
unit versioninfo;
{$mode objfpc}
interface
uses
Classes, SysUtils, resource, versiontypes, versionresource;
type
{ TVersionInfo }
TVersionInfo = class
private
FVersResource: TVersionResource;
function GetFixedInfo: TVersionFixedInfo;
function GetStringFileInfo: TVersionStringFileInfo;
function GetVarFileInfo: TVersionVarFileInfo;
public
constructor Create;
destructor Destroy; override;
procedure Load(Instance: THandle);
property FixedInfo: TVersionFixedInfo read GetFixedInfo;
property StringFileInfo: TVersionStringFileInfo read GetStringFileInfo;
property VarFileInfo: TVersionVarFileInfo read GetVarFileInfo;
end;
implementation
{ TVersionInfo }
function TVersionInfo.GetFixedInfo: TVersionFixedInfo;
begin
Result := FVersResource.FixedInfo;
end;
function TVersionInfo.GetStringFileInfo: TVersionStringFileInfo;
begin
Result := FVersResource.StringFileInfo;
end;
function TVersionInfo.GetVarFileInfo: TVersionVarFileInfo;
begin
Result := FVersResource.VarFileInfo;
end;
constructor TVersionInfo.Create;
begin
inherited Create;
FVersResource := TVersionResource.Create;
end;
destructor TVersionInfo.Destroy;
begin
FVersResource.Free;
inherited Destroy;
end;
procedure TVersionInfo.Load(Instance: THandle);
var
Stream: TResourceStream;
begin
Stream := TResourceStream.CreateFromID(Instance, 1, PChar(RT_VERSION));
try
FVersResource.SetCustomRawDataStream(Stream);
// access some property to load from the stream
FVersResource.FixedInfo;
// clear the stream
FVersResource.SetCustomRawDataStream(nil);
finally
Stream.Free;
end;
end;
end.
|
{-------------------------------------------------------------------------------
// EasyComponents For Delphi 7
// 一轩软研第三方开发包
// @Copyright 2010 hehf
// ------------------------------------
//
// 本开发包是公司内部使用,作为开发工具使用任何,何海锋个人负责开发,任何
// 人不得外泄,否则后果自负.
//
// 使用权限以及相关解释请联系何海锋
//
//
// 网站地址:http://www.YiXuan-SoftWare.com
// 电子邮件:hehaifeng1984@126.com
// YiXuan-SoftWare@hotmail.com
// QQ :383530895
// MSN :YiXuan-SoftWare@hotmail.com
//------------------------------------------------------------------------------
//单元说明:
//
//主要实现:
//
//-----------------------------------------------------------------------------}
unit untEasyUtilStream;
interface
uses
Windows, SysUtils, Classes;
type
{ TEasyEncryptStream }
TEasyEncryptStream = class (TStream)
{* 加密的 TStream 抽象基类,支持数据读写时进行加密处理。}
private
FStream: TStream;
FOwned: Boolean;
protected
procedure DeEncrypt(var Buffer; Count: Longint); virtual; abstract;
{* 解密方法,抽象方法。}
procedure Encrypt(var Buffer; Count: Longint); virtual; abstract;
{* 加密方法,抽象方法。}
procedure DoBeforeEncrypt(const Buffer; Count: Longint); virtual; abstract;
procedure DoAfterEncrypt(const Buffer; Count: Longint); virtual; abstract;
procedure DoBeforeDeEncrypt(const Buffer; Count: Longint); virtual; abstract;
procedure DoAfterDeEncrypt(const Buffer; Count: Longint); virtual; abstract;
function GetSize: Int64; override;
procedure SetSize(NewSize: Longint); override;
procedure SetSize(const NewSize: Int64); overload; override;
property Owned: Boolean read FOwned;
property Stream: TStream read FStream;
public
constructor Create(AStream: TStream; AOwned: Boolean = False);
{* 类构造器,AStream 参数为需要进行加密处理的流,AOwned 表示是否
在释放加密流时同时释放 AStream。}
destructor Destroy; override;
function Read(var Buffer; Count: Longint): LongInt; override;
function Seek(Offset: Longint; Origin: Word): LongInt; override;
function Write(const Buffer; Count: Longint): LongInt; override;
end;
{ TEasyXorStream }
TEasyXorStream = class (TEasyEncryptStream)
{* Xor 加密的 TStream 类,支持数据读写时进行 Xor 加密处理。}
private
FXorStr: AnsiString;
FSeedPos: Integer;
protected
procedure DeEncrypt(var Buffer; Count: Longint); override;
procedure Encrypt(var Buffer; Count: Longint); override;
procedure DoBeforeEncrypt(const Buffer; Count: Longint); override;
procedure DoAfterEncrypt(const Buffer; Count: Longint); override;
procedure DoBeforeDeEncrypt(const Buffer; Count: Longint); override;
procedure DoAfterDeEncrypt(const Buffer; Count: Longint); override;
public
constructor Create(AStream: TStream; const AXorStr: AnsiString;
AOwned: Boolean = False);
{* 类构造器
|<PRE>
AStream: TStream - 需要进行加密处理的流
AXorStr: string - 用于加密处理的字符串
AOwned: Boolean - 是否在释放加密流时同时释放 AStream
|</PRE>}
property XorStr: AnsiString read FXorStr write FXorStr;
{* 用于加密处理的字符串 }
end;
function EasyFastMemoryStreamCopyFrom(Dest, Source: TStream; Count: Int64): Int64;
{* 快速的 MemoryStream 的 CopyFrom 方法,用于 Dest 或 Source 之一是 MemoryStream
的情况,直接读写内存,避免了分配缓冲区和重复读写的开销。如传入的俩 Stream 都
不是 TCustomMemoryStream,则调用原 CopyFrom 方法。}
implementation
function EasyFastMemoryStreamCopyFrom(Dest, Source: TStream; Count: Int64): Int64;
var
aNewSize: Longint;
begin
if Count = 0 then
begin
Source.Position := 0;
Count := Source.Size;
end;
Result := Count;
//注意此方法能工作的首要条件是Dest, Source两者之一是TCustomMemoryStream,否则调用原函数
//判断Dest或Source是不是TCustomMemoryStream,如果是的话,直接从Memory的地址上进行操作 ,
//因为CustomMemoryStream 的read或writer都用到System.move
//这样省去了原TStream不停地创建和写buffer 及设置Capacity ,原copyfrom这里最浪费时间
//用此方法可直接将Source的内存块追加到Dest的Memory地址的后面
if Source is TCustomMemoryStream then //直接写入到Dest的地址内
Dest.WriteBuffer(Pointer(Longint(TCustomMemoryStream(Source).Memory) + Source.Position)^,Count)
else if Dest is TCustomMemoryStream then
begin
aNewSize := Dest.Position + Count;
TCustomMemoryStream(Dest).Size := aNewSize; //先设置内存的大小,将Dest.Memory扩大,不然下面找不到地址
//source直接从Dest.memory后面写
Source.ReadBuffer(Pointer(Longint(TCustomMemoryStream(Dest).Memory) + Dest.Position)^, Count);
end
else
begin
Dest.CopyFrom(Source, Count);
end;
end;
{ TEasyEncryptStream }
constructor TEasyEncryptStream.Create(AStream: TStream; AOwned: Boolean);
begin
inherited Create;
Assert(Assigned(AStream));
FStream := AStream;
FOwned := AOwned;
end;
destructor TEasyEncryptStream.Destroy;
begin
if FOwned then
FreeAndNil(FStream);
inherited;
end;
function TEasyEncryptStream.GetSize: Int64;
begin
Result := FStream.Size;
end;
function TEasyEncryptStream.Read(var Buffer; Count: Integer): LongInt;
begin
Result := FStream.Read(Buffer, Count);
DoBeforeDeEncrypt(Buffer, Count);
DeEncrypt(Buffer, Count);
DoAfterDeEncrypt(Buffer, Count);
end;
function TEasyEncryptStream.Seek(Offset: Integer; Origin: Word): LongInt;
begin
Result := FStream.Seek(Offset, Origin);
end;
procedure TEasyEncryptStream.SetSize(NewSize: Integer);
begin
FStream.Size := NewSize;
end;
procedure TEasyEncryptStream.SetSize(const NewSize: Int64);
begin
FStream.Size := NewSize;
end;
function TEasyEncryptStream.Write(const Buffer; Count: Integer): LongInt;
var
MemBuff: Pointer;
begin
GetMem(MemBuff, Count);
try
DoBeforeEncrypt(Buffer, Count);
CopyMemory(MemBuff, @Buffer, Count);
Encrypt(MemBuff^, Count);
DoAfterEncrypt(Buffer, Count);
Result := FStream.Write(MemBuff^, Count);
finally
FreeMem(MemBuff);
end;
end;
{ TEasyXorStream }
constructor TEasyXorStream.Create(AStream: TStream;
const AXorStr: AnsiString; AOwned: Boolean);
begin
inherited Create(AStream, AOwned);
FXorStr := AXorStr;
end;
procedure TEasyXorStream.DeEncrypt(var Buffer; Count: Integer);
begin
Encrypt(Buffer, Count);
end;
procedure TEasyXorStream.DoAfterDeEncrypt(const Buffer; Count: Integer);
begin
// inherited;
end;
procedure TEasyXorStream.DoAfterEncrypt(const Buffer; Count: Integer);
begin
// inherited;
end;
procedure TEasyXorStream.DoBeforeDeEncrypt(const Buffer; Count: Integer);
begin
// 读写前后需要记录位置,和流中的xor加密的种子字符位置对的上号
FSeedPos := Position - Count;
end;
procedure TEasyXorStream.DoBeforeEncrypt(const Buffer; Count: Integer);
begin
// 读写前后需要记录位置,和流中的xor加密的种子字符位置对的上号
FSeedPos := Position;
end;
procedure TEasyXorStream.Encrypt(var Buffer; Count: Integer);
var
i, p, l: Integer;
begin
l := Length(FXorStr);
if l > 0 then
begin
p := FSeedPos;
for i := 0 to Count - 1 do
PByteArray(@Buffer)^[i] := PByteArray(@Buffer)^[i] xor
Byte(FXorStr[(p + i) mod l + 1]);
end;
end;
end.
|
unit SearchFamilyCategoriesQry;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, BaseQuery, FireDAC.Stan.Intf,
FireDAC.Stan.Option, FireDAC.Stan.Param, FireDAC.Stan.Error, FireDAC.DatS,
FireDAC.Phys.Intf, FireDAC.DApt.Intf, FireDAC.Stan.Async, FireDAC.DApt,
Data.DB, FireDAC.Comp.DataSet, FireDAC.Comp.Client, Vcl.StdCtrls, DSWrap;
type
TSearchFamilyCategoriesW = class(TDSWrap)
private
FID: TFieldWrap;
FParentProductID: TFieldWrap;
FCategory: TFieldWrap;
FExternalID: TFieldWrap;
FProductCategoryID: TFieldWrap;
FValue: TFieldWrap;
public
constructor Create(AOwner: TComponent); override;
property ID: TFieldWrap read FID;
property ParentProductID: TFieldWrap read FParentProductID;
property Category: TFieldWrap read FCategory;
property ExternalID: TFieldWrap read FExternalID;
property ProductCategoryID: TFieldWrap read FProductCategoryID;
property Value: TFieldWrap read FValue;
end;
TQrySearchFamilyCategories = class(TQueryBase)
private
FW: TSearchFamilyCategoriesW;
{ Private declarations }
public
constructor Create(AOwner: TComponent); override;
function SearchFamily(const AFamilyName: string): Integer;
property W: TSearchFamilyCategoriesW read FW;
{ Public declarations }
end;
implementation
uses
StrHelper;
constructor TSearchFamilyCategoriesW.Create(AOwner: TComponent);
begin
inherited;
FID := TFieldWrap.Create(Self, 'p.ID', '', True);
FParentProductID := TFieldWrap.Create(Self, 'p.ParentProductID');
FValue := TFieldWrap.Create(Self, 'p.Value');
FProductCategoryID := TFieldWrap.Create(Self, 'ppc.ProductCategoryID');
FCategory := TFieldWrap.Create(Self, 'Category');
FExternalID := TFieldWrap.Create(Self, 'pp.ExternalId');
end;
constructor TQrySearchFamilyCategories.Create(AOwner: TComponent);
begin
inherited;
FW := TSearchFamilyCategoriesW.Create(FDQuery);
end;
function TQrySearchFamilyCategories.SearchFamily(const AFamilyName : string):
Integer;
var
ANewSQL: string;
begin
Assert(not AFamilyName.IsEmpty);
// ƒелаем замену в первоначальном SQL запросе
ANewSQL := ReplaceInSQL(SQL, Format('%s is null',
[W.ParentProductID.FullName]), 0);
FDQuery.SQL.Text := ReplaceInSQL(ANewSQL, Format('upper(%s) = upper(:%s)',
[W.Value.FullName, W.Value.FieldName]), 1);
SetParamType(W.Value.FieldName, ptInput, ftWideString);
// »щем
Result := Search([W.Value.FieldName], [AFamilyName]);
end;
{$R *.dfm}
end.
|
{*******************************************************}
{ }
{ Delphi DataSnap Framework }
{ }
{ Copyright(c) 2011 Embarcadero Technologies, Inc. }
{ }
{*******************************************************}
// Manage list of project features
unit DSServerFeatureManager;
interface
uses
SysUtils, Classes, DSServerFeatures, WizardAPI, ExpertsUIWizard, DSServerDsnResStrs;
type
TFeatureDescription = record
public
Group: TDSServerFeature;
Feature: TDSServerFeature;
Name: string;
Description: string;
WizardTypes: TDSWizardTypes;
constructor Create(AGroup: TDSServerFeature; AFeature: TDSServerFeature;
const AName: string; const ADescription: string;
const AWizardTypes: TDSWizardTypes);
end;
// (Feature: dsFilters; Name: sFiltersFeatureName; Description: sFiltersFeatureDescription),
// (Feature: dsEncryptionFilters; Name: sEncryptionFeatureName; Description: sEncryptionFeatureDescription),
// (Feature: dsCompressionFilter; Name: sCompressionFeatureName; Description: sCompressionFeatureDescription)
procedure AddFeature(AFeaturesPage: TCustomExpertsFeaturesWizardPage; AFeatureDescription: TFeatureDescription);
procedure EnumFeatures(AFeatureDescriptions: TArray<TFeatureDescription>; AFilter: TFunc<TFeatureDescription, Boolean>; AEnum: TProc<TFeatureDescription>);
procedure EnumApplicationFeatures(AFeatureDescriptions: TArray<TFeatureDescription>; AType: TDSWizardType; AEnum: TProc<TFeatureDescription>);
procedure CheckFeature(AFeaturesPage: TCustomExpertsFeaturesWizardPage; AFeature: TDSServerFeature; AChecked: Boolean);
procedure CheckFeatures(AFeatureDescriptions: TArray<TFeatureDescription>; AFeaturesPage: TCustomExpertsFeaturesWizardPage; AType: TDSWizardType; AFeatures: TDSServerFeatures);
procedure AddFeatures(AFeatureDescriptions: TArray<TFeatureDescription>; AFeaturesPage: TCustomExpertsFeaturesWizardPage; AType: TDSWizardType);
procedure UpdateFeatures(AFeatureDescriptions: TArray<TFeatureDescription>; AFeaturesPage: TCustomExpertsFeaturesWizardPage; AType: TDSWizardType;
var AFeatures: TDSServerFeatures);
function DefaultFeatureDescriptions: TArray<TFeatureDescription>;
implementation
uses Generics.Collections;
// Standalone DataSnap server features
const GDefaultFeatureDescriptions: array[0..14] of TFeatureDescription =
((Group: dsProtocols; Feature: dsNull; Name: sProtocolFeatureName; Description: sProtocolFeatureDescription; WizardTypes: [wtStandAlone]),
(Group: dsProtocols; Feature: dsTCPProtocol; Name: sTCPProtocolFeatureName; Description: sTCPProtocolFeatureDescription; WizardTypes: [wtStandAlone]),
(Group: dsProtocols; Feature: dsHTTPProtocol; Name: sHTTPProtocolFeatureName; Description: sHTTPProtocolFeatureDescription; WizardTypes: [wtStandAlone]),
(Group: dsProtocols; Feature: dsHTTPSProtocol; Name: sHTTPSProtocolFeatureName; Description: sHTTPSProtocolFeatureDescription; WizardTypes: [wtStandAlone]),
(Group: dsNull; Feature: dsAuthentication; Name: sAuthenticationFeatureName; Description: sAuthenticationFeatureDescription; WizardTypes: [wtAll]),
(Group: dsAuthentication; Feature: dsAuthorization; Name: sAuthorizationFeatureName; Description: sAuthorizationFeatureDescription; WizardTypes: [wtAll]),
(Group: dsNull; Feature: dsServerMethodClass; Name: sServerMethodClassFeatureName; Description: sSampleMethodsFeatureDescription; WizardTypes: [wtAll]),
(Group: dsServerMethodClass; Feature: dsSampleMethods; Name: sSampleMethodsFeatureName; Description: sSampleMethodsFeatureDescription; WizardTypes: [wtAll]),
(Group: dsServerMethodClass; Feature: dsSampleWebFiles; Name: sSampleWebFilesFeatureName; Description: sSampleWebFilesFeatureDescription; WizardTypes: [wtWebBrokerRest]),
(Group: dsFilters; Feature: dsNull; Name: sFiltersFeatureName; Description: sFiltersFeatureDescription; WizardTypes: [wtStandAlone, wtWebBroker]),
(Group: dsFilters; Feature: dsEncryptionFilters; Name: sEncryptionFeatureName; Description: sEncryptionFeatureDescription; WizardTypes: [wtStandAlone, wtWebBroker]),
(Group: dsFilters; Feature: dsCompressionFilter; Name: sCompressionFeatureName; Description: sCompressionFeatureDescription; WizardTypes: [wtStandAlone, wtWebBroker]),
(Group: dsNull; Feature: dsWebFiles; Name: sWebFilesFeatureName; Description: sWebFilesFeatureDescription; WizardTypes: [wtStandAlone]),
(Group: dsNull; Feature: dsConnectors; Name: sConnectorsFeatureName; Description: sConnectorsFeatureDescription; WizardTypes: [wtAll]),
(Group: dsNull; Feature: dsServerModule; Name: sServerModuleFeatureName; Description: sServerModuleFeatureDescription; WizardTypes: [wtWebBroker, wtWebBrokerRest])
);
function DefaultFeatureDescriptions: TArray<TFeatureDescription>;
var
LList: TList<TFeatureDescription>;
LItem: TFeatureDescription;
begin
LList := TList<TFeatureDescription>.Create;
try
for LItem in GDefaultFeatureDescriptions do
LList.Add(LItem);
Result := LList.ToArray;
finally
LList.Free;
end;
end;
procedure AddFeature(AFeaturesPage: TCustomExpertsFeaturesWizardPage; AFeatureDescription: TFeatureDescription);
begin
if AFeatureDescription.Feature = dsNull then
with AFeatureDescription do
AFeaturesPage.AddFeatureGroup(Integer(Group), Name, Description)
else if AFeatureDescription.Group = dsNull then
with AFeatureDescription do
AFeaturesPage.AddFeature(Integer(Feature), Name, Description)
else
with AFeatureDescription do
AFeaturesPage.AddFeature(Integer(Group), Integer(Feature), Name, Description)
end;
procedure EnumFeatures(AFeatureDescriptions: TArray<TFeatureDescription>; AFilter: TFunc<TFeatureDescription, Boolean>; AEnum: TProc<TFeatureDescription>);
var
LDescription: TFeatureDescription;
begin
for LDescription in AFeatureDescriptions do
if AFilter(LDescription) then
begin
AEnum(LDescription);
end;
end;
procedure EnumApplicationFeatures(AFeatureDescriptions: TArray<TFeatureDescription>; AType: TDSWizardType; AEnum: TProc<TFeatureDescription>);
begin
EnumFeatures(AFeatureDescriptions,
function(ADescription: TFeatureDescription): Boolean
begin
Result := (ADescription.WizardTypes * [AType, wtAll]) <> []
end, AEnum);
end;
procedure CheckFeature(AFeaturesPage: TCustomExpertsFeaturesWizardPage; AFeature: TDSServerFeature; AChecked: Boolean);
begin
AFeaturesPage.Checked[Integer(AFeature)] := AChecked;
end;
procedure CheckFeatures(AFeatureDescriptions: TArray<TFeatureDescription>; AFeaturesPage: TCustomExpertsFeaturesWizardPage; AType: TDSWizardType; AFeatures: TDSServerFeatures);
begin
EnumApplicationFeatures(AFeatureDescriptions, AType,
procedure(ADescription: TFeatureDescription)
begin
if ADescription.Feature <> dsNull then
CheckFeature(AFeaturesPage, ADescription.Feature,
(AFeatures * [ADescription.Feature]) <> []);
end)
end;
procedure AddFeatures(AFeatureDescriptions: TArray<TFeatureDescription>; AFeaturesPage: TCustomExpertsFeaturesWizardPage; AType: TDSWizardType);
begin
EnumApplicationFeatures(AFeatureDescriptions, AType,
procedure(ADescription: TFeatureDescription)
begin
AddFeature(AFeaturesPage, ADescription);
end)
end;
procedure UpdateFeatures(AFeatureDescriptions: TArray<TFeatureDescription>; AFeaturesPage: TCustomExpertsFeaturesWizardPage; AType: TDSWizardType;
var AFeatures: TDSServerFeatures);
var
LFeatures: TDSServerFeatures;
begin
LFeatures := AFeatures;
EnumApplicationFeatures(AFeatureDescriptions, AType,
procedure(ADescription: TFeatureDescription)
begin
if ADescription.Feature <> dsNull then
begin
if AFeaturesPage.Checked[Integer(ADescription.Feature)] then
Include(LFeatures, ADescription.Feature)
else
Exclude(LFeatures, ADescription.Feature)
end;
end);
AFeatures := LFeatures;
end;
{ TFeatureDescription }
constructor TFeatureDescription.Create(AGroup, AFeature: TDSServerFeature;
const AName, ADescription: string; const AWizardTypes: TDSWizardTypes);
begin
Group := AGroup;
Feature := AFeature;
Name := AName;
Description := ADescription;
WizardTypes := AWizardTypes;
end;
end.
|
unit UMsgBox;
interface
uses Windows;
procedure ShowMsg(const Text: string; const Caption: string = '提示');
procedure ShowSuccess(const Text: string; const Caption: string = '提示');
procedure ShowWarning(const Text: string; const Caption: string = '警告');
procedure ShowError(const Text: string; const Caption: string = '错误');
function ShowConfirm(const Text: string; const Caption: string = '确认'): Boolean;
implementation
uses uFrmMsgBox;
const
MB_SUCCESS = $00000006;
procedure ShowMsg(const Text, Caption: string);
begin // 64
TFrmMsgBox.ShowDialogForm(Text, Caption, MB_ICONINFORMATION + MB_OK);
end;
procedure ShowSuccess(const Text: string; const Caption: string);
begin // 70
TFrmMsgBox.ShowDialogForm(Text, Caption, MB_ICONINFORMATION + MB_SUCCESS);
end;
procedure ShowWarning(const Text, Caption: string);
begin // 48
TFrmMsgBox.ShowDialogForm(Text, Caption, MB_ICONWARNING + MB_OK);
end;
procedure ShowError(const Text, Caption: string);
begin // 16
TFrmMsgBox.ShowDialogForm(Text, Caption, MB_ICONERROR + MB_OK);
end;
function ShowConfirm(const Text, Caption: string): Boolean;
begin // 33
Result := TFrmMsgBox.ShowDialogForm(Text, Caption, MB_ICONQUESTION + MB_OKCANCEL);
end;
end.
|
- generics types
- persitencia
- singleton
- rtti
- attribute
unit uTeste;
interface
uses
Classes, SysUtils,
Generics.Collections;
type
{ generics types }
IClasseIntf<T : class> = class
public
function MetodoArray<T : class>(AArray : TArray<T>) : T;
function MetodoLista<T : class>(ALista : TList<T>) : T;
end;
TClasse<T : class> = class(TObject, IClasseIntf<T>)
public
function MetodoArray<T : class>(AArray : TArray<T>) : T;
function MetodoLista<T : class>(ALista : TList<T>) : T;
end;
{ singleton }
TClasseSingleton = class
private
protected
class var _instance : TClasseSingleton;
constructor Create;
public
class function Instance : TClasseSingleton;
end.
implementation
{ generics types }
function TClasse<T>.MetodoArray<T>(AArray : TArray<T>) : T;
var
vItem : T;
begin
for vItem in AArray do
with vItem do
Exit(vItem);
end;
function TClasse<T>.MetodoLista<T>(ALista : TList<T>) : T;
var
vItem : T;
begin
for vItem in ALista do
with vItem do
Exit(vItem);
end;
{ singleton }
class function TClasseSingleton.Instance : TClasseSingleton;
public
if not Assigned(_instance) then
_instance := TClasseSingleton.Create;
Result := _instance;
end.
constructor TClasseSingleton.Create;
public
end.
end; |
unit ListeningSQLUnit;
interface
uses
JoanModule,
TestClasses,
SysUtils, Generics.Collections, Classes, Contnrs;
procedure InsertListeningData(ListeningData: TListening);
procedure ModifyListeningData(ListeningData: TListening);
procedure DeleteListeningData(ListeningData: TListening);
function GetListeningData(TestIndex: integer): TObjectList<TQuiz>;
implementation
function GetListeningData(TestIndex: integer): TObjectList<TQuiz>;
var
Listening: TListening;
begin
Result := TObjectList<TQuiz>.Create;
Joan.JoanQuery.SQL.Clear;
Joan.JoanQuery.SQL.Text :=
'SELECT t1.*, t2.* FROM ' +
'(SELECT * FROM listening ' +
' WHERE test_idx = :idx) t1 ' +
'LEFT JOIN quiz t2 ' +
'ON t1.quiz_idx = t2.idx;';
Joan.JoanQuery.ParamByName('idx').AsInteger := TestIndex;
Joan.JoanQuery.Open;
while not Joan.JoanQuery.Eof do
begin
begin
Listening := TListening.Create;
Listening.Idx := Joan.JoanQuery.FieldByName('test_idx').AsInteger;
Listening.QuizIdx := Joan.JoanQuery.FieldByName('quiz_idx').AsInteger;
Listening.QuizNumber := Joan.JoanQuery.FieldByName('number').AsInteger;
Listening.Quiz := Joan.JoanQuery.FieldByName('question').Asstring;
Listening.A := Joan.JoanQuery.FieldByName('A').Asstring;
Listening.B := Joan.JoanQuery.FieldByName('B').Asstring;
Listening.C := Joan.JoanQuery.FieldByName('C').Asstring;
Listening.D := Joan.JoanQuery.FieldByName('D').Asstring;
Listening.Answer := Joan.JoanQuery.FieldByName('answer').Asstring;
Result.Add(Listening);
Joan.JoanQuery.Next;
end;
end;
end;
procedure InsertListeningData(ListeningData: TListening);
var
LastInsertID: Integer;
begin
with Joan.JoanQuery do
begin
Close;
SQL.Clear;
SQL.Text := 'select f_insert_quiz(:number, :question, :a, :b, ' +
':c, :d, :answer) as last_insert_id';
ParamByName('number').AsInteger := ListeningData.QuizNumber;
ParamByName('question').Asstring := ListeningData.Quiz;
ParamByName('A').Asstring := ListeningData.A;
ParamByName('B').Asstring := ListeningData.B;
ParamByName('C').Asstring := ListeningData.C;
ParamByName('D').Asstring := ListeningData.D;
ParamByName('answer').Asstring := ListeningData.Answer;
Open;
LastInsertID := FieldByName('LAST_INSERT_ID').AsInteger;
Close;
SQL.Clear;
SQL.Text :=
'INSERT INTO listening (test_idx, quiz_idx) values ' +
' (:test_idx, :quiz_idx)';
ParamByName('test_idx').AsInteger := ListeningData.Idx;
ParamByName('quiz_idx').AsInteger := LastInsertID;
ExecSQL();
end;
end;
procedure ModifyListeningData(ListeningData: TListening);
begin
with Joan.JoanQuery do
begin
SQL.Clear;
SQL.Text :=
'SELECT t1.*, t2.* FROM ' +
'(SELECT * FROM listening ' +
' WHERE test_idx = :idx) t1 ' +
'INNER JOIN quiz t2 ' +
'ON (t1.quiz_idx = t2.idx) and (t2.number = :quiznumber);';
ParamByName('idx').AsInteger := ListeningData.Idx;
ParamByName('quiznumber').AsInteger := ListeningData.QuizNumber;
Open;
ListeningData.idx := FieldByName('quiz_idx').AsInteger;
Close;
SQL.Clear;
SQL.Text := 'UPDATE quiz SET ' +
'number = :quiznumber, question = :quiz, A = :A, ' +
'B = :B, C = :C, D = :D, answer =:answer ' +
'WHERE idx = :quizidx ';
ParamByName('quizidx').AsInteger := ListeningData.idx;
ParamByName('quiznumber').AsInteger := ListeningData.Quiznumber;
ParamByName('quiz').Asstring := ListeningData.Quiz;
ParamByName('A').Asstring := ListeningData.A;
ParamByName('B').Asstring := ListeningData.B;
ParamByName('C').Asstring := ListeningData.C;
ParamByName('D').AsString := ListeningData.D;
ParamByName('answer').Asstring := ListeningData.Answer;
ExecSQL();
end;
end;
procedure DeleteListeningData(ListeningData: TListening);
begin
with Joan.JoanQuery do
begin
SQL.Clear;
SQL.Text :=
'SELECT t1.*, t2.* FROM ' +
'(SELECT * FROM listening ' +
' WHERE test_idx = :idx) t1 ' +
'INNER JOIN quiz t2 ' +
'ON (t1.quiz_idx = t2.idx) and (t2.number = :quiznumber);';
ParamByName('idx').AsInteger := ListeningData.Idx;
ParamByName('quiznumber').AsInteger := ListeningData.QuizNumber;
Open;
ListeningData.QuizIdx := FieldByName('quiz_idx').AsInteger;
Close;
Sql.Clear;
sql.Text := ' DELETE FROM quiz WHERE idx = :idx ';
ParamByName('idx').AsInteger := ListeningData.QuizIdx;
ExecSQL();
Close;
SQL.Clear;
SQL.Text :=
' DELETE FROM listening WHERE (test_idx = :test_idx) and (quiz_idx = :quiz_idx) ';
ParamByName('test_idx').AsInteger := ListeningData.Idx;
ParamByName('quiz_idx').AsInteger := ListeningData.QuizIdx;
ExecSQL();
end;
end;
end.
|
unit Config;
interface
uses
System.SysUtils, System.Classes, System.Types, System.Variants, Vcl.Forms, IniFiles,
System.Rtti,
MyUtils, Migration;
type
TConfig = class
private
class procedure CreateFile(Path: string);
class function Source: string;
public
class function GetConfig(const Section, Name: string; Default: string = ''): string;
class procedure SetConfig(const Section, Name: string; Value: string = '');
class procedure SetGeral(Config: TMigrationConfig);
class procedure GetGeral(var Config: TMigrationConfig);
end;
implementation
{ TConfigs }
class procedure TConfig.CreateFile(Path: string);
var
Arq: TIniFile;
begin
Arq := TIniFile.Create(Path);
try
Arq.WriteString('SOURCE', 'User', 'SYSDBA');
Arq.WriteString('SOURCE', 'Password', 'masterkey');
Arq.WriteString('SOURCE', 'Database', '');
Arq.WriteString('SOURCE', 'Version', '0');
Arq.WriteString('DEST', 'Database', '');
Arq.WriteString('DEST', 'Version', '0');
finally
FreeAndNil(Arq);
end;
end;
//Caminho das configurações
class function TConfig.Source: string;
begin
Result := TUtils.Temp + 'FirebirdMigrator\' + 'Config.ini';
if not FileExists(Result) then
begin
if not DirectoryExists(ExtractFileDir(Result)) then
begin
CreateDir(ExtractFileDir(Result));
end;
CreateFile(Result);
end;
end;
//Busca uma configuração específica
class function TConfig.GetConfig(const Section, Name: string; Default: string = ''): string;
var
Arq: TIniFile;
begin
Arq := TIniFile.Create(Source);
try
Result := Arq.ReadString(Section, Name, Default);
finally
FreeAndNil(Arq);
end;
end;
//Define uma configuração específica
class procedure TConfig.SetConfig(const Section, Name: string; Value: string = '');
var
Arq: TIniFile;
begin
Arq := TIniFile.Create(Source);
try
Arq.WriteString(Section, Name, Value);
finally
FreeAndNil(Arq);
end;
end;
class procedure TConfig.SetGeral(Config: TMigrationConfig);
begin
with Config.Source do
begin
SetConfig('SOURCE', 'User', User);
SetConfig('SOURCE', 'Password', Password);
SetConfig('SOURCE', 'Database', Database);
SetConfig('SOURCE', 'Version', Integer(Version).ToString);
end;
with Config.Dest do
begin
SetConfig('DEST', 'Database', Database);
SetConfig('DEST', 'Version', Integer(Version).ToString);
end;
end;
class procedure TConfig.GetGeral(var Config: TMigrationConfig);
begin
with Config.Source do
begin
User := GetConfig('SOURCE', 'User', 'SYSDBA');
Password := GetConfig('SOURCE', 'Password', 'masterkey');
Database := GetConfig('SOURCE', 'Database', '');
Version := TVersion(GetConfig('SOURCE', 'Version', '0').ToInteger);
end;
with Config.Dest do
begin
Database := GetConfig('DEST', 'Database', '');
Version := TVersion(GetConfig('DEST', 'Version', '0').ToInteger);
end;
end;
end.
|
unit IL.Instructions;
interface
{$i compilers.inc}
uses SysUtils, Classes, TypInfo, StrUtils, Math, AVL, IL.Types, NPCompiler.Utils, NPCompiler.DataTypes,
NPCompiler.Classes, HWPlatforms; // system
type
TILInstruction = class;
// контекст встраивания процедуры
TPIContext = record
InlineProc: TIDProcedure; // встраиваемая процедура/функция
Instruction: TILInstruction; // текущая встраиваемая инструкция
MethodSelf: TIDExpression; // self-указатель для полей/методов встраиваемой процедуры
EqualList: TIDPairList; // список соответсвий локальных переменных
end;
TCFBlockType = (
CFB_PROC, // основной блок процедуры
CFB_IF, // блок ветвления IF
CFB_IF_THEN, // блок секции THEN ветвления IF
CFB_IF_ELSE, // блок секции ELSE ветвления IF
CFB_FOR_BODY, // блок тела цикла FOR
CFB_FOR_ELSE, // блок секции ELSE циклы FOR
CFB_CASE, // блок ветвления CASE
CFB_CASE_ENTRY, // блок очередной секции ветвления CASE
CFB_CASE_ELSE, // блок секции DEFAULT ветвления CASE
CFB_WHILE_BODY, // блок тела цикла WHILE или REPEAT
CFB_EXCEPT, // блок секции EXCEPT
CFB_FINALLY // блок секции FINALLY ??? нужен ли ???
);
TCFBVars = TAVLTree<TIDVariable, Boolean>;
{Control Flow Block}
TCFBlock = class(TPooledObject)
private
FParent: TCFBlock;
FType: TCFBlockType;
FPrev: TCFBlock;
FLastChild: TCFBlock;
FVars: TCFBVars;
protected
function FindVarInitDOWN(const Variable: TIDVariable): Boolean; virtual;
function FindVarInitUP(const Variable: TIDVariable; Child: TCFBlock): Boolean;
public
constructor Create(Parent: TCFBlock);
destructor Destroy; override;
procedure AddVariable(const Variable: TIDVariable);
property BlockType: TCFBlockType read FType;
property Parent: TCFBlock read FParent;
property LastChild: TCFBlock read FLastChild write FLastChild;
property Prev: TCFBlock read FPrev write FPrev;
function IsVarInitialized(const Variable: TIDVariable): Boolean; virtual;
end;
TCFBIF = class(TCFBlock)
private
FTrue: TCFBlock;
FElse: TCFBlock;
protected
function FindVarInitDOWN(const Variable: TIDVariable): Boolean; override;
public
function IsVarInitialized(const Variable: TIDVariable): Boolean; override;
end;
TCFBCASE = class(TCFBlock)
private
//FType: TIDDeclaration; // тип выражения CASE <Expr> OF ...
//FFirstItem: TCFBlock;
FLastItem: TCFBlock;
//FElseItem: TCFBlock;
protected
function FindVarInitDOWN(const Variable: TIDVariable): Boolean; override;
public
function IsVarInitialized(const Variable: TIDVariable): Boolean; override;
end;
TCFBFOR = class(TCFBlock)
private
//FElse: TCFBlock;
end;
(*====================================================================
// Алгоритм проверки что некая переменная инициализированна:
// - каждое выражение имеет ссылку на инструкцию, которая его порадила
// - каждая инструкция иммет ссылку на TCFBlock в котором она находится
// 1. Если интрукция чтения переменной находится в том же CF блоке что
// и инструкция записи, только ниже по списку, значит что переменная
// инициализированна!
// 2.
|-------------------------------------|
| CFB_COMMON |
| |--------------| |
| |-----------|<--| CFB_IF_TRUE | |
| | | |--------------| |
|<--| CFB_IF | |
| | | |--------------| |
| |-----------|<--| CFB_IF_ELSE | |
| |--------------| |
| |
| |
| |--------------| |
| |-----------|<--| CFB_FOR_BODY | |
| | | |--------------| |
|<--| CFB_FOR | |
| | | |--------------| |
| |-----------|<--| CFB_FOR_ELSE | |
| |--------------| |
| |
| |
| |-----------| |
| | | |--------------| |
|<--| CFB_LOOP |<--| CFB_LP_BODY | |
| | | |--------------| |
| |-----------| |
| |
| |
| |--------------| |
| |-----------|<--| CFB_WH_BODY | |
| | | |--------------| |
|<--| CFB_WHILE | |
| | | |--------------| |
| |-----------|<--| CFB_WH_ELSE? | |
| |--------------| |
| |
| |
| |--------------| |
| |-----------|<--| CFB_CASE_1 | |
| | | |--------------| |
| | | |
| | | |--------------| |
|<--| CFB_CASE |<--| CFB_CASE_N | |
| | | |--------------| |
| | | |
| | | |--------------| |
| |-----------|<--| CFB_CASE_ELSE| |
| |--------------| |
| |
| |
| |--------------| |
| |-----------|<--| CFB_EXCEPT | |
| | | |--------------| |
|<--| CFB_TRY | |
| | | |--------------| |
| |-----------|<--| CFB_FINALLY | |
| |--------------| |
| |
|-------------------------------------|
====================================================================*)
TILArgsEnumProc = reference to procedure (const Arg: TIDExpression; var BreakEnum: Boolean);
TIL = class;
{контекст вычисления в режиме ConstExpr}
TILCECalcContext = record
Next: TILInstruction; // следующая инструкция
Cond: Boolean; // условие инструкций сравнения
Return: Boolean; // признак выхода
end;
TILInstruction = class(TPooledObject)
private
FCondition: TILCondition; // условие исполнения
FPrev: TILInstruction;
FNext: TILInstruction;
FPosition: Integer;
FCFBlock: TCFBlock; // указывает какому CF блоку принадлежит инструкция
protected
function ArgumentsCount: Integer; virtual;
function GetArgument(Index: Integer): TIDExpression; virtual;
function GetLine: Integer; virtual;
function CondAsText: string;
procedure CheckArgInit(Proc: TIDProcedure; Expr: TIDExpression);
public
constructor Create;
function Text: string; virtual;
function ILCode: TILCode; virtual; abstract;
function ILCodeString(InUpperCase: Boolean = True): string;
property Condition: TILCondition read FCondition write FCondition;
property Position: Integer read FPosition write FPosition;
property Prev: TILInstruction read FPrev;
property Next: TILInstruction read FNext;
property Line: Integer read GetLine; // строка исходного кода для которой была создана эта инструкция
property CFBlock: TCFBlock read FCFBlock;
procedure SwapArguments(const Context: TPIContext); virtual;
procedure Write(Proc: TIDProcedure; Stream: TStream); virtual;
procedure Read(Stream: TStream); virtual;
procedure RemoveBack(ToInstruction: TILInstruction);
{процедура увеличивает счетчики чтения/записи для аргументов инструкции}
procedure IncReferences(var RCPath: UInt32); virtual;
{процедура уменьшает счетчики чтения/записи для аргументов инструкции}
procedure DecReferences(var RCPath: UInt32); virtual;
procedure ProcessVarInit(Proc: TIDProcedure); virtual;
procedure EnumerateArgs(const EnumProc: TILArgsEnumProc; var BreakEnum: Boolean); virtual;
{constexpr calculate}
procedure CECalc(var Ctx: TILCECalcContext); virtual; abstract;
end;
TILInstructionClass = class of TILInstruction;
TILNoArgInstruction = class(TILInstruction)
private
FLine: Integer;
protected
function GetLine: Integer; override;
public
constructor Create(Line: Integer);
property Line: Integer read GetLine write FLine;
end;
TILNope = class(TILNoArgInstruction)
public
function ILCode: TILCode; override;
function Text: string; override;
procedure CECalc(var Ctx: TILCECalcContext); override;
end;
TILDestInstruction = class(TILInstruction)
private
FDestination: TIDExpression;
procedure SetDestination(const Value: TIDExpression);
protected
function ArgumentsCount: Integer; override;
function GetArgument(Index: Integer): TIDExpression; override;
function GetLine: Integer; override;
public
procedure Init(Condition: TILCondition; Destination: TIDExpression); overload; inline;
procedure SwapArguments(const Context: TPIContext); override;
procedure Write(Proc: TIDProcedure; Stream: TStream); override;
procedure IncReferences(var RCPath: UInt32); override;
procedure DecReferences(var RCPath: UInt32); override;
procedure ProcessVarInit(Proc: TIDProcedure); override;
procedure EnumerateArgs(const EnumProc: TILArgsEnumProc; var BreakEnum: Boolean); override;
property Destination: TIDExpression read FDestination write SetDestination;
function Text: string; override;
end;
TIL1ArgInstriction = class(TILInstruction)
private
FArg: TIDExpression;
protected
function ArgumentsCount: Integer; override;
function GetArgument(Index: Integer): TIDExpression; override;
function GetLine: Integer; override;
public
procedure Init(Condition: TILCondition; Arg: TIDExpression); overload; inline;
procedure SwapArguments(const Context: TPIContext); override;
procedure Write(Proc: TIDProcedure; Stream: TStream); override;
procedure IncReferences(var RCPath: UInt32); override;
procedure DecReferences(var RCPath: UInt32); override;
procedure ProcessVarInit(Proc: TIDProcedure); override;
procedure EnumerateArgs(const EnumProc: TILArgsEnumProc; var BreakEnum: Boolean); override;
property Arg: TIDExpression read FArg write FArg;
function Text: string; override;
end;
TILDstSrcInstruction = class(TILDestInstruction)
private
FSource: TIDExpression;
protected
function ArgumentsCount: Integer; override;
function GetArgument(Index: Integer): TIDExpression; override;
function GetLine: Integer; override;
public
procedure Init(Condition: TILCondition; Destination, Source: TIDExpression); overload; inline;
procedure SwapArguments(const Context: TPIContext); override;
procedure Write(Proc: TIDProcedure; Stream: TStream); override;
procedure IncReferences(var RCPath: UInt32); override;
procedure DecReferences(var RCPath: UInt32); override;
procedure EnumerateArgs(const EnumProc: TILArgsEnumProc; var BreakEnum: Boolean); override;
function Text: string; override;
procedure ProcessVarInit(Proc: TIDProcedure); override;
property Source: TIDExpression read FSource write FSource;
end;
TILReadDRef = class(TILDstSrcInstruction)
public
function ILCode: TILCode; override;
function Text: string; override;
end;
TILWriteDRef = class(TILDstSrcInstruction)
public
function ILCode: TILCode; override;
function Text: string; override;
end;
TILCompareInstruction = class(TILInstruction)
private
FLeft: TIDExpression;
FRight: TIDExpression;
protected
function ArgumentsCount: Integer; override;
function GetArgument(Index: Integer): TIDExpression; override;
function GetLine: Integer; override;
public
procedure Init(Condition: TILCondition; Left, Right: TIDExpression); overload; inline;
procedure SwapArguments(const Context: TPIContext); override;
procedure Write(Proc: TIDProcedure; Stream: TStream); override;
procedure IncReferences(var RCPath: UInt32); override;
procedure DecReferences(var RCPath: UInt32); override;
function Text: string; override;
procedure ProcessVarInit(Proc: TIDProcedure); override;
procedure EnumerateArgs(const EnumProc: TILArgsEnumProc; var BreakEnum: Boolean); override;
property Left: TIDExpression read FLeft write FLeft;
property Right: TIDExpression read FRight write FRight;
end;
TILCmpJmp = class(TILCompareInstruction)
private
FDestination: TILInstruction;
public
procedure Init(Condition: TILCondition; Left, Right: TIDExpression; Destination: TILInstruction); overload;
function ILCode: TILCode; override;
function Text: string; override;
procedure Write(Proc: TIDProcedure; Stream: TStream); override;
end;
TILDstSrcSrcInstruction = class(TILDestInstruction)
private
FLeft: TIDExpression;
FRight: TIDExpression;
protected
function ArgumentsCount: Integer; override;
function GetArgument(Index: Integer): TIDExpression; override;
public
procedure Init(Condition: TILCondition; Dest, Left, Right: TIDExpression); overload; inline;
procedure SwapArguments(const Context: TPIContext); override;
procedure Write(Proc: TIDProcedure; Stream: TStream); override;
procedure IncReferences(var RCPath: UInt32); override;
procedure DecReferences(var RCPath: UInt32); override;
procedure ProcessVarInit(Proc: TIDProcedure); override;
procedure EnumerateArgs(const EnumProc: TILArgsEnumProc; var BreakEnum: Boolean); override;
function Text: string; override;
property Left: TIDExpression read FLeft write FLeft;
property Right: TIDExpression read FRight write FRight;
end;
TILRet = class(TILNoArgInstruction)
public
function ILCode: TILCode; override;
function Text: string; override;
procedure CECalc(var Ctx: TILCECalcContext); override;
end;
TILNeg = class(TILDstSrcInstruction)
public
function ILCode: TILCode; override;
function Text: string; override;
procedure CECalc(var Ctx: TILCECalcContext); override;
end;
TILNot = class(TILDstSrcInstruction)
public
function ILCode: TILCode; override;
function Text: string; override;
procedure CECalc(var Ctx: TILCECalcContext); override;
end;
TILAnd = class(TILDstSrcSrcInstruction)
public
function ILCode: TILCode; override;
function Text: string; override;
procedure CECalc(var Ctx: TILCECalcContext); override;
end;
TILOr = class(TILDstSrcSrcInstruction)
public
function ILCode: TILCode; override;
function Text: string; override;
procedure CECalc(var Ctx: TILCECalcContext); override;
end;
TILXor = class(TILDstSrcSrcInstruction)
public
function ILCode: TILCode; override;
function Text: string; override;
procedure CECalc(var Ctx: TILCECalcContext); override;
end;
TILShl = class(TILDstSrcSrcInstruction)
public
function ILCode: TILCode; override;
function Text: string; override;
procedure CECalc(var Ctx: TILCECalcContext); override;
end;
TILShr = class(TILDstSrcSrcInstruction)
public
function ILCode: TILCode; override;
function Text: string; override;
procedure CECalc(var Ctx: TILCECalcContext); override;
end;
TILMove = class(TILDstSrcInstruction)
public
function ILCode: TILCode; override;
function Text: string; override;
procedure Write(Proc: TIDProcedure; Stream: TStream); override;
procedure CECalc(var Ctx: TILCECalcContext); override;
end;
TILSetBool = class(TILDestInstruction)
public
function ILCode: TILCode; override;
function Text: string; override;
end;
TILGetBit = class(TILDstSrcSrcInstruction)
public
function ILCode: TILCode; override;
function Text: string; override;
end;
TILSetBit = class(TILDstSrcSrcInstruction)
public
function ILCode: TILCode; override;
function Text: string; override;
end;
TILAdd = class(TILDstSrcSrcInstruction)
public
function ILCode: TILCode; override;
function Text: string; override;
procedure Write(Proc: TIDProcedure; Stream: TStream); override;
procedure CECalc(var Ctx: TILCECalcContext); override;
end;
TILSub = class(TILDstSrcSrcInstruction)
public
function ILCode: TILCode; override;
function Text: string; override;
procedure Write(Proc: TIDProcedure; Stream: TStream); override;
procedure CECalc(var Ctx: TILCECalcContext); override;
end;
TILMul = class(TILDstSrcSrcInstruction)
public
function ILCode: TILCode; override;
function Text: string; override;
procedure CECalc(var Ctx: TILCECalcContext); override;
end;
TILDiv = class(TILDstSrcSrcInstruction)
public
function ILCode: TILCode; override;
function Text: string; override;
procedure CECalc(var Ctx: TILCECalcContext); override;
end;
TILCast = class(TILDstSrcInstruction)
public
function ILCode: TILCode; override;
function Text: string; override;
end;
TILIntDiv = class(TILDstSrcSrcInstruction)
public
function ILCode: TILCode; override;
function Text: string; override;
procedure CECalc(var Ctx: TILCECalcContext); override;
end;
TILMod = class(TILDstSrcSrcInstruction)
public
function ILCode: TILCode; override;
function Text: string; override;
procedure CECalc(var Ctx: TILCECalcContext); override;
end;
TILCmp = class(TILCompareInstruction)
public
function ILCode: TILCode; override;
function Text: string; override;
procedure CECalc(var Ctx: TILCECalcContext); override;
end;
TILTest = class(TILCompareInstruction)
public
function ILCode: TILCode; override;
function Text: string; override;
end;
TILConvert = class(TILDstSrcInstruction)
public
function ILCode: TILCode; override;
function Text: string; override;
end;
TILCheckBound = class(TILCompareInstruction)
public
function ILCode: TILCode; override;
function Text: string; override;
end;
TILUniqueInstruction = class(TILDestInstruction)
public
function ILCode: TILCode; override;
function Text: string; override;
end;
TILLoadAddr = class(TILDstSrcSrcInstruction)
public
function ILCode: TILCode; override;
function Text: string; override;
procedure Write(Proc: TIDProcedure; Stream: TStream); override;
end;
TIL1ConstArgInstruction = class(TILNoArgInstruction)
protected
FArgument: Integer;
function ArgumentsCount: Integer; override;
public
function Text: string; override;
property Argument: Integer read FArgument write FArgument;
procedure Write(Proc: TIDProcedure; Stream: TStream); override;
end;
{инструкции перехода/прыжка (аргумет - инструкция на которую необходимо совершить переход)}
TILJampedInstruction = class(TILNoArgInstruction)
private
FDestination: TILInstruction;
protected
function GetDestinationPosition: Integer; virtual;
public
procedure Write(Proc: TIDProcedure; Stream: TStream); override;
procedure CECalc(var Ctx: TILCECalcContext); override;
property Destination: TILInstruction read FDestination write FDestination;
property DestinationPosition: Integer read GetDestinationPosition;
function Text: string; override;
end;
{Прыжок на инструкциию с адресом Destination}
TILJmp = class(TILJampedInstruction)
function ILCode: TILCode; override;
function Text: string; override;
end;
{Прыжок на инструкциию идущую после Destination}
TILJmpNext = class(TILJmp)
protected
function GetDestinationPosition: Integer; override;
procedure CECalc(var Ctx: TILCECalcContext); override;
end;
TILDestMultiArgsInstruction = class(TILDestInstruction)
private
FArgs: TIDExpressions;
function GetArgsNames: string;
public
procedure Init(Condition: TILCondition; Dest: TIDExpression; const Args: TIDExpressions); overload; inline;
procedure IncReferences(var RCPath: UInt32); override;
procedure DecReferences(var RCPath: UInt32); override;
procedure SwapArguments(const Context: TPIContext); override;
property Arguments: TIDExpressions read FArgs;
end;
TILProcCall = class(TILDestMultiArgsInstruction)
private
FProc: TIDExpression;
FInstance: TIDExpression;
protected
function ArgumentsCount: Integer; override;
function GetArgument(Index: Integer): TIDExpression; override;
function GetLine: Integer; override;
public
procedure Init(Condition: TILCondition; Proc, Result, Instance: TIDExpression; const Args: TIDExpressions); overload; inline;
procedure Write(Proc: TIDProcedure; Stream: TStream); override;
procedure IncReferences(var RCPath: UInt32); override;
procedure DecReferences(var RCPath: UInt32); override;
procedure ProcessVarInit(Proc: TIDProcedure); override;
procedure SwapArguments(const Context: TPIContext); override;
procedure EnumerateArgs(const EnumProc: TILArgsEnumProc; var BreakEnum: Boolean); override;
function ILCode: TILCode; override;
function Text: string; override;
procedure CECalc(var Ctx: TILCECalcContext); override;
property Proc: TIDExpression read FProc;
property Instance: TIDExpression read FInstance;
end;
TILProcCallUnSafe = class(TILProcCall)
public
function ILCode: TILCode; override;
procedure Write(Proc: TIDProcedure; Stream: TStream); override;
end;
TILInheritedCall = class(TILProcCall)
public
function ILCode: TILCode; override;
function Text: string; override;
procedure Write(Proc: TIDProcedure; Stream: TStream); override;
end;
TILVirtCall = class(TILProcCall)
public
function ILCode: TILCode; override;
end;
TILGetPtr = class(TILDestInstruction)
private
FBase: TIDExpression; // Base может быть nil (для GetSelfPtr)
FMember: TIDExpression;
public
function ILCode: TILCode; override;
function Text: string; override;
procedure SwapArguments(const Context: TPIContext); override;
procedure EnumerateArgs(const EnumProc: TILArgsEnumProc; var BreakEnum: Boolean); override;
property Base: TIDExpression read FBase;
property Member: TIDExpression read FMember;
procedure Write(Proc: TIDProcedure; Stream: TStream); override;
end;
TILGetPtrMulti = class(TILDestMultiArgsInstruction)
protected
function ArgumentsCount: Integer; override;
function GetArgument(Index: Integer): TIDExpression; override;
public
function ILCode: TILCode; override;
function Text: string; override;
procedure Write(Proc: TIDProcedure; Stream: TStream); override;
procedure EnumerateArgs(const EnumProc: TILArgsEnumProc; var BreakEnum: Boolean); override;
end;
TILDNewObj = class(TILDestInstruction)
private
FInstance: TIDExpression;
public
function ILCode: TILCode; override;
function Text: string; override;
procedure Write(Proc: TIDProcedure; Stream: TStream); override;
procedure EnumerateArgs(const EnumProc: TILArgsEnumProc; var BreakEnum: Boolean); override;
procedure IncReferences(var RCPath: UInt32); override;
procedure DecReferences(var RCPath: UInt32); override;
end;
TILLDMethod = class(TILGetPtr)
public
function ILCode: TILCode; override;
end;
TILTypeInfo = class(TILDstSrcInstruction)
public
function ILCode: TILCode; override;
function Text: string; override;
end;
TILQueryType = class(TILDstSrcSrcInstruction)
public
function ILCode: TILCode; override;
function Text: string; override;
end;
TILSNewObj = class(TILProcCall)
public
function ILCode: TILCode; override;
end;
TILMemGet = class(TILDestInstruction)
public
function ILCode: TILCode; override;
function Text: string; override;
end;
TILMemFree = class(TILDestInstruction)
public
function ILCode: TILCode; override;
function Text: string; override;
end;
TILArrayDAlloc = class(TILDstSrcInstruction)
public
function ILCode: TILCode; override;
function Text: string; override;
end;
TILArrayRAlloc = class(TILDstSrcInstruction)
public
function ILCode: TILCode; override;
function Text: string; override;
end;
TILArraySAlloc = class(TILDstSrcInstruction)
public
function ILCode: TILCode; override;
function Text: string; override;
end;
TILArrayLength = class(TILDstSrcInstruction)
public
function ILCode: TILCode; override;
function Text: string; override;
end;
TILArrayCopy = class(TILDstSrcInstruction)
private
FFrom: TIDExpression;
FCount: TIDExpression;
public
function ILCode: TILCode; override;
function Text: string; override;
procedure Write(Proc: TIDProcedure; Stream: TStream); override;
procedure IncReferences(var RCPath: UInt32); override;
procedure DecReferences(var RCPath: UInt32); override;
end;
TILMemMove = class(TILInstruction)
private
FSrcArr: TIDExpression;
FSrcIdx: TIDExpression;
FDstArr: TIDExpression;
FDstIdx: TIDExpression;
FCnt: TIDExpression;
protected
function GetLine: Integer; override;
public
function ILCode: TILCode; override;
function Text: string; override;
procedure Write(Proc: TIDProcedure; Stream: TStream); override;
end;
TILMemSet = class(TILDstSrcInstruction)
public
function ILCode: TILCode; override;
function Text: string; override;
end;
TILNearCall = class(TILJampedInstruction)
public
function ILCode: TILCode; override;
function Text: string; override;
end;
TILTryBegin = class(TILJampedInstruction)
public
function ILCode: TILCode; override;
function Text: string; override;
end;
TILTryEnd = class(TIL1ConstArgInstruction)
public
function ILCode: TILCode; override;
function Text: string; override;
end;
{инструкция выброса исключения}
TILEThrow = class(TIL1ArgInstriction)
public
function ILCode: TILCode; override;
function Text: string; override;
end;
TILTryCallHandler = class(TILInstruction)
public
function ILCode: TILCode; override;
function Text: string; override;
end;
TILIncRef = class(TILDestInstruction)
public
function ILCode: TILCode; override;
function Text: string; override;
end;
TILDecRef = class(TILDestInstruction)
public
function ILCode: TILCode; override;
function Text: string; override;
procedure Write(Proc: TIDProcedure; Stream: TStream); override;
procedure IncReferences(var RCPath: UInt32); override;
procedure DecReferences(var RCPath: UInt32); override;
end;
TILWeakRef = class(TILDstSrcInstruction)
public
function ILCode: TILCode; override;
function Text: string; override;
end;
TILStrongRef = class(TILDstSrcInstruction)
public
function ILCode: TILCode; override;
function Text: string; override;
end;
TILInit = class(TILDestInstruction)
public
function ILCode: TILCode; override;
function Text: string; override;
end;
{TILFinal = class(TILDestInstruction)
public
function ILCode: TILCode; override;
function Text: string; override;
end;}
TILRefCount = class(TILDstSrcInstruction)
public
function ILCode: TILCode; override;
function Text: string; override;
end;
TILNow = class(TILDestInstruction)
public
function ILCode: TILCode; override;
function Text: string; override;
end;
TILFMacro = class(TILDestMultiArgsInstruction)
private
FMacroID: TILMacroID;
public
procedure SwapArguments(const Context: TPIContext); override;
procedure Write(Proc: TIDProcedure; Stream: TStream); override;
function ILCode: TILCode; override;
function Text: string; override;
property MacroID: TILMacroID read FMacroID;
end;
TILPlatform = class(TILInstruction)
private
FPlatform: TIDPlatform;
FCount: Integer;
FFirst: TPlatformInstruction;
FLast: TPlatformInstruction;
FLine: Integer;
protected
function GetLine: Integer; override;
public
constructor Create(Platform: TIDPlatform; Line: Integer);
destructor Destroy; override;
procedure Write(Proc: TIDProcedure; Stream: TStream); override;
procedure Add(Instruction: TPlatformInstruction);
function ILCode: TILCode; override;
function Text: string; override;
property Count: Integer read FCount;
property FirstInstruction: TPlatformInstruction read FFirst;
property LastInstruction: TPlatformInstruction read FLast;
end;
TIL = class
private
FProc: TIDProcedure;
FCount: Integer; // Позиция следующей инструкции
FFirst: TILInstruction;
FLast: TILInstruction;
FCFBRoot: TCFBlock;
FCFBCurrent: TCFBlock;
protected
procedure OptimizeIL;
public
constructor Create(Proc: TIDProcedure);
destructor Destroy; override;
////////////////////////////////////////////////////////////////////////////////
property First: TILInstruction read FFirst;
property Last: TILInstruction read FLast;
//==============================================================================
class function IL_Nope: TILNope; inline;
class function IL_Move(Dst, Src: TIDExpression): TILMove; overload; static; inline;
class function IL_Move(Cond: TILCondition; Dst, Src: TIDExpression): TILMove; overload; static; inline;
class function IL_SetBool(Cond: TILCondition; Dst: TIDExpression): TILSetBool; static; inline;
class function IL_GetBit(Dst, Value, BitIndex: TIDExpression): TILGetBit; static; inline;
class function IL_SetBit(Dst, BitIndex, BitValue: TIDExpression): TILSetBit; static; inline;
class function IL_Add(Dst, Left, Right: TIDExpression): TILAdd; static; inline;
class function IL_Sub(Dst, Left, Right: TIDExpression): TILSub; overload; static; inline;
class function IL_Sub(Cond: TILCondition; Dst, Left, Right: TIDExpression): TILSub; overload; static; inline;
class function IL_Mul(Dst, Left, Right: TIDExpression): TILMul; static; inline;
class function IL_Div(Dst, Left, Right: TIDExpression): TILDiv; static; inline;
class function IL_IntDiv(Dst, Left, Right: TIDExpression): TILIntDiv; static; inline;
class function IL_ModDiv(Dst, Left, Right: TIDExpression): TILMod; static; inline;
class function IL_Neg(Dst, Src: TIDExpression): TILNeg; static; inline;
class function IL_Not(Dst, Src: TIDExpression): TILNot; static; inline;
class function IL_And(Dst, Left, Right: TIDExpression): TILAnd; static; inline;
class function IL_Or(Dst, Left, Right: TIDExpression): TILOr; static; inline;
class function IL_Xor(Dst, Left, Right: TIDExpression): TILXor; static; inline;
class function IL_Shl(Dst, Left, Right: TIDExpression): TILShl; static; inline;
class function IL_Shr(Dst, Left, Right: TIDExpression): TILShr; static; inline;
class function IL_Cmp(Left, Right: TIDExpression): TILCmp; static; inline;
class function IL_Test(Left, Right: TIDExpression): TILTest; static; inline;
class function IL_Convert(Dst, Src: TIDExpression): TILConvert; static; inline;
class function IL_CheckBound(Src, Index: TIDExpression): TILCheckBound; static; inline;
class function IL_Jmp(Line: Integer; Condition: TILCondition; Destination: TILInstruction): TILJmp; static; inline;
class function IL_JmpNext(Line: Integer; Condition: TILCondition; Destination: TILInstruction): TILJmpNext; static; inline;
class function IL_CmpJmp(Cond: TILCondition; Left, Right: TIDExpression; Destination: TILInstruction): TILCmpJmp; static; inline;
class function IL_Cast(Dst, Src: TIDExpression): TILCast; static; inline;
class function IL_Ret(Line: Integer; Condition: TILCondition = cNone): TILRet; static; inline;
class function IL_Unique(Dst: TIDExpression): TILUniqueInstruction; static; inline;
class function IL_ProcCall(Proc, Dst, Instance: TIDExpression; const Args: TIDExpressions): TILProcCall; static; inline;
class function IL_ProcCallUnSafe(Proc, Dst, Instance: TIDExpression; const Args: TIDExpressions): TILProcCallUnSafe; static; inline;
class function IL_VirtCall(Proc, Dst, Instance: TIDExpression; const Args: TIDExpressions): TILVirtCall; static; inline;
class function IL_InheritedCall(Proc, Dst, Instance: TIDExpression; const Args: TIDExpressions): TILInheritedCall; static; inline;
class function IL_GetPtr(Dst: TIDExpression; const Args: TIDExpressions): TILGetPtrMulti; overload; static; inline;
class function IL_GetPtr(Dst: TIDExpression; const Base, Member: TIDExpression): TILGetPtr; overload; static; inline;
class function IL_ReadDRef(Dst, Src: TIDExpression): TILReadDRef; overload; static; inline;
class function IL_WriteDRef(Dst, Src: TIDExpression): TILWriteDRef; overload; static; inline;
class function IL_LoadAddress(const Dst, Src: TIDExpression; Offset: TIDExpression = nil): TILLoadAddr; static; inline;
class function IL_DAlloc(const Dst, Src: TIDExpression): TILArrayDAlloc; static; inline;
class function IL_RAlloc(const Dst, Src: TIDExpression): TILArrayRAlloc; static; inline;
class function IL_SAlloc(const Dst, Src: TIDExpression): TILArraySAlloc; static; inline;
class function IL_Length(const Dst, Src: TIDExpression): TILArrayLength; static; inline;
class function IL_Copy(const Dst, Src, From, Count: TIDExpression): TILArrayCopy; static; inline;
class function IL_MoveArray(const SrcArr, SrcIdx, DstArr, DstIdx, Count: TIDExpression): TILMemMove; static; inline;
class function IL_MemSet(const Dst, SetByte: TIDExpression): TILMemSet; static; inline;
class function IL_DNew(Dst, Instance: TIDExpression): TILDNewObj; static; inline;
class function IL_New(const Dst: TIDExpression): TILMemGet; static; inline;
class function IL_FreeInstance(const Dst: TIDExpression): TILMemFree; static; inline;
class function IL_TypeInfo(const Dst, Src: TIDExpression): TILTypeInfo; static; inline;
class function IL_QueryType(const Dst, Src, DstType: TIDExpression): TILQueryType; static; inline;
class function IL_NearCall(Dest: TILInstruction): TILNearCall; static; inline;
class function IL_TryBegin(Dest: TILInstruction; Line: Integer): TILTryBegin; static; inline;
class function IL_TryEnd(Line: Integer): TILTryEnd; static; inline;
class function IL_TryCallHandler: TILTryCallHandler; static; inline;
class function IL_EThrow(Condition: TILCondition; ExceptExpr: TIDExpression): TILEThrow; static; inline;
class function IL_Init(Dst: TIDExpression): TILInit; static; inline;
class function IL_IncRef(Dst: TIDExpression): TILIncRef; static; inline;
class function IL_DecRef(Dst: TIDExpression): TILDecRef; static; inline;
class function IL_WeakRef(const Dst, Src: TIDExpression): TILWeakRef; static; inline;
class function IL_StrongRef(const Dst, Src: TIDExpression): TILStrongRef; static; inline;
class function IL_LDMethod(const Dst, Base, Member: TIDExpression): TILLDMethod; static; inline;
class function IL_RefCount(const Dst, Src: TIDExpression): TILRefCount; static; inline;
class function IL_Now(const Dst: TIDExpression): TILNow; static; inline;
class function IL_Macro(const Dst: TIDExpression; MacroID: TILMacroID; const Args: TIDExpressions): TILFMacro; overload; static; inline;
//==============================================================================
procedure InlineProc(DestinationProc, InlineProc: TIDProcedure; NextInstruction: TILInstruction;
Struct, FuncResult: TIDExpression; const Arguments: TIDExpressions);
function GetAsText(ShowCFB, ShowLineNum: Boolean): string;
{процедура завершения записи}
procedure Complete(var RCPath: UInt32);
procedure RemoveReferences(var RCPath: UInt32);
procedure CheckVarsInitialized;
procedure Write(const Instruction: TILInstruction); inline;
procedure InsertAfter(Instruction, NewInstruction: TILInstruction);
procedure InsertFirst(Instruction: TILInstruction);
procedure InsertBefore(Instruction, NewInstruction: TILInstruction);
procedure Replace(const Prev, New: TILInstruction); overload; inline;
{процедура заменяет цель перехода для инструкций перехода}
procedure ReplaceJmpTarget(const OldTarget, NewTarget: TILInstruction);
procedure SaveToStream(Stream: TStream; const Package: INPPackage);
procedure ChecRefToInstruction(Instruction: TILInstruction);
procedure Delete(FromInstruction, ToInstruction: TILInstruction); overload;
procedure Delete(Instruction: TILInstruction); overload;
procedure CFBBegin(const CFBlockType: TCFBlockType);
procedure CFBEnd(const CFBlockType: TCFBlockType);
procedure AddVariable(const Variable: TIDVariable);
procedure EnumerateArgs(const EnumProc: TILArgsEnumProc);
property Count: Integer read FCount;
property Proc: TIDProcedure read FProc;
procedure CopyFrom(const IL: TIL);
function GetWriteCount(Expr: TIDExpression): Integer;
procedure CECalc;
end;
implementation
uses SystemUnit, NPCompiler, NPCompiler.Operators, NPCompiler.ConstCalculator;
{функция определят "нулевая" ли константа}
function ZeroConstant(Decl: TIDConstant): Boolean;
begin
Result := ((Decl.ClassType = TIDIntConstant) and (TIDIntConstant(Decl).Value = 0)) or
((Decl.ClassType = TIDCharConstant) and (TIDCharConstant(Decl).Value = #0)) or
((Decl.ClassType = TIDFloatConstant) and (TIDFloatConstant(Decl).Value = 0)) or
((Decl.ClassType = TIDStringConstant) and (TIDStringConstant(Decl).Value = '')) or
((Decl.ClassType = TIDDynArrayConstant) and (Length(TIDDynArrayConstant(Decl).Value) = 0));
end;
procedure WriteConstArgument(Stream: TStream; Value: Integer; Next: Boolean = False);
var
Prefix: UInt8;
ByteSize: Integer;
Edt: TDataTypeID;
begin
Edt := GetValueDataType(Value);
ByteSize := GetValueByteSize(Value);
Prefix := UInt8(ARG_IMMCONST) + UInt8(SYSUnit.DataTypes[Edt].Index);
if Next then Prefix := Prefix + UInt8(ARG_NEXT);
Stream.WriteUInt8(Prefix);
Stream.Write(Value, ByteSize);
end;
procedure WriteArgument(Stream: TStream; Declaration: TIDDeclaration; UnitID: Integer = -1; Next: Boolean = False);
var
Data: Int64;
Prefix: UInt8;
ByteSize: Integer;
EDataType: TDataTypeID;
begin
if Declaration.ItemType = itConst then
begin
{аргумент - табличная константа}
if (Declaration.ClassType = TIDStringConstant) then
begin
Data := Declaration.Index;
if Data = 0 then
Data := Declaration.Package.GetStringConstant(TIDStringConstant(Declaration).Value);
Prefix := (UInt8(TILARG_CLASS.ARG_SCONST) shl 2);
end else
if Declaration.ClassType = TIDDynArrayConstant then begin
if ZeroConstant(TIDConstant(Declaration)) then
begin
Data := 0;
Prefix := UInt8(ARG_IMMCONST) or UInt8(dtInt8);
end else begin
Data := Declaration.Index;
Prefix := (UInt8(TILARG_CLASS.ARG_TCONST) shl 2);
end;
end else
if Declaration.ClassType = TIDSizeofConstant then
begin
Data := TIDSizeofConstant(Declaration).AsInt64;
Prefix := (UInt8(TILARG_CLASS.ARG_SIZEOF) shl 2);
end else
if (Declaration.ItemType = itConst) and
(Declaration.DataType.DataTypeID in [dtRecord, dtStaticArray, dtGuid]) then
begin
Data := Declaration.Index;
Prefix := (UInt8(TILARG_CLASS.ARG_TCONST) shl 2);
end else
{аргумент - непосредственная константа}
begin
{для явно указанного типа пишем константу как есть}
if Assigned(TIDConstant(Declaration).ExplicitDataType) then
begin
ByteSize := TIDConstant(Declaration).ExplicitDataType.DataSize;
EDataType := TIDConstant(Declaration).ExplicitDataType.DataTypeID;
end else begin
{если тип явно не указан, выбираем подходящий}
ByteSize := TIDConstant(Declaration).ValueByteSize;
EDataType := TIDConstant(Declaration).ValueDataType;
end;
Data := TIDConstant(Declaration).AsInt64;
Prefix := UInt8(ARG_IMMCONST) or UInt8(EDataType);
if Next then Prefix := Prefix or UInt8(ARG_NEXT);
Stream.WriteUInt8(Prefix);
Stream.Write(Data, ByteSize);
Exit;
end;
end else
begin
{аргумент - переменная, процедура, тип}
case Declaration.ItemType of
itVar: Prefix := UInt8(TILARG_CLASS.ARG_VAR) shl 2;
itProcedure: if Assigned(TIDProcedure(Declaration).Struct) then
Prefix := UInt8(TILARG_CLASS.ARG_METHOD) shl 2
else
Prefix := UInt8(TILARG_CLASS.ARG_PROC) shl 2;
itType: Prefix := UInt8(TILARG_CLASS.ARG_TYPE) shl 2;
else
Prefix := 0;
end;
case Declaration.Scope.ScopeType of
stLocal: Prefix := Prefix or UInt8(ARG_SCOPE_LOCAL);
stGlobal: Prefix := Prefix or UInt8(ARG_SCOPE_GLOBAL);
stStruct: Prefix := Prefix or UInt8(ARG_SCOPE_STRUCT);
end;
Data := Declaration.SpaceIndex;
end;
if Next then
Prefix := Prefix + ARG_NEXT;
if (UnitID <> -1) and (Declaration.Scope.ScopeType <> stStruct) then
Prefix := Prefix or UInt8(ARG_SCOPE_UNIT);
Stream.WriteUInt8(Prefix);
if (UnitID <> -1) and (Declaration.Scope.ScopeType <> stStruct) then
Stream.WriteStretchUInt(UnitID);
Stream.WriteStretchUInt(Data);
end;
function GetUnitID(Proc: TIDProcedure; Decl: TIDDeclaration): Integer;
var
DeclUnit: TNPUnit;
begin
Result := -1;
// если Scope не определен, значит это временный обьект из текущего модуля
if Assigned(Decl.Scope) then
begin
DeclUnit := TNPUnit(Decl.DeclUnit);
if Assigned(DeclUnit) and (DeclUnit <> Proc.DeclUnit) then
Result := DeclUnit.UnitID;
end;
end;
procedure WriteILArgument(Proc: TIDProcedure; Stream: TStream; Declaration: TIDDeclaration); overload;
var
UnitID: Integer;
begin
UnitID := GetUnitID(Proc, Declaration);
WriteArgument(Stream, Declaration, UnitID, False);
end;
{записует список аргументов как цепочку (без кол-ва)}
procedure WriteILArgumentsChain(Proc: TIDProcedure; Stream: TStream; const Args: TIDExpressions); overload;
var
i, c: Integer;
BDT: TDataTypeID;
Arg: TIDExpression;
UnitID: Integer;
begin
c := Length(Args) - 1;
// вычисляем бызовый тип
BDT := Args[0].DataType.DataTypeID;
if BDT = dtPointer then
BDT := TIDPointer(Args[0].DataType).ReferenceType.DataTypeID;
for i := 0 to c do
begin
Arg := Args[i];
if (Arg.ItemType = itVar) and (BDT = dtRecord) and (i > 0) then
WriteConstArgument(Stream, Arg.Declaration.SpaceIndex, i < c)
else begin
UnitID := GetUnitID(Proc, Arg.Declaration);
WriteArgument(Stream, Arg.Declaration, UnitID, i < c);
end;
// вычисляем новый бызовый тип
BDT := Arg.DataTypeID;
if BDT = dtPointer then
if Assigned(TIDPointer(Arg.DataType).ReferenceType) then
BDT := TIDPointer(Arg.DataType).ReferenceType.DataTypeID;
end;
end;
procedure WriteILArgumentsChain(Proc: TIDProcedure; Stream: TStream; const Base, Member: TIDExpression); overload;
var
UnitID: Integer;
begin
UnitID := GetUnitID(Proc, Base.Declaration);
WriteArgument(Stream, Base.Declaration, UnitID, True);
if (Member.ItemType = itVar) and (Base.DataTypeID in [dtRecord, dtClass]) then
begin
WriteConstArgument(Stream, Member.Declaration.SpaceIndex, False)
end else
WriteArgument(Stream, Member.Declaration, UnitID, False);
end;
procedure WriteILArgument(Proc: TIDProcedure; Stream: TStream; Expression: TIDExpression; Next: Boolean = False); overload;
var
UnitID: Integer;
begin
if Expression.ExpressionType = etDeclaration then
begin
UnitID := GetUnitID(Proc, Expression.Declaration);
WriteArgument(Stream, Expression.Declaration, UnitID, Next)
end else
WriteILArgumentsChain(Proc, Stream, TIDMultiExpression(Expression).Items);
end;
procedure WriteILArguments(Proc: TIDProcedure; Stream: TStream; const Args: TIDExpressions; WriteElCountFirst: Boolean); overload; inline;
var
i, c: Integer;
begin
c := Length(Args);
if WriteElCountFirst then Stream.WriteStretchUInt(c);
for i := 0 to c - 1 do
WriteILArgument(Proc, Stream, Args[i]);
end;
function ConditionToStr(Condition: TILCondition): string;
begin
case Condition of
cEqual: Result := '[=] ';
cNotEqual: Result := '[<>] ';
cGreater: Result := '[>] ';
cGreaterOrEqual: Result := '[>=] ';
cLess: Result := '[<] ';
cLessOrEqual: Result := '[<=] ';
cZero: Result := '[=0] ';
cNonZero: Result := '[<>0] ';
else
Result := '';
end;
end;
{ TIL }
constructor TIL.Create(Proc: TIDProcedure);
var
V: TIDVariable;
begin
FProc := Proc;
FCFBRoot := TCFBlock.Create(nil);
FCFBRoot.FType := CFB_PROC;
FCFBCurrent := FCFBRoot;
{всем входным параметрам проставляем инициализацию}
V := Proc.VarSpace.First;
while Assigned(V) do begin
if VarParameter in V.Flags then
FCFBRoot.AddVariable(V);
V := TIDVariable(V.NextItem);
end;
end;
destructor TIL.Destroy;
{var
Block, DBlock: TCFBlock;}
begin
{Block := FCFBCurrent;
while Assigned(Block) do
begin
DBlock := Block;
Block := Block.FirstChild;
DBlock.Free;
end;}
inherited;
end;
procedure TIL.EnumerateArgs(const EnumProc: TILArgsEnumProc);
var
Code: TILInstruction;
BreakEnum: Boolean;
begin
Code := FFirst;
BreakEnum := False;
while Assigned(Code) do
begin
Code.EnumerateArgs(EnumProc, BreakEnum);
if BreakEnum then
Exit;
Code := Code.Next;
end;
end;
procedure TIL.Delete(FromInstruction, ToInstruction: TILInstruction);
var
Instruction: TILInstruction;
begin
while True do begin
Instruction := FromInstruction;
FromInstruction := FromInstruction.Next;
Delete(Instruction);
if Instruction = ToInstruction then
Exit;
end;
end;
procedure TIL.Delete(Instruction: TILInstruction);
var
Prev, Next: TILInstruction;
begin
ChecRefToInstruction(Instruction);
Prev := Instruction.Prev;
Next := Instruction.Next;
if Assigned(Prev) then
Prev.FNext := Next;
if Assigned(Next) then
Next.FPrev := Prev;
if Instruction = FFirst then
FFirst := Next;
if Instruction = FLast then
FLast := Prev;
Dec(FCount);
end;
function TIL.GetAsText(ShowCFB, ShowLineNum: Boolean): string;
var
c: Integer;
f: string;
Instruction: TILInstruction;
begin
c := Length(IntToStr(FCount));
f := DupeString('0', c);
Result := '';
Instruction := FFirst;
while Assigned(Instruction) do begin
Result := AddStringSegment(Result, FormatFloat(f, Instruction.Position) + ': ' + Instruction.Text, #10);
if ShowCFB then
if Assigned(Instruction.FCFBlock) then
Result := Result + ' // ' + GetEnumName(TypeInfo(TCFBlockType), Ord(Instruction.FCFBlock.FType))
else
Result := Result + ' // NULL';
if ShowLineNum then
Result := Result + ' //Line: ' + IntToStr(Instruction.Line);
Instruction := Instruction.Next;
end;
end;
function TIL.GetWriteCount(Expr: TIDExpression): Integer;
var
Code: TILInstruction;
begin
Result := 0;
Code := FLast;
while Assigned(Code) do
begin
if Code is TILDestInstruction then
begin
if TILDestInstruction(Code).Destination = Expr then
Inc(Result);
end;
Code := Code.Prev;
end;
end;
procedure TIL.InlineProc(DestinationProc, InlineProc: TIDProcedure; NextInstruction: TILInstruction;
Struct, FuncResult: TIDExpression; const Arguments: TIDExpressions);
type
TInlineCodeInfo = record
Src: TILInstruction;
Dst: TILInstruction;
end;
var
ILPos, i: Integer;
item: TIDVariable;
SourceIL: TIL;
SInstruction, DInstruction: TILInstruction;
InlineCodes: array of TInlineCodeInfo;
//Expr: TIDExpression;
Context: TPIContext;
begin
Context.InlineProc := InlineProc;
Context.EqualList := TIDPairList.Create;
{ Создаем спосок соответствий локальных/временных переменных и параметров встраиваемой функции
и аргументов функции назначения}
// порядок следования параметров в функции/методе/процедуре: [RESULT][SELF][PARAM1...]
item := TIDVariable(InlineProc.VarSpace.First);
// результат
if Assigned(FuncResult) then begin
Context.EqualList.InsertNode(item, FuncResult);
item := TIDVariable(item.NextItem);
end;
// self-параметр
if Assigned(Struct) then begin
Context.MethodSelf := Struct;
Context.EqualList.InsertNode(item, Struct);
item := TIDVariable(item.NextItem);
end;
// параметры
for i := 0 to Length(Arguments) - 1 do begin
(*if (not item.Reference {and (item.WriteCount > 0)}) and ((i > 0) or not assigned(InlineProc.Struct)) then begin
// делаем копию при передаче аргумента по значению
Expr := TIDExpression.Create(DestinationProc.GetTMPVar(item.DataType));
Write(IL_Move(Expr, Arguments[i]));
Context.EqualList.InsertNode(item, Expr);
end else*)
Context.EqualList.InsertNode(item, Arguments[i]);
item := TIDVariable(item.NextItem);
end;
// локальные переменные
while Assigned(item) do begin
if item.ItemType = itVar then
Context.EqualList.InsertNode(item, TIDExpression.Create(DestinationProc.GetTMPVar(item.DataType, item.Reference)));
item := TIDVariable(item.NextItem);
end;
// временные переменные
(*with InlineFunc.TempVars do
for i := 0 to Count - 1 do begin
item := TIDVariable(InlineFunc.TempVars.items[i]);
i2 := DestinationFunc.GetTMPVar(item.DataType, item.Reference);
Context.EqualList.InsertNode(item, TIDExpression.Create(i2));
end;*)
ILPos := 0;
SourceIL := TIL(InlineProc.IL);
SetLength(InlineCodes, SourceIL.Count);
SInstruction := SourceIL.First;
while Assigned(SInstruction) do
begin
SInstruction.Position := ILPos;
if SInstruction.ILCode <> icRet then
begin
Context.Instruction := SInstruction;
DInstruction := TILInstructionClass(SInstruction.ClassType).Create;
DInstruction.SwapArguments(Context);
if DInstruction.ILCode = icGetSelfPtr then
TILGetPtr(DInstruction).FBase := Struct;
end else begin
// если встретился RET (не последний),- заменяем его на JMP на конец процедуры
if Assigned(SInstruction.Next) then
DInstruction := TILJmpNext.Create(SInstruction.Line)
else
DInstruction := TIL.IL_Nope;
end;
DInstruction.Condition := SInstruction.Condition;
with InlineCodes[ILPos] do
begin
Src := SInstruction;
Dst := DInstruction;
end;
Inc(ILPos);
InsertAfter(NextInstruction, DInstruction);
NextInstruction := DInstruction;
SInstruction := SInstruction.Next;
end;
Context.EqualList.Free;
// корректировка переходов
for i := 0 to SourceIL.Count - 1 do begin
SInstruction := InlineCodes[i].Src;
if SInstruction.ILCode = icJmp then
begin
ILPos := TILJampedInstruction(SInstruction).Destination.Position;
DInstruction := InlineCodes[ILPos].Dst;
TILJampedInstruction(InlineCodes[i].Dst).Destination := DInstruction;
end else
// если это не последний RET - корректируем смещение
if (SInstruction.ILCode = icRet) and (i < SourceIL.Count - 1) then
TILJampedInstruction(InlineCodes[i].Dst).Destination := InlineCodes[SourceIL.Count - 1].Dst;
end;
end;
procedure TIL.Write(const Instruction: TILInstruction);
begin
if Assigned(FLast) then begin
Instruction.FPrev := FLast;
FLast.FNext := Instruction;
end else
FFirst := Instruction;
FLast := Instruction;
Instruction.FCFBlock := FCFBCurrent;
{$IFDEF DEBUG}
Instruction.Position := FCount;
{$ENDIF}
Inc(FCount);
end;
procedure TIL.InsertAfter(Instruction, NewInstruction: TILInstruction);
var
Next: TILInstruction;
begin
{если Instruction = nil вставляем в начало}
if not Assigned(Instruction) then
begin
NewInstruction.FNext := FFirst;
NewInstruction.FCFBlock := FCFBCurrent;
if Assigned(FFirst) then
FFirst.FPrev := NewInstruction
else
FLast := NewInstruction;
FFirst := NewInstruction;
Inc(FCount);
Exit;
end;
Next := Instruction.Next;
Instruction.FNext := NewInstruction;
if Assigned(Next) then
Next.FPrev := NewInstruction;
NewInstruction.FNext := Next;
NewInstruction.FPrev := Instruction;
NewInstruction.FCFBlock := Instruction.FCFBlock;
if Instruction = FLast then
FLast := NewInstruction;
Inc(FCount);
end;
procedure TIL.InsertBefore(Instruction, NewInstruction: TILInstruction);
var
Prev: TILInstruction;
begin
{если Instruction = nil вставляем в начало}
if not Assigned(Instruction) then
begin
NewInstruction.FNext := FFirst;
if Assigned(FFirst) then
FFirst.FPrev := NewInstruction
else
FLast := NewInstruction;
FFirst := NewInstruction;
NewInstruction.FCFBlock := FCFBCurrent;
Inc(FCount);
Exit;
end;
Prev := Instruction.Prev;
Instruction.FPrev := NewInstruction;
if Assigned(Prev) then
Prev.FNext := NewInstruction;
NewInstruction.FPrev := Prev;
NewInstruction.FNext := Instruction;
NewInstruction.FCFBlock := Instruction.FCFBlock;
if Instruction = FFirst then
FFirst := NewInstruction;
Inc(FCount);
end;
procedure TIL.InsertFirst(Instruction: TILInstruction);
begin
if Assigned(FFirst) then
FFirst.FPrev := Instruction
else
FLast := Instruction;
Instruction.FPrev := nil;
Instruction.FNext := FFirst;
Instruction.FCFBlock := FCFBCurrent;
FFirst := Instruction;
{$IFDEF DEBUG}
Instruction.Position := FCount;
{$ENDIF}
Inc(FCount);
end;
procedure TIL.SaveToStream(Stream: TStream; const Package: INPPackage);
var
Instruction: TILInstruction;
begin
{завершающая инструкция Return отсутствует (оптимизация), ее добавляет транслятор если нужно}
Stream.WriteStretchUInt(FCount); // кол-во инструкций
Instruction := FFirst;
while Assigned(Instruction) do
begin
Instruction.Write(FProc, Stream);
if Package.IncludeDebugInfo then
Stream.WriteStretchUInt(Instruction.Line);
// {$IFDEF DEBUG}Stream.WriteUInt32($10203040);{$ENDIF}
Instruction := Instruction.Next;
end;
end;
class function TIL.IL_Add(Dst, Left, Right: TIDExpression): TILAdd;
begin
Result := TILAdd.Create;
Result.Init(cNone, Dst, Left, Right);
end;
class function TIL.IL_And(Dst, Left, Right: TIDExpression): TILAnd;
begin
Result := TILAnd.Create;
Result.Init(cNone, Dst, Left, Right);
end;
class function TIL.IL_LDMethod(const Dst, Base, Member: TIDExpression): TILLDMethod;
begin
Result := TILLDMethod.Create;
Result.Init(cNone, Dst);
Result.FBase := Base;
Result.FMember := Member;
end;
class function TIL.IL_Length(const Dst, Src: TIDExpression): TILArrayLength;
begin
Result := TILArrayLength.Create;
Result.Init(cNone, Dst, Src);
end;
class function TIL.IL_Convert(Dst, Src: TIDExpression): TILConvert;
begin
Result := TILConvert.Create;
Result.Init(cNone, Dst, Src);
end;
class function TIL.IL_Copy(const Dst, Src, From, Count: TIDExpression): TILArrayCopy;
begin
Result := TILArrayCopy.Create;
Result.Init(cNone, Dst, Src);
Result.FFrom := From;
Result.FCount := Count;
end;
class function TIL.IL_MoveArray(const SrcArr, SrcIdx, DstArr, DstIdx, Count: TIDExpression): TILMemMove;
begin
Result := TILMemMove.Create;
Result.FSrcArr := SrcArr;
Result.FSrcIDx := SrcIdx;
Result.FDstArr := DstArr;
Result.FDstIdx := DstIdx;
Result.FCnt := Count;
end;
class function TIL.IL_RAlloc(const Dst, Src: TIDExpression): TILArrayRAlloc;
begin
Result := TILArrayRAlloc.Create;
Result.Init(cNone, Dst, Src);
end;
class function TIL.IL_Or(Dst, Left, Right: TIDExpression): TILOr;
begin
Result := TILOr.Create;
Result.Init(cNone, Dst, Left, Right);
end;
class function TIL.IL_Xor(Dst, Left, Right: TIDExpression): TILXor;
begin
Result := TILXor.Create;
Result.Init(cNone, Dst, Left, Right);
end;
procedure TIL.OptimizeIL;
var
Cur, Next, New: TILInstruction;
begin
Cur := FFirst;
while Assigned(Cur) do begin
Next := Cur.Next;
if not Assigned(Next) then
Exit;
if (Cur.ILCode = icCmp) and (Next.ILCode = icJmp) and (Cur.Condition = cNone) then
begin
New := TIL.IL_CmpJmp(Next.Condition, TILCompareInstruction(Cur).Left, TILCompareInstruction(Cur).Right, TILJmp(Next).Destination);
Delete(Next);
Replace(Cur, New);
Cur := New.Next
end else
Cur := Next;
end;
end;
procedure TIL.AddVariable(const Variable: TIDVariable);
begin
FCFBCurrent.AddVariable(Variable);
end;
procedure TIL.CECalc;
var
Ctx: TILCECalcContext;
Instr: TILInstruction;
str: string;
begin
Ctx.Next := nil;
Ctx.Cond := False;
Ctx.Return := False;
Instr := FFirst;
while Assigned(Instr) do
begin
str := Instr.Text;
Instr.CECalc(Ctx);
if Ctx.Return then
Break;
if Assigned(Ctx.Next) then
begin
Instr := Ctx.Next;
Ctx.Next := nil;
end else
Instr := Instr.Next;
end;
end;
procedure TIL.CFBBegin(const CFBlockType: TCFBlockType);
var
Block, Parent: TCFBlock;
begin
Parent := FCFBCurrent;
case CFBlockType of
CFB_IF: begin
Block := TCFBIF.Create(Parent);
Block.Prev := Parent.LastChild;
Parent.LastChild := Block;
end;
CFB_IF_THEN: begin
Assert(Parent.BlockType = CFB_IF);
Assert(TCFBIF(Parent).FTrue = nil);
Block := TCFBlock.Create(Parent);
TCFBIF(Parent).FTrue := Block;
end;
CFB_IF_ELSE: begin
Assert(Parent.BlockType = CFB_IF);
Assert(TCFBIF(Parent).FElse = nil);
Block := TCFBlock.Create(Parent);
TCFBIF(Parent).FElse := Block;
end;
CFB_CASE: begin
Block := TCFBCASE.Create(Parent);
Block.Prev := Parent.LastChild;
Parent.LastChild := Block;
end;
CFB_CASE_ENTRY: begin
Assert(Parent.BlockType = CFB_CASE);
Block := TCFBlock.Create(Parent);
TCFBCASE(Parent).FLastItem := Block;
end;
else
Block := TCFBlock.Create(Parent);
Block.Prev := Parent.LastChild;
Parent.LastChild := Block;
end;
Block.FType := CFBlockType;
FCFBCurrent := Block;
end;
procedure TIL.CFBEnd(const CFBlockType: TCFBlockType);
begin
Assert(Assigned(FCFBCurrent));
Assert(FCFBCurrent.BlockType = CFBlockType);
FCFBCurrent := FCFBCurrent.Parent;
end;
procedure TIL.CheckVarsInitialized;
var
Instruction: TILInstruction;
begin
Instruction := FFirst;
while Assigned(Instruction) do
begin
Instruction.ProcessVarInit(FProc);
Instruction := Instruction.Next;
end;
end;
procedure TIL.ChecRefToInstruction(Instruction: TILInstruction);
var
Curr: TILInstruction;
begin
Curr := FFirst;
while Assigned(Curr) do begin
if Curr is TILJampedInstruction then
if TILJampedInstruction(Curr).Destination = Instruction then
TILJampedInstruction(Curr).Destination := Instruction.Next;
Curr := Curr.Next;
end;
end;
procedure TIL.Complete(var RCPath: UInt32);
var
i, JmpPos: Integer;
Instr, RetCode: TILInstruction;
begin
// OptimizeIL; !!! пока не поддерживается
i := 0;
Instr := FFirst;
while Assigned(Instr) do
begin
if Instr.ILCode <> icNope then
begin
Instr.Position := i;
// проставляем зависимости
Instr.IncReferences(RCPath);
Inc(i);
end else
Delete(Instr); // удаляем инструкции-пустышки {}
Instr := Instr.Next;
end;
Instr := FFirst;
while Assigned(Instr) do
begin
// Замена переходов за пределы процедуры на RET
if (Instr.ILCode = icJmp) then
begin
JmpPos := TILJampedInstruction(Instr).DestinationPosition;
if (JmpPos >= i) or (JmpPos < 0) then
begin
RetCode := IL_Ret(Instr.Line, Instr.Condition);
Replace(Instr, RetCode);
end;
end;
Instr := Instr.Next;
end;{}
end;
procedure TIL.CopyFrom(const IL: TIL);
var
Inst: TILInstruction;
begin
Inst := IL.First;
while Assigned(Inst) do
begin
Write(Inst);
Inst := Inst.Next;
end;
end;
procedure TIL.RemoveReferences(var RCPath: UInt32);
var
Instr: TILInstruction;
begin
Instr := FFirst;
while Assigned(Instr) do
begin
Instr.DecReferences(RCPath);
Instr := Instr.Next;
end;
end;
procedure TIL.Replace(const Prev, New: TILInstruction);
var
Inst: TILInstruction;
begin
Inst := Prev.Prev;
if Assigned(Inst) then
Inst.FNext := New
else
FFirst := New;
New.FPrev := Inst;
Inst := Prev.Next;
if Assigned(Inst) then
Inst.FPrev := New
else
FLast := New;
New.FNext := Inst;
New.Position := Prev.Position;
New.FCFBlock := Prev.FCFBlock;
ReplaceJmpTarget(Prev, New);
end;
procedure TIL.ReplaceJmpTarget(const OldTarget, NewTarget: TILInstruction);
var
Inst: TILInstruction;
begin
Inst := FFirst;
while Assigned(Inst) do
begin
if (Inst.ILCode = icJmp) and (TILJmp(Inst).Destination = OldTarget) then
TILJmp(Inst).Destination := NewTarget;
Inst := Inst.Next;
end;
end;
class function TIL.IL_Init(Dst: TIDExpression): TILInit;
begin
Result := TILInit.Create;
Result.Init(cNone, Dst);
end;
{class function TIL.IL_Final(Dst: TIDExpression): TILFinal;
begin
Result := TILFinal.Create;
Result.Init(cNone, Dst);
end;}
class function TIL.IL_Ret(Line: Integer; Condition: TILCondition = cNone): TILRet;
begin
Result := TILRet.Create(Line);
Result.Condition := Condition;
end;
class function TIL.IL_ProcCall(Proc, Dst, Instance: TIDExpression; const Args: TIDExpressions): TILProcCall;
begin
Result := TILProcCall.Create;
Result.Init(cNone, Proc, Dst, Instance, Args);
end;
class function TIL.IL_ProcCallUnSafe(Proc, Dst, Instance: TIDExpression; const Args: TIDExpressions): TILProcCallUnSafe;
begin
Result := TILProcCallUnSafe.Create;
Result.Init(cNone, Proc, Dst, Instance, Args);
end;
class function TIL.IL_QueryType(const Dst, Src, DstType: TIDExpression): TILQueryType;
begin
Result := TILQueryType.Create;
Result.Init(cNone, Dst, Src, DstType);
end;
class function TIL.IL_VirtCall(Proc, Dst, Instance: TIDExpression; const Args: TIDExpressions): TILVirtCall;
begin
Result := TILVirtCall.Create;
Result.Init(cNone, Proc, Dst, Instance, Args);
end;
class function TIL.IL_IncRef(Dst: TIDExpression): TILIncRef;
begin
Result := TILIncRef.Create;
Result.Init(cNone, Dst);
end;
class function TIL.IL_InheritedCall(Proc, Dst, Instance: TIDExpression; const Args: TIDExpressions): TILInheritedCall;
begin
Result := TILInheritedCall.Create;
Result.Init(cNone, Proc, Dst, Instance, Args);
end;
class function TIL.IL_Cast(Dst, Src: TIDExpression): TILCast;
begin
Result := TILCast.Create;
Result.Init(cNone, Dst, Src);
end;
class function TIL.IL_CheckBound(Src, Index: TIDExpression): TILCheckBound;
begin
Result := TILCheckBound.Create;
Result.Init(cNone, Src, Index);
end;
class function TIL.IL_Cmp(Left, Right: TIDExpression): TILCmp;
begin
Result := TILCmp.Create;
Result.Init(cNone, Left, Right);
end;
class function TIL.IL_CmpJmp(Cond: TILCondition; Left, Right: TIDExpression; Destination: TILInstruction): TILCmpJmp;
begin
Result := TILCmpJmp.Create;
Result.Init(Cond, Left, Right, Destination);
end;
class function TIL.IL_Div(Dst, Left, Right: TIDExpression): TILDiv;
begin
Result := TILDiv.Create;
Result.Init(cNone, Dst, Left, Right);
end;
class function TIL.IL_TryBegin(Dest: TILInstruction; Line: Integer): TILTryBegin;
begin
Result := TILTryBegin.Create(0);
Result.Destination := Dest;
Result.Line := Line;
end;
class function TIL.IL_TryEnd(Line: Integer): TILTryEnd;
begin
Result := TILTryEnd.Create(0);
Result.Line := Line;
end;
class function TIL.IL_TypeInfo(const Dst, Src: TIDExpression): TILTypeInfo;
begin
Result := TILTypeInfo.Create;
Result.Init(cNone, Dst, Src);
end;
class function TIL.IL_TryCallHandler: TILTryCallHandler;
begin
Result := TILTryCallHandler.Create;
end;
class function TIL.IL_GetPtr(Dst: TIDExpression; const Args: TIDExpressions): TILGetPtrMulti;
begin
Result := TILGetPtrMulti.Create;
Result.Init(cNone, Dst, Args);
end;
class function TIL.IL_GetPtr(Dst: TIDExpression; const Base, Member: TIDExpression): TILGetPtr;
begin
Result := TILGetPtr.Create;
Result.Init(cNone, Dst);
Result.FBase := Base;
Result.FMember := Member;
end;
class function TIL.IL_IntDiv(Dst, Left, Right: TIDExpression): TILIntDiv;
begin
Result := TILIntDiv.Create;
Result.Init(cNone, Dst, Left, Right);
end;
class function TIL.IL_Macro(const Dst: TIDExpression; MacroID: TILMacroID; const Args: TIDExpressions): TILFMacro;
begin
Result := TILFMacro.Create;
Result.Init(cNone, Dst, Args);
Result.FMacroID := MacroID;
end;
class function TIL.IL_MemSet(const Dst, SetByte: TIDExpression): TILMemSet;
begin
Result := TILMemSet.Create;
Result.Init(cNone, Dst, SetByte);
end;
class function TIL.IL_ModDiv(Dst, Left, Right: TIDExpression): TILMod;
begin
Result := TILMod.Create;
Result.Init(cNone, Dst, Left, Right);
end;
class function TIL.IL_Jmp(Line: Integer; Condition: TILCondition; Destination: TILInstruction): TILJmp;
begin
Result := TILJmp.Create(Line);
Result.Condition := Condition;
Result.Destination := Destination;
end;
class function TIL.IL_JmpNext(Line: Integer; Condition: TILCondition; Destination: TILInstruction): TILJmpNext;
begin
Result := TILJmpNext.Create(Line);
Result.Condition := Condition;
Result.Destination := Destination;
end;
class function TIL.IL_Move(Dst, Src: TIDExpression): TILMove;
begin
Result := TILMove.Create;
Result.Init(cNone, Dst, Src);
end;
class function TIL.IL_Move(Cond: TILCondition; Dst, Src: TIDExpression): TILMove;
begin
Result := TILMove.Create;
Result.Init(Cond, Dst, Src);
end;
class function TIL.IL_LoadAddress(const Dst, Src: TIDExpression; Offset: TIDExpression = nil): TILLoadAddr;
begin
Result := TILLoadAddr.Create;
Result.Init(cNone, Dst, Src, Offset);
end;
class function TIL.IL_Mul(Dst, Left, Right: TIDExpression): TILMul;
begin
Result := TILMul.Create;
Result.Init(cNone, Dst, Left, Right);
end;
class function TIL.IL_NearCall(Dest: TILInstruction): TILNearCall;
begin
Result := TILNearCall.Create(0);
Result.Destination := Dest;
end;
class function TIL.IL_Neg(Dst, Src: TIDExpression): TILNeg;
begin
Result := TILNeg.Create;
Result.Init(cNone, Dst, Src);
end;
class function TIL.IL_New(const Dst: TIDExpression): TILMemGet;
begin
Result := TILMemGet.Create;
Result.Init(cNone, Dst);
end;
class function TIL.IL_DNew(Dst, Instance: TIDExpression): TILDNewObj;
begin
Result := TILDNewObj.Create;
Result.Init(cNone, Dst);
Result.FInstance := Instance;
end;
class function TIL.IL_ReadDRef(Dst, Src: TIDExpression): TILReadDRef;
begin
Result := TILReadDRef.Create;
Result.Init(cNone, Dst, Src);
end;
class function TIL.IL_RefCount(const Dst, Src: TIDExpression): TILRefCount;
begin
Result := TILRefCount.Create;
Result.Init(cNone, Dst, Src);
end;
class function TIL.IL_WriteDRef(Dst, Src: TIDExpression): TILWriteDRef;
begin
Result := TILWriteDRef.Create;
Result.Init(cNone, Dst, Src);
end;
class function TIL.IL_FreeInstance(const Dst: TIDExpression): TILMemFree;
begin
Result := TILMemFree.Create;
Result.Init(cNone, Dst);
end;
class function TIL.IL_StrongRef(const Dst, Src: TIDExpression): TILStrongRef;
begin
Result := TILStrongRef.Create;
Result.Init(cNone, Dst, Src);
end;
class function TIL.IL_WeakRef(const Dst, Src: TIDExpression): TILWeakRef;
begin
Result := TILWeakRef.Create;
Result.Init(cNone, Dst, Src);
end;
class function TIL.IL_Nope: TILNope;
begin
Result := TILNope.Create(0);
end;
class function TIL.IL_Not(Dst, Src: TIDExpression): TILNot;
begin
Result := TILNot.Create;
Result.Init(cNone, Dst, Src);
end;
class function TIL.IL_Now(const Dst: TIDExpression): TILNow;
begin
Result := TILNow.Create;
Result.Init(cNone, Dst);
end;
class function TIL.IL_SetBool(Cond: TILCondition; Dst: TIDExpression): TILSetBool;
begin
Result := TILSetBool.Create;
Result.Init(Cond, Dst);
end;
class function TIL.IL_GetBit(Dst, Value, BitIndex: TIDExpression): TILGetBit;
begin
Result := TILGetBit.Create;
Result.Init(cNone, Dst, Value, BitIndex);
end;
class function TIL.IL_SetBit(Dst, BitIndex, BitValue: TIDExpression): TILSetBit;
begin
Result := TILSetBit.Create;
Result.Init(cNone, Dst, BitIndex, BitValue);
end;
class function TIL.IL_Shl(Dst, Left, Right: TIDExpression): TILShl;
begin
Result := TILShl.Create;
Result.Init(cNone, Dst, Left, Right);
end;
class function TIL.IL_Shr(Dst, Left, Right: TIDExpression): TILShr;
begin
Result := TILShr.Create;
Result.Init(cNone, Dst, Left, Right);
end;
class function TIL.IL_DAlloc(const Dst, Src: TIDExpression): TILArrayDAlloc;
begin
Result := TILArrayDAlloc.Create;
Result.Init(cNone, Dst, Src);
end;
class function TIL.IL_DecRef(Dst: TIDExpression): TILDecRef;
begin
Result := TILDecRef.Create;
Result.Init(cNone, Dst);
end;
class function TIL.IL_SAlloc(const Dst, Src: TIDExpression): TILArraySAlloc;
begin
Result := TILArraySAlloc.Create;
Result.Init(cNone, Dst, Src);
end;
class function TIL.IL_Sub(Dst, Left, Right: TIDExpression): TILSub;
begin
Result := TILSub.Create;
Result.Init(cNone, Dst, Left, Right);
end;
class function TIL.IL_Sub(Cond: TILCondition; Dst, Left, Right: TIDExpression): TILSub;
begin
Result := TILSub.Create;
Result.Init(Cond, Dst, Left, Right);
end;
class function TIL.IL_Test(Left, Right: TIDExpression): TILTest;
begin
Result := TILTest.Create;
Result.Init(cNone, Left, Right);
end;
class function TIL.IL_EThrow(Condition: TILCondition; ExceptExpr: TIDExpression): TILEThrow;
begin
Result := TILEThrow.Create;
Result.Init(Condition, ExceptExpr);
end;
class function TIL.IL_Unique(Dst: TIDExpression): TILUniqueInstruction;
begin
Result := TILUniqueInstruction.Create;
Result.Init(cNone, Dst);
end;
{ TILInstruction }
function TILInstruction.ArgumentsCount: Integer;
begin
Result := 0;
end;
procedure _ERROR_VAR_IS_NOT_INITIALIZED(Proc: TIDProcedure; const Arg: TIDExpression);
begin
Proc.Warning('Variable "%s" is not initialized', [Arg.DisplayName], Arg.TextPosition);
end;
procedure TILInstruction.CheckArgInit(Proc: TIDProcedure; Expr: TIDExpression);
begin
if Assigned(Expr) and Expr.IsLocalVar then
begin
if Expr.DataTypeID in [dtStaticArray, dtRecord] then
Exit;
if not FCFBlock.IsVarInitialized(Expr.AsVariable) then
_ERROR_VAR_IS_NOT_INITIALIZED(Proc, Expr);
end;
end;
constructor TILInstruction.Create;
begin
CreateFromPool;
end;
procedure TILInstruction.EnumerateArgs(const EnumProc: TILArgsEnumProc; var BreakEnum: Boolean);
begin
end;
function TILInstruction.GetArgument(Index: Integer): TIDExpression;
begin
Result := nil;
end;
function TILInstruction.GetLine: Integer;
begin
Result := -1;
end;
function TILInstruction.ILCodeString(InUpperCase: Boolean): string;
begin
Result := GetILCodeName(ILCode);
if InUpperCase then
Result := UpperCase(Result);
end;
procedure TILInstruction.IncReferences(var RCPath: UInt32);
begin
end;
procedure TILInstruction.ProcessVarInit(Proc: TIDProcedure);
begin
end;
function TILInstruction.CondAsText: string;
begin
case FCondition of
cEqual: Result := '[=] ';
cNotEqual: Result := '[<>] ';
cGreater: Result := '[>] ';
cGreaterOrEqual: Result := '[>=] ';
cLess: Result := '[<] ';
cLessOrEqual: Result := '[<=] ';
cZero: Result := '[=0] ';
cNonZero: Result := '[<>0] ';
else
Result := '';
end;
end;
function TILInstruction.Text: string;
begin
Result := CondAsText;
end;
procedure TILInstruction.DecReferences(var RCPath: UInt32);
begin
end;
procedure TILInstruction.Read(Stream: TStream);
begin
FCondition := TILCondition(Stream.ReadUInt8);
end;
procedure TILInstruction.RemoveBack(ToInstruction: TILInstruction);
begin
end;
{ TILDstSrcInstruction }
function TILDstSrcInstruction.ArgumentsCount: Integer;
begin
Result := 2;
end;
procedure TILDstSrcInstruction.EnumerateArgs(const EnumProc: TILArgsEnumProc; var BreakEnum: Boolean);
begin
EnumProc(FDestination, BreakEnum);
if BreakEnum then
Exit;
EnumProc(FSource, BreakEnum);
end;
function TILDstSrcInstruction.GetArgument(Index: Integer): TIDExpression;
begin
case Index of
0: Result := FDestination;
1: Result := FSource;
else Result := nil;
end;
end;
function TILDstSrcInstruction.GetLine: Integer;
begin
Result := inherited GetLine;
if Result = 0 then
Result := FSource.Line;
end;
procedure TILDstSrcInstruction.Init(Condition: TILCondition; Destination, Source: TIDExpression);
begin
Init(Condition, Destination);
FSource := Source;
end;
procedure TILDstSrcInstruction.IncReferences(var RCPath: UInt32);
begin
IncReadCount(FDestination, Self, RCPath); Inc(RCPath);
IncReadCount(FSource, Self, RCPath); Inc(RCPath);
end;
procedure TILDstSrcInstruction.DecReferences(var RCPath: UInt32);
begin
DecReadCount(FDestination, Self, RCPath); Inc(RCPath);
DecReadCount(FSource, Self, RCPath); Inc(RCPath);
end;
procedure TILDstSrcInstruction.ProcessVarInit(Proc: TIDProcedure);
begin
inherited;
CheckArgInit(Proc, FSource);
end;
function TILDstSrcInstruction.Text: string;
begin
Result := Format('%s, %s', [inherited Text, ExpressionName(FSource)]);
end;
procedure TILInstruction.SwapArguments(const Context: TPIContext);
begin
FCFBlock := Context.Instruction.FCFBlock;
end;
procedure WriteILCode(Stream: TStream; ILCode: TILCode; Condition: TILCondition); inline;
var
CodeByte: UInt8;
begin
CodeByte := UInt8(ILCode);
if Condition <> cNone then
CodeByte := CodeByte or 128;
Stream.WriteUInt8(CodeByte);
if Condition <> cNone then
Stream.WriteUInt8(UInt8(Condition));
end;
procedure TILInstruction.Write(Proc: TIDProcedure; Stream: TStream);
begin
WriteILCode(Stream, ILCode, FCondition);
end;
{ TILMove }
procedure TILMove.CECalc(var Ctx: TILCECalcContext);
begin
FDestination.CValue := FSource.CValue;
end;
function TILMove.ILCode: TILCode;
var
Src: TIDDeclaration;
begin
Src := Source.Declaration;
if (Source.ExpressionType = etDeclaration) and (Src.ItemType = itConst) and ZeroConstant(TIDConstant(Src)) then
Result := icMoveZero
else
Result := icMove;
end;
function TILMove.Text: string;
begin
if ILCode = icMove then
Result := 'MOVE ' + inherited Text
else
Result := 'MOVEZERO ' + CondAsText + ExpressionName(FDestination);
end;
procedure TILMove.Write(Proc: TIDProcedure; Stream: TStream);
var
MoveCode: TILCode;
begin
MoveCode := ILCode;
WriteILCode(Stream, MoveCode, FCondition);
WriteILArgument(Proc, Stream, Destination);
if MoveCode <> icMoveZero then
WriteILArgument(Proc, Stream, FSource);
end;
{ TILDstSrcSrcInstruction }
function TILDstSrcSrcInstruction.ArgumentsCount: Integer;
begin
Result := 3;
end;
procedure TILDstSrcSrcInstruction.ProcessVarInit(Proc: TIDProcedure);
begin
inherited;
CheckArgInit(Proc, Left);
CheckArgInit(Proc, Right);
end;
procedure TILDstSrcSrcInstruction.EnumerateArgs(const EnumProc: TILArgsEnumProc; var BreakEnum: Boolean);
begin
EnumProc(FDestination, BreakEnum);
if BreakEnum then
Exit;
EnumProc(FLeft, BreakEnum);
if BreakEnum then
Exit;
if Assigned(FRight) then
EnumProc(FRight, BreakEnum);
end;
function TILDstSrcSrcInstruction.GetArgument(Index: Integer): TIDExpression;
begin
case Index of
0: Result := FDestination;
1: Result := FLeft;
2: Result := FRight;
else Result := nil;
end;
end;
procedure TILDstSrcSrcInstruction.Init(Condition: TILCondition; Dest, Left, Right: TIDExpression);
begin
Init(Condition, Dest);
FLeft := Left;
FRight := Right;
end;
procedure TILDstSrcSrcInstruction.IncReferences(var RCPath: UInt32);
begin
IncReadCount(FDestination, Self, RCPath); Inc(RCPath);
IncReadCount(FLeft, Self, RCPath); Inc(RCPath);
IncReadCount(FRight, Self, RCPath); Inc(RCPath);
end;
procedure TILDstSrcSrcInstruction.DecReferences(var RCPath: UInt32);
begin
DecReadCount(FDestination, Self, RCPath); Inc(RCPath);
DecReadCount(FLeft, Self, RCPath); Inc(RCPath);
DecReadCount(FRight, Self, RCPath); Inc(RCPath);
end;
function TILDstSrcSrcInstruction.Text: string;
begin
if Assigned(FRight) then
Result := Format('%s, %s, %s', [inherited Text, ExpressionName(FLeft), ExpressionName(FRight)])
else
Result := Format('%s, %s', [inherited Text, ExpressionName(FLeft)])
end;
{ TILAdd }
procedure TILAdd.CECalc(var Ctx: TILCECalcContext);
begin
FDestination.CValue := ProcessConstOperation(FLeft.CValue, FRight.CValue, opAdd);
end;
function TILAdd.ILCode: TILCode;
var
Dest: TIDDeclaration;
begin
Dest := Destination.Declaration;
if ((Left.ExpressionType = etDeclaration) and (Left.ItemType = itConst) and (Dest = Right.Declaration) and (Left.Declaration = SYSUnit._OneConstant)) or
((Right.ExpressionType = etDeclaration) and (Right.ItemType = itConst) and (Dest = Left.Declaration) and (Right.Declaration = SYSUnit._OneConstant)) then
Result := icInc
else
if ((Destination.ExpressionType = etDeclaration) and (Dest = Left.Declaration)) or // нужно дописать полную проверку для цепочек
((Destination.ExpressionType = etDeclaration) and (Dest = Right.Declaration)) then
Result := icAdd2
else
Result := icAdd;
end;
function TILAdd.Text: string;
begin
if ILCode = icInc then begin
Result := 'INC ' + ConditionToStr(Condition) + ExpressionName(FDestination);
end else
Result := 'ADD ' + inherited Text;
end;
procedure TILAdd.Write(Proc: TIDProcedure; Stream: TStream);
var
iCode: TILCode;
begin
iCode := ILCode;
WriteILCode(Stream, iCode, FCondition);
WriteILArgument(Proc, Stream, Destination);
if (iCode = icInc) then Exit;
if (iCode = icAdd) or ((iCode = icAdd2) and (Right.Declaration = Destination.Declaration)) then
WriteILArgument(Proc, Stream, Left)
else
WriteILArgument(Proc, Stream, Right);
if iCode = icAdd then
WriteILArgument(Proc, Stream, Right);
end;
{ TILIntDiv }
procedure TILIntDiv.CECalc(var Ctx: TILCECalcContext);
begin
FDestination.CValue := ProcessConstOperation(FLeft.CValue, FRight.CValue, opIntDiv);
end;
function TILIntDiv.ILCode: TILCode;
begin
if Destination.Declaration <> Left.Declaration then
Result := icIntDiv
else
Result := icIntDiv2;
end;
function TILIntDiv.Text: string;
begin
Result := 'DIV ' + inherited Text;
end;
{ TILDiv }
procedure TILDiv.CECalc(var Ctx: TILCECalcContext);
begin
FDestination.CValue := ProcessConstOperation(FLeft.CValue, FRight.CValue, opDivide);
end;
function TILDiv.ILCode: TILCode;
begin
if Destination.Declaration <> Left.Declaration then
Result := icDiv
else
Result := icDiv2;
end;
function TILDiv.Text: string;
begin
Result := 'DIV ' + inherited Text;
end;
{ TILMod }
procedure TILMod.CECalc(var Ctx: TILCECalcContext);
begin
FDestination.CValue := ProcessConstOperation(FLeft.CValue, FRight.CValue, opModDiv);
end;
function TILMod.ILCode: TILCode;
begin
if Destination.Declaration <> Left.Declaration then
Result := icModDiv
else
Result := icModDiv2;
end;
function TILMod.Text: string;
begin
Result := 'MOD ' + inherited Text;
end;
{ TILMul }
procedure TILMul.CECalc(var Ctx: TILCECalcContext);
begin
FDestination.CValue := ProcessConstOperation(FLeft.CValue, FRight.CValue, opMultiply);
end;
function TILMul.ILCode: TILCode;
begin
if Destination.Declaration <> Left.Declaration then
Result := icMul
else
Result := icMul2;
end;
function TILMul.Text: string;
begin
Result := 'MUL ' + inherited Text;
end;
{ TILSub }
procedure TILSub.CECalc(var Ctx: TILCECalcContext);
begin
FDestination.CValue := ProcessConstOperation(FLeft.CValue, FRight.CValue, opSubtract);
end;
function TILSub.ILCode: TILCode;
var
Decl: TIDDeclaration;
begin
Decl := Destination.Declaration;
if (Right.ExpressionType = etDeclaration) and (Right.ItemType = itConst) and (Decl = Left.Declaration) and (Right.Declaration = SYSUnit._OneConstant) then
Result := icDec
else
if Decl = Left.Declaration then
Result := icSub2
else
Result := icSub;
end;
function TILSub.Text: string;
begin
if ILCode = icDec then
Result := 'DEC ' + ConditionToStr(Condition) + ExpressionName(FDestination)
else
Result := 'SUB ' + inherited Text;
end;
procedure TILSub.Write(Proc: TIDProcedure; Stream: TStream);
var
iCode: TILCode;
begin
iCode := ILCode;
WriteILCode(Stream, iCode, FCondition);
WriteILArgument(Proc, Stream, Destination);
if iCode = icDec then Exit;
if iCode = icSub then
WriteILArgument(Proc, Stream, Left);
WriteILArgument(Proc, Stream, Right);
end;
{ TILProcCall }
function TILProcCall.ArgumentsCount: Integer;
begin
Result := 1 + 1 + Length(FArgs);
end;
procedure TILProcCall.EnumerateArgs(const EnumProc: TILArgsEnumProc; var BreakEnum: Boolean);
var
i: Integer;
begin
if Assigned(FDestination) then EnumProc(FDestination, BreakEnum);
if BreakEnum then
Exit;
EnumProc(FProc, BreakEnum);
if BreakEnum then
Exit;
if Assigned(FInstance) then EnumProc(FInstance, BreakEnum);
if BreakEnum then
Exit;
for i := 0 to Length(FArgs) - 1 do
begin
EnumProc(FArgs[i], BreakEnum);
if BreakEnum then
Exit;
end;
end;
function TILProcCall.GetArgument(Index: Integer): TIDExpression;
begin
case Index of
0: Result := FDestination;
1: Result := FProc;
else
Result := FArgs[Index];
end;
end;
function TILProcCall.GetLine: Integer;
begin
Result := FProc.TextPosition.Row;
end;
function TILProcCall.ILCode: TILCode;
begin
Result := icProcCall;
end;
procedure TILProcCall.Init(Condition: TILCondition; Proc, Result, Instance: TIDExpression; const Args: TIDExpressions);
begin
Init(Condition, Result, Args);
FProc := Proc;
FInstance := Instance;
end;
procedure TILProcCall.IncReferences(var RCPath: UInt32);
begin
inherited IncReferences(RCPath);
IncReadCount(FProc, Self, RCPath); Inc(RCPath);
if Assigned(FInstance) then
begin
IncReadCount(FInstance, Self, RCPath);
Inc(RCPath);
end;
end;
procedure TILProcCall.CECalc(var Ctx: TILCECalcContext);
begin
if FProc.ItemType = itProcedure then
FDestination.CValue := FProc.AsProcedure.CECalc(FArgs);
end;
procedure TILProcCall.DecReferences(var RCPath: UInt32);
begin
inherited DecReferences(RCPath);
DecReadCount(FProc, Self, RCPath); Inc(RCPath);
if Assigned(FInstance) then
begin
DecReadCount(FInstance, Self, RCPath);
Inc(RCPath);
end;
end;
procedure TILProcCall.ProcessVarInit(Proc: TIDProcedure);
var
Param: TIDVariable;
Arg: TIDExpression;
i: Integer;
begin
inherited;
if FProc.ItemType = itProcedure then
Param := FProc.AsProcedure.VarSpace.First
else begin
if Length((FProc.DataType as TIDProcType).Params) > 0 then
Param := (FProc.DataType as TIDProcType).Params[0]
else
Param := nil;
end;
i := 0;
{проставляем модификацию возвращаемым аргументам}
while Assigned(Param) do
begin
if (VarResult in Param.Flags) or
(VarSelf in Param.Flags) then
begin
Param := TIDVariable(Param.NextItem);
continue;
end;
if VarOut in Param.Flags then
begin
Arg := FArgs[i];
if Arg.IsLocalVar then
FCFBlock.AddVariable(Arg.AsVariable);
end;
Inc(i);
Param := TIDVariable(Param.NextItem);
end;
end;
procedure TILProcCall.SwapArguments(const Context: TPIContext);
begin
inherited;
FProc := TILProcCall(Context.Instruction).FProc;
end;
function TILProcCall.Text: string;
var
Proc: TIDProcedure;
DeclName: string;
begin
if Assigned(FDestination) then
Result := Trim(inherited Text)
else
Result := '';
Result := AddStringSegment(Result, GetArgsNames, ', ');
Proc := FProc.AsProcedure;
if Assigned(FInstance) then
DeclName := FInstance.DisplayName + '.' + Proc.DisplayName
else
DeclName := DeclarationName(Proc);
Result := ILCodeString + ' ' + CondAsText + AddStringSegment(DeclName, Result, ', ');
end;
procedure TILProcCall.Write(Proc: TIDProcedure; Stream: TStream);
var
Cnt, UnitID: Integer;
ProcDecl: TIDProcedure;
begin
WriteILCode(Stream, ILCode, Condition);
// сохраняем информацию о типе если это статический метод
if FProc.ItemType = itProcedure then
begin
ProcDecl := FProc.AsProcedure;
if ProcDecl.IsStatic then begin
UnitID := GetUnitID(Proc, ProcDecl.Struct);
WriteArgument(Stream, ProcDecl.Struct, UnitID, True);
end else
if Assigned(FInstance) then
WriteILArgument(Proc, Stream, FInstance, True);
end;
WriteILArgument(Proc, Stream, FProc);
// пишем кол-во аргуметов
Cnt := Length(FArgs);
if Assigned(FDestination) then
Inc(Cnt);
Stream.WriteStretchUInt(Cnt);
// пишем аргуметы
if Assigned(FDestination) then
WriteILArgument(Proc, Stream, FDestination);
WriteILArguments(Proc, Stream, FArgs, False);
end;
{ TILProcCallUnSafe }
function TILProcCallUnSafe.ILCode: TILCode;
begin
Result := icUSafeCall;
end;
procedure TILProcCallUnSafe.Write(Proc: TIDProcedure; Stream: TStream);
var
Cnt, UnitID: Integer;
ProcDecl: TIDProcedure;
begin
// write il code header
WriteILCode(Stream, ILCode, Condition);
// write ptr-variable arg
WriteILArgument(Proc, Stream, FProc);
// write the casted-type arg
WriteILArgument(Proc, Stream, TIDCastedCallExpression(FProc).DataType);
// write count of args
Cnt := Length(FArgs);
if Assigned(FDestination) then
Inc(Cnt);
Stream.WriteStretchUInt(Cnt);
// write the args...
if Assigned(FDestination) then
WriteILArgument(Proc, Stream, FDestination);
WriteILArguments(Proc, Stream, FArgs, False);
end;
{ TILNeg }
procedure TILNeg.CECalc(var Ctx: TILCECalcContext);
begin
FDestination.CValue := ProcessConstOperation(FSource.CValue, FSource.CValue, opNegative);
end;
function TILNeg.ILCode: TILCode;
begin
Result := icNeg;
end;
function TILNeg.Text: string;
begin
Result := 'NEG ' + inherited Text;
end;
{ TILCmp }
procedure TILCmp.CECalc(var Ctx: TILCECalcContext);
var
CRes: TIDConstant;
CmpOp: TOperatorID;
begin
case FNext.Condition of
cEqual: CmpOp := opEqual;
cNotEqual: CmpOp := opNotEqual;
cGreater: CmpOp := opGreater;
cGreaterOrEqual: CmpOp := opGreaterOrEqual;
cLess: CmpOp := opLess;
cLessOrEqual: CmpOp := opLessOrEqual;
else
AbortWorkInternal('Unknown condition');
CmpOp := opNone;
end;
CRes := ProcessConstOperation(FLeft.CValue, FRight.CValue, CmpOp);
Ctx.Cond := (CRes as TIDBooleanConstant).Value;
end;
function TILCmp.ILCode: TILCode;
begin
Result := icCmp;
end;
function TILCmp.Text: string;
begin
Result := 'CMP ' + inherited Text;
end;
{ TILUniqueInstruction }
function TILUniqueInstruction.ILCode: TILCode;
begin
Result := icUnique;
end;
function TILUniqueInstruction.Text: string;
begin
Result := 'UNIQUE ' + inherited Text;;
end;
{ TILJmp }
function TILJmp.ILCode: TILCode;
begin
Result := icJmp
end;
function TILJmp.Text: string;
begin
Result := Format('JMP %s', [inherited Text]);
end;
{ TILJmpNext }
procedure TILJmpNext.CECalc(var Ctx: TILCECalcContext);
begin
if (FCondition <> cNone) and not Ctx.Cond then
Exit;
if Assigned(FDestination.Next) then
Ctx.Next := FDestination.Next
else
Ctx.Return := True;
end;
function TILJmpNext.GetDestinationPosition: Integer;
begin
if Assigned(FDestination) then
Result := FDestination.Position + 1
else
Result := -1;
end;
{ TILCast }
function TILCast.ILCode: TILCode;
begin
Result := icCovert;
end;
function TILCast.Text: string;
begin
Result := 'CAST ' + inherited Text;
end;
{ TILDestInstruction }
function TILDestInstruction.ArgumentsCount: Integer;
begin
Result := 1;
end;
procedure TILDestInstruction.EnumerateArgs(const EnumProc: TILArgsEnumProc; var BreakEnum: Boolean);
begin
EnumProc(FDestination, BreakEnum);
end;
function TILDestInstruction.GetArgument(Index: Integer): TIDExpression;
begin
if Index = 0 then
Result := FDestination
else
Result := nil;
end;
function TILDestInstruction.GetLine: Integer;
begin
if Assigned(FDestination) then
Result := FDestination.TextPosition.Row
else
Result := -1;
end;
procedure TILDestInstruction.Init(Condition: TILCondition; Destination: TIDExpression);
begin
FCondition := Condition;
FDestination := Destination;
if Assigned(Destination) then
Destination.Instruction := Self;
end;
procedure TILDestInstruction.IncReferences(var RCPath: UInt32);
begin
IncReadCount(FDestination, Self, RCPath);
Inc(RCPath);
end;
procedure TILDestInstruction.DecReferences(var RCPath: UInt32);
begin
DecReadCount(FDestination, Self, RCPath);
Inc(RCPath);
end;
procedure TILDestInstruction.ProcessVarInit(Proc: TIDProcedure);
begin
if Assigned(FDestination) and FDestination.IsLocalVar then
FCFBlock.AddVariable(FDestination.AsVariable);
end;
function TILDestInstruction.Text: string;
var
Name: string;
begin
Name := ExpressionName(FDestination);
Result := Format('%s%s',[inherited Text, Name]);
end;
procedure TILDestInstruction.Write(Proc: TIDProcedure; Stream: TStream);
begin
inherited Write(Proc, Stream);
WriteILArgument(Proc, Stream, FDestination);
end;
function InlineInstructionArgument(Src: TIDExpression; const Context: TPIContext): TIDExpression;
procedure CheckNode(Node: TIDPairList.PAVLNode; Src: TIDExpression); inline;
begin
if not Assigned(Node) then
AbortWorkInternal('Equal object for [%s: %s] is not found', [Src.DisplayName, Src.DataType.DisplayName]);
end;
var
EList: TIDExpressions;
SrcItems: TIDExpressions;
Node: TIDPairList.PAVLNode;
begin
if (Src.ItemType = itVar) and (Src.AsVariable.Scope.ScopeType <> stGlobal) then
begin
if Src.ExpressionType = etDeclaration then begin
if Src.AsVariable.IsField then
begin
{SetLength(EList, 2); // !!!!!!!!! неизвестно правильно ли изменен код
EList[0] := Context.MethodSelf;
EList[1] := Src;}
Result := Src;// TIDMultyExpression.Create(EList, Src.TextPosition);
end else begin
Node := Context.EqualList.Find(Src.Declaration);
CheckNode(Node, Src);
Result := TIDExpression(Node.Data);
end;
end else begin
SrcItems := TIDMultiExpression(Src).Items;
SetLength(EList, Length(SrcItems)); // пока только список из 2-х элементов!!!
EList[1] := TIDMultiExpression(Src).Items[1];
Node := Context.EqualList.Find(SrcItems[0].Declaration);
CheckNode(Node, Src);
EList[0] := TIDExpression(Node.Data);
Result := TIDMultiExpression.Create(EList, Src.TextPosition);
end;
end else
Result := Src;
end;
procedure TILDestInstruction.SetDestination(const Value: TIDExpression);
begin
FDestination := Value;
if Assigned(FDestination) and FDestination.IsLocalVar then
FCFBlock.AddVariable(FDestination.AsVariable);
end;
procedure TILDestInstruction.SwapArguments(const Context: TPIContext);
var
SrcInstrDst: TIDExpression;
begin
inherited SwapArguments(Context);
SrcInstrDst := TILDestInstruction(Context.Instruction).Destination;
if Assigned(SrcInstrDst) then begin
Destination := InlineInstructionArgument(SrcInstrDst, Context);
Destination.Instruction := Self;
end;
end;
{ TILSetBool }
function TILSetBool.ILCode: TILCode;
begin
Result := icSetBool;
end;
function TILSetBool.Text: string;
begin
Result := 'SETBOOL ' + inherited Text;
end;
{ TILGetBit }
function TILGetBit.ILCode: TILCode;
begin
Result := icGetBit;
end;
function TILGetBit.Text: string;
begin
Result := 'GETBIT ' + inherited Text;
end;
{ TILSetBit }
function TILSetBit.ILCode: TILCode;
begin
Result := icSetBit;
end;
function TILSetBit.Text: string;
begin
Result := 'SETBIT ' + inherited Text;
end;
{ TILNot }
procedure TILNot.CECalc(var Ctx: TILCECalcContext);
begin
FDestination.CValue := ProcessConstOperation(FSource.CValue, FSource.CValue, opNot);
end;
function TILNot.ILCode: TILCode;
begin
Result := icNot;
end;
function TILNot.Text: string;
begin
Result := 'NOT ' + inherited Text;
end;
{ TILAnd }
procedure TILAnd.CECalc(var Ctx: TILCECalcContext);
begin
FDestination.CValue := ProcessConstOperation(FLeft.CValue, FRight.CValue, opAnd);
end;
function TILAnd.ILCode: TILCode;
begin
if Destination.Declaration <> Left.Declaration then
Result := icAnd
else
Result := icAnd2;
end;
function TILAnd.Text: string;
begin
Result := 'AND ' + inherited Text;
end;
{ TILOr }
procedure TILOr.CECalc(var Ctx: TILCECalcContext);
begin
FDestination.CValue := ProcessConstOperation(FLeft.CValue, FRight.CValue, opOr);
end;
function TILOr.ILCode: TILCode;
begin
if Destination.Declaration <> Left.Declaration then
Result := icOr
else
Result := icOr2;
end;
function TILOr.Text: string;
begin
Result := 'OR ' + inherited Text;
end;
{ TILXor }
procedure TILXor.CECalc(var Ctx: TILCECalcContext);
begin
FDestination.CValue := ProcessConstOperation(FLeft.CValue, FRight.CValue, opXor);
end;
function TILXor.ILCode: TILCode;
begin
if Destination.Declaration <> Left.Declaration then
Result := icXor
else
Result := icXor2;
end;
function TILXor.Text: string;
begin
Result := 'XOR ' + inherited Text;
end;
{ TILShr }
procedure TILShr.CECalc(var Ctx: TILCECalcContext);
begin
FDestination.CValue := ProcessConstOperation(FLeft.CValue, FRight.CValue, opShiftRight);
end;
function TILShr.ILCode: TILCode;
begin
if Destination.Declaration <> Left.Declaration then
Result := icShr
else
Result := icShr2;
end;
function TILShr.Text: string;
begin
Result := 'SHR ' + inherited Text;
end;
{ TILShl }
procedure TILShl.CECalc(var Ctx: TILCECalcContext);
begin
FDestination.CValue := ProcessConstOperation(FLeft.CValue, FRight.CValue, opShiftLeft);
end;
function TILShl.ILCode: TILCode;
begin
if Destination.Declaration <> Left.Declaration then
Result := icShl
else
Result := icShl2;
end;
function TILShl.Text: string;
begin
Result := 'SHL ' + inherited Text;
end;
{ TILTest }
function TILTest.ILCode: TILCode;
begin
Result := icTest;
end;
function TILTest.Text: string;
begin
Result := 'TEST ' + inherited Text;
end;
{ TILCheckBound }
function TILCheckBound.ILCode: TILCode;
begin
Result := icCheckBound;
end;
function TILCheckBound.Text: string;
begin
Result := 'CHKB ' + inherited Text;
end;
{ TILCompareInstruction }
function TILCompareInstruction.ArgumentsCount: Integer;
begin
Result := 2;
end;
procedure TILCompareInstruction.EnumerateArgs(const EnumProc: TILArgsEnumProc; var BreakEnum: Boolean);
begin
EnumProc(FLeft, BreakEnum);
if BreakEnum then
Exit;
EnumProc(FRight, BreakEnum);
end;
function TILCompareInstruction.GetArgument(Index: Integer): TIDExpression;
begin
case Index of
0: Result := FLeft;
1: Result := FRight;
else Result := nil;
end;
end;
function TILCompareInstruction.GetLine: Integer;
begin
if Assigned(FLeft) then
Result := FLeft.TextPosition.Row
else
Result := -1;
end;
procedure TILCompareInstruction.Init(Condition: TILCondition; Left, Right: TIDExpression);
begin
FCondition := Condition;
FLeft := Left;
FRight := Right;
end;
procedure TILCompareInstruction.IncReferences(var RCPath: UInt32);
begin
IncReadCount(FLeft, Self, RCPath); Inc(RCPath);
IncReadCount(FRight, Self, RCPath); Inc(RCPath);
end;
procedure TILCompareInstruction.DecReferences(var RCPath: UInt32);
begin
DecReadCount(FLeft, Self, RCPath); Inc(RCPath);
DecReadCount(FRight, Self, RCPath); Inc(RCPath);
end;
procedure TILCompareInstruction.ProcessVarInit(Proc: TIDProcedure);
begin
CheckArgInit(Proc, Left);
CheckArgInit(Proc, Right);
end;
function TILCompareInstruction.Text: string;
begin
Result := Format('%s%s, %s', [inherited Text, ExpressionName(FLeft), ExpressionName(FRight)]);
end;
{ TILDstSrcInstruction }
procedure TILDstSrcInstruction.SwapArguments(const Context: TPIContext);
var
Src: TIDExpression;
begin
inherited SwapArguments(Context);
Src := TILDstSrcInstruction(Context.Instruction).Source;
Source := InlineInstructionArgument(Src, Context);
end;
procedure TILDstSrcInstruction.Write(Proc: TIDProcedure; Stream: TStream);
begin
inherited Write(Proc, Stream);
WriteILArgument(Proc, Stream, FSource);
end;
procedure TILDstSrcSrcInstruction.SwapArguments(const Context: TPIContext);
begin
inherited SwapArguments(Context);
with TILDstSrcSrcInstruction(Context.Instruction) do begin
Self.Left := InlineInstructionArgument(Left, Context);
Self.Right := InlineInstructionArgument(Right, Context);
end;
end;
procedure TILDstSrcSrcInstruction.Write(Proc: TIDProcedure; Stream: TStream);
begin
inherited Write(Proc, Stream);
if Destination.Declaration <> Left.Declaration then
WriteILArgument(Proc, Stream, FLeft);
if Assigned(FRight) then
WriteILArgument(Proc, Stream, FRight);
end;
procedure TILCompareInstruction.SwapArguments(const Context: TPIContext);
begin
inherited SwapArguments(Context);
with TILCompareInstruction(Context.Instruction) do begin
Self.Left := InlineInstructionArgument(Left, Context);
Self.Right := InlineInstructionArgument(Right, Context);
end;
end;
procedure TILCompareInstruction.Write(Proc: TIDProcedure; Stream: TStream);
begin
inherited;
WriteILArgument(Proc, Stream, FLeft);
WriteILArgument(Proc, Stream, FRight);
end;
{ TILGetPtr }
procedure TILGetPtr.EnumerateArgs(const EnumProc: TILArgsEnumProc; var BreakEnum: Boolean);
begin
EnumProc(FDestination, BreakEnum);
if BreakEnum then
Exit;
if Assigned(FBase) then EnumProc(FBase, BreakEnum);
if BreakEnum then
Exit;
EnumProc(FMember, BreakEnum);
end;
function TILGetPtr.ILCode: TILCode;
begin
if FMember.IsProcedure then
begin
if Assigned(FBase) then
Result := icLoadMethod
else
Result := icLoadSelfMethod;
end else begin
if Assigned(FBase) then
Result := icGetPtr
else
Result := icGetSelfPtr;
end;
end;
procedure TILGetPtr.SwapArguments(const Context: TPIContext);
var
Code: TILGetPtr;
begin
inherited SwapArguments(Context);
Code := TILGetPtr(Context.Instruction);
if Assigned(Code.Base) then
Self.FBase := InlineInstructionArgument(Code.Base, Context)
else
Self.FBase := nil;
Self.FMember := InlineInstructionArgument(Code.Member, Context);
end;
function TILGetPtr.Text: string;
var
BaseStr, S1, S2: string;
begin
if Assigned(FBase) then
begin
BaseStr := ExpressionName(FBase);
if FBase.DataType is TIDArray then
begin
S1 := '[';
S2 := ']';
end else begin
S1 := '.';
S2 := '';
end;
end;
Result := ILCodeString + ' ' + inherited Text + ', ' + BaseStr + S1 + ExpressionName(FMember) + S2;
end;
procedure TILGetPtr.Write(Proc: TIDProcedure; Stream: TStream);
begin
inherited Write(Proc, Stream);
if Assigned(FBase) then
WriteILArgumentsChain(Proc, Stream, FBase, FMember)
else
WriteILArgument(Proc, Stream, FMember);
end;
{ TILGetPtrMulti }
function TILGetPtrMulti.ArgumentsCount: Integer;
begin
Result := 1 + Length(FArgs);
end;
procedure TILGetPtrMulti.EnumerateArgs(const EnumProc: TILArgsEnumProc; var BreakEnum: Boolean);
begin
EnumProc(FDestination, BreakEnum);
if BreakEnum then
Exit;
EnumProc(FArgs[0], BreakEnum);
if BreakEnum then
Exit;
end;
function TILGetPtrMulti.GetArgument(Index: Integer): TIDExpression;
begin
if Index = 0 then
Result := FDestination
else
Result := FArgs[Index];
end;
function TILGetPtrMulti.ILCode: TILCode;
begin
if FArgs[0].Declaration.ClassType <> TIDField then
Result := icGetPtr
else
Result := icGetSelfPtr;
end;
function TILGetPtrMulti.Text: string;
begin
Result := ILCodeString + ' ' + ExpressionName(FDestination) + ', ' + ExpressionsName(FArgs);
end;
procedure TILGetPtrMulti.Write(Proc: TIDProcedure; Stream: TStream);
begin
inherited Write(Proc, Stream);
WriteILArgumentsChain(Proc, Stream, FArgs);
end;
{ TILRet }
procedure TILRet.CECalc(var Ctx: TILCECalcContext);
begin
if (FCondition <> cNone) and not Ctx.Cond then
Exit;
Ctx.Return := True;
end;
function TILRet.ILCode: TILCode;
begin
Result := icRet;
end;
function TILRet.Text: string;
begin
Result := 'RET ' + inherited Text;
end;
{ TILDestMultiArgsInstruction }
function TILDestMultiArgsInstruction.GetArgsNames: string;
var
i: Integer;
Expr: TIDExpression;
begin
Result := '';
for i := 0 to Length(FArgs) - 1 do
begin
Expr := FArgs[i];
if Assigned(Expr) then
Result := AddStringSegment(Result, DeclarationName(Expr.Declaration), ', ')
else
Result := AddStringSegment(Result, 'nil', ', ');
end;
end;
procedure TILDestMultiArgsInstruction.Init(Condition: TILCondition; Dest: TIDExpression; const Args: TIDExpressions);
begin
Init(Condition, Dest);
FArgs := Args;
end;
procedure TILDestMultiArgsInstruction.IncReferences(var RCPath: UInt32);
var
i: Integer;
begin
IncReadCount(FDestination, Self, RCPath); Inc(RCPath);
for i := 0 to Length(FArgs) - 1 do
begin
IncReadCount(FArgs[i], Self, RCPath);
Inc(RCPath);
end;
end;
procedure TILDestMultiArgsInstruction.DecReferences(var RCPath: UInt32);
var
i: Integer;
begin
DecReadCount(FDestination, Self, RCPath); Inc(RCPath);
for i := 0 to Length(FArgs) - 1 do
begin
DecReadCount(FArgs[i], Self, RCPath);
Inc(RCPath);
end;
end;
procedure TILDestMultiArgsInstruction.SwapArguments(const Context: TPIContext);
var
i: Integer;
SrcInstruction: TILDestMultiArgsInstruction;
begin
inherited SwapArguments(Context);
SrcInstruction := TILDestMultiArgsInstruction(Context.Instruction);
SetLength(FArgs, Length(SrcInstruction.FArgs));
for i := 0 to High(SrcInstruction.FArgs) do
FArgs[i] := InlineInstructionArgument(SrcInstruction.Arguments[i], Context);
end;
{ TILLoadAddress }
function TILLoadAddr.ILCode: TILCode;
begin
if Assigned(Right) then
Result := icLea
else
Result := icLea2
end;
function TILLoadAddr.Text: string;
begin
Result := 'LEA ' + Trim(inherited Text);
end;
procedure TILLoadAddr.Write(Proc: TIDProcedure; Stream: TStream);
begin
WriteILCode(Stream, ILCode, FCondition);
WriteILArgument(Proc, Stream, FDestination);
WriteILArgument(Proc, Stream, FLeft);
if Assigned(FRight) then
WriteILArgument(Proc, Stream, FRight);
end;
{ TILArrayDAlloc }
function TILArrayDAlloc.ILCode: TILCode;
begin
Result := icArrayDAlloc
end;
function TILArrayDAlloc.Text: string;
begin
Result := 'ARR_DALLOC ' + inherited Text;
end;
{ TILArrayRAlloc }
function TILArrayRAlloc.ILCode: TILCode;
begin
Result := icArrayRAlloc
end;
function TILArrayRAlloc.Text: string;
begin
Result := 'ARR_REALLOC ' + inherited Text;
end;
{ TILArraySAlloc }
function TILArraySAlloc.ILCode: TILCode;
begin
Result := icArraySAlloc
end;
function TILArraySAlloc.Text: string;
begin
Result := 'ARR_SALLOC ' + inherited Text;
end;
{ TILArrayLength }
function TILArrayLength.ILCode: TILCode;
begin
Result := icArrayLength;
end;
function TILArrayLength.Text: string;
begin
Result := 'LENGTH ' + inherited Text;
end;
{ TILTryBegin }
function TILTryBegin.ILCode: TILCode;
begin
Result := icTryBegin;
end;
function TILTryBegin.Text: string;
begin
Result := 'TRYBEGIN ' + inherited Text;
end;
{ TILTryEnd }
function TILTryEnd.ILCode: TILCode;
begin
Result := icTryEnd;
end;
function TILTryEnd.Text: string;
begin
Result := 'TRYEND ' + inherited Text;
end;
{ TIL1ConstArgInstruction }
function TIL1ConstArgInstruction.ArgumentsCount: Integer;
begin
Result := 1;
end;
function TIL1ConstArgInstruction.Text: string;
begin
Result := Format('%s%d', [inherited Text, Argument]);
end;
procedure TIL1ConstArgInstruction.Write(Proc: TIDProcedure; Stream: TStream);
begin
inherited Write(Proc, Stream);
WriteConstArgument(Stream, FArgument);
end;
{ TILEThrow }
function TILEThrow.ILCode: TILCode;
begin
Result := icEThrow;
end;
function TILEThrow.Text: string;
begin
Result := 'ETHROW ' + inherited Text;
end;
{ TILTryCallHandler }
function TILTryCallHandler.ILCode: TILCode;
begin
Result := icTryCallHandler;
end;
function TILTryCallHandler.Text: string;
begin
Result := 'TRYCALLHANDLER ' + inherited Text;
end;
{ TILNearCall }
function TILNearCall.ILCode: TILCode;
begin
Result := icNearCall;
end;
function TILNearCall.Text: string;
begin
Result := 'NCALL ' + inherited Text;
end;
{ TILDNewObj }
procedure TILDNewObj.EnumerateArgs(const EnumProc: TILArgsEnumProc; var BreakEnum: Boolean);
begin
EnumProc(FDestination, BreakEnum);
if BreakEnum then
Exit;
EnumProc(FInstance, BreakEnum);
end;
function TILDNewObj.ILCode: TILCode;
begin
Result := icDNewObj;
end;
procedure TILDNewObj.IncReferences(var RCPath: UInt32);
begin
IncReadCount(FDestination, Self, RCPath); Inc(RCPath);
IncReadCount(FInstance, Self, RCPath); Inc(RCPath);
end;
procedure TILDNewObj.DecReferences(var RCPath: UInt32);
begin
DecReadCount(FDestination, Self, RCPath); Inc(RCPath);
DecReadCount(FInstance, Self, RCPath); Inc(RCPath);
end;
function TILDNewObj.Text: string;
begin
Result := 'DNEWOBJ ' + FDestination.DisplayName + ', ' + FInstance.DisplayName;
end;
procedure TILDNewObj.Write(Proc: TIDProcedure; Stream: TStream);
begin
WriteILCode(Stream, ILCode, FCondition);
WriteILArgument(Proc, Stream, FInstance);
WriteILArgument(Proc, Stream, FDestination);
end;
{ TILSNewObj }
function TILSNewObj.ILCode: TILCode;
begin
Result := icSNewObj;
end;
{ TILNewInstruction }
function TILMemGet.ILCode: TILCode;
begin
Result := icMemGet;
end;
function TILMemGet.Text: string;
begin
Result := 'MEMGET ' + inherited Text;
end;
{ TILFreeInstanceInstruction }
function TILMemFree.ILCode: TILCode;
begin
Result := icMemFree;
end;
function TILMemFree.Text: string;
begin
Result := 'MEMFREE ' + inherited Text;
end;
{ TILJampedInstruction }
procedure TILJampedInstruction.CECalc(var Ctx: TILCECalcContext);
begin
if (FCondition <> cNone) and not Ctx.Cond then
Exit;
Ctx.Next := FDestination;
end;
function TILJampedInstruction.GetDestinationPosition: Integer;
begin
if Assigned(FDestination) then
Result := FDestination.Position
else
Result := -1;
end;
function TILJampedInstruction.Text: string;
begin
Result := inherited Text + IntToStr(DestinationPosition);
end;
procedure TILJampedInstruction.Write(Proc: TIDProcedure; Stream: TStream);
begin
inherited Write(Proc, Stream);
WriteConstArgument(Stream, DestinationPosition);
end;
{ TILNopeInstruction }
procedure TILNope.CECalc(var Ctx: TILCECalcContext);
begin
// nope
end;
function TILNope.ILCode: TILCode;
begin
Result := icNope;
end;
function TILNope.Text: string;
begin
Result := 'NOPE';
end;
{ TILPlatformInstructions }
procedure TILPlatform.Add(Instruction: TPlatformInstruction);
begin
if not Assigned(FFirst) then
begin
FFirst := Instruction;
FLast := Instruction;
end else begin
FLast.Next := Instruction;
FLast := Instruction;
end;
Inc(FCount);
end;
constructor TILPlatform.Create(Platform: TIDPlatform; Line: Integer);
begin
CreateFromPool;
FPlatform := Platform;
FLine := Line;
end;
destructor TILPlatform.Destroy;
var
Instr, Tmp: TPlatformInstruction;
begin
Instr := FFirst;
while Assigned(Instr) do begin
Tmp := Instr;
Instr := Instr.Next;
Tmp.Free;
end;
end;
function TILPlatform.GetLine: Integer;
begin
Result := FLine;
end;
function TILPlatform.ILCode: TILCode;
begin
Result := icPlatform
end;
function TILPlatform.Text: string;
var
Instruction: TPlatformInstruction;
Prefix, sCode: string;
Stream: TMemoryStream;
begin
Result := '';
Prefix := FPlatform.Name + ': ';
Instruction := FFirst;
Stream := TMemoryStream.Create;
try
while Assigned(Instruction) do begin
Instruction.Encode(Stream);
Result := AddStringSegment(Result, Prefix + Instruction.Text, #10);
Instruction := Instruction.Next;
end;
Result := AddStringSegment(Result, 'bytes: ', #10);
SetLength(sCode, Stream.Size*2);
//BinToHex(Stream.Memory, {$IFDEF FPC}PAnsiChar{$ELSE}PChar{$ENDIF}(sCode), Stream.Size);
Result := Result + sCode;
finally
Stream.Free;
end;
end;
procedure TILPlatform.Write(Proc: TIDProcedure; Stream: TStream);
var
Instruction: TPlatformInstruction;
begin
inherited Write(Proc, Stream);
Stream.WriteStretchUInt(0); // platform name
Stream.WriteStretchUInt(FCount);
Instruction := FFirst;
while Assigned(Instruction) do begin
Instruction.Write(Stream);
Instruction := Instruction.Next;
end;
end;
{ TILVirtCallInstruction }
function TILVirtCall.ILCode: TILCode;
begin
Result := icVirtCall;
end;
{ TILMethodCallInstruction }
function TILInheritedCall.ILCode: TILCode;
begin
Result := icInhtCall;
end;
function TILInheritedCall.Text: string;
var
Proc: TIDProcedure;
DeclName: string;
begin
if Assigned(FDestination) then
Result := FDestination.DisplayName
else
Result := '';
Result := AddStringSegment(Result, GetArgsNames, ', ');
Proc := FProc.AsProcedure;
DeclName := FInstance.Declaration.DisplayName + '.' + Proc.Struct.DisplayName + '.' + Proc.DisplayName;
Result := ILCodeString + ' ' + AddStringSegment(DeclName, Result, ', ');
end;
procedure TILInheritedCall.Write(Proc: TIDProcedure; Stream: TStream);
var
ProcDecl: TIDProcedure;
Cnt: Integer;
begin
WriteILCode(Stream, ILCode, Condition);
ProcDecl := FProc.AsProcedure;
WriteILArgument(Proc, Stream, ProcDecl.Struct);
Stream.WriteStretchUInt(ProcDecl.Index);
{сохраняем инстанс}
WriteILArgument(Proc, Stream, FInstance);
{пишем кол-во аргуметов}
Cnt := Length(FArgs);
if Assigned(FDestination) then
Inc(Cnt);
Stream.WriteStretchUInt(Cnt);
{пишем аргуметы}
if Assigned(FDestination) then
WriteILArgument(Proc, Stream, FDestination);
WriteILArguments(Proc, Stream, FArgs, False);
end;
{ TILIncRef }
function TILIncRef.ILCode: TILCode;
begin
Result := icIncRef;
end;
function TILIncRef.Text: string;
begin
Result := 'INCREF ' + inherited Text;
end;
{ TILDecRef }
function TILDecRef.ILCode: TILCode;
begin
if not Assigned(Destination.DataType.FinalProc) then
Result := icDecRef
else
Result := icDecRefFinal;
end;
procedure TILDecRef.IncReferences(var RCPath: UInt32);
begin
IncReadCount(FDestination, Self, RCPath); Inc(RCPath);
if ILCode = icDecRefFinal then
begin
FDestination.DataType.FinalProc.IncRefCount(RCPath);
Inc(RCPath);
end;
end;
procedure TILDecRef.DecReferences(var RCPath: UInt32);
begin
DecReadCount(FDestination, Self, RCPath); Inc(RCPath);
if ILCode = icDecRefFinal then
begin
FDestination.DataType.FinalProc.DecRefCount(RCPath);
Inc(RCPath);
end;
end;
function TILDecRef.Text: string;
begin
Result := 'DECREF ' + inherited Text;
if ILCode = icDecRefFinal then
Result := Result + ', ' + DeclarationName(FDestination.DataType.FinalProc);
end;
procedure TILDecRef.Write(Proc: TIDProcedure; Stream: TStream);
var
FProc: TIDProcedure;
begin
inherited;
if ILCode = icDecRefFinal then
begin
FProc := FDestination.DataType.FinalProc;
WriteArgument(Stream, FProc, FProc.UnitID);
end;
end;
{ TILRefInit }
function TILInit.ILCode: TILCode;
begin
Result := icInit;
end;
function TILInit.Text: string;
begin
Result := 'INIT ' + inherited Text;
end;
{ TILGetStrong }
function TILStrongRef.ILCode: TILCode;
begin
Result := icStrongRef;
end;
function TILStrongRef.Text: string;
begin
Result := 'STRONGREF ' + inherited Text;
end;
{ TILGetWeakRef }
function TILWeakRef.ILCode: TILCode;
begin
Result := icWeakRef;
end;
function TILWeakRef.Text: string;
begin
Result := 'WEAKREF ' + inherited Text;
end;
{ TIL1ArgsInstriction }
function TIL1ArgInstriction.ArgumentsCount: Integer;
begin
Result := 1;
end;
procedure TIL1ArgInstriction.ProcessVarInit(Proc: TIDProcedure);
begin
CheckArgInit(Proc, Arg);
end;
procedure TIL1ArgInstriction.EnumerateArgs(const EnumProc: TILArgsEnumProc; var BreakEnum: Boolean);
begin
EnumProc(FArg, BreakEnum);
end;
function TIL1ArgInstriction.GetArgument(Index: Integer): TIDExpression;
begin
if Index = 0 then
Result := FArg
else
Result := nil;
end;
function TIL1ArgInstriction.GetLine: Integer;
begin
if Assigned(FArg) then
Result := FArg.TextPosition.Row
else
Result := -1;
end;
procedure TIL1ArgInstriction.Init(Condition: TILCondition; Arg: TIDExpression);
begin
FCondition := Condition;
FArg := Arg;
end;
procedure TIL1ArgInstriction.IncReferences(var RCPath: UInt32);
begin
IncReadCount(FArg, Self, RCPath);
Inc(RCPath);
end;
procedure TIL1ArgInstriction.DecReferences(var RCPath: UInt32);
begin
DecReadCount(FArg, Self, RCPath);
Inc(RCPath);
end;
procedure TIL1ArgInstriction.SwapArguments(const Context: TPIContext);
var
SrcInstrArg: TIDExpression;
begin
inherited SwapArguments(Context);
SrcInstrArg := TIL1ArgInstriction(Context.Instruction).Arg;
Arg := InlineInstructionArgument(SrcInstrArg, Context);
end;
function TIL1ArgInstriction.Text: string;
var
Name: string;
begin
Name := ExpressionName(FArg);
Result := Format('%s%s',[inherited Text, Name]);
end;
procedure TIL1ArgInstriction.Write(Proc: TIDProcedure; Stream: TStream);
begin
inherited Write(Proc, Stream);
WriteILArgument(Proc, Stream, FArg);
end;
{ TILTypeInfo }
function TILTypeInfo.ILCode: TILCode;
begin
Result := icTypeInfo;
end;
function TILTypeInfo.Text: string;
begin
Result := 'TYPEINFO ' + inherited Text;
end;
{ TILCmpJmp }
function TILCmpJmp.ILCode: TILCode;
begin
Result := icCmpJmp;
end;
procedure TILCmpJmp.Init(Condition: TILCondition; Left, Right: TIDExpression; Destination: TILInstruction);
begin
inherited Init(Condition, Left, Right);
FDestination := Destination;
end;
function TILCmpJmp.Text: string;
var
Pos: Integer;
begin
if Assigned(FDestination) then
Pos := FDestination.Position + 1
else
Pos := -1;
Result := 'CMPJ ' + inherited Text + ', ' + IntToStr(Pos);
end;
procedure TILCmpJmp.Write(Proc: TIDProcedure; Stream: TStream);
begin
inherited Write(Proc, Stream);
WriteConstArgument(Stream, FDestination.Position + 1);
end;
{ TILFinal
function TILFinal.ILCode: TILCode;
begin
Result := icFinal;
end;
function TILFinal.Text: string;
begin
Result := 'FINAL ' + inherited;
end; }
{ TCFBlock }
function vars_cmp(const Left, Right: TIDVariable): NativeInt;
begin
Result := NativeInt(Left) - NativeInt(Right);
end;
constructor TCFBlock.Create(Parent: TCFBlock);
begin
CreateFromPool;
FVars := TCFBVars.Create(vars_cmp);
{if Assigned(Parent) then
FVars.CopyFrom(Parent.FVars);}
FParent := Parent;
end;
destructor TCFBlock.Destroy;
begin
FVars.Free;
inherited;
end;
function TCFBlock.FindVarInitDOWN(const Variable: TIDVariable): Boolean;
var
Child: TCFBlock;
begin
Result := (FVars.Find(Variable) <> nil);
if Result then
Exit;
Child := FLastChild;
while Assigned(Child) do
begin
Result := Child.FindVarInitDOWN(Variable);
if Result then
Exit;
Child := Child.Prev;
end;
end;
function TCFBlock.FindVarInitUP(const Variable: TIDVariable; Child: TCFBlock): Boolean;
var
PrevBlock: TCFBlock;
begin
Result := (FVars.Find(Variable) <> nil);
if Result then
Exit;
PrevBlock := Child.Prev;
while Assigned(PrevBlock) do
begin
Result := PrevBlock.FindVarInitDOWN(Variable);
if Result then
Exit;
PrevBlock := PrevBlock.Prev;
end;
if Assigned(FParent) then
begin
Result := FParent.FindVarInitUP(Variable, Self);
if Result then
Exit;
end;
end;
procedure TCFBlock.AddVariable(const Variable: TIDVariable);
begin
FVars.InsertNode(Variable, True);
end;
function TCFBlock.IsVarInitialized(const Variable: TIDVariable): Boolean;
var
PrevBlock: TCFBlock;
begin
Result := (FVars.Find(Variable) <> nil);
if Result then
Exit;
PrevBlock := FLastChild;
while Assigned(PrevBlock) do
begin
Result := PrevBlock.FindVarInitDOWN(Variable);
if Result then
Exit;
PrevBlock := PrevBlock.Prev;
end;
if Assigned(FParent) then
begin
Result := FParent.FindVarInitUP(Variable, Self);
if Result then
Exit;
end;
end;
{ TILNoArgInstruction }
constructor TILNoArgInstruction.Create(Line: Integer);
begin
CreateFromPool;
FLine := Line;
end;
function TILNoArgInstruction.GetLine: Integer;
begin
Result := FLine;
end;
{ TILArrayCopy }
function TILArrayCopy.ILCode: TILCode;
begin
Result := icArrayCopy;
end;
procedure TILArrayCopy.IncReferences(var RCPath: UInt32);
begin
inherited;
IncReadCount(FFrom, Self, RCPath); Inc(RCPath);
IncReadCount(FCount, Self, RCPath); Inc(RCPath);
end;
procedure TILArrayCopy.DecReferences(var RCPath: UInt32);
begin
inherited;
DecReadCount(FFrom, Self, RCPath); Inc(RCPath);
DecReadCount(FCount, Self, RCPath); Inc(RCPath);
end;
function TILArrayCopy.Text: string;
begin
Result := 'COPY ' + inherited + ', ' + ExpressionName(FFrom) + ', ' + ExpressionName(FCount);
end;
procedure TILArrayCopy.Write(Proc: TIDProcedure; Stream: TStream);
begin
inherited;
WriteILArgument(Proc, Stream, FFrom);
WriteILArgument(Proc, Stream, FCount);
end;
{ TCFBIF }
function TCFBIF.FindVarInitDOWN(const Variable: TIDVariable): Boolean;
begin
Result := Assigned(FTrue) and FTrue.FindVarInitDOWN(Variable) and
Assigned(FElse) and FElse.FindVarInitDOWN(Variable);
end;
function TCFBIF.IsVarInitialized(const Variable: TIDVariable): Boolean;
begin
Result := (FVars.Find(Variable) <> nil);
if Result then
Exit;
Result := FindVarInitUP(Variable, Self);
end;
{ TCFBCASE }
function TCFBCASE.FindVarInitDOWN(const Variable: TIDVariable): Boolean;
begin
Result := True;
end;
function TCFBCASE.IsVarInitialized(const Variable: TIDVariable): Boolean;
begin
Result := FindVarInitUP(Variable, Self);
end;
{ TILDref }
function TILReadDRef.ILCode: TILCode;
begin
Result := icReadDRef;
end;
function TILReadDRef.Text: string;
begin
Result := 'RDREF ' + inherited;
end;
{ TILSetRef }
function TILWriteDRef.ILCode: TILCode;
begin
Result := icWriteDRef;
end;
function TILWriteDRef.Text: string;
begin
Result := 'WDREF ' + inherited;
end;
{ TILQueryIntf }
function TILQueryType.ILCode: TILCode;
begin
Result := icQueryType;
end;
function TILQueryType.Text: string;
begin
Result := 'QTYPE ' + inherited;
end;
{ TILMemMove }
function TILMemMove.GetLine: Integer;
begin
Result := FSrcArr.Line;
end;
function TILMemMove.ILCode: TILCode;
begin
Result := icMemMove;
end;
function TILMemMove.Text: string;
begin
Result := 'MEMMOVE ' + CondAsText + ' ' + ExpressionName(FSrcArr) + ', ' +
ExpressionName(FSrcIdx) + ', ' +
ExpressionName(FDstArr) + ', ' +
ExpressionName(FDstIdx) + ', ' +
ExpressionName(FCnt);
end;
procedure TILMemMove.Write(Proc: TIDProcedure; Stream: TStream);
begin
inherited;
WriteILArgument(Proc, Stream, FSrcArr);
WriteILArgument(Proc, Stream, FSrcIdx);
WriteILArgument(Proc, Stream, FDstArr);
WriteILArgument(Proc, Stream, FDstIdx);
WriteILArgument(Proc, Stream, FCnt);
end;
{ TILLDMethod }
function TILLDMethod.ILCode: TILCode;
begin
if Assigned(FBase) then
Result := icLoadMethod
else
Result := icLoadSelfMethod;
end;
{ TILConvert }
function TILConvert.ILCode: TILCode;
begin
Result := icCovert;
end;
function TILConvert.Text: string;
begin
Result := 'CONVERT ' + inherited;
end;
{ TILMemSet }
function TILMemSet.ILCode: TILCode;
begin
Result := icMemSet;
end;
function TILMemSet.Text: string;
begin
Result := 'MEMSET ' + inherited;
end;
{ TILRefCount }
function TILRefCount.ILCode: TILCode;
begin
Result := icRefCount;
end;
function TILRefCount.Text: string;
begin
Result := 'REFCNT ' + inherited;
end;
{ TILNow }
function TILNow.ILCode: TILCode;
begin
Result := icNow;
end;
function TILNow.Text: string;
begin
Result := 'NOW ' + inherited;
end;
{ TILMacro }
function TILFMacro.ILCode: TILCode;
begin
Result := icFMacro;
end;
procedure TILFMacro.SwapArguments(const Context: TPIContext);
begin
inherited;
FMacroID := TILFMacro(Context.Instruction).MacroID;
end;
function TILFMacro.Text: string;
begin
Result := 'MACRO ' + GetILMacroName(FMacroID) + ', ' + inherited Text{ + ', ' + GetArgsNames};
end;
procedure TILFMacro.Write(Proc: TIDProcedure; Stream: TStream);
begin
inherited;
WriteConstArgument(Stream, FMacroID, False);
WriteILArguments(Proc, Stream, FArgs, False);
end;
end.
|
unit ClientMain;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, Corba, Broker_I, Broker_C;
type
TForm2 = class(TForm)
btnMoneyMarket: TButton;
btnMargin: TButton;
btnInvestment: TButton;
Memo1: TMemo;
procedure FormCreate(Sender: TObject);
procedure btnMoneyMarketClick(Sender: TObject);
procedure btnMarginClick(Sender: TObject);
procedure btnInvestmentClick(Sender: TObject);
private
{ Private declarations }
MoneyMarketAcct : MoneyMarket;
MarginAcct : MarginAccount;
InvestmentAcct : InvestmentAccount;
public
{ Public declarations }
end;
var
Form2: TForm2;
implementation
{$R *.DFM}
procedure TForm2.FormCreate(Sender: TObject);
begin
CorbaInitialize;
MoneyMarketAcct := TMoneyMarketHelper.Bind;
MarginAcct := TMarginAccountHelper.Bind;
InvestmentAcct := TInvestmentAccountHelper.Bind;
end;
procedure TForm2.btnMoneyMarketClick(Sender: TObject);
begin
Memo1.Lines.Add('Money Market Interest Rate = ' +
FormatFloat('#0.00%', MoneyMarketAcct.interest_rate));
end;
procedure TForm2.btnMarginClick(Sender: TObject);
begin
Memo1.Lines.Add('Margin Interest Rate = ' +
FormatFloat('#0.00%', MarginAcct.margin_rate));
end;
procedure TForm2.btnInvestmentClick(Sender: TObject);
begin
Memo1.Lines.Add('Investment Acct Interest Rate = ' +
FormatFloat('#0.00%', InvestmentAcct.interest_rate));
Memo1.Lines.Add('Investment Acct Balance = ' +
FormatFloat('$###,##0.00', InvestmentAcct.balance));
Memo1.Lines.Add('Investment Acct Margin Rate = ' +
FormatFloat('$###,##0.00', InvestmentAcct.margin_rate));
end;
end.
|
{ Map Viewer Download Engine Free Pascal HTTP Client
Copyright (C) 2011 Maciej Kaczkowski / keit.co
License: modified LGPL with linking exception (like RTL, FCL and LCL)
See the file COPYING.modifiedLGPL.txt, included in the Lazarus distribution,
for details about the license.
See also: https://wiki.lazarus.freepascal.org/FPC_modified_LGPL
Taken from:
https://forum.lazarus.freepascal.org/index.php/topic,12674.msg160255.html#msg160255
}
unit mvDLEFpc;
{$mode objfpc}{$H+}
{.$DEFINE LOG_URL}
interface
uses
SysUtils, Classes,
mvDownloadEngine;
type
{ TMVDEFPC }
TMVDEFPC = class(TMvCustomDownloadEngine)
{$IF FPC_FullVersion >= 30101}
private
FUseProxy: Boolean;
FProxyHost: string;
FProxyPort: Word;
FProxyUserName: String;
FProxyPassWord: String;
{$IFEND}
public
procedure DownloadFile(const Url: string; AStream: TStream); override;
{$IF FPC_FullVersion >= 30101}
published
property UseProxy: Boolean read FUseProxy write FUseProxy default false;
property ProxyHost: String read FProxyHost write FProxyHost;
property ProxyPort: Word read FProxyPort write FProxyPort;
property ProxyUsername: String read FProxyUserName write FProxyUserName;
property ProxyPassword: String read FProxyPassword write FProxyPassword;
{$IFEND}
end;
implementation
uses
{$IFDEF LOG_URL}
lazlogger,
{$ENDIF}
fphttpclient, openssl;
{ TMVDEFPC }
procedure TMVDEFPC.DownloadFile(const Url: string; AStream: TStream);
var
http: TFpHttpClient;
begin
{$IFDEF LOG_URL}
DebugLn(Url);
{$ENDIF}
InitSSLInterface;
http := TFpHttpClient.Create(nil);
try
{$IF FPC_FullVersion >= 30000}
http.AllowRedirect := true;
{$IFEND}
http.AddHeader('User-Agent', 'Mozilla/5.0 (compatible; fpweb)');
{$IF FPC_FullVersion >= 30101}
if UseProxy then begin
http.Proxy.Host := FProxyHost;
http.Proxy.Port := FProxyPort;
http.Proxy.UserName := FProxyUserName;
http.Proxy.Password := FProxyPassword;
end;
{$ENDIF}
try
http.Get(Url, AStream);
except
// Eat the exception because we don't know on which server the map is found.
end;
AStream.Position := 0;
finally
http.Free;
end;
end;
end.
|
{*******************************************************}
{ }
{ Delphi Visual Component Library }
{ }
{ Copyright(c) 1995-2018 Embarcadero Technologies, Inc. }
{ All rights reserved }
{ }
{*******************************************************}
unit Vcl.ActnList;
{$HPPEMIT LEGACYHPP}
{$T-,H+,X+}
interface
uses
System.Classes, System.SysUtils, System.Actions, Winapi.Messages, Vcl.ImgList;
type
/// <summary> The usual list of actions (without published properties) in VCL </summary>
TCustomActionList = class(TContainedActionList)
private
FImageChangeLink: TChangeLink;
FImages: TCustomImageList;
procedure ImageListChange(Sender: TObject);
protected
procedure Notification(AComponent: TComponent; Operation: TOperation); override;
procedure Change; override;
procedure SetImages(Value: TCustomImageList); virtual;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
function IsShortCut(var Message: TWMKey): Boolean;
property Images: TCustomImageList read FImages write SetImages;
end;
/// <summary> The usual list of actions (with published properties) in VCL </summary>
TActionList = class(TCustomActionList)
published
property Images;
property State;
property OnChange;
property OnExecute;
property OnStateChange;
property OnUpdate;
end;
/// <summary> This class is designed to communicate with some of the object in VCL </summary>
TActionLink = class(TContainedActionLink)
protected
end;
TActionLinkClass = class of TActionLink;
/// <summary> List of additional combinations of hot keys in VCL </summary>
TShortCutList = class(TCustomShortCutList)
public
function Add(const S: String): Integer; override;
end;
/// <summary> The usual action (without published properties) in VCL </summary>
TCustomAction = class(TContainedAction)
private
//FActionList: TContainedActionList;
function GetImages: TCustomImageList;
function GetCustomActionList: TCustomActionList; inline;
procedure SetCustomActionList(const Value: TCustomActionList); inline;
protected
FImage: TObject;
FMask: TObject;
procedure AssignTo(Dest: TPersistent); override;
function CreateShortCutList: TCustomShortCutList; override;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
function Execute: Boolean; override;
function Update: Boolean; override;
property Images: TCustomImageList read GetImages;
property ActionList: TCustomActionList read GetCustomActionList write SetCustomActionList;
{ Property access for design time support in .NET }
{$IF DEFINED(CLR)}
property Image: TObject read FImage write FImage;
property Mask: TObject read FMask write FMask;
{$ENDIF}
end;
/// <summary> The usual action (with published properties) in VCL </summary>
TAction = class(TCustomAction)
private
public
constructor Create(AOwner: TComponent); override;
published
property AutoCheck;
property Caption;
property Checked;
property Enabled;
property GroupIndex;
property HelpContext;
property HelpKeyword;
property HelpType;
property Hint;
property ImageIndex;
property SecondaryShortCuts;
property ShortCut default 0;
property Visible;
property OnExecute;
property OnHint;
property OnUpdate;
end;
implementation
uses
{$IF DEFINED(CLR)}
System.Runtime.InteropServices, System.Security.Permissions,
{$ENDIF}
Winapi.Windows, Vcl.Forms, Vcl.Menus, Vcl.Consts, Vcl.Controls;
{ TCustomVCLActionList }
procedure TCustomActionList.Change;
begin
inherited;
if ActionsCreated and (csDesigning in ComponentState) then
begin
if (Owner is TForm) and (TForm(Owner).Designer <> nil) then
TForm(Owner).Designer.Modified;
end;
end;
constructor TCustomActionList.Create(AOwner: TComponent);
begin
inherited;
FImageChangeLink := TChangeLink.Create;
FImageChangeLink.OnChange := ImageListChange;
end;
destructor TCustomActionList.Destroy;
begin
FreeAndNil(FImageChangeLink);
inherited;
end;
procedure TCustomActionList.ImageListChange(Sender: TObject);
begin
if Sender = Images then
Change;
end;
[UIPermission(SecurityAction.LinkDemand, Window=UIPermissionWindow.AllWindows)]
function TCustomActionList.IsShortCut(var Message: TWMKey): Boolean;
var
I: Integer;
ShortCut: TShortCut;
ShiftState: TShiftState;
Action: TContainedAction;
CustAction: TCustomAction;
begin
{$IF NOT DEFINED(CLR)}
Result := False;
if Vcl.Menus.IsAltGRPressed then Exit;
{$ENDIF}
ShiftState := KeyDataToShiftState(Message.KeyData);
ShortCut := Vcl.Menus.ShortCut(Message.CharCode, ShiftState);
if ShortCut <> scNone then
for I := 0 to ActionCount - 1 do
begin
Action := Actions[I];
if Action is TCustomAction then
begin
CustAction := TCustomAction(Action);
if (CustAction.ShortCut = ShortCut) or (Assigned(CustAction.SecondaryShortCuts) and
(CustAction.SecondaryShortCuts.IndexOfShortCut(ShortCut) <> -1)) then
begin
Result := CustAction.HandleShortCut;
Exit;
end;
end;
end;
{$IF DEFINED(CLR)}
Result := False;
{$ENDIF}
end;
procedure TCustomActionList.Notification(AComponent: TComponent; Operation: TOperation);
begin
inherited;
if Operation = opRemove then
if AComponent = Images then
Images := nil;
end;
procedure TCustomActionList.SetImages(Value: TCustomImageList);
begin
if Images <> nil then
Images.UnRegisterChanges(FImageChangeLink);
FImages := Value;
if Images <> nil then
begin
Images.RegisterChanges(FImageChangeLink);
Images.FreeNotification(Self);
end;
end;
{ TShortCutList }
function TShortCutList.Add(const S: String): Integer;
begin
Result := inherited Add(S);
Objects[Result] := TObject(TextToShortCut(S));
end;
{ TCustomAction }
constructor TCustomAction.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
end;
function TCustomAction.CreateShortCutList: TCustomShortCutList;
begin
Result := TShortCutList.Create;
end;
destructor TCustomAction.Destroy;
begin
FImage.Free;
FMask.Free;
inherited Destroy;
end;
procedure TCustomAction.AssignTo(Dest: TPersistent);
begin
inherited AssignTo(Dest);
if Dest is TCustomAction then
begin
end;
end;
function TCustomAction.Execute: Boolean;
begin
Result := False;
if Suspended then
exit;
Update;
if Enabled and AutoCheck then
if not Checked or Checked and (GroupIndex = 0) then
Checked := not Checked;
Result := Enabled;
if Result then
begin
{$IF DEFINED(CLR)}
Result := ((ActionList <> nil) and ActionList.ExecuteAction(Self)) or
(Application.ExecuteAction(Self)) or
(inherited Execute);
if (not Result) and
(Assigned(Application)) then
Result := Application.DispatchAction(True, self, False);
{$ELSE}
Result := ((ActionList <> nil) and ActionList.ExecuteAction(Self)) or
(Application.ExecuteAction(Self)) or
(inherited Execute) or
(SendAppMessage(CM_ACTIONEXECUTE, 0, LPARAM(Self)) = 1);
{$ENDIF}
end;
end;
function TCustomAction.GetCustomActionList: TCustomActionList;
begin
Result := TCustomActionList(inherited ActionList);
end;
procedure TCustomAction.SetCustomActionList(const Value: TCustomActionList);
begin
inherited ActionList := Value;
end;
function TCustomAction.GetImages: TCustomImageList;
begin
if ActionList <> nil then
Result := ActionList.Images
else
Result := nil;
end;
function TCustomAction.Update: Boolean;
begin
{$IF DEFINED(CLR)}
Result := (ActionList <> nil) and ActionList.UpdateAction(Self) or
Application.UpdateAction(Self) or inherited Update;
if not Result then
if Assigned(Application) then
Result := Application.DispatchAction(False, self, False);
{$ELSE}
Result := (ActionList <> nil) and ActionList.UpdateAction(Self) or
Application.UpdateAction(Self) or inherited Update or
(SendAppMessage(CM_ACTIONUPDATE, 0, LPARAM(Self)) = 1);
{$ENDIF}
end;
{ TAction }
constructor TAction.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
DisableIfNoHandler := True;
end;
{$IF NOT DEFINED(CLR)}
initialization
StartClassGroup(TControl);
ActivateClassGroup(TControl);
GroupDescendentsWith(TCustomActionList, TControl);
GroupDescendentsWith(TCustomAction, TControl);
{$ENDIF}
end.
|
{*******************************************************}
{ }
{ DelphiWebMVC }
{ }
{ 版权所有 (C) 2019 苏兴迎(PRSoft) }
{ }
{*******************************************************}
unit BaseController;
interface
uses
System.Classes, System.SysUtils, Web.HTTPApp, View, IdCustomHTTPServer, System.Net.URLClient,
System.Net.HttpClient, System.Net.HttpClientComponent, IdURI, IdGlobal, RedisM,
RedisList;
type
TBaseController = class
private
RedisM: TRedisM;
RedisItem: TRedisItem;
FRequest: TWebRequest;
FResponse: TWebResponse;
FActionPath: string;
procedure SetRequest(const Value: TWebRequest);
procedure SetResponse(const Value: TWebResponse);
procedure SetActionPath(const Value: string);
protected
public
View: TView;
Error: Boolean;
function isPOST: Boolean;
function isGET: Boolean;
function isPut: Boolean;
function isAny: Boolean;
function isDelete: Boolean;
function isHead: Boolean;
function isPatch: Boolean;
function isNil(text: string): Boolean;
function isNotNil(text: string): Boolean;
procedure RedisSetKey(key: string; value: string; timerout: Integer = 0);
procedure RedisSetExpire(key: string; timerout: Integer);
function RedisGetKey(key: string): string;
function URLDecode(Asrc: string; AByteEncoding: IIdTextEncoding = nil): string;
function URLEncode(Asrc: string; AByteEncoding: IIdTextEncoding = nil): string;
function Interceptor: boolean;
procedure CreateView();
function HttpGet(url: string; encode: TEncoding): string;
constructor Create();
destructor Destroy; override;
function AppPath: string; //获取项目物理路径
property Request: TWebRequest read FRequest write SetRequest;
property Response: TWebResponse read FResponse write SetResponse;
property ActionPath: string read FActionPath write SetActionPath;
end;
implementation
uses
command, uConfig;
{ TBaseController }
function TBaseController.Interceptor: boolean;
begin
if open_interceptor then
begin
Result := _interceptor.execute(View, Error);
end
else
begin
Result := false;
end;
end;
function TBaseController.isAny: Boolean;
begin
Result := Request.MethodType = mtAny;
end;
function TBaseController.isDelete: Boolean;
begin
Result := Request.MethodType = mtDelete;
end;
function TBaseController.isGET: Boolean;
begin
Result := Request.MethodType = mtGet;
end;
function TBaseController.isHead: Boolean;
begin
Result := Request.MethodType = mtHead;
end;
function TBaseController.isNil(text: string): Boolean;
begin
if (Trim(text) = '') then
Result := true
else
Result := false;
end;
function TBaseController.isNotNil(text: string): Boolean;
begin
Result := not isNil(text);
end;
function TBaseController.isPatch: Boolean;
begin
Result := Request.MethodType = mtPatch;
end;
function TBaseController.isPOST: Boolean;
begin
Result := Request.MethodType = mtPost;
end;
function TBaseController.isPut: Boolean;
begin
Result := Request.MethodType = mtPut;
end;
function TBaseController.RedisGetKey(key: string): string;
begin
if (_RedisList <> nil) and (RedisItem = nil) then
begin
RedisItem := _RedisList.OpenRedis();
RedisM := RedisItem.item;
end;
if (_RedisList <> nil) then
Result := RedisM.getKey(key)
else
Result := '';
end;
procedure TBaseController.RedisSetExpire(key: string; timerout: Integer);
begin
if (_RedisList <> nil) then
RedisM.setExpire(key, timerout);
end;
procedure TBaseController.RedisSetKey(key, value: string; timerout: Integer = 0);
begin
if (_RedisList <> nil) and (RedisItem = nil) then
begin
RedisItem := _RedisList.OpenRedis();
RedisM := RedisItem.item;
end;
if (_RedisList <> nil) then
RedisM.setKey(key, value, timerout);
end;
procedure TBaseController.SetActionPath(const Value: string);
begin
FActionPath := Value;
end;
procedure TBaseController.SetRequest(const Value: TWebRequest);
begin
FRequest := Value;
end;
procedure TBaseController.SetResponse(const Value: TWebResponse);
begin
FResponse := Value;
end;
function TBaseController.URLDecode(Asrc: string; AByteEncoding: IIdtextEncoding): string;
begin
if AByteEncoding <> nil then
Result := TIdURI.URLDecode(Asrc, AByteEncoding)
else
Result := TIdURI.URLDecode(Asrc);
end;
function TBaseController.URLEncode(Asrc: string; AByteEncoding: IIdTextEncoding): string;
begin
if AByteEncoding <> nil then
Result := TIdURI.URLEncode(Asrc, AByteEncoding)
else
Result := TIdURI.URLEncode(Asrc);
end;
function TBaseController.AppPath: string;
begin
Result := WebApplicationDirectory;
end;
constructor TBaseController.Create();
begin
View := nil;
ActionPath := '';
RedisItem := nil;
RedisM := nil;
end;
procedure TBaseController.CreateView;
begin
try
View := TView.Create(Response, Request, ActionPath);
RedisItem := nil;
except
on e: Exception do
begin
self.Response.Content := e.ToString;
Error := true;
end;
end;
end;
destructor TBaseController.Destroy;
begin
if (Redisitem <> nil) and (_RedisList <> nil) then
begin
_RedisList.CloseRedis(Redisitem.guid);
end;
FreeAndNil(View);
inherited;
end;
function TBaseController.HttpGet(url: string; encode: TEncoding): string;
var
http: TNetHTTPClient;
html: TStringStream;
ret: string;
begin
ret := '';
if Trim(url) <> '' then
begin
try
http := TNetHTTPClient.Create(nil);
html := TStringStream.Create('', encode);
http.UserAgent := 'User-Agent:Mozilla/4.0(compatible;MSIE7.0;WindowsNT5.1;360SE)';
try
http.Get(url, html);
ret := (html.DataString);
except
ret := '请求异常';
end;
finally
html.Clear;
FreeAndNil(html);
FreeAndNil(http);
end;
end;
Result := ret;
end;
end.
|
Program Operacoes_com_numeros ;
var n1, n2, soma, subtracao, multiplicacao, divisao:real;
Begin
//Pede os valores de "N1" e "N2"
writeln('Introduza o 1 número');
readln(n1);
writeln('Introduza o 2 número');
readln(n2);
//Soma os valores
soma:=n1 + n2;
//Subtrai os valores
subtracao:=n1 - n2;
//multiplica os valores
multiplicacao:=n1 * n2;
//Divide os valores
divisao:=n1 / n2;
//Mostra os resultados
writeln('A soma é ', soma:0:2);
writeln('A subtração é ', subtracao:0:2);
writeln('A multiplicação é ', multiplicacao:0:2);
writeln('A divisão é ', divisao:0:2);
End.
|
unit cImageMap;
interface
uses ExtCtrls,StdCtrls,cMap,cImageBuffer;
type TImageMap = class
//=== Protected ================================================================
Protected
FQtdX :Integer;
FQtdY :Integer;
FPosX :Integer;
FPosY :Integer;
FWidth :Integer;
FHeight :Integer;
FImageBuffer :TImageBuffer;
FImageMap :Array of Array of TImage;
FLabelCoordX :Array of TLabel;
FLabelCoordY :Array of TLabel;
function GetMap(x :Integer; y :Integer): TImage;
procedure SetMap(x :Integer; y :Integer; Image :TImage);
//=== Public ===================================================================
Public
Property QtdX :Integer read FQtdX write FQtdX;
Property QtdY :Integer read FQtdY write FQtdY;
Property PosX :Integer read FPosX write FPosX;
Property PosY :Integer read FPosY write FPosY;
Property W :Integer read FWidth write FWidth;
Property H :Integer read FHeight write FHeight;
property Map[x :Integer; y :Integer] :TImage read GetMap write SetMap; default;
Constructor Create();
Procedure Make();
Procedure Arrange();
Procedure UpdateImage();
end;
implementation
uses uClient,SysUtils,Forms,Dialogs;
//=== Constructor ==============================================================
Constructor TImageMap.Create();
begin
FImageBuffer := TImageBuffer.Create;
FPosX:=500;
FPosY:=500;
FWidth :=53;
FHeight:=38;
Make;
Arrange;
UpdateImage;
end;
//=== Get Function =============================================================
function TImageMap.GetMap(x :Integer; y :Integer): TImage;
begin
result := FImageMap[x,y];
end;
//=== Set Function =============================================================
procedure TImageMap.SetMap(x :Integer; y :Integer; Image :TImage);
begin
FImageMap[x,y] := Image;
end;
//=== Make Function ============================================================
Procedure TImageMap.Make();
var x,y :Integer;
begin
//Number of Images
FQtdX := (Client.MapBox.Width Div FWidth )+1;
FQtdY := (Client.MapBox.Height Div FHeight)+1;
SetLength(FImageMap, FQtdX+1,FQtdY+1);
//Create Map
for y := 0 to FQtdY do
for x := 0 to FQtdX do begin
FImageMap[x,y]:=TImage.Create(Client.MapBox);
FImageMap[x,y].Parent:=Client.MapBox;
FImageMap[x,y].OnMouseDown:=Client.MouseDown;
FImageMap[x,y].OnMouseMove:=Client.MouseMove;
FImageMap[x,y].OnMouseUp :=Client.MouseUp ;
FImageMap[x,y].Picture:=FImageBuffer.GetImage('gras1');
end;
//Coords Label
SetLength(FLabelCoordX,FQtdX+1);
SetLength(FLabelCoordY,FQtdY+1);
for x := 0 to High(FLabelCoordX) do begin
FLabelCoordX[x]:= TLabel.Create(Client.MapBox);
FLabelCoordX[x].Parent :=Client.MapBox;
end;
for y := 0 to High(FLabelCoordY) do begin
FLabelCoordY[y]:= TLabel.Create(Client.MapBox);
FLabelCoordY[y].Parent :=Client.MapBox;
end;
end;
//=== Arrange Function =========================================================
Procedure TImageMap.Arrange();
var x,y :Integer;
begin
//Reset Map Position
if FImageMap[0,0].Left<=-FWidth then begin
Client.MouseDownSpot.x := Client.MouseDownSpot.X - FWidth ;
FPosX:=PosX+1;
UpdateImage;
end;
if FImageMap[0,0].Top <=-FHeight then begin
Client.MouseDownSpot.y := Client.MouseDownSpot.y - FHeight;
FPosY:=PosY+1;
UpdateImage;
end;
if FImageMap[0,0].Left> 0 then begin
Client.MouseDownSpot.x := Client.MouseDownSpot.X + FWidth ;
FPosX:=PosX-1;
UpdateImage;
end;
if FImageMap[0,0].Top > 0 then begin
Client.MouseDownSpot.y := Client.MouseDownSpot.y + FHeight;
FPosY:=PosY-1;
UpdateImage;
end;
//Map Limit
if FPosX<=0 then begin FImageMap[0,0].Left:=0; FPosX:=0 ; end;
if FPosY<=0 then begin FImageMap[0,0].Top :=0; FPosY:=0 ; end;
if FPosX>=999-FQtdX then begin FImageMap[0,0].Left:=0; FPosX:=999-FQtdX; end;
if FPosY>=999-FQtdY then begin FImageMap[0,0].Top :=0; FPosY:=999-FQtdY; end;
//Draw Map
for y := 0 to FQtdY do
for x := 0 to FQtdX do begin
FImageMap[x,y].Left:= FImageMap[0,0].Left + (x*FWidth );
FImageMap[x,y].Top := FImageMap[0,0].Top + (y*FHeight);
end;
//Draw Coords Label
for x := 0 to High(FLabelCoordX) do begin
FLabelCoordX[x].Caption:=IntToStr(FPosX+x);
FLabelCoordX[x].Top := Client.MapBox.Height-20;
FLabelCoordX[x].Left:= FImageMap[x,0].Left;
end;
for y := 0 to High(FLabelCoordY) do begin
FLabelCoordY[y].Caption:=IntToStr(FPosX+y);
FLabelCoordY[y].Top := FImageMap[0,y].Top;
FLabelCoordY[y].Left:= 5;
end;
end;
//=== Update Image =============================================================
Procedure TImageMap.UpdateImage();
var x,y :Integer;
name:String;
begin
for y := 0 to FQtdY do
for x := 0 to FQtdX do begin
if Client.Map[x+FPosX,y+FPosY]= nil then begin name:='gras1';
end else begin
//Bonus
if Client.Map[x+FPosX,y+FPosY].Bonus<>0 then name:='v' else name:='b';
//Points
if Client.Map[x+FPosX,y+FPosY].Points <300 then name:=name+'1'
else if Client.Map[x+FPosX,y+FPosY].Points <1000 then name:=name+'2'
else if Client.Map[x+FPosX,y+FPosY].Points <3000 then name:=name+'3'
else if Client.Map[x+FPosX,y+FPosY].Points <9000 then name:=name+'4'
else if Client.Map[x+FPosX,y+FPosY].Points <11000 then name:=name+'5'
else name:=name+'6';
//Owner
if Client.Map[x+FPosX,y+FPosY].Owner =0 then name:=name+'_left';
end;
FImageMap[x,y].Picture:=FImageBuffer.GetImage(name);
end;
end;
end.
|
unit p_RCC;
interface
uses xMisc, Types, Windows, xBase, SysUtils,
Menus, Controls, Forms, Classes;
function CreateRCCProtocol(CP: Pointer): Pointer;
type
TRCCState = (
bdInit,
bdWork,
bdDone
);
TRCC = class(TBiDirProtocol)
SList: TStringColl;
function GetStateStr: string; override;
procedure ReportTraf(txMail, txFiles: DWORD); override;
procedure Cancel; override;
constructor Create(ACP: TPort);
destructor Destroy; override;
function TimeoutValue: DWORD; override;
function NextStep: boolean; override;
procedure Start({RX}AAcceptFile: TAcceptFile;
AFinishRece: TFinishRece;
{TX}AGetNextFile: TGetNextFile;
AFinishSend: TFinishSend;
{CH}AChangeOrder: TChangeOrder
); override;
procedure PutString(const s: string);
procedure CloseLine;
private
State: TRCCState;
RForm: TForm;
LList: TStringColl;
TBuff: string;
// Click: TNotifyEvent;
function ExpandMenu(t: TMenuItem): string;
function FindMenu(const o: TComponent; const N: string): string;
procedure PushMenu(const o: TComponent; const N, I: string);
procedure ClickMenu(const i: TMenuItem; const N: string);
procedure DoStep;
end;
implementation
uses Wizard, RemoteUnit, RCCUnit;
function CreateRCCProtocol;
begin
Result := TRCC.Create(CP);
end;
function TRCC.GetStateStr: string;
begin
result := ''; //just to avoid warning
end;
procedure TRCC.ReportTraf(txMail, txFiles: DWORD);
begin
//nothing, just to avoid warning
end;
procedure TRCC.Cancel;
begin
// nothing, just to avoid warning
end;
constructor TRCC.Create;
begin
inherited Create(ACP);
LList := TStringColl.Create('');
SList := TStringColl.Create('');
pRCC := self;
end;
destructor TRCC.Destroy;
begin
FreeObject(LList);
FreeObject(SList);
inherited Destroy;
end;
function TRCC.TimeoutValue;
begin
Result := 1000;
end;
function TRCC.ExpandMenu;
var i: integer;
begin
Result := '{' + t.Caption + '[' + inttostr(integer(t.Enabled)) + ',' +
inttostr(integer(t.Visible)) + ']';
for i := 0 to t.Count - 1 do begin
Result := Result + ExpandMenu(t.Items[i]);
end;
Result := Result + '}'
end;
function TRCC.FindMenu;
var m: TMainMenu;
c: TComponent;
i: integer;
j: integer;
begin
Result := '';
for i := 0 to o.ComponentCount - 1 do begin
c := o.Components[i];
if c is TForm then begin
Result := Result + FindMenu(c, n);
end else
if UpperCase(c.Name) = n then begin
m := c as TMainMenu;
for j := 0 to m.Items.Count - 1 do begin
Result := Result + ExpandMenu(m.Items[j]);
end;
exit;
end;
end;
end;
procedure TRCC.ClickMenu;
var p: integer;
// s: integer;
begin
for p := 0 to i.Count - 1 do begin
if UpperCase(Trim(i.Items[p].Caption)) = n then begin
SendMessage(MainWinHandle, WM_CLICKMENU, integer(self), integer(i.Items[p]));
end else begin
ClickMenu(i.Items[p], n);
end;
end;
end;
procedure TRCC.PushMenu;
var m: integer;
// p: integer;
c: TComponent;
begin
for m := 0 to o.ComponentCount - 1 do begin
c := o.Components[m];
if c is TForm then begin
if UpperCase(TForm(c).Caption) <> 'REMOTEFORM' then begin
PushMenu(c, n, i);
end;
end else
if UpperCase(c.Name) = n then begin
ClickMenu(TMenu(c).Items, i);
end;
end;
end;
procedure TRCC.DoStep;
var C: byte;
S,
Z: string;
begin
case State of
bdInit:
begin
if originator then begin
PutString('get menu MainMenu');
State := bdWork;
end;
end;
bdWork:;
bdDone:;
end;
while CP.CharReady do begin
if CP.GetChar(C) then begin
if C <> 10 then begin
TBuff := TBuff + Chr(C);
end else begin
LList.Add(TBuff);
TBuff := '';
end;
end;
end;
while LList.Count > 0 do begin
s := LList[0];
GetWrd(s, z, ' ');
z := UpperCase(z);
if z = 'GET' then begin
GetWrd(s, z, ' ');
if UpperCase(z) = 'MENU' then begin
s := 'put menu ' + s + ' ' + FindMenu(Application, UpperCase(s));
PutString(s);
end;
end else
if z = 'PUT' then begin
GetWrd(s, z, ' ');
if UpperCase(z) = 'MENU' then begin
GetWrd(s, z, ' ');
(RForm as TRemoteForm).FillMenu(s);
end else
if UpperCase(z) = 'CNTR' then begin
(RForm as TRemoteForm).FillForm(s);
end;
end else
if z = 'PUSH' then begin
GetWrd(s, z, ' ');
if UpperCase(z) = 'MENU' then begin
GetWrd(s, z, ' ');
PushMenu(Application, UpperCase(z), UpperCase(s));
end;
end;
LList.AtFree(0);
end;
SList.Enter;
while SList.Count > 0 do begin
if CP.OutUsed < 1024 then begin
PutString(SList[0]);
SList.AtFree(0);
end else begin
CP.Flsh;
break;
end;
end;
SList.Leave;
Application.ProcessMessages;
end;
function TRCC.NextStep: boolean;
begin
DoStep;
Result := (State <> bdDone) and (CP.Carrier = CP.DCD);
end;
procedure TRCC.Start;
begin
if Originator then begin
RForm := Pointer(SendMessage(MainWinHandle, WM_OPENREMOTE, integer(Self), 0));
end;
end;
procedure TRCC.PutString;
var i: integer;
begin
for i := 1 to length(s) do CP.PutChar(ord(s[i]));
CP.PutChar(10);
end;
procedure TRCC.CloseLine;
begin
State := bdDone;
end;
end.
|
unit dep_parentsform;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;
type
TParentsForm = class(TForm)
OkBtn: TButton;
CancelBtn: TButton;
FNameEdit: TLabeledEdit;
MNameEdit: TLabeledEdit;
LNameEdit: TLabeledEdit;
WorkPhoneEdit: TLabeledEdit;
HomePhoneEdit: TLabeledEdit;
CellPhoneEdit: TLabeledEdit;
JobPlaceEdit: TLabeledEdit;
JobEdit: TLabeledEdit;
IsMotherComboBox: TComboBox;
IsNativComboBox: TComboBox;
Label1: TLabel;
NoteEdit: TMemo;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
procedure setEnabled(ro : boolean);
{ Public declarations }
end;
var
ParentsForm: TParentsForm;
implementation
{$R *.dfm}
procedure TParentsForm.setEnabled(ro: boolean);
begin
FNameEdit.Enabled := ro;
MNameEdit.Enabled := ro;
LNameEdit.Enabled := ro;
WorkPhoneEdit.Enabled := ro;
HomePhoneEdit.Enabled := ro;
CellPhoneEdit.Enabled := ro;
IsMotherComboBox.Enabled := ro;
isNativComboBox.Enabled := ro;
JobEdit.Enabled := ro;
JobPlaceEdit.Enabled := ro;
NoteEdit.Enabled := ro;
end;
procedure TParentsForm.FormCreate(Sender: TObject);
begin
IsMotherComboBox.ItemIndex := 0;
IsNativComboBox.ItemIndex := 1;
end;
end.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.