• R/O
  • SSH
  • HTTPS

akdf: Commit


Commit MetaInfo

Revision514 (tree)
Time2020-07-14 00:25:24
Authorderekwildstar

Log Message

Incluído código para nomea a thread de validação em modo de depuração

Change Summary

Incremental Difference

--- trunk/rtp/src/Xml/KRK.Xml.ValidateXmlXsd.pas (revision 513)
+++ trunk/rtp/src/Xml/KRK.Xml.ValidateXmlXsd.pas (revision 514)
@@ -21,6 +21,7 @@
2121 FOnIgnorableWarning: TOnIgnorableWarning;
2222 FProgressNotificationRate: Word;
2323 function Validate: TStringList;
24+ procedure ConfigureName;
2425 public
2526 procedure Execute; override;
2627 class procedure Go(AXMLFile: String; AXSDFile: String; AOnProgress: TOnProgress; AProgressNotificationRate: Word; AOnMax: TOnMax; AOnTerminate: TOnTerminate; AOnError: TOnError; AOnFatalError: TOnFatalError; AOnIgnorableWarning: TOnIgnorableWarning);
@@ -33,7 +34,7 @@
3334 implementation
3435
3536 uses
36- SysUtils, ComObj, ActiveX, KRK.Xml.MsXml;
37+ SysUtils, ComObj, ActiveX, KRK.Xml.MsXml, Windows;
3738
3839 type
3940 TSaxErrorHandler = class (TInterfacedObject, IVBSAXErrorHandler)
@@ -117,11 +118,35 @@
117118 end;
118119 end;
119120
121+procedure TKRKValidateXMLXSD.ConfigureName;
122+type
123+ TThreadNameInfo = record
124+ ThreadType: LongWord; // must be 0x1000
125+ Name: PChar; // pointer to name (in user address space)
126+ ThreadID: LongWord; // thread ID (-1 indicates caller thread)
127+ Flags: LongWord; // reserved for future use, must be zero
128+ end;
129+
130+var
131+ ThreadNameInfo: TThreadNameInfo;
132+begin
133+ ThreadNameInfo.ThreadType := $1000;
134+ ThreadNameInfo.Name := PChar('Validando ' + ExtractFileName(FXMLFile) + ' com ' + ExtractFileName(FXSDFile));
135+ ThreadNameInfo.ThreadID := $FFFFFFFF;
136+ ThreadNameInfo.Flags := 0;
137+
138+ try
139+ RaiseException( $406D1388, 0, sizeof(ThreadNameInfo) div sizeof(LongWord), @ThreadNameInfo );
140+ except
141+ end;
142+end;
143+
120144 procedure TKRKValidateXMLXSD.Execute;
121145 var
122146 XMLDocument: IXMLDOMDocument3;
123147 begin
124148 inherited;
149+ ConfigureName;
125150 DoMax(0);
126151
127152 if CoInitialize(nil) = S_OK then
Show on old repository browser