Prechádzať zdrojové kódy

- removed renamed units

git-svn-id: branches/fixes_2_2@9745 -
Jonas Maebe 17 rokov pred
rodič
commit
61f487f30d

+ 0 - 4
.gitattributes

@@ -4334,13 +4334,10 @@ packages/winunits-jedi/Makefile svneol=native#text/plain
 packages/winunits-jedi/Makefile.fpc svneol=native#text/plain
 packages/winunits-jedi/fpmake.inc svneol=native#text/plain
 packages/winunits-jedi/fpmake.pp svneol=native#text/plain
-packages/winunits-jedi/src/JwaVista.pas svneol=native#text/plain
-packages/winunits-jedi/src/JwaWinSta.pas svneol=native#text/plain
 packages/winunits-jedi/src/ModuleLoader.pas svneol=native#text/plain
 packages/winunits-jedi/src/buildjwa.pp svneol=native#text/plain
 packages/winunits-jedi/src/jedi.inc svneol=native#text/plain
 packages/winunits-jedi/src/jediapilib.inc svneol=native#text/plain
-packages/winunits-jedi/src/jwaObjsel.pas svneol=native#text/plain
 packages/winunits-jedi/src/jwaaccctrl.pas svneol=native#text/plain
 packages/winunits-jedi/src/jwaaclapi.pas svneol=native#text/plain
 packages/winunits-jedi/src/jwaaclui.pas svneol=native#text/plain
@@ -4396,7 +4393,6 @@ packages/winunits-jedi/src/jwafaxmmc.pas svneol=native#text/plain
 packages/winunits-jedi/src/jwafaxroute.pas svneol=native#text/plain
 packages/winunits-jedi/src/jwagpedit.pas svneol=native#text/plain
 packages/winunits-jedi/src/jwahherror.pas svneol=native#text/plain
-packages/winunits-jedi/src/jwahtmlGuid.pas svneol=native#text/plain
 packages/winunits-jedi/src/jwahtmlguid.pas svneol=native#text/plain
 packages/winunits-jedi/src/jwahtmlhelp.pas svneol=native#text/plain
 packages/winunits-jedi/src/jwaiaccess.pas svneol=native#text/plain

+ 0 - 380
packages/winunits-jedi/src/JwaVista.pas

@@ -1,380 +0,0 @@
-{******************************************************************************}
-{                                                                              }
-{ Windows API interface Unit for Object Pascal                                 }
-{ Master file for Windows Vista applications                                   }
-{                                                                              }
-{ Portions created by Microsoft are Copyright (C) Microsoft Corporation.       }
-{  All Rights Reserved.                                                        }
-{                                                                              }
-{ The original Pascal code is: JwaVista.pas, released Octobre 2007.            }
-{                                                                              }
-{ Portions created by Christian Wimmer are Copyright (C) 2007                  }
-{ Christian Wimmer. All Rights Reserved.                                       }
-{                                                                              }
-{ Obtained through: Joint Endeavour of Delphi Innovators (Project JEDI)        }
-{                                                                              }
-{ You may retrieve the latest version of this file at the Project JEDI         }
-{ APILIB home page, located at http://jedi-apilib.sourceforge.net              }
-{                                                                              }
-{ The contents of this file are used with permission, 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/MPL/MPL-1.1.html                                      }
-{                                                                              }
-{ 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 Lesser General Public License (the  "LGPL License"), in which case the   }
-{ provisions of the LGPL License are applicable instead of those above.        }
-{ If you wish to allow use of your version of this file only under the terms   }
-{ of the LGPL License and not to allow others to use your version of this file }
-{ under the MPL, indicate your decision by deleting  the provisions above and  }
-{ replace  them with the notice and other provisions required by the LGPL      }
-{ License.  If you do not delete the provisions above, a recipient may use     }
-{ your version of this file under either the MPL or the LGPL License.          }
-{                                                                              }
-{ For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html }
-{                                                                              }
-{ This unit contains declarations that are new in Windows Vista.               }
-{ This unit can be used in programs to be run under older versions of windows. }
-{ However you should not use these types in a semantic way.                    }
-{ This unit is not part of JwaWindows.pas and MUST be included by uses clause. }
-{ To use this unit you must compile JwaWindows.pas with include mode.}
-
-unit JwaVista;
-
-interface
-
-uses JwaWindows;
-
-
-type
-  WELL_KNOWN_SID_TYPE = (
-  WinNullSid {= 0},
-  WinWorldSid {= 1},
-  WinLocalSid {= 2},
-  WinCreatorOwnerSid {= 3},
-  WinCreatorGroupSid {= 4},
-  WinCreatorOwnerServerSid {= 5},
-  WinCreatorGroupServerSid {= 6},
-  WinNtAuthoritySid {= 7},
-  WinDialupSid {= 8},
-  WinNetworkSid {= 9},
-  WinBatchSid {= 10},
-  WinInteractiveSid {= 11},
-  WinServiceSid {= 12},
-  WinAnonymousSid {= 13},
-  WinProxySid {= 14},
-  WinEnterpriseControllersSid {= 15},
-  WinSelfSid {= 16},
-  WinAuthenticatedUserSid {= 17},
-  WinRestrictedCodeSid {= 18},
-  WinTerminalServerSid {= 19},
-  WinRemoteLogonIdSid {= 20},
-  WinLogonIdsSid {= 21},
-  WinLocalSystemSid {= 22},
-  WinLocalServiceSid {= 23},
-  WinNetworkServiceSid {= 24},
-  WinBuiltinDomainSid {= 25},
-  WinBuiltinAdministratorsSid {= 26},
-  WinBuiltinUsersSid {= 27},
-  WinBuiltinGuestsSid {= 28},
-  WinBuiltinPowerUsersSid {= 29},
-  WinBuiltinAccountOperatorsSid {= 30},
-  WinBuiltinSystemOperatorsSid {= 31},
-  WinBuiltinPrintOperatorsSid {= 32},
-  WinBuiltinBackupOperatorsSid {= 33},
-  WinBuiltinReplicatorSid {= 34},
-  WinBuiltinPreWindows2000CompatibleAccessSid {= 35},
-  WinBuiltinRemoteDesktopUsersSid {= 36},
-  WinBuiltinNetworkConfigurationOperatorsSid {= 37},
-  WinAccountAdministratorSid {= 38},
-  WinAccountGuestSid {= 39},
-  WinAccountKrbtgtSid {= 40},
-  WinAccountDomainAdminsSid {= 41},
-  WinAccountDomainUsersSid {= 42},
-  WinAccountDomainGuestsSid {= 43},
-  WinAccountComputersSid {= 44},
-  WinAccountControllersSid {= 45},
-  WinAccountCertAdminsSid {= 46},
-  WinAccountSchemaAdminsSid {= 47},
-  WinAccountEnterpriseAdminsSid {= 48},
-  WinAccountPolicyAdminsSid {= 49},
-  WinAccountRasAndIasServersSid {= 50},
-  WinNTLMAuthenticationSid {= 51},
-  WinDigestAuthenticationSid {= 52},
-  WinSChannelAuthenticationSid {= 53},
-  WinThisOrganizationSid {= 54},
-  WinOtherOrganizationSid {= 55},
-  WinBuiltinIncomingForestTrustBuildersSid {= 56},
-  WinBuiltinPerfMonitoringUsersSid {= 57},
-  WinBuiltinPerfLoggingUsersSid {= 58},
-  WinBuiltinAuthorizationAccessSid {= 59},
-  WinBuiltinTerminalServerLicenseServersSid {= 60},
-  WinBuiltinDCOMUsersSid {= 61},
-  WinBuiltinIUsersSid {= 62},
-  WinIUserSid {= 63},
-  WinBuiltinCryptoOperatorsSid {= 64},
-  WinUntrustedLabelSid {= 65},
-  WinLowLabelSid {= 66},
-  WinMediumLabelSid {= 67},
-  WinHighLabelSid {= 68},
-  WinSystemLabelSid {= 69},
-  WinWriteRestrictedCodeSid {= 70},
-  WinCreatorOwnerRightsSid {= 71},
-  WinCacheablePrincipalsGroupSid {= 72},
-  WinNonCacheablePrincipalsGroupSid {= 73},
-  WinEnterpriseReadonlyControllersSid {= 74},
-  WinAccountReadonlyControllersSid {= 75},
-  WinBuiltinEventLogReadersGroup {= 76},
-  WinNewEnterpriseReadonlyControllersSid {= 77},
-  WinBuiltinCertSvcDComAccessGroup {= 78}
-  );
-
-  TWellKnownSidType = WELL_KNOWN_SID_TYPE;
-
-
-    {Token elevation type.
-     TokenElevationTypePad0 does not belong to this type. It is only a pad.
-
-     Vista only
-    }
-  _TOKEN_ELEVATION_TYPE = (TokenElevationTypePad0,
-    TokenElevationTypeDefault, TokenElevationTypeFull,
-    TokenElevationTypeLimited);
-
-  {see @link(_TOKEN_ELEVATION_TYPE)}
-  TTokenElevationType = _TOKEN_ELEVATION_TYPE;
-  {see @Link(_TOKEN_ELEVATION_TYPE)}
-  PTokenElevationType = ^TTokenElevationType;
-
-  {@Name contains the elevation status of a token on a vista system.}
-  _TOKEN_ELEVATION = record
-    TokenIsElevated: DWORD;
-  end;
-
-  {see @Link(_TOKEN_ELEVATION)}
-  TTokenElevation = _TOKEN_ELEVATION;
-  {see @Link(_TOKEN_ELEVATION)}
-  PTokenElevation = ^TTokenElevation;
-
-    {@Name is the new token information class of a vista system.
-     The enum constant TokenPadding0 is only for padding and is not used.
-     }
-
-
-  _TOKEN_INFORMATION_CLASS = (TokenPadding0,
-    TokenUser,
-    TokenGroups,
-    TokenPrivileges,
-    TokenOwner,
-    TokenPrimaryGroup,
-    TokenDefaultDacl,
-    TokenSource,
-    TokenType,
-    TokenImpersonationLevel,
-    TokenStatistics,
-    TokenRestrictedSids,
-    TokenSessionId,
-    TokenGroupsAndPrivileges,
-    TokenSessionReference,
-    TokenSandBoxInert,
-    TokenAuditPolicy,
-    TokenOrigin,
-    TokenElevationType,
-    TokenLinkedToken,
-    TokenElevation,
-    TokenHasRestrictions,
-    TokenAccessInformation,
-    TokenVirtualizationAllowed,
-    TokenVirtualizationEnabled,
-    TokenIntegrityLevel,
-    TokenUIAccess,
-    TokenMandatoryPolicy,
-    TokenLogonSid,
-    // MaxTokenInfoClass should always be the last enum
-    MaxTokenInfoClass
-    );
-
-
-  {see @Link(_TOKEN_INFORMATION_CLASS)}
-  TTokenInformationClass   = _TOKEN_INFORMATION_CLASS;
-  {see @Link(_TOKEN_INFORMATION_CLASS)}
-  PTokenInformationClass   = ^TTokenInformationClass;
-
-type
-  MANDATORY_LEVEL = (
-    MandatoryLevelUntrusted, {= 0}
-    MandatoryLevelLow,
-    MandatoryLevelMedium,
-    MandatoryLevelHigh,
-    MandatoryLevelSystem,
-    MandatoryLevelSecureProcess,
-    MandatoryLevelCount);
-
-  PMANDATORY_LEVEL = ^MANDATORY_LEVEL;
-
-  TMandatoryLevel = MANDATORY_LEVEL;
-  PMandatoryLevel = ^TMandatoryLevel;
-
-const
-  SYSTEM_MANDATORY_LABEL_NO_WRITE_UP = $1; //A principal with a lower mandatory level than the object cannot write to the object.
-  SYSTEM_MANDATORY_LABEL_NO_READ_UP = $2; //A principal with a lower mandatory level than the object cannot read the object.
-  SYSTEM_MANDATORY_LABEL_NO_EXECUTE_UP = $4; //A principal with a lower mandatory level than the object cannot execute the object.
-
-type
-  //http://msdn2.microsoft.com/en-us/library/aa965848.aspx
-  _SYSTEM_MANDATORY_LABEL_ACE = record
-    Header : ACE_HEADER;
-    Mask : ACCESS_MASK;
-    SidStart : DWORD;
-  end;
-  SYSTEM_MANDATORY_LABEL_ACE = _SYSTEM_MANDATORY_LABEL_ACE;
-  PSYSTEM_MANDATORY_LABEL_ACE = ^_SYSTEM_MANDATORY_LABEL_ACE;
-
-  TSystemMandatoryLabelAce = _SYSTEM_MANDATORY_LABEL_ACE;
-  PSystemMandatoryLabelAce = ^TSystemMandatoryLabelAce;
-
-const
-  TOKEN_MANDATORY_POLICY_OFF = $0; //No mandatory integrity policy is enforced for the token.
-  TOKEN_MANDATORY_POLICY_NO_WRITE_UP = $1; //A process associated with the token cannot write to objects that have a greater mandatory integrity level.
-  TOKEN_MANDATORY_POLICY_NEW_PROCESS_MIN = $2; //A process created with the token has an integrity level that is the lesser of the parent-process integrity level and the executable-file integrity level.
-  TOKEN_MANDATORY_POLICY_VALID_MASK = $3; //A combination of TOKEN_MANDATORY_POLICY_NO_WRITE_UP and TOKEN_MANDATORY_POLICY_NEW_PROCESS_MIN
-
-type
-  //http://msdn2.microsoft.com/en-us/library/bb394728.aspx
-  _TOKEN_MANDATORY_POLICY = record
-    Policy : DWORD;
-  end;
-
-  TOKEN_MANDATORY_POLICY = _TOKEN_MANDATORY_POLICY;
-  PTOKEN_MANDATORY_POLICY = ^TOKEN_MANDATORY_POLICY;
-
-  TTokenMandatoryPolicy = _TOKEN_MANDATORY_POLICY;
-  PTokenMandatoryPolicy = ^TTokenMandatoryPolicy;
-
-const
-  {
-  The SID_HASH_SIZE array dimension is defined in WinNT.h as 32.
-  http://msdn2.microsoft.com/en-us/library/bb394725.aspx
-  }
-  SID_HASH_SIZE = 32;
-
-type
-  SID_HASH_ENTRY = ULONG_PTR;
-  TSidHashEntry = SID_HASH_ENTRY;
-
-  //http://msdn2.microsoft.com/en-us/library/bb394725.aspx
-  _SID_AND_ATTRIBUTES_HASH = record
-    SidCount : DWORD;
-    SidAttr : PSID_AND_ATTRIBUTES;
-    Hash : array[0..SID_HASH_SIZE-1] of SID_HASH_ENTRY;
-  end;
-
-  SID_AND_ATTRIBUTES_HASH = _SID_AND_ATTRIBUTES_HASH;
-  PSID_AND_ATTRIBUTES_HASH = ^SID_AND_ATTRIBUTES_HASH;
-
-  TSidAndAttributesHash = _SID_AND_ATTRIBUTES_HASH;
-  PSidAndAttributesHash = ^TSidAndAttributesHash;
-
-
-  //http://msdn2.microsoft.com/en-us/library/bb394726.aspx
-  _TOKEN_ACCESS_INFORMATION = record
-    SidHash: PSID_AND_ATTRIBUTES_HASH;
-    RestrictedSidHash : PSID_AND_ATTRIBUTES_HASH;
-    Privileges : PTOKEN_PRIVILEGES;
-    AuthenticationId : LUID;
-    TokenType : TOKEN_TYPE;
-    ImpersonationLevel : SECURITY_IMPERSONATION_LEVEL;
-    MandatoryPolicy : TOKEN_MANDATORY_POLICY;
-    Flags : DWORD;
-  end;
-
-  TOKEN_ACCESS_INFORMATION = _TOKEN_ACCESS_INFORMATION;
-  PTOKEN_ACCESS_INFORMATION = ^TOKEN_ACCESS_INFORMATION;
-
-  TTokenAccessInformation = _TOKEN_ACCESS_INFORMATION;
-  PTokenAccessInformation = ^TTokenAccessInformation;
-
-  //http://msdn2.microsoft.com/en-us/library/bb530719.aspx
-  _TOKEN_LINKED_TOKEN = record
-    LinkedToken : HANDLE;
-  end;
-  TOKEN_LINKED_TOKEN = _TOKEN_LINKED_TOKEN;
-  PTOKEN_LINKED_TOKEN = ^TOKEN_LINKED_TOKEN;
-
-  TTokenLinkedToken = _TOKEN_LINKED_TOKEN;
-  PTokenLinkedToken = ^TTokenLinkedToken;
-
-
-  _TOKEN_MANDATORY_LABEL = record
-    Label_ : SID_AND_ATTRIBUTES;
-  end;
-
-  TOKEN_MANDATORY_LABEL = _TOKEN_MANDATORY_LABEL;
-  PTOKEN_MANDATORY_LABEL = ^TOKEN_MANDATORY_LABEL;
-
-  TTokenMandatoryLabel = _TOKEN_MANDATORY_LABEL;
-  PTokenMandatoryLabel = ^TTokenMandatoryLabel;
-
-const
-  SYSTEM_MANDATORY_LABEL_ACE_TYPE = $11;
-
-  SE_RELABEL_NAME = 'SeRelabelPrivilege'; //Required to modify the mandatory integrity level of an object.
-
-
-  SE_GROUP_INTEGRITY                 = $00000020;
-  SE_GROUP_INTEGRITY_ENABLED         = $00000040;
-
-  {@Name includes the integrity ACE into the security descriptor string.
-   See http://msdn2.microsoft.com/en-us/library/aa376397.aspx
-   }
-  LABEL_SECURITY_INFORMATION = $0000010;
-
-
-  SECURITY_MANDATORY_UNTRUSTED_RID = $0;
-  SECURITY_MANDATORY_LOW_RID = $1000;
-  SECURITY_MANDATORY_MEDIUM_RID = $2000;
-  SECURITY_MANDATORY_HIGH_RID = $3000;          
-  SECURITY_MANDATORY_SYSTEM_RID = $4000;
-  SECURITY_MANDATORY_PROTECTED_PROCESS_RID = $5000;
-
-  LowIL = 'S-1-16-4096';
-  MediumIL = 'S-1-16-8192';
-  HighIL = 'S-1-16-12288';
-  SystemIL = 'S-1-16-16384';
-  ProtectedProcessIL = 'S-1-16-20480';
-
-
-  function AddMandatoryAce(pAcl: PACL; dwAceRevision, AceFlags, MandatoryPolicy: DWORD;
-    pLabelSid: PSID): BOOL; stdcall;
-  {$EXTERNALSYM AddMandatoryAce}
-
-
-
-implementation
-uses JwaWinDLLNames;
-
-{$IFNDEF DYNAMIC_LINK}
-  function AddMandatoryAce(pAcl: PACL; dwAceRevision, AceFlags, MandatoryPolicy: DWORD;
-    pLabelSid: PSID): BOOL; stdcall; external advapi32 name 'AddMandatoryAce';
-{$ELSE}
-
-var
-  _AddMandatoryAce: Pointer;
-
-function AddMandatoryAce;
-begin
-  GetProcedureAddress(_AddMandatoryAce, advapi32, 'AddMandatoryAce');
-  asm
-        MOV     ESP, EBP
-        POP     EBP
-        JMP     [_AddMandatoryAce]
-  end;
-end;
-
-{$ENDIF DYNAMIC_LINK}
-
-end.

+ 0 - 1409
packages/winunits-jedi/src/JwaWinSta.pas

@@ -1,1409 +0,0 @@
-{******************************************************************}
-{ This Unit provides Delphi translations of some functions from    }
-{ WinSta.dll and Utildll.                                          }
-{ Most functions are undocumented and somehow related to           }
-{ Terminal Server                                                  }
-{                                                                  }
-{ Author: Remko Weijnen (r dot weijnen at gmail dot com)           }
-{ Documentation can be found at www.remkoweijnen.nl                }
-{                                                                  }
-{ 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/MPL/MPL-1.1.html                          }
-{                                                                  }
-{ 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.                        }
-{******************************************************************}
-
-{$IFNDEF JWA_OMIT_SECTIONS}
-
-unit JwaWinSta;
-
-
-interface
-
-{$I jediapilib.inc}
-
-uses
-  DateUtils, SysUtils, JwaWinType, // JwaWinType must be declared before JwaWinBase because of duplicate declaration of FILETIME
-  JwaWinBase, JwaWinError, JwaNTStatus, JwaWinNT, JwaWinsock2,
-  JwaWinSvc, JwaWtsApi32, JwaNative;
-{$ENDIF JWA_OMIT_SECTIONS}
-
-
-{$IFNDEF JWA_IMPLEMENTATIONSECTION}
-
-//==============================================================================
-// Defines
-//==============================================================================
-const
-  SERVERNAME_CURRENT = 0;
-  
-  // constants used for WinStationGetTermSrvCounters
-  TOTAL_SESSIONS_CREATED_COUNTER = 1;
-  TOTAL_SESSIONS_DISCONNECTED_COUNTER = 2;
-  TOTAL_SESSIONS_RECONNECTED_COUNTER = 3;
-  TOTAL_SESSIONS_TOTAL_CONNECTED_NOW_COUNTER = 4;
-  TOTAL_SESSIONS_TOTAL_DISCONNECTED_NOW_COUNTER = 5;
-  TOTAL_SESSIONS_TOTAL_CONNECTED_NOW_COUNTER_2 = 6; //TermSrvSuccLocalLogons;
-  TOTAL_SESSIONS_TOTAL_DISCONNECTED_NOW_COUNTER_2 = 7;
-
-  // Max lenght for ElapsedTimeString (server 2008 version of utildll
-  // fixes size at 15, so that's assumed to be safe
-  ELAPSED_TIME_STRING_LENGTH = 15;
-
-  // WdFlag = WinStation Driver Flag, it is returned in class 3 (WdConfig)
-  // of WinStationQueryInformation and has a different value which
-  // depends on the protocol. WdFlag is also returned by QueryCurrentWinStation
-  WD_FLAG_CONSOLE_XP = $24; // XP
-  WD_FLAG_CONSOLE = $34; // 2003/2008
-  WD_FLAG_RDP = $36; // XP/2003/2008
-  WD_FLAG_ICA = $6E; // Citrix Presentation Server
-//  (value from Citrix PS4, other versions could be different!)
-
-  // Class constants for WinStationQueryInformationW
-  // These names were found in winsta.dll because they have
-  // corresponding unicode 2 ansi conversion functions.
-  // Unknown: AsyncConfig, NasiConfig, OemTdConfig, PdConfig, PdConfig2
-  // PdParams UserConfig, WinStationCreate, WinStationPrinter
-  //
-  // The structures below are currently defined, constant names were
-  // mapped on best guess:
-
-  WdConfig = 3;
-  WinStationClient = 1;
-  WinStationConfig = 6;
-  WinStationInformation = 8;
-  WinStationProductId = 27;
-  WinStationRemoteAddress = 29;
-
-  // Constants for WinStationSetInformation
-  WinStationBeep = 10;  // Calls MessageBeep
-
-  // This class is used to query the user's primary access token
-  // Only System account is allowed to retrieve this!
-  WinStationToken = 14;
-
-  // WinStationLocks plays the lock or unlock sound
-  // functionality not yet confirmed
-  WinStationLock = 28; // Locks or Unlocks the WinStation
-
-  SECONDS_PER_DAY = 86400;
-  SECONDS_PER_HOUR = 3600;
-  SECONDS_PER_MINUTE = 60;
-type
-  // This type is used for ElapsedTimeString
-  TDiffTime = record
-    wDays: Word;
-    wHours: Word;
-    wMinutes: Word;
-    wSeconds: Word;
-    wMilliseconds: Word;
-  end;
-  PDiffTime = ^TDiffTime;
-
-  // This type is used for WinStationQueryLogonCredentialsW
-  // dwType can be one of the types defined in JwaWinWlx
-  // WLX_CREDENTIAL_TYPE_V1_0 or  WLX_CREDENTIAL_TYPE_V2_0 = 2
-  _LOGON_CREDENTIALSW = record
-    dwType: DWORD;
-    pUsername: PWideChar;
-    pDomain: PWideChar;
-    pPassword: PWideChar;
-    Unknown2 : DWORD;
-    Unknown3 : DWORD;
-    Unknown4: DWORD;
-  end;
-  PLOGON_CREDENTIALSW = ^_LOGON_CREDENTIALSW;
-  TLogonCredentialsW = _LOGON_CREDENTIALSW;
-  PLogonCredentialsW = PLOGON_CREDENTIALSW;
-
-  _WINSTA_USER_TOKEN = record
-    ProcessId : DWORD;
-    ThreadId : DWORD;
-    TokenHandle : THandle;
-  end;
-  PWINSTA_USER_TOKEN = ^_WINSTA_USER_TOKEN;
-  TWinstaUserToken = _WINSTA_USER_TOKEN;
-  PWinstaUserToken = ^TWinstaUserToken;
-
- // this type is used for WinStationGetTemSrvCounters
-  _TERM_SRV_COUNTER = record
-    dwIndex: DWORD;
-    bSuccess: BOOL;
-    dwValue: DWORD;
-    Reserved2: DWORD;
-    Reserved3: DWORD;
-    Reserved4: DWORD;
-  end;
-  PTERM_SRV_COUNTER = ^_TERM_SRV_COUNTER;
-  TTermSrvCounter = _TERM_SRV_COUNTER;
-  PTermSrvCounter = ^TTermSrvCounter;
-
-  TERM_SRV_COUNTER_ARRAY = array [1..7] of _TERM_SRV_COUNTER;
-  PTERM_SRV_COUNTER_ARRAY = ^TERM_SRV_COUNTER_ARRAY;
-  TTermSrvCounterArray = TERM_SRV_COUNTER_ARRAY;
-  PTermSrvCounterArray = PTERM_SRV_COUNTER_ARRAY;
-
-  // The following types are used for WinStationGetAllProcesses
-  // _WINSTA_PROCESS_INFO
-  _WINSTA_PROCESS_INFO = record
-    ExtendedInfo: PSYSTEM_PROCESSES;
-    dwSidLength: DWORD;
-    pUserSid: PSID;
-  end;
-  PWINSTA_PROCESS_INFO = ^_WINSTA_PROCESS_INFO;
-  TWinstaProcessInfo = _WINSTA_PROCESS_INFO;
-  PWinstaProcessInfo = PWINSTA_PROCESS_INFO;
-
-  // Array of _WINSTA_PROCESS_INFO
-  _WINSTA_PROCESS_INFO_ARRAY = array [0..ANYSIZE_ARRAY-1] of _WINSTA_PROCESS_INFO;
-  PWINSTA_PROCESS_INFO_ARRAY= ^_WINSTA_PROCESS_INFO_ARRAY;
-  TWinstaProcessInfoArray = _WINSTA_PROCESS_INFO_ARRAY;
-  PWinstaProcessInfoArray = PWINSTA_PROCESS_INFO_ARRAY;
-
-  // The following types are used for WinStationQueryInformationW
-
-  // WinStationClient, returns information as provided by the
-  // Terminal Server client (mstsc).
-  _WINSTATION_CLIENTW = record
-    Comment: array[0..59] of WCHAR;
-    Reserved1: array[0..2] of DWORD;
-    ClientUsername: array[0..20] of WCHAR;
-    ClientDomain: array[0..17] of WCHAR;
-    ClientPassword: array[0..255] of WCHAR; // this was fixec win2000 SP4
-    Reserved2: array[0..1635] of BYTE;
-    Reserved3: array[0..6] of DWORD;
-    Reserved4: array[0..275] of BYTE;
-  end;
-  PWINSTATION_CLIENTW = ^_WINSTATION_CLIENTW;
-  TWinStationClientW = _WINSTATION_CLIENTW;
-  PWinStationClientW = PWINSTATION_CLIENTW;
-
-  // WdConfig class, returns information about the WinStationDriver
-  _WD_CONFIGW = record
-    WdName: array[0..32] of WCHAR;
-    WdDLL: array[0..32] of WCHAR;
-    WsxDLL: array[0..33] of WCHAR;
-    WdFlag: DWORD;
-    InputBufferLength: DWORD;
-    CfgDLL: array[0..32] of WCHAR;
-    WdPrefix: array[0..12] of WCHAR;
-  end;
-  PWD_CONFIGW = ^_WD_CONFIGW;
-  TWdConfigW = _WD_CONFIGW;
-  PWdConfigW = PWD_CONFIGW;
-
-  // WinStationConfig class, returns information about the client's
-  // configuration such as network, time(zone) settings and such
-  _WINSTATION_CONFIGW = record
-    Reserved1: DWORD;
-    ClientName: array[0..20] of WCHAR;
-    Domain: array[0..17] of WCHAR;
-    Username: array[0..35] of WCHAR;
-    CurrentDirectory: array[0..256] of WCHAR;
-    ApplicationName:array[0..259] of WCHAR;
-    Reserved2: DWORD;
-    AddressFamily: DWORD;  // AF_INET, AF_IPX, AF_NETBIOS, AF_UNSPEC
-    ClientAddress: array[0..27] of WCHAR;
-    Reserved3: array[0..7] of BYTE;
-    Reserved4: array[0..4] of DWORD;
-    Reserved5: array[0..69] of BYTE;
-    ClientDLLName: array[0..330] of WCHAR;
-    Reserved6: array[0..1] of FILETIME;
-    AudioDriver: array[0..9] of WCHAR;
-    TZBias: DWORD;
-    TZStandardName: array[0..31] of WCHAR;
-    Reserved7: DWORD; // Standard Bias??
-    TZDaylightName: array[0..31] of WCHAR;
-    TZDayLightStart: array[0..15] of BYTE;
-    TZDayLightBias: DWORD;
-    Reserved8: DWORD; // Daylight offset?
-    TSInstanceID: array[0..33] of WCHAR; // sometimes windows license key(s)
-    Reserved9: DWORD;      // related to license key or instanceid?
-  end;
-  PWINSTATION_CONFIGW = ^_WINSTATION_CONFIGW;
-  TWinStationConfigW = _WINSTATION_CONFIGW;
-  PWinStationConfigW = PWINSTATION_CONFIGW;
-
-  // class WinStationInformationClass
-  // provides information about the current state of the client such as
-  // idletime, sessionstatus and transferred/received bytes
-  _WINSTATION_INFORMATIONW = record
-    State: DWORD;
-    WinStationName: array[0..10] of WideChar;
-    Unknown1: array[0..10] of byte;
-    Unknown3: array[0..10] of WideChar;
-    Unknown2: array[0..8] of byte;
-    SessionId: DWORD;
-    Reserved2: array[0..3] of byte;
-    ConnectTime: FILETIME;
-    DisconnectTime: FILETIME;
-    LastInputTime: FILETIME;
-    LogonTime: FILETIME;
-    Unknown4: array[0..11] of byte;
-    OutgoingFrames: DWORD;
-    OutgoingBytes: DWORD;
-    OutgoingCompressBytes: DWORD;
-    Unknown5: array[0..435] of byte;
-    IncomingCompressedBytes: DWORD;
-    Unknown6: array[0..7] of byte;
-    IncomingFrames: DWORD;
-    IncomingBytes: DWORD;
-    Unknown7: array[0..3] of byte;
-    Reserved3: array[0..528] of byte;
-    Domain: array[0..17] of WideChar;
-    Username: array[0..22] of WideChar;
-    CurrentTime: FILETIME;
-  end;
-  PWINSTATION_INFORMATIONW = ^_WINSTATION_INFORMATIONW;
-  TWinStationInformationExW = _WINSTATION_INFORMATIONW;
-  PWinStationInformationExW = PWINSTATION_INFORMATIONW;
-
-  // WinStationRemoteAddress (class 29)
-  // Definition is preliminary
-  // AddressFamily can be AF_INET, AF_IPX, AF_NETBIOS, AF_UNSPEC
-  // Port is the remote port number (local port number is 3389 by default)
-  // Address (for type AF_INET it start's at a 2 byte offset)
-  // You can format IP Address to string like this:
-  // Format('%d.%d.%d.%d', [WinStationAddress.Address[2],
-  //  WinStationRemoteAddress.[3], WinStationRemoteAddress.Address[4],
-  //  WinStationRemoteAddress..Address[5]]);
-  //
-  // Be sure to fill the structure with zeroes before query!
-  _WINSTATION_REMOTE_ADDRESS = record
-    AddressFamily: DWORD;
-    Port: WORD;
-    Address: array [0..19] of BYTE;
-    Reserved: array[0..5] of BYTE;
-  end;
-  PWINSTATION_REMOTE_ADDRESS = ^_WINSTATION_REMOTE_ADDRESS;
-  TWinStationRemoteAddress = _WINSTATION_REMOTE_ADDRESS;
-  PWinStationRemoteAddress = PWINSTATION_REMOTE_ADDRESS;
-
-
-function AreWeRunningTerminalServices: Boolean;
-
-procedure CachedGetUserFromSid(pSid: PSID; pUserName: LPWSTR;
-  var cbUserName: DWORD); stdcall;
-
-function CalculateDiffTime(TimeLow: INT64; TimeHigh: INT64): INT64;
-  stdcall;
-
-// Calculate Elapsed time from a Filetime (UTC time) to DiffTime structure
-function CalculateElapsedTime(lpFileTime: PFILETIME; var DiffTime: TDiffTime):
-  Boolean; stdcall;
-
-function CpuTime2Str(ACPUTime: LARGE_INTEGER): string;
-
-function CurrentDateTimeString(out lpBuffer: PWideChar): Boolean; stdcall;
-
-// This is the version for NT Terminal Server, 2000, XP/2003 and Server 2008
-function DateTimeString(DateTime: PFILETIME; lpBuffer: PWideChar): PWideChar;
-  stdcall;
-
-// This is a wrapped for all OS versions
-function DateTimeStringSafe(DateTime: PFILETIME; lpBuffer: PWideChar;
-  cchDest: SIZE_T): PWideChar; stdcall;
-
-// This is the Vista version which takes an additional parameter with
-// maximum buffer size (you have to set it) 
-function DateTimeStringVista(DateTime: PFILETIME; lpBuffer: PWideChar;
-  cchDest: SIZE_T): PWideChar; stdcall;
-
-function DiffTimeString(FTLow: FILETIME; FTHigh: FILETIME;
-  out pwElapsedTime: PWideChar): Integer;
-
-// This is the version for NT Terminal Server, 2000, XP/2003 and Server 2008
-function ElapsedTimeString(DiffTime: PDiffTime; bShowSeconds: Boolean;
-  lpElapsedTime: PWideChar): Integer; stdcall;
-
-// This is a wrapped for all OS versions
-function ElapsedTimeStringSafe(DiffTime: PDiffTime; bShowSeconds: Boolean;
-  lpElapsedTime: PWideChar; cchDest: SIZE_T): Integer;
-
-// This is the Vista version of ElapsedTimeString which takes an additional
-// parameter with the count of characters for lpElapsedTime (you have to set it)
-function ElapsedTimeStringEx(DiffTime: PDiffTime; bShowSeconds: Boolean;
-  lpElapsedTime: PWideChar; cchDest: SIZE_T): HRESULT; stdcall;
-
-function FileTime2DateTime(FileTime: TFileTime): TDateTime;
-
-function GetUnknownString: PWideChar; stdcall;
-
-function GetWTSLogonIdleTime(hServer: Handle; SessionId: DWORD;
-  var sLogonTime: string; var sIdleTime: string): Boolean;
-
-// Helper function that inits the structure for you!
-procedure InitTermSrvCounterArray(
-  var ATermSrvCounterArray: TTermSrvCounterArray);
-
-function IsTerminalServiceRunning: boolean;
-
-// Tested and working on Windows XP but doesn't seem to work on
-// Windows Vista/2008. Better use W version to be sure!
-function LogonIdFromWinStationNameA(hServer: HANDLE; pWinStationName: LPSTR;
-  var SessionId: DWORD): BOOL; stdcall;
-
-// Tested and working on XP, 2003 and 2008
-function LogonIdFromWinStationNameW(hServer: HANDLE; pWinStationName: LPWSTR;
-  var SessionId: DWORD): BOOL; stdcall;
-
-// This is the version for NT Terminal Server, 2000, XP/2003 and Server 2008
-// Reserve 66 bytes for pWinStationName and 21 for pUserName
-function QueryCurrentWinStation(pWinStationName: LPWSTR;
-  pUserName: LPWSTR; var SessionId: DWORD; var WdFlag: DWORD): Boolean;
-  stdcall;
-
-// This is the Vista version of QueryCurrentWinStation which takes an
-// additional parameter with the count of characters for pUserName
-// note that pWinStationname is Fixed Size!
-function QueryCurrentWinStationEx(pWinStationName: LPWSTR;
-  pUserName: PWideChar; cchDest: DWORD; var SessionId: DWORD;
-  var WdFlag: DWORD): Boolean; stdcall;
-
-function QueryCurrentWinStationSafe(pWinStationName: LPWSTR;
-  pUserName: PWideChar; cchDest: DWORD; var SessionId: DWORD;
-  var WdFlag: DWORD): Boolean; stdcall;
-
-function StrConnectState(ConnectState: WTS_CONNECTSTATE_CLASS;
-  bShortString: BOOL): PWideChar; stdcall;
-
-function WinStationBroadcastSystemMessage(hServer: HANDLE;
-  SendToAllWinstations: BOOL; SessionId: DWORD; TimeOut: DWORD;
-  dwFlags: DWORD; lpdwRecipients: DWORD; uiMessage: ULONG; wParam: WPARAM;
-  lParam: LPARAM; pResponse: LONGINT): LONGINT; stdcall;
-
-function WinStationCallBack(hServer:HANDLE; SessionId: DWORD;
-	pPhoneNumber: LPWSTR): BOOL; stdcall;
-
-function WinStationConnectW(hServer: Handle; SessionId: DWORD;
-  TargetSessionId: DWORD; pPassword: LPWSTR;
-  bWait: BOOL): BOOL; stdcall;
-
-function WinStationDisconnect(hServer: THandle; SessionId: DWORD;
-  bWait: BOOL): BOOL; stdcall;
-
-function WinStationEnumerateA(hServer: HANDLE;
-  var ppSessionInfo: PWTS_SESSION_INFOA; var pCount: DWORD): BOOL; stdcall;
-
-function WinStationEnumerateW(hServer: HANDLE;
-  var ppSessionInfo: PWTS_SESSION_INFOW; var pCount: DWORD): BOOL; stdcall;
-
-// Used to release memory allocated by WinStationGetAllProcesses
-function WinStationFreeGAPMemory(ClassIndex: DWORD;
-  pProcessInfo: PWINSTA_PROCESS_INFO_ARRAY; Count: Integer): BOOL; stdcall;
-
-// Important! pProcessInfo must be nil before calling this function
-// by using Out parameter Delphi takes care of this for us
-function WinStationGetAllProcesses(hServer: HANDLE; ClassIndex: DWORD;
-  var Count: Integer; out pProcessInfo: PWINSTA_PROCESS_INFO_ARRAY):
-  BOOL; stdcall;
-
-function WinStationGetLanAdapterNameW(hServer: HANDLE; LanaId: DWORD;
-  ProtocolTypeLength: DWORD; ProtocolType: PWideChar;
-  var ResultLength: DWORD; var LanAdapterName: PWideChar): DWORD; stdcall;
-
-function WinStationGetProcessSid(hServer: Handle; dwPID: DWORD;
-  ProcessStartTime: FILETIME; pProcessUserSid: PSID; var dwSidSize: DWORD):
-  BOOL; stdcall;
-
-function WinStationGetRemoteIPAddress(hServer: HANDLE; SessionId: DWORD;
-  var RemoteIPAddress: string; var Port: WORD): Boolean;
-
-function WinStationGetTermSrvCountersValue(hServer: Handle;
-  dwArraySize: DWORD; PCountersArray: PTERM_SRV_COUNTER_ARRAY): BOOL;
-  stdcall;
-
-function WinStationNameFromLogonIdA(hServer: HANDLE; SessionId: ULONG;
-  pWinStationName: LPSTR): BOOL; stdcall;
-
-function WinStationNameFromLogonIdW(hServer: HANDLE; SessionId: ULONG;
-  pWinStationName: LPWSTR): BOOL; stdcall;
-
-function WinStationQueryInformationW(hServer: HANDLE; SessionId: DWORD;
-  WinStationInformationClass: Cardinal; pWinStationInformation: PVOID;
-  WinStationInformationLength: DWORD; var pReturnLength: DWORD):
-  Boolean; stdcall;
-
-function WinStationQueryLogonCredentialsW(
-  var LogonCredentials: _LOGON_CREDENTIALSW): HRESULT; stdcall;
-
-function WinstationQueryUserToken(hServer: HANDLE; SessionId: DWORD;
-  var hToken: HANDLE): BOOL;
-
-// WinStationRename needs Admin rights and always returns true
-// need to check GetLastError
-// Duplicate names are not allowed
-// Renaming a WinStation gives errors on Remote Connections:
-// the windowstation is busy processing connect, disconnect, reset
-// or login request
-
-// A version untested
-function WinStationRenameA(hServer: HANDLE; pOldWinStationName: LPSTR;
-  pNewWinStationName: LPSTR): BOOL; stdcall;
-
-// W version was tested
-function WinStationRenameW(hServer: HANDLE; pOldWinStationName: LPWSTR;
-  pNewWinStationName: LPWSTR): BOOL; stdcall;
-
-function WinStationSendMessageA(hServer: HANDLE; SessionId: DWORD;
-  pTitle: LPSTR; TitleLength: DWORD; pMessage: LPSTR; MessageLength: DWORD;
-  Style: DWORD; Timeout: DWORD; var pResponse: DWORD;
-  bWait: BOOL): BOOL; stdcall;
-
-function WinStationSendMessageW(hServer: HANDLE; SessionId: DWORD;
-  pTitle: LPWSTR; TitleLength: DWORD; pMessage: LPWSTR; MessageLength: DWORD;
-  Style: DWORD; Timeout: DWORD; var pResponse: DWORD;
-  bWait: BOOL): BOOL; stdcall;
-
-function WinStationSetInformationA(hServer: HANDLE; SessionID: DWORD;
-  InformationClass: DWORD; InformationClassDATA: PVOID;
-  DataSize: DWORD): BOOL; stdcall;
-
-function WinStationSetInformationW(hServer: HANDLE; SessionID: DWORD;
-  InformationClass: DWORD; InformationClassDATA: PVOID;
-  DataSize: DWORD): BOOL; stdcall;
-
-function WinStationShadow(hServer: Handle; pServerName: LPWSTR;
-  SessionId: DWORD; HotKey: DWORD; HKModifier: DWORD): BOOL; stdcall;
-
-// Admin can stop a shadowed session. SessionId is the targetsession
-// so the "victim" and not the one who is shadowing
-function WinStationShadowStop(hServer: Handle; SessionId: DWORD;
-  bWait: BOOL): BOOL; stdcall;
-
-function WinStationShutDownSystem(hSERVER: HANDLE;
-  ShutdownFlags: DWORD): BOOL; stdcall;
-
-function WinStationTerminateProcess(hServer: Handle; dwPID: DWORD;
-  dwExitCode: DWORD): BOOL; stdcall;
-
-{$ENDIF JWA_IMPLEMENTATIONSECTION}
-
-{$IFNDEF JWA_OMIT_SECTIONS}
-implementation
-
-uses
-  JwaWinDLLNames;
-{$ENDIF JWA_OMIT_SECTIONS}
-
-{$IFNDEF JWA_INCLUDEMODE}
-const
-  winstadll = 'winsta.dll';
-  utildll = 'utildll.dll';
-{$ENDIF JWA_INCLUDEMODE}
-
-{$IFNDEF JWA_INTERFACESECTION}
-
-
-{$IFNDEF DYNAMIC_LINK}
-procedure CachedGetUserFromSid; external utildll name 'CachedGetUserFromSid';
-function CalculateDiffTime; external utildll name 'CalculateDiffTime';
-function CalculateElapsedTime; external utildll name 'CalculateElapsedTime';
-function CurrentDateTimeString; external utildll name 'CurrentDateTimeString';
-function DateTimeString; external utildll name 'DateTimeString';
-function DateTimeStringVista; external utildll name 'DateTimeString';
-function ElapsedTimeString; external utildll name 'ElapsedTimeString';
-// Vista version of ElapsedTimeString, exported name is ElapsedTimeString
-function ElapsedTimeStringEx; external utildll name 'ElapsedTimeString';
-function GetUnknownString; external utildll name 'GetUnknownString';
-function LogonIdFromWinStationNameA; external winstadll name 'LogonIdFromWinStationNameA';
-function LogonIdFromWinStationNameW; external winstadll name 'LogonIdFromWinStationNameW';
-function QueryCurrentWinStation; external utildll name 'QueryCurrentWinStation';
-function QueryCurrentWinStationEx; external utildll name 'QueryCurrentWinStation';
-function StrConnectState; external utildll name 'StrConnectState';
-function WinStationBroadcastSystemMessage; external winstadll name 'WinStationBroadcastSystemMessage';
-function WinStationCallBack; external winstadll name 'WinStationCallBack';
-function WinStationConnectW; external winstadll name 'WinStationConnectW';
-function WinStationDisconnect; external winstadll name 'WinStationDisconnect';
-function WinStationEnumerateA; external winstadll name 'WinStationEnumerateA';
-function WinStationEnumerateW; external winstadll name 'WinStationEnumerateW';
-function WinStationFreeGAPMemory; external winstadll name 'WinStationFreeGAPMemory';
-function WinStationGetAllProcesses; external winstadll name 'WinStationGetAllProcesses';
-function WinStationGetLanAdapterNameW; external winstadll name 'WinStationGetLanAdapterNameW';
-function WinStationGetProcessSid; external winstadll name 'WinStationGetProcessSid';
-function WinStationGetTermSrvCountersValue; external winstadll name 'WinStationGetTermSrvCountersValue';
-function WinStationNameFromLogonIdA; external winstadll name 'WinStationNameFromLogonIdA';
-function WinStationNameFromLogonIdW; external winstadll name 'WinStationNameFromLogonIdW';
-function WinStationQueryLogonCredentialsW; external winstadll name 'WinStationQueryLogonCredentialsW';
-function WinStationRenameA; external winstadll name 'WinStationRenameA';
-function WinStationRenameW; external winstadll name 'WinStationRenameW';
-function WinStationSendMessageA; external winstadll name 'WinStationSendMessageA';
-function WinStationSendMessageW; external winstadll name 'WinStationSendMessageW';
-function WinStationSetInformationA; external winstadll name 'WinStationSetInformationA';
-function WinStationSetInformationW; external winstadll name 'WinStationSetInformationW';
-function WinStationShadow; external winstadll name 'WinStationShadow';
-function WinStationShadowStop; external winstadll name 'WinStationShadowStop';
-function WinStationShutDownSystem; external winstadll name 'WinStationShutDownSystem';
-function WinStationQueryInformationW; external winstadll name 'WinStationQueryInformationW';
-function WinStationTerminateProcess; external winstadll name 'WinStationTerminateProcess';
-{$ELSE}
-
-var
-  __CachedGetUserFromSid: Pointer;
-
-procedure CachedGetUserFromSid;
-begin
-  GetProcedureAddress(__CachedGetUserFromSid, utildll, 'CachedGetUserFromSid');
-  asm
-        MOV     ESP, EBP
-        POP     EBP
-        JMP     [__CachedGetUserFromSid]
-  end;
-end;
-
-var
-  __CalculateDiffTime: Pointer;
-
-function CalculateDiffTime;
-begin
-  GetProcedureAddress(__CalculateDiffTime, utildll, 'CalculateDiffTime');
-  asm
-        MOV     ESP, EBP
-        POP     EBP
-        JMP     [__CalculateDiffTime]
-  end;
-end;
-
-var
-  __CalculateElapsedTime: Pointer;
-
-function CalculateElapsedTime;
-begin
-  GetProcedureAddress(__CalculateElapsedTime, utildll, 'CalculateElapsedTime');
-  asm
-        MOV     ESP, EBP
-        POP     EBP
-        JMP     [__CalculateElapsedTime]
-  end;
-end;
-
-var
-  __CurrentDateTimeString: Pointer;
-
-function CurrentDateTimeString;
-begin
-  GetProcedureAddress(__CurrentDateTimeString, utildll, 'CurrentDateTimeString');
-  asm
-        MOV     ESP, EBP
-        POP     EBP
-        JMP     [__CurrentDateTimeString]
-  end;
-end;
-
-var
-  __DateTimeString: Pointer;
-
-function DateTimeString;
-begin
-  GetProcedureAddress(__DateTimeString, utildll, 'DateTimeString');
-  asm
-        MOV     ESP, EBP
-        POP     EBP
-        JMP     [__DateTimeString]
-  end;
-end;
-
-var
-  __DateTimeStringVista: Pointer;
-
-function DateTimeStringVista;
-begin
-  GetProcedureAddress(__DateTimeStringVista, utildll, 'DateTimeString');
-  asm
-        MOV     ESP, EBP
-        POP     EBP
-        JMP     [__DateTimeStringVista]
-  end;
-end;
-
-var
-  __ElapsedTimeString: Pointer;
-
-function ElapsedTimeString;
-begin
-  GetProcedureAddress(__ElapsedTimeString, utildll, 'ElapsedTimeString');
-  asm
-        MOV     ESP, EBP
-        POP     EBP
-        JMP     [__ElapsedTimeString]
-  end;
-end;
-
-var
-  __ElapsedTimeStringEx: Pointer;
-
-function ElapsedTimeStringEx;
-begin
-  GetProcedureAddress(__ElapsedTimeStringEx, utildll, 'ElapsedTimeString');
-  asm
-        MOV     ESP, EBP
-        POP     EBP
-        JMP     [__ElapsedTimeStringEx]
-  end;
-end;
-
-
-var
-  __GetUnknownString: Pointer;
-
-function GetUnknownString;
-begin
-  GetProcedureAddress(__GetUnknownString, utildll, 'GetUnknownString');
-  asm
-        MOV     ESP, EBP
-        POP     EBP
-        JMP     [__GetUnknownString]
-  end;
-end;
-
-var
-  __LogonIdFromWinStationNameA: Pointer;
-
-function LogonIdFromWinStationNameA;
-begin
-  GetProcedureAddress(__LogonIdFromWinStationNameA, winstadll, 'LogonIdFromWinStationNameA');
-  asm
-        MOV     ESP, EBP
-        POP     EBP
-        JMP     [__LogonIdFromWinStationNameA]
-  end;
-end;
-
-var
-  __LogonIdFromWinStationNameW: Pointer;
-
-function LogonIdFromWinStationNameW;
-begin
-  GetProcedureAddress(__LogonIdFromWinStationNameW, winstadll, 'LogonIdFromWinStationNameW');
-  asm
-        MOV     ESP, EBP
-        POP     EBP
-        JMP     [__LogonIdFromWinStationNameW]
-  end;
-end;
-
-var
-  __QueryCurrentWinStation: Pointer;
-
-function QueryCurrentWinStation;
-begin
-  GetProcedureAddress(__QueryCurrentWinStation, utildll, 'QueryCurrentWinStation');
-  asm
-        MOV     ESP, EBP
-        POP     EBP
-        JMP     [__QueryCurrentWinStation]
-  end;
-end;
-
-var
-  __QueryCurrentWinStationEx: Pointer;
-
-function QueryCurrentWinStationEx;
-begin
-  GetProcedureAddress(__QueryCurrentWinStationEx, utildll, 'QueryCurrentWinStation');
-  asm
-        MOV     ESP, EBP
-        POP     EBP
-        JMP     [__QueryCurrentWinStationEx]
-  end;
-end;
-
-var
-  __StrConnectState: Pointer;
-
-function StrConnectState;
-begin
-  GetProcedureAddress(__StrConnectState, utildll, 'StrConnectState');
-  asm
-        MOV     ESP, EBP
-        POP     EBP
-        JMP     [__StrConnectState]
-  end;
-end;
-
-var
-  __WinStationBroadcastSystemMessage: Pointer;
-
-function WinStationBroadcastSystemMessage;
-begin
-  GetProcedureAddress(__WinStationBroadcastSystemMessage, winstadll, 'WinStationBroadcastSystemMessage');
-  asm
-        MOV     ESP, EBP
-        POP     EBP
-        JMP     [__WinStationBroadcastSystemMessage]
-  end;
-end;
-
-var
-  __WinStationCallBack: Pointer;
-
-function WinStationCallBack;
-begin
-  GetProcedureAddress(__WinStationCallBack, winstadll, 'WinStationCallBack');
-  asm
-        MOV     ESP, EBP
-        POP     EBP
-        JMP     [__WinStationCallBack]
-  end;
-end;
-
-
-var
-  __WinStationConnectW: Pointer;
-
-function WinStationConnectW;
-begin
-  GetProcedureAddress(__WinStationConnectW, winstadll, 'WinStationConnectW');
-  asm
-        MOV     ESP, EBP
-        POP     EBP
-        JMP     [__WinStationConnectW]
-  end;
-end;
-
-
-var
-  __WinStationDisconnect: Pointer;
-
-function WinStationDisconnect;
-begin
-  GetProcedureAddress(__WinStationDisconnect, winstadll, 'WinStationDisconnect');
-  asm
-        MOV     ESP, EBP
-        POP     EBP
-        JMP     [__WinStationDisconnect]
-  end;
-end;
-
-var
-  __WinStationEnumerateA: Pointer;
-
-function WinStationEnumerateA;
-begin
-  GetProcedureAddress(__WinStationEnumerateA, winstadll, 'WinStationEnumerateA');
-  asm
-        MOV     ESP, EBP
-        POP     EBP
-        JMP     [__WinStationEnumerateA]
-  end;
-end;
-
-var
-  __WinStationEnumerateW: Pointer;
-
-function WinStationEnumerateW;
-begin
-  GetProcedureAddress(__WinStationEnumerateW, winstadll, 'WinStationEnumerateW');
-  asm
-        MOV     ESP, EBP
-        POP     EBP
-        JMP     [__WinStationEnumerateW]
-  end;
-end;
-
-var
-  __WinStationFreeGAPMemory: Pointer;
-
-function WinStationFreeGAPMemory;
-begin
-  GetProcedureAddress(__WinStationFreeGAPMemory, winstadll, 'WinStationFreeGAPMemory');
-  asm
-        MOV     ESP, EBP
-        POP     EBP
-        JMP     [__WinStationFreeGAPMemory]
-  end;
-end;
-
-var
-  __WinStationGetAllProcesses: Pointer;
-
-function WinStationGetAllProcesses;
-begin
-  GetProcedureAddress(__WinStationGetAllProcesses, winstadll, 'WinStationGetAllProcesses');
-  asm
-        MOV     ESP, EBP
-        POP     EBP
-        JMP     [__WinStationGetAllProcesses]
-  end;
-end;
-
-var
-  __WinStationGetLanAdapterNameW: Pointer;
-
-function WinStationGetLanAdapterNameW;
-begin
-  GetProcedureAddress(__WinStationGetLanAdapterNameW, winstadll, 'WinStationGetLanAdapterNameW');
-  asm
-        MOV     ESP, EBP
-        POP     EBP
-        JMP     [__WinStationGetLanAdapterNameW]
-  end;
-end;
-
-var
-  __WinStationGetProcessSid: Pointer;
-
-function WinStationGetProcessSid;
-begin
-  GetProcedureAddress(__WinStationGetProcessSid, winstadll, 'WinStationGetProcessSid');
-  asm
-        MOV     ESP, EBP
-        POP     EBP
-        JMP     [__WinStationGetProcessSid]
-  end;
-end;
-
-var
-  __WinStationGetTermSrvCountersValue: Pointer;
-
-function WinStationGetTermSrvCountersValue;
-begin
-  GetProcedureAddress(__WinStationGetTermSrvCountersValue, winstadll, 'WinStationGetTermSrvCountersValue');
-  asm
-        MOV     ESP, EBP
-        POP     EBP
-        JMP     [__WinStationGetTermSrvCountersValue]
-  end;
-end;
-
-var
-  __WinStationNameFromLogonIdA: Pointer;
-
-function WinStationNameFromLogonIdA;
-begin
-  GetProcedureAddress(__WinStationNameFromLogonIdA, winstadll, 'WinStationNameFromLogonIdA');
-  asm
-        MOV     ESP, EBP
-        POP     EBP
-        JMP     [__WinStationNameFromLogonIdA]
-  end;
-end;
-
-
-var
-  __WinStationNameFromLogonIdW: Pointer;
-
-function WinStationNameFromLogonIdW;
-begin
-  GetProcedureAddress(__WinStationNameFromLogonIdW, winstadll, 'WinStationNameFromLogonIdW');
-  asm
-        MOV     ESP, EBP
-        POP     EBP
-        JMP     [__WinStationNameFromLogonIdW]
-  end;
-end;
-
-var
-  __WinStationQueryLogonCredentialsW: Pointer;
-
-function WinStationQueryLogonCredentialsW;
-begin
-  GetProcedureAddress(__WinStationQueryLogonCredentialsW, winstadll, 'WinStationQueryLogonCredentialsW');
-  asm
-        MOV     ESP, EBP
-        POP     EBP
-        JMP     [__WinStationQueryLogonCredentialsW]
-  end;
-end;
-
-var
-  __WinStationRenameA: Pointer;
-
-function WinStationRenameA;
-begin
-  GetProcedureAddress(__WinStationRenameA, winstadll, 'WinStationRenameA');
-  asm
-        MOV     ESP, EBP
-        POP     EBP
-        JMP     [__WinStationRenameA]
-  end;
-end;
-
-var
-  __WinStationRenameW: Pointer;
-
-function WinStationRenameW;
-begin
-  GetProcedureAddress(__WinStationRenameW, winstadll, 'WinStationRenameW');
-  asm
-        MOV     ESP, EBP
-        POP     EBP
-        JMP     [__WinStationRenameW]
-  end;
-end;
-
-var
-  __WinStationQueryInformationW: Pointer;
-
-function WinStationQueryInformationW;
-begin
-  GetProcedureAddress(__WinStationQueryInformationW, winstadll, 'WinStationQueryInformationW');
-  asm
-        MOV     ESP, EBP
-        POP     EBP
-        JMP     [__WinStationQueryInformationW]
-  end;
-end;
-
-var
-  __WinStationSendMessageA: Pointer;
-
-function WinStationSendMessageA;
-begin
-  GetProcedureAddress(__WinStationSendMessageA, winstadll, 'WinStationSendMessageA');
-  asm
-        MOV     ESP, EBP
-        POP     EBP
-        JMP     [__WinStationSendMessageA]
-  end;
-end;
-
-var
-  __WinStationSendMessageW: Pointer;
-
-function WinStationSendMessageW;
-begin
-  GetProcedureAddress(__WinStationSendMessageW, winstadll, 'WinStationSendMessageW');
-  asm
-        MOV     ESP, EBP
-        POP     EBP
-        JMP     [__WinStationSendMessageW]
-  end;
-end;
-
-var
-  __WinStationSetInformationA: Pointer;
-
-function WinStationSetInformationA;
-begin
-  GetProcedureAddress(__WinStationSetInformationA, winstadll, 'WinStationSetInformationA');
-  asm
-        MOV     ESP, EBP
-        POP     EBP
-        JMP     [__WinStationSetInformationA]
-  end;
-end;
-
-var
-  __WinStationSetInformationW: Pointer;
-
-function WinStationSetInformationW;
-begin
-  GetProcedureAddress(__WinStationSetInformationW, winstadll, 'WinStationSetInformationW');
-  asm
-        MOV     ESP, EBP
-        POP     EBP
-        JMP     [__WinStationSetInformationW]
-  end;
-end;
-
-var
-  __WinStationShadow: Pointer;
-
-function WinStationShadow;
-begin
-  GetProcedureAddress(__WinStationShadow, winstadll, 'WinStationShadow');
-  asm
-        MOV     ESP, EBP
-        POP     EBP
-        JMP     [__WinStationShadow]
-  end;
-end;
-
-
-var
-  __WinStationShadowStop : Pointer;
-
-function WinStationShadowStop;
-begin
-  GetProcedureAddress(__WinStationShadowStop, winstadll, 'WinStationShadowStop');
-  asm
-        MOV     ESP, EBP
-        POP     EBP
-        JMP     [__WinStationShadowStop]
-  end;
-end;
-
-
-var
-  __WinStationShutDownSystem : Pointer;
-
-function WinStationShutDownSystem;
-begin
-  GetProcedureAddress(__WinStationShutDownSystem, winstadll, 'WinStationShutDownSystem');
-  asm
-        MOV     ESP, EBP
-        POP     EBP
-        JMP     [__WinStationShutDownSystem]
-  end;
-end;
-
-var
-  __WinStationTerminateProcess: Pointer;
-
-function WinStationTerminateProcess;
-begin
-  GetProcedureAddress(__WinStationTerminateProcess, winstadll, 'WinStationTerminateProcess');
-  asm
-        MOV     ESP, EBP
-        POP     EBP
-        JMP     [__WinStationTerminateProcess]
-  end;
-end;
-{$ENDIF DYNAMIC_LINK}
-
-// This function is not exported
-function IsVista: boolean;
-var VersionInfo: TOSVersionInfoEx;
-begin
-  // Zero Memory and set structure size
-  ZeroMemory(@VersionInfo, SizeOf(VersionInfo));
-  VersionInfo.dwOSVersionInfoSize := SizeOf(VersionInfo);
-  GetVersionEx(@VersionInfo);
-
-  // Are we running Vista?
-  Result := (VersionInfo.dwMajorVersion = 6) and
-    (VersionInfo.dwMinorVersion = 0) and
-    (VersionInfo.wProductType = VER_NT_WORKSTATION);
-end;
-
-// This the way QWinsta checks if Terminal Services is active:
-function AreWeRunningTerminalServices: Boolean;
-var VersionInfo: TOSVersionInfoEx;
-  dwlConditionMask: Int64;
-begin
-  // Zero Memory and set structure size
-  ZeroMemory(@VersionInfo, SizeOf(VersionInfo));
-  VersionInfo.dwOSVersionInfoSize := SizeOf(VersionInfo);
-
-  // We are either Terminal Server or Personal Terminal Server
-  VersionInfo.wSuiteMask := VER_SUITE_TERMINAL or VER_SUITE_SINGLEUSERTS;
-  dwlConditionMask := VerSetConditionMask(0, VER_SUITENAME, VER_OR);
-
-  // Test it
-  Result := VerifyVersionInfo(VersionInfo, VER_SUITENAME, dwlConditionMask);
-end;
-
-// This functions converts CPU times as returned by
-// TSystemProcesses structure to a string
-function CpuTime2Str(ACPUTime: LARGE_INTEGER): String;
-var SystemTime: TSystemTime;
-{$IFDEF COMPILER7_UP}
-  FS: TFormatSettings;
-{$ENDIF COMPILER7_UP}
-begin
-  FileTimeToSystemTime(FILETIME(ACPUTime), SystemTime);
-{$IFDEF COMPILER7_UP}
-  GetLocaleFormatSettings(LOCALE_SYSTEM_DEFAULT, FS);
-  Result := TimeToStr(SystemTimeToDateTime(SystemTime), FS);
-{$ELSE}
-  Result := TimeToStr(SystemTimeToDateTime(SystemTime));
-{$ENDIF COMPILER7_UP}
-end;
-
-function DateTimeStringSafe(DateTime: PFILETIME; lpBuffer: PWideChar;
-  cchDest: SIZE_T): PWideChar; stdcall;
-begin
-  // Zero Memory
-  ZeroMemory(lpBuffer, cchDest * SizeOf(WCHAR));
-
- // Are we running Vista?
-  if IsVista then
-  begin
-    // Vista version
-    Result := DateTimeStringVista(DateTime, lpBuffer, cchDest);
-  end
-  else begin
-    // Other OS's (including server 2008!)
-    Result := DateTimeString(DateTime, lpBuffer);
-  end;
-end;
-
-// DiffTimeString is a helper function that returns a formatted
-// Elapsed time string (the way Idle Time is displayed in TSAdmin)
-// Return value is the string length
-function DiffTimeString(FTLow: FILETIME; FTHigh: FILETIME;
-  out pwElapsedTime: PWideChar): Integer;
-var
-  DiffSecs: INT64;
-  DiffTime: TDiffTime;
-  NumChars: DWORD;
-begin
-  // Get the Difftime where Time1 is the "oldest" time
-  // Return value is the difference in seconds
-  DiffSecs := CalculateDiffTime(Int64(FTLow), Int64(FTHigh));
-  // Recalc DiffTime to TDiffTime
-  ZeroMemory(@DiffTime, SizeOf(DiffTime));
-  // Calculate no of whole days
-  DiffTime.wDays := DiffSecs DIV SECONDS_PER_DAY;
-  // Calculate no of whole hours
-  DiffTime.wHours :=  DiffSecs MOD SECONDS_PER_DAY DIV SECONDS_PER_HOUR;
-  // Calculate no of whole minutes
-  DiffTime.wMinutes := DiffSecs MOD SECONDS_PER_DAY MOD SECONDS_PER_HOUR
-    DIV SECONDS_PER_MINUTE; // Result = No of whole minutes
-  // Calculate no of whole seconds
-  DiffTime.wSeconds := DiffSecs MOD SECONDS_PER_DAY MOD SECONDS_PER_HOUR
-    MOD SECONDS_PER_MINUTE; // Result = No of seconds
-  // Note that Milliseconds are not used and therefore not calculated
-
-  // Reserve Memory
-  GetMem(pwElapsedTime, ELAPSED_TIME_STRING_LENGTH * SizeOf(WCHAR));
-  // Format Elapsed TimeString in minutes (bShowSeconds = False)
-  NumChars := ElapsedTimeStringSafe(@DiffTime, False, pwElapsedTime,
-    ELAPSED_TIME_STRING_LENGTH);
-  Result := NumChars;
-  // Caller has to free memory when done
-end;
-
-function ElapsedTimeStringSafe(DiffTime: PDiffTime; bShowSeconds: Boolean;
-  lpElapsedTime: PWideChar; cchDest: SIZE_T): Integer;
-var
-  hr: HRESULT;
-begin
-  // Zero Memory
-  ZeroMemory(lpElapsedTime, cchDest * SizeOf(WCHAR));
-
- // Are we running Vista?
-  if IsVista then
-  begin
-    hr := ElapsedTimeStringEx(DiffTime, bShowSeconds, lpElapsedTime,
-      cchDest);
-    if Succeeded(hr) then
-    begin
-      Result := cchDest;
-    end
-    else begin
-      Result := 0;
-    end;
-   
-  end
-  else begin
-    Result := ElapsedTimeString(DiffTime, bShowSeconds, lpElapsedTime);
-  end;
-  // Caller has to free memory when done
-end;
-
-function FileTime2DateTime(FileTime: TFileTime): TDateTime;
-var LocalFileTime: TFileTime;
-  SystemTime: TSystemTime;
-begin
-  FileTimeToLocalFileTime(FileTime, LocalFileTime);
-  FileTimeToSystemTime(LocalFileTime, SystemTime);
-  Result := SystemTimeToDateTime(SystemTime);
-end;
-
-function GetWTSLogonIdleTime(hServer: HANDLE; SessionId: DWORD;
-  var sLogonTime: string; var sIdleTime: string): Boolean;
-var
-  uReturnLength: DWORD;
-  Info: _WINSTATION_INFORMATIONW;
-  CurrentTime: TDateTime;
-  LastInputTime: TDateTime;
-  IdleTime: TDateTime;
-  LogonTime: TDateTime;
-  Days, Hours, Minutes: Word;
-  {$IFDEF COMPILER7_UP}
-  FS: TFormatSettings;
-  {$ENDIF COMPILER7_UP}
-begin
-  {$IFDEF COMPILER7_UP}
-  GetLocaleFormatSettings(LOCALE_SYSTEM_DEFAULT, FS);
-  {$ENDIF COMPILER7_UP}
-  uReturnLength := 0;
-  try
-    Result := WinStationQueryInformationW(hServer, SessionId, 8, @Info, SizeOf(Info), uReturnLength);
-    if Result then
-    begin
-      LogonTime := FileTime2DateTime(Info.LogonTime);
-      if YearOf(LogonTime) = 1601 then
-        sLogonTime := ''
-      else
-        {$IFDEF COMPILER7_UP}
-        sLogonTime := DateTimeToStr(LogonTime, FS);
-        {$ELSE}
-        sLogonTime := DateTimeToStr(LogonTime);
-        {$ENDIF COMPILER7_UP}
-      { from Usenet post by Chuck Chopp
-        http://groups.google.com/group/microsoft.public.win32.programmer.kernel/browse_thread/thread/c6dd86e7df6d26e4/3cf53e12a3246e25?lnk=st&q=WinStationQueryInformationa+group:microsoft.public.*&rnum=1&hl=en#3cf53e12a3246e25
-        2)  The system console session cannot go into an idle/disconnected state.
-            As such, the LastInputTime value will always math CurrentTime for the
-            console session.
-        3)  The LastInputTime value will be zero if the session has gone
-            disconnected.  In that case, use the DisconnectTime value in place of
-            LastInputTime when calculating the current idle time for a disconnected session.
-        4)  All of these time values are GMT time values.
-        5)  The disconnect time value will be zero if the sesson has never been
-            disconnected.}
-      CurrentTime := FileTime2DateTime(Info.CurrentTime);
-      LastInputTime := FileTime2DateTime(Info.LastInputTime);
-
-      // Disconnected session = idle since DisconnectTime
-      if YearOf(LastInputTime) = 1601 then
-        LastInputTime := FileTime2DateTime(Info.DisconnectTime);
-
-      IdleTime := LastInputTime - CurrentTime;
-      Days := Trunc(IdleTime);
-      Hours := HourOf(IdleTime);
-      Minutes := MinuteOf(IdleTime);
-      if Days > 0 then
-        sIdleTime := Format('%dd %d:%1.2d', [Days, Hours, Minutes])
-      else
-      if Hours > 0 then
-        sIdleTime := Format('%d:%1.2d', [Hours, Minutes])
-      else
-      if Minutes > 0 then
-        sIdleTime := IntToStr(Minutes)
-      else
-        sIdleTime := '-';
-    end;
-  except
-    Result := False;
-  end;
-end;
-
-procedure InitTermSrvCounterArray(var ATermSrvCounterArray: TTermSrvCounterArray);
-begin
-  ATermSrvCounterArray[1].dwIndex := TOTAL_SESSIONS_CREATED_COUNTER;
-  ATermSrvCounterArray[2].dwIndex := TOTAL_SESSIONS_DISCONNECTED_COUNTER;
-  ATermSrvCounterArray[3].dwIndex := TOTAL_SESSIONS_RECONNECTED_COUNTER;
-  ATermSrvCounterArray[4].dwIndex := TOTAL_SESSIONS_TOTAL_CONNECTED_NOW_COUNTER;
-  ATermSrvCounterArray[5].dwIndex := TOTAL_SESSIONS_TOTAL_DISCONNECTED_NOW_COUNTER;
-  ATermSrvCounterArray[6].dwIndex := TOTAL_SESSIONS_TOTAL_CONNECTED_NOW_COUNTER_2;
-  ATermSrvCounterArray[7].dwIndex := TOTAL_SESSIONS_TOTAL_DISCONNECTED_NOW_COUNTER_2;
-end;
-
-// This is the way WTSApi32.dll checks if Terminal Service is running
-function IsTerminalServiceRunning: boolean;
-var hSCM: HANDLE;
-  hService: HANDLE;
-  ServiceStatus: SERVICE_STATUS;
-begin
-  Result := False;
-  // Open handle to Service Control Manager
-  hSCM := OpenSCManager(nil, SERVICES_ACTIVE_DATABASE, GENERIC_READ);
-  if hSCM > 0 then
-  begin
-    // Open handle to Terminal Server Service
-    hService := OpenService(hSCM, 'TermService', GENERIC_READ);
-    if hService > 0 then
-    begin
-      // Check if the service is running
-      QueryServiceStatus(hService, ServiceStatus);
-      Result := ServiceStatus.dwCurrentState = SERVICE_RUNNING;
-      // Close the handle
-      CloseServiceHandle(hService);
-    end;
-    // Close the handle
-    CloseServiceHandle(hSCM);
-  end;
-end;
-
-function QueryCurrentWinStationSafe(pWinStationName: LPWSTR;
-  pUserName: PWideChar; cchDest: DWORD; var SessionId: DWORD;
-  var WdFlag: DWORD): Boolean;
-begin
-  // Zero Memory
-  ZeroMemory(pWinStationName, 66);
-  ZeroMemory(pUserName, cchDest * SizeOf(WCHAR));
-
-  // Are we running Vista?
-  if IsVista then
-  begin
-    Result := QueryCurrentWinStationEx(pWinStationName, pUserName, cchDest,
-      SessionId, WdFlag);
-  end
-  else begin
-    Result := QueryCurrentWinStation(pWinStationName, pUserName, SessionId,
-      WdFlag);
-  end;
-
-end;
-
-function WinStationGetRemoteIPAddress(hServer: HANDLE; SessionId: DWORD;
-  var RemoteIPAddress: string; var Port: WORD): Boolean;
-var WinStationRemoteIPAddress: TWinStationRemoteAddress;
-  pReturnLength: DWORD;
-begin
-  // Zero Memory
-  ZeroMemory(@WinStationRemoteIPAddress, SizeOf(WinStationRemoteIPAddress));
-  // Query Remote Address
-  Result := WinStationQueryInformationW(hServer, SessionId,
-    WinStationRemoteAddress, @WinStationRemoteIPAddress,
-    SizeOf(WinStationRemoteIPAddress), pReturnLength);
-  if Result then
-  begin
-    // If the AddressFamily is IPv4
-    if WinStationRemoteIPAddress.AddressFamily = AF_INET then
-    begin
-      // The ntohs function converts a u_short from TCP/IP network byte order
-      // to host byte order (which is little-endian on Intel processors).
-      Port := ntohs(WinStationRemoteIPAddress.Port);
-      with WinStationRemoteIPAddress do
-      begin
-        // format the IP Address as string
-        RemoteIPAddress := Format('%d.%d.%d.%d', [Address[2], Address[3],
-          Address[4], Address[5]]);
-        // If you want to convert the to a sockaddr structure you could
-        // user WSAStringToAddress
-      end;
-    end
-    else begin
-      Result := False;
-      Port := 0;
-      RemoteIPAddress := '';
-      // SetLastError to give the user a clue as to why we failed..
-      //  An address incompatible with the requested protocol was used.
-      // (An address incompatible with the requested protocol was used.)
-      SetLastError(WSAEAFNOSUPPORT);
-    end;
-  end;
-end;
-
-function WinStationQueryUserToken(hServer: HANDLE; SessionId: DWORD;
-  var hToken: HANDLE): BOOL;
-var WinstaUserToken: _WINSTA_USER_TOKEN;
-  dwReturnLength: DWORD;
-  LUID: _LUID;
-  bWasPrivEnabled: Boolean;
-  Res: NTSTATUS;
-begin
-  // Enable SeTcbPrivilege (system account has this enabled by default)
-  LookupPrivilegeValue(nil, SE_TCB_NAME, LUID);
-  Res := RtlAdjustPrivilege(LUID.LowPart, True, False, @bWasPrivEnabled);
-
-  // Initialize structure
-  WinstaUserToken.ProcessId :=  GetCurrentProcessId;  // Current Process Id
-  WinstaUserToken.ThreadId := GetCurrentThreadId; // Current Thread Id
-  WinstaUserToken.TokenHandle := 0;
-
-  if Res = STATUS_SUCCESS then
-  begin
-    // Query for the token, we are only allowed to do this if we are the
-    // System account (else ACCESS_DENIED is returned)
-    Result := WinStationQueryInformationW(hServer, SessionId, WinStationToken,
-      @WinstaUserToken, SizeOf(WinstaUserToken), dwReturnLength);
-    hToken := WinStaUserToken.TokenHandle;
-
-    // Restore state of SeTcbPrivilege
-    RtlAdjustPrivilege(LUID.LowPart, bWasPrivEnabled, False, @bWasPrivEnabled);
-  end
-  else begin
-    Result := False;
-    // Convert NTStatus to WinError and SetLastError
-    SetLastError(RtlNtStatusToDosError(Res));
-  end;
-
-end;
-
-{$ENDIF JWA_INTERFACESECTION}
-
-{$IFNDEF JWA_OMIT_SECTIONS}
-end.
-{$ENDIF JWA_OMIT_SECTIONS}
-

+ 0 - 698
packages/winunits-jedi/src/jwaObjsel.pas

@@ -1,698 +0,0 @@
-{******************************************************************************}
-{                                                                              }
-{ Object Picker API interface Unit for Object Pascal                           }
-{                                                                              }
-{ Portions created by Microsoft are Copyright (C) 1995-2001 Microsoft          }
-{ Corporation. All Rights Reserved.                                            }
-{                                                                              }
-{ The original file is: objsel.h, released June 2000. The original Pascal      }
-{ code is: ObjSel.pas, released December 2000. The initial developer of the    }
-{ Pascal code is Marcel van Brakel (brakelm att chello dott nl).               }
-{                                                                              }
-{ Portions created by Marcel van Brakel are Copyright (C) 1999-2001            }
-{ Marcel van Brakel. All Rights Reserved.                                      }
-{                                                                              }
-{ Obtained through: Joint Endeavour of Delphi Innovators (Project JEDI)        }
-{                                                                              }
-{ You may retrieve the latest version of this file at the Project JEDI         }
-{ APILIB home page, located at http://jedi-apilib.sourceforge.net              }
-{                                                                              }
-{ The contents of this file are used with permission, 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/MPL/MPL-1.1.html                                      }
-{                                                                              }
-{ 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 Lesser General Public License (the  "LGPL License"), in which case the   }
-{ provisions of the LGPL License are applicable instead of those above.        }
-{ If you wish to allow use of your version of this file only under the terms   }
-{ of the LGPL License and not to allow others to use your version of this file }
-{ under the MPL, indicate your decision by deleting  the provisions above and  }
-{ replace  them with the notice and other provisions required by the LGPL      }
-{ License.  If you do not delete the provisions above, a recipient may use     }
-{ your version of this file under either the MPL or the LGPL License.          }
-{                                                                              }
-{ For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html }
-{                                                                              }
-{******************************************************************************}
-
-// $Id: JwaObjSel.pas,v 1.8 2007/09/05 11:58:51 dezipaitor Exp $
-{$IFNDEF JWA_OMIT_SECTIONS}
-unit JwaObjSel;
-
-{$WEAKPACKAGEUNIT}
-{$ENDIF JWA_OMIT_SECTIONS}
-
-{$HPPEMIT ''}
-{$HPPEMIT '#include "ObjSel.h"'}
-{$HPPEMIT ''}
-
-{$IFNDEF JWA_OMIT_SECTIONS}
-{$I jediapilib.inc}
-
-interface
-
-uses
-  JwaActiveX, JwaWinType;
-{$ENDIF JWA_OMIT_SECTIONS}
-
-{$IFNDEF JWA_IMPLEMENTATIONSECTION}
-
-//  Contents:   Object Picker Dialog public header
-
-const
-  //'{17d6ccd8-3b7b-11d2-b9e0-00c04fd8dbf7}'
-  CLSID_DsObjectPicker: TGUID = (
-    D1:$17d6ccd8; D2:$3b7b; D3:$11d2; D4:($b9,$e0,$00,$c0,$4f,$d8,$db,$f7));
-  {$EXTERNALSYM CLSID_DsObjectPicker}
-
-  IID_IDsObjectPicker: TGUID = (
-    D1:$0c87e64e; D2:$3b7a; D3:$11d2; D4:($b9,$e0,$00,$c0,$4f,$d8,$db,$f7));
-  {$EXTERNALSYM IID_IDsObjectPicker}
-
-{
-CLIPBOARD FORMATS
-=================
-
-CFSTR_DSOP_DS_SELECTION_LIST
-    Returns an HGLOBAL for global memory containing a DS_SELECTION_LIST
-    variable length structure.
-}
-
-const
-  CFSTR_DSOP_DS_SELECTION_LIST = 'CFSTR_DSOP_DS_SELECTION_LIST';
-  {$EXTERNALSYM CFSTR_DSOP_DS_SELECTION_LIST}
-
-{
-SCOPE TYPES
-===========
-
-A scope is an entry in the "Look In" dropdown list of the Object Picker
-dialog.
-
-When initializing the DS Object Picker, DSOP_SCOPE_TYPEs are used with
-DSOP_SCOPE_INIT_INFO.flType member to specify which types of scopes the
-DS Object Picker should put in the "Look In" list.
-
-DSOP_SCOPE_TYPE_TARGET_COMPUTER
-    Computer specified by DSOP_INIT_INFO.pwzTargetComputer, NULL is
-    local computer.
-
-DSOP_SCOPE_TYPE_UPLEVEL_JOINED_DOMAIN
-    Uplevel domain to which target computer is joined.
-
-DSOP_SCOPE_TYPE_DOWNLEVEL_JOINED_DOMAIN
-    Downlevel domain to which target computer is joined.
-
-DSOP_SCOPE_TYPE_ENTERPRISE_DOMAIN
-    All domains in the enterprise to which the target computer belongs
-    other than the JOINED_DOMAIN or USER_SPECIFIED_*_SCOPEs.
-
-DSOP_SCOPE_TYPE_GLOBAL_CATALOG
-    The Entire Directory scope.
-
-DSOP_SCOPE_TYPE_EXTERNAL_UPLEVEL_DOMAIN
-    All uplevel domains external to the enterprise but trusted by the
-    domain to which the target computer is joined.
-
-DSOP_SCOPE_TYPE_EXTERNAL_DOWNLEVEL_DOMAIN
-    All downlevel domains external to the enterprise but trusted by the
-    domain to which the target computer is joined.
-
-DSOP_SCOPE_TYPE_WORKGROUP
-    The workgroup of which TARGET_COMPUTER is a member.  Applies only if the
-    TARGET_COMPUTER is not joined to a domain.
-
-DSOP_SCOPE_TYPE_USER_ENTERED_UPLEVEL_SCOPE
-DSOP_SCOPE_TYPE_USER_ENTERED_DOWNLEVEL_SCOPE
-    Any uplevel or downlevel scope generated by processing user input.  If
-    neither of these types is specified, user entries that do not refer to
-    one of the scopes in the "Look In" control will be rejected.
-
-}
-
-const
-  DSOP_SCOPE_TYPE_TARGET_COMPUTER              = $00000001;
-  {$EXTERNALSYM DSOP_SCOPE_TYPE_TARGET_COMPUTER}
-  DSOP_SCOPE_TYPE_UPLEVEL_JOINED_DOMAIN        = $00000002;
-  {$EXTERNALSYM DSOP_SCOPE_TYPE_UPLEVEL_JOINED_DOMAIN}
-  DSOP_SCOPE_TYPE_DOWNLEVEL_JOINED_DOMAIN      = $00000004;
-  {$EXTERNALSYM DSOP_SCOPE_TYPE_DOWNLEVEL_JOINED_DOMAIN}
-  DSOP_SCOPE_TYPE_ENTERPRISE_DOMAIN            = $00000008;
-  {$EXTERNALSYM DSOP_SCOPE_TYPE_ENTERPRISE_DOMAIN}
-  DSOP_SCOPE_TYPE_GLOBAL_CATALOG               = $00000010;
-  {$EXTERNALSYM DSOP_SCOPE_TYPE_GLOBAL_CATALOG}
-  DSOP_SCOPE_TYPE_EXTERNAL_UPLEVEL_DOMAIN      = $00000020;
-  {$EXTERNALSYM DSOP_SCOPE_TYPE_EXTERNAL_UPLEVEL_DOMAIN}
-  DSOP_SCOPE_TYPE_EXTERNAL_DOWNLEVEL_DOMAIN    = $00000040;
-  {$EXTERNALSYM DSOP_SCOPE_TYPE_EXTERNAL_DOWNLEVEL_DOMAIN}
-  DSOP_SCOPE_TYPE_WORKGROUP                    = $00000080;
-  {$EXTERNALSYM DSOP_SCOPE_TYPE_WORKGROUP}
-  DSOP_SCOPE_TYPE_USER_ENTERED_UPLEVEL_SCOPE   = $00000100;
-  {$EXTERNALSYM DSOP_SCOPE_TYPE_USER_ENTERED_UPLEVEL_SCOPE}
-  DSOP_SCOPE_TYPE_USER_ENTERED_DOWNLEVEL_SCOPE = $00000200;
-  {$EXTERNALSYM DSOP_SCOPE_TYPE_USER_ENTERED_DOWNLEVEL_SCOPE}
-
-{
-DSOP_SCOPE_INIT_INFO flags
-==========================
-
-The flScope member can contain zero or more of the following flags:
-
-DSOP_SCOPE_FLAG_STARTING_SCOPE
-    The scope should be the first one selected in the Look In control after
-    dialog initialization.  If more than one scope specifies this flag,
-    the one which is chosen to be the starting scope is implementation
-    dependant.
-
-DSOP_SCOPE_FLAG_WANT_PROVIDER_WINNT
-    ADs paths for objects selected from this scope should be converted to use
-    the WinNT provider.
-
-DSOP_SCOPE_FLAG_WANT_PROVIDER_LDAP
-    ADs paths for objects selected from this scope should be converted to use
-    the LDAP provider.
-
-DSOP_SCOPE_FLAG_WANT_PROVIDER_GC
-    ADs paths for objects selected from this scope should be converted to use
-    the GC provider.
-
-DSOP_SCOPE_FLAG_WANT_SID_PATH
-    ADs paths for objects selected from this scope having an objectSid
-    attribute should be converted to the form LDAP://<SID=x>, where x
-    represents the hexidecimal digits of the objectSid attribute value.
-
-DSOP_SCOPE_FLAG_WANT_DOWNLEVEL_BUILTIN_PATH
-    ADs paths for downlevel well-known SID objects (for example,
-    DSOP_DOWNLEVEL_FILTER_INTERACTIVE) are an empty string unless this flag is
-    specified.  If it is, the paths will be of the form
-    WinNT://NT AUTHORITY/Interactive or WinNT://Creator owner.
-
-DSOP_SCOPE_FLAG_DEFAULT_FILTER_USERS
-    If the scope filter contains the DSOP_FILTER_USERS or
-    DSOP_DOWNLEVEL_FILTER_USERS flag, then check the Users checkbox by
-    default in the Look For dialog.
-
-DSOP_SCOPE_FLAG_DEFAULT_FILTER_GROUPS
-
-DSOP_SCOPE_FLAG_DEFAULT_FILTER_COMPUTERS
-
-DSOP_SCOPE_FLAG_DEFAULT_FILTER_CONTACTS
-}
-
-const
-  DSOP_SCOPE_FLAG_STARTING_SCOPE              = $00000001;
-  {$EXTERNALSYM DSOP_SCOPE_FLAG_STARTING_SCOPE}
-  DSOP_SCOPE_FLAG_WANT_PROVIDER_WINNT         = $00000002;
-  {$EXTERNALSYM DSOP_SCOPE_FLAG_WANT_PROVIDER_WINNT}
-  DSOP_SCOPE_FLAG_WANT_PROVIDER_LDAP          = $00000004;
-  {$EXTERNALSYM DSOP_SCOPE_FLAG_WANT_PROVIDER_LDAP}
-  DSOP_SCOPE_FLAG_WANT_PROVIDER_GC            = $00000008;
-  {$EXTERNALSYM DSOP_SCOPE_FLAG_WANT_PROVIDER_GC}
-  DSOP_SCOPE_FLAG_WANT_SID_PATH               = $00000010;
-  {$EXTERNALSYM DSOP_SCOPE_FLAG_WANT_SID_PATH}
-  DSOP_SCOPE_FLAG_WANT_DOWNLEVEL_BUILTIN_PATH = $00000020;
-  {$EXTERNALSYM DSOP_SCOPE_FLAG_WANT_DOWNLEVEL_BUILTIN_PATH}
-  DSOP_SCOPE_FLAG_DEFAULT_FILTER_USERS        = $00000040;
-  {$EXTERNALSYM DSOP_SCOPE_FLAG_DEFAULT_FILTER_USERS}
-  DSOP_SCOPE_FLAG_DEFAULT_FILTER_GROUPS       = $00000080;
-  {$EXTERNALSYM DSOP_SCOPE_FLAG_DEFAULT_FILTER_GROUPS}
-  DSOP_SCOPE_FLAG_DEFAULT_FILTER_COMPUTERS    = $00000100;
-  {$EXTERNALSYM DSOP_SCOPE_FLAG_DEFAULT_FILTER_COMPUTERS}
-  DSOP_SCOPE_FLAG_DEFAULT_FILTER_CONTACTS     = $00000200;
-  {$EXTERNALSYM DSOP_SCOPE_FLAG_DEFAULT_FILTER_CONTACTS}
-
-{
-The flMixedModeOnly/flNativeModeOnly member of an uplevel scope can
-contain one or more of the following flags (at least one must be specified):
-
-DSOP_FILTER_INCLUDE_ADVANCED_VIEW
-    Include objects which have the attribute showInAdvancedViewOnly set to
-    true.
-
-DSOP_FILTER_USERS
-    Include user objects.
-
-DSOP_FILTER_BUILTIN_GROUPS
-    Include group objects with a groupType value having the flag
-    GROUP_TYPE_BUILTIN_LOCAL_GROUP.
-
-DSOP_FILTER_WELL_KNOWN_PRINCIPALS
-    Include the contents of the WellKnown Security Principals container.
-
-DSOP_FILTER_UNIVERSAL_GROUPS_DL
-    Include distribution list universal groups.
-
-DSOP_FILTER_UNIVERSAL_GROUPS_SE
-    Include security enabled universal groups.
-
-DSOP_FILTER_GLOBAL_GROUPS_DL
-    Include distribution list global groups.
-
-DSOP_FILTER_GLOBAL_GROUPS_SE
-    Include security enabled global groups.
-
-DSOP_FILTER_DOMAIN_LOCAL_GROUPS_DL
-    Include distribution list domain global groups.
-
-DSOP_FILTER_DOMAIN_LOCAL_GROUPS_SE
-    Include security enabled domain local groups.
-
-DSOP_FILTER_CONTACTS
-    Include contact objects.
-
-DSOP_FILTER_COMPUTERS
-    Include computer objects.
-}
-
-const
-  DSOP_FILTER_INCLUDE_ADVANCED_VIEW  = $00000001;
-  {$EXTERNALSYM DSOP_FILTER_INCLUDE_ADVANCED_VIEW}
-  DSOP_FILTER_USERS                  = $00000002;
-  {$EXTERNALSYM DSOP_FILTER_USERS}
-  DSOP_FILTER_BUILTIN_GROUPS         = $00000004;
-  {$EXTERNALSYM DSOP_FILTER_BUILTIN_GROUPS}
-  DSOP_FILTER_WELL_KNOWN_PRINCIPALS  = $00000008;
-  {$EXTERNALSYM DSOP_FILTER_WELL_KNOWN_PRINCIPALS}
-  DSOP_FILTER_UNIVERSAL_GROUPS_DL    = $00000010;
-  {$EXTERNALSYM DSOP_FILTER_UNIVERSAL_GROUPS_DL}
-  DSOP_FILTER_UNIVERSAL_GROUPS_SE    = $00000020;
-  {$EXTERNALSYM DSOP_FILTER_UNIVERSAL_GROUPS_SE}
-  DSOP_FILTER_GLOBAL_GROUPS_DL       = $00000040;
-  {$EXTERNALSYM DSOP_FILTER_GLOBAL_GROUPS_DL}
-  DSOP_FILTER_GLOBAL_GROUPS_SE       = $00000080;
-  {$EXTERNALSYM DSOP_FILTER_GLOBAL_GROUPS_SE}
-  DSOP_FILTER_DOMAIN_LOCAL_GROUPS_DL = $00000100;
-  {$EXTERNALSYM DSOP_FILTER_DOMAIN_LOCAL_GROUPS_DL}
-  DSOP_FILTER_DOMAIN_LOCAL_GROUPS_SE = $00000200;
-  {$EXTERNALSYM DSOP_FILTER_DOMAIN_LOCAL_GROUPS_SE}
-  DSOP_FILTER_CONTACTS               = $00000400;
-  {$EXTERNALSYM DSOP_FILTER_CONTACTS}
-  DSOP_FILTER_COMPUTERS              = $00000800;
-  {$EXTERNALSYM DSOP_FILTER_COMPUTERS}
-
-{
-The flFilter member of a downlevel scope can contain one or more of the
-following flags:
-
-DSOP_DOWNLEVEL_FILTER_USERS
-    Include user objects.
-
-DSOP_DOWNLEVEL_FILTER_LOCAL_GROUPS
-    Include all local groups.
-
-DSOP_DOWNLEVEL_FILTER_GLOBAL_GROUPS
-    Include all global groups.
-
-DSOP_DOWNLEVEL_FILTER_COMPUTERS
-    Include computer objects
-
-DSOP_DOWNLEVEL_FILTER_WORLD
-    Include builtin security principal World (Everyone).
-
-DSOP_DOWNLEVEL_FILTER_AUTHENTICATED_USER
-    Include builtin security principal Authenticated User.
-
-DSOP_DOWNLEVEL_FILTER_ANONYMOUS
-    Include builtin security principal Anonymous.
-
-DSOP_DOWNLEVEL_FILTER_BATCH
-    Include builtin security principal Batch.
-
-DSOP_DOWNLEVEL_FILTER_CREATOR_OWNER
-    Include builtin security principal Creator Owner.
-
-DSOP_DOWNLEVEL_FILTER_CREATOR_GROUP
-    Include builtin security principal Creator Group.
-
-DSOP_DOWNLEVEL_FILTER_DIALUP
-    Include builtin security principal Dialup.
-
-DSOP_DOWNLEVEL_FILTER_INTERACTIVE
-    Include builtin security principal Interactive.
-
-DSOP_DOWNLEVEL_FILTER_NETWORK
-    Include builtin security principal Network.
-
-DSOP_DOWNLEVEL_FILTER_SERVICE
-    Include builtin security principal Service.
-
-DSOP_DOWNLEVEL_FILTER_SYSTEM
-    Include builtin security principal System.
-
-DSOP_DOWNLEVEL_FILTER_EXCLUDE_BUILTIN_GROUPS
-    Exclude local builtin groups returned by groups enumeration.
-
-DSOP_DOWNLEVEL_FILTER_TERMINAL_SERVER
-    Include builtin security principal Terminal Server.
-
-DSOP_DOWNLEVEL_FILTER_LOCAL_SERVICE
-    Include builtin security principal Local Service
-
-DSOP_DOWNLEVEL_FILTER_NETWORK_SERVICE
-    Include builtin security principal Network Service
-
-DSOP_DOWNLEVEL_FILTER_ALL_WELLKNOWN_SIDS
-    Include all builtin security principals.
-}
-
-const
-  DSOP_DOWNLEVEL_FILTER_USERS                  = DWORD($80000001);
-  {$EXTERNALSYM DSOP_DOWNLEVEL_FILTER_USERS}
-  DSOP_DOWNLEVEL_FILTER_LOCAL_GROUPS           = DWORD($80000002);
-  {$EXTERNALSYM DSOP_DOWNLEVEL_FILTER_LOCAL_GROUPS}
-  DSOP_DOWNLEVEL_FILTER_GLOBAL_GROUPS          = DWORD($80000004);
-  {$EXTERNALSYM DSOP_DOWNLEVEL_FILTER_GLOBAL_GROUPS}
-  DSOP_DOWNLEVEL_FILTER_COMPUTERS              = DWORD($80000008);
-  {$EXTERNALSYM DSOP_DOWNLEVEL_FILTER_COMPUTERS}
-  DSOP_DOWNLEVEL_FILTER_WORLD                  = DWORD($80000010);
-  {$EXTERNALSYM DSOP_DOWNLEVEL_FILTER_WORLD}
-  DSOP_DOWNLEVEL_FILTER_AUTHENTICATED_USER     = DWORD($80000020);
-  {$EXTERNALSYM DSOP_DOWNLEVEL_FILTER_AUTHENTICATED_USER}
-  DSOP_DOWNLEVEL_FILTER_ANONYMOUS              = DWORD($80000040);
-  {$EXTERNALSYM DSOP_DOWNLEVEL_FILTER_ANONYMOUS}
-  DSOP_DOWNLEVEL_FILTER_BATCH                  = DWORD($80000080);
-  {$EXTERNALSYM DSOP_DOWNLEVEL_FILTER_BATCH}
-  DSOP_DOWNLEVEL_FILTER_CREATOR_OWNER          = DWORD($80000100);
-  {$EXTERNALSYM DSOP_DOWNLEVEL_FILTER_CREATOR_OWNER}
-  DSOP_DOWNLEVEL_FILTER_CREATOR_GROUP          = DWORD($80000200);
-  {$EXTERNALSYM DSOP_DOWNLEVEL_FILTER_CREATOR_GROUP}
-  DSOP_DOWNLEVEL_FILTER_DIALUP                 = DWORD($80000400);
-  {$EXTERNALSYM DSOP_DOWNLEVEL_FILTER_DIALUP}
-  DSOP_DOWNLEVEL_FILTER_INTERACTIVE            = DWORD($80000800);
-  {$EXTERNALSYM DSOP_DOWNLEVEL_FILTER_INTERACTIVE}
-  DSOP_DOWNLEVEL_FILTER_NETWORK                = DWORD($80001000);
-  {$EXTERNALSYM DSOP_DOWNLEVEL_FILTER_NETWORK}
-  DSOP_DOWNLEVEL_FILTER_SERVICE                = DWORD($80002000);
-  {$EXTERNALSYM DSOP_DOWNLEVEL_FILTER_SERVICE}
-  DSOP_DOWNLEVEL_FILTER_SYSTEM                 = DWORD($80004000);
-  {$EXTERNALSYM DSOP_DOWNLEVEL_FILTER_SYSTEM}
-  DSOP_DOWNLEVEL_FILTER_EXCLUDE_BUILTIN_GROUPS = DWORD($80008000);
-  {$EXTERNALSYM DSOP_DOWNLEVEL_FILTER_EXCLUDE_BUILTIN_GROUPS}
-  DSOP_DOWNLEVEL_FILTER_TERMINAL_SERVER        = DWORD($80010000);
-  {$EXTERNALSYM DSOP_DOWNLEVEL_FILTER_TERMINAL_SERVER}
-  DSOP_DOWNLEVEL_FILTER_ALL_WELLKNOWN_SIDS     = DWORD($80020000);
-  {$EXTERNALSYM DSOP_DOWNLEVEL_FILTER_ALL_WELLKNOWN_SIDS}
-  DSOP_DOWNLEVEL_FILTER_LOCAL_SERVICE          = DWORD($80040000);
-  {$EXTERNALSYM DSOP_DOWNLEVEL_FILTER_LOCAL_SERVICE}
-  DSOP_DOWNLEVEL_FILTER_NETWORK_SERVICE        = DWORD($80080000);
-  {$EXTERNALSYM DSOP_DOWNLEVEL_FILTER_NETWORK_SERVICE}
-  DSOP_DOWNLEVEL_FILTER_REMOTE_LOGON           = DWORD($80100000);
-  {$EXTERNALSYM DSOP_DOWNLEVEL_FILTER_REMOTE_LOGON}
-
-{
-DSOP_UPLEVEL_FILTER_FLAGS
-=========================
-
-Contains the DSOP_FILTER_* flags for use with a DSOP_SCOPE_INIT_INFO
-structure when the scope is uplevel (DS-aware).
-
-flBothModes
-    Flags to use for an uplevel scope, regardless of whether it is a
-    mixed or native mode domain.
-
-flMixedModeOnly
-    Flags to use when an uplevel domain is in mixed mode.
-
-flNativeModeOnly
-    Flags to use when an uplevel domain is in native mode.
-
-DSOP_FILTER_FLAGS
-=================
-
-Uplevel
-    Contains flags to use for an uplevel scope.
-
-flDownlevel
-    Flags to use for a downlevel scope.
-}
-
-type
-  _DSOP_UPLEVEL_FILTER_FLAGS = record
-    flBothModes: ULONG;
-    flMixedModeOnly: ULONG;
-    flNativeModeOnly: ULONG;
-  end;
-  {$EXTERNALSYM _DSOP_UPLEVEL_FILTER_FLAGS}
-  DSOP_UPLEVEL_FILTER_FLAGS = _DSOP_UPLEVEL_FILTER_FLAGS;
-  {$EXTERNALSYM DSOP_UPLEVEL_FILTER_FLAGS}
-  TDsOpUpLevelFilterFlags = DSOP_UPLEVEL_FILTER_FLAGS;
-  PDsOpUpLevelFilterFlags = ^DSOP_UPLEVEL_FILTER_FLAGS;
-
-  _DSOP_FILTER_FLAGS = record
-    Uplevel: DSOP_UPLEVEL_FILTER_FLAGS;
-    flDownlevel: ULONG;
-  end;
-  {$EXTERNALSYM _DSOP_FILTER_FLAGS}
-  DSOP_FILTER_FLAGS = _DSOP_FILTER_FLAGS;
-  {$EXTERNALSYM DSOP_FILTER_FLAGS}
-  TDsOpFilterFlags = DSOP_FILTER_FLAGS;
-  PDsOpFilterFlags = ^DSOP_FILTER_FLAGS;
-
-{
-DSOP_SCOPE_INIT_INFO
-====================
-
-Each DSOP_SCOPE_INIT_INFO structure in the array DSOP_INIT_INFO.aDsScopeInfos
-describes a single scope or a group of scopes with the same settings.
-
-cbSize
-    Size, in bytes, of the entire structure.
-
-flType
-    DSOP_SCOPE_TYPE_* flags.  It is legal to combine multiple values via
-    bitwise OR if all of the types of scopes combined in this way require
-    the same settings.
-
-flScope
-    DSOP_SCOPE_ * flags.
-
-FilterFlags
-    DSOP_FILTER_* flags that indicate which types of objects should be
-    presented to the user in this scope.
-
-pwzDcName
-    Name of the DC of a domain.  This member is used only if the flType
-    member contains the flag DSOP_SCOPE_TYPE_JOINED_DOMAIN.  If that flag is
-    not set, this member must be NULL.
-
-pwzADsPath
-    Currently not supported, must be NULL.
-
-hr
-    Filled with S_OK if the scope represented by this structure could be
-    created, or an error message indicating why it could not.  If
-    IDsObjectPicker::SetScopes returns a success code, this value will
-    also be a success code.
-}
-
-type
-  PDSOP_SCOPE_INIT_INFO = ^DSOP_SCOPE_INIT_INFO;
-  {$EXTERNALSYM PDSOP_SCOPE_INIT_INFO}
-  _DSOP_SCOPE_INIT_INFO = record
-    cbSize: ULONG;
-    flType: ULONG;
-    flScope: ULONG;
-    FilterFlags: DSOP_FILTER_FLAGS;
-    pwzDcName: PWSTR;  // OPTIONAL
-    pwzADsPath: PWSTR; // OPTIONAL
-    hr: HRESULT;
-  end;
-  {$EXTERNALSYM _DSOP_SCOPE_INIT_INFO}
-  DSOP_SCOPE_INIT_INFO = _DSOP_SCOPE_INIT_INFO;
-  {$EXTERNALSYM DSOP_SCOPE_INIT_INFO}
-  PCDSOP_SCOPE_INIT_INFO = PDSOP_SCOPE_INIT_INFO;
-  {$EXTERNALSYM PCDSOP_SCOPE_INIT_INFO}
-  TDsOpScopeInitInfo = DSOP_SCOPE_INIT_INFO;
-  PDsOpScopeInitInfo = PDSOP_SCOPE_INIT_INFO;
-
-{
-DSOP_INIT_INFO flags
-====================
-
-The following flags may be set in DSOP_INIT_INFO.flOptions:
-
-DSOP_FLAG_MULTISELECT
-    Allow multiple selections.  If this flag is not set, the dialog will
-    return zero or one objects.
-
-DSOP_FLAG_SKIP_TARGET_COMPUTER_DC_CHECK
-    If this flag is NOT set, then the DSOP_SCOPE_TYPE_TARGET_COMPUTER flag
-    will be ignored if the target computer is a DC.  This flag has no effect
-    unless DSOP_SCOPE_TYPE_TARGET_COMPUTER is specified.
-
-}
-
-const
-  DSOP_FLAG_MULTISELECT                   = $00000001;
-  {$EXTERNALSYM DSOP_FLAG_MULTISELECT}
-  DSOP_FLAG_SKIP_TARGET_COMPUTER_DC_CHECK = $00000002;
-  {$EXTERNALSYM DSOP_FLAG_SKIP_TARGET_COMPUTER_DC_CHECK}
-
-{
-DSOP_INIT_INFO
-==============
-
-Used to configure the DS Object Picker dialog.
-
-cbSize
-    Size, in bytes, of entire structure.
-
-pwzTargetComputer
-    Sets the computer associated with DSOP_SCOPE_TARGET_COMPUTER, and
-    which is used to determine the joined domain and enterprise.
-    If this value is NULL, the target computer is the local machine.
-
-cDsScopeInfos
-    Count of elements in aDsScopeInfos.  Must be at least 1, since
-    the object picker cannot operate without at least one scope.
-
-aDsScopeInfos
-    Array of scope initialization structures.  Must be present and
-    contain at least one element.
-
-flOptions
-    Various DS Object Picker flags (DSOP_FLAG_MULTISELECT).
-
-cAttributesToFetch
-    Count of elements in apwzAttributeNames.  Can be 0.
-
-apwzAttributeNames
-    Array of names of attributes to fetch for each object.  Ignored
-    if cAttributesToFetch is 0.
-}
-
-type
-  PDSOP_INIT_INFO = ^DSOP_INIT_INFO;
-  {$EXTERNALSYM PDSOP_INIT_INFO}
-  _DSOP_INIT_INFO = record
-    cbSize: ULONG;
-    pwzTargetComputer: PWSTR;
-    cDsScopeInfos: ULONG;
-    aDsScopeInfos: PDSOP_SCOPE_INIT_INFO;
-    flOptions: ULONG;
-    cAttributesToFetch: ULONG;
-    apwzAttributeNames: LPLPWSTR;
-  end;
-  {$EXTERNALSYM _DSOP_INIT_INFO}
-  DSOP_INIT_INFO = _DSOP_INIT_INFO;
-  {$EXTERNALSYM DSOP_INIT_INFO}
-  PCDSOP_INIT_INFO = PDSOP_INIT_INFO;
-  {$EXTERNALSYM PCDSOP_INIT_INFO}
-  TDsOpInitInfo = DSOP_INIT_INFO;
-  PDsOpInitInfo = PDSOP_INIT_INFO;
-
-{
-DS_SELECTION
-============
-Describes an object selected by the user.
-
-pwzName
-    The object's RDN.
-
-pwzADsPath
-    The object's ADsPath.
-
-pwzClass
-    The object's class attribute value.
-
-pwzUPN
-    The object's userPrincipalName attribute value.
-
-pvarFetchedAttributes
-    An array of VARIANTs, one for each attribute fetched.
-
-flScopeType
-    A single DSOP_SCOPE_TYPE_* flag describing the type of the scope
-    from which this object was selected.
-
-DS_SELECTION_LIST
-=================
-Available as a clipboard format from the data object returned by
-IDsObjectPicker::InvokeDialog.  Contains a list of objects that the user
-selected.
-
-cItems
-    Number of elements in the aDsSelection array.
-
-cFetchedAttributes
-    Number of elements in each DSSELECTION.avarFetchedAttributes member.
-
-aDsSelection
-    Array of cItems DSSELECTION structures.
-}
-
-type
-  PDS_SELECTION = ^DS_SELECTION;
-  {$EXTERNALSYM PDS_SELECTION}
-  _DS_SELECTION = record
-    pwzName: PWSTR;
-    pwzADsPath: PWSTR;
-    pwzClass: PWSTR;
-    pwzUPN: PWSTR;
-    pvarFetchedAttributes: POleVariant; 
-    flScopeType: ULONG;
-  end;
-  {$EXTERNALSYM _DS_SELECTION}
-  DS_SELECTION = _DS_SELECTION;
-  {$EXTERNALSYM DS_SELECTION}
-  TDsSelection = DS_SELECTION;
-  PDsSelection = PDS_SELECTION;
-
-  PDS_SELECTION_LIST = ^DS_SELECTION_LIST;
-  {$EXTERNALSYM PDS_SELECTION_LIST}
-  _DS_SELECTION_LIST = record
-    cItems: ULONG;
-    cFetchedAttributes: ULONG;
-    aDsSelection: array [0..ANYSIZE_ARRAY - 1] of DS_SELECTION;
-  end;
-  {$EXTERNALSYM _DS_SELECTION_LIST}
-  DS_SELECTION_LIST = _DS_SELECTION_LIST;
-  {$EXTERNALSYM DS_SELECTION_LIST}
-  TDsSelectionList = DS_SELECTION_LIST;
-  PDsSelectionList = PDS_SELECTION_LIST;
-
-//
-// Object Picker Interfaces
-//
-
-//
-// The main interface to the DS Object Picker, used to initialize it,
-// invoke the dialog, and return the user's selections.
-//
-
-type
-  IDsObjectPicker = interface (IUnknown)
-  ['{0c87e64e-3b7a-11d2-b9e0-00c04fd8dbf7}']
-    // Sets scope, filter, etc. for use with next invocation of dialog
-    function Initialize(const pInitInfo: DSOP_INIT_INFO): HRESULT; stdcall;
-    // Creates the modal DS Object Picker dialog.
-    function InvokeDialog(hwndParent: HWND; out ppdoSelections: IDataObject): HRESULT; stdcall;
-  end;
-  {$EXTERNALSYM IDsObjectPicker}
-
-{$ENDIF JWA_IMPLEMENTATIONSECTION}
-
-
-
-{$IFNDEF JWA_OMIT_SECTIONS}
-implementation
-//uses ...
-{$ENDIF JWA_OMIT_SECTIONS}
-
-
-
-{$IFNDEF JWA_INTERFACESECTION}
-
-//your implementation here
-{$ENDIF JWA_INTERFACESECTION}
-
-
-
-{$IFNDEF JWA_OMIT_SECTIONS}
-end.
-{$ENDIF JWA_OMIT_SECTIONS}

+ 0 - 109
packages/winunits-jedi/src/jwahtmlGuid.pas

@@ -1,109 +0,0 @@
-{******************************************************************************}
-{                                                                              }
-{ GUID Definitions for HTML Viewer object API interface Unit for Object Pascal }
-{                                                                              }
-{ Portions created by Microsoft are Copyright (C) 1995-2001 Microsoft          }
-{ Corporation. All Rights Reserved.                                            }
-{                                                                              }
-{ The original file is: htmlguid.h, released November 2002. The original Pascal}
-{ code is: HtmlGuid.pas, released March 2002. The initial developer of the     }
-{ Pascal code is Marcel van Brakel (brakelm att chello dott nl).               }
-{                                                                              }
-{ Portions created by Marcel van Brakel are Copyright (C) 1999-2001            }
-{ Marcel van Brakel. All Rights Reserved.                                      }
-{                                                                              }
-{ Obtained through: Joint Endeavour of Delphi Innovators (Project JEDI)        }
-{                                                                              }
-{ You may retrieve the latest version of this file at the Project JEDI         }
-{ APILIB home page, located at http://jedi-apilib.sourceforge.net              }
-{                                                                              }
-{ The contents of this file are used with permission, 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/MPL/MPL-1.1.html                                      }
-{                                                                              }
-{ 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 Lesser General Public License (the  "LGPL License"), in which case the   }
-{ provisions of the LGPL License are applicable instead of those above.        }
-{ If you wish to allow use of your version of this file only under the terms   }
-{ of the LGPL License and not to allow others to use your version of this file }
-{ under the MPL, indicate your decision by deleting  the provisions above and  }
-{ replace  them with the notice and other provisions required by the LGPL      }
-{ License.  If you do not delete the provisions above, a recipient may use     }
-{ your version of this file under either the MPL or the LGPL License.          }
-{                                                                              }
-{ For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html }
-{                                                                              }
-{******************************************************************************}
-
-// $Id: JwaHtmlGuid.pas,v 1.6 2007/09/05 11:58:49 dezipaitor Exp $
-{$IFNDEF JWA_OMIT_SECTIONS}
-unit JwaHtmlGuid;
-
-{$WEAKPACKAGEUNIT}
-{$ENDIF JWA_OMIT_SECTIONS}
-
-{$HPPEMIT ''}
-{$HPPEMIT '#include "htmlguid.h"'}
-{$HPPEMIT ''}
-
-{$IFNDEF JWA_OMIT_SECTIONS}
-{$I jediapilib.inc}
-
-interface
-{$ENDIF JWA_OMIT_SECTIONS}
-
-{$IFNDEF JWA_IMPLEMENTATIONSECTION}
-
-const
-// GUID for HTML viewer is: {25336920-03F9-11cf-8FD0-00AA00686F13}
-  CLSID_HTMLViewer: TGUID = (D1:$25336920; D2:$3f9; D3:$11cf; D4:($8f, $d0, $0, $aa, $0, $68, $6f, $13));
-  {$EXTERNALSYM CLSID_HTMLViewer}
-
-// GUID for BSCB proxy is: {25336922-03F9-11cf-8FD0-00AA00686F13}
-  CLSID_HTMLBSCBProxy: TGUID = (D1:$25336922; D2:$3f9; D3:$11cf; D4:($8f, $d0, $0, $aa, $0, $68, $6f, $13));
-  {$EXTERNALSYM CLSID_HTMLBSCBProxy}
-
-// The GUID used to identify the TypeLib of the HTML Page
-// {71BC8840-60BB-11cf-8B97-00AA00476DA6}
-  GUID_PageTL: TGUID = (D1:$71bc8840; D2:$60bb; D3:$11cf; D4:($8b, $97, $0, $aa, $0, $47, $6d, $a6));
-  {$EXTERNALSYM GUID_PageTL}
-
-// The GUID used to identify the Primary dispinterface of the HTML Page
-// {71BC8841-60BB-11cf-8B97-00AA00476DA6}
-  IID_PageProps: TGUID = (D1:$71bc8841; D2:$60bb; D3:$11cf; D4:($8b, $97, $0, $aa, $0, $47, $6d, $a6));
-  {$EXTERNALSYM IID_PageProps}
-
-// The GUID used to identify the Event dispinterface of the HTML Page
-// The page events are currently commented out but will be added later
-// so I grabbed a guid for the events now.
-// {71BC8842-60BB-11cf-8B97-00AA00476DA6}
-  IID_PageEvents: TGUID = (D1:$71bc8842; D2:$60bb; D3:$11cf; D4:($8b, $97, $0, $aa, $0, $47, $6d, $a6));
-  {$EXTERNALSYM IID_PageEvents}
-
-// The GUID used to identify the coclass of the HTML Page
-// {71BC8843-60BB-11cf-8B97-00AA00476DA6}
-  CLSID_Page: TGUID = (D1:$71bc8843; D2:$60bb; D3:$11cf; D4:($8b, $97, $0, $aa, $0, $47, $6d, $a6));
-  {$EXTERNALSYM CLSID_Page}
-
-{$ENDIF JWA_IMPLEMENTATIONSECTION}
-
-
-
-{$IFNDEF JWA_OMIT_SECTIONS}
-implementation
-//uses ...
-{$ENDIF JWA_OMIT_SECTIONS}
-
-{$IFNDEF JWA_INTERFACESECTION}
-//your implementation here
-{$ENDIF JWA_INTERFACESECTION}
-
-
-{$IFNDEF JWA_OMIT_SECTIONS}
-end.
-{$ENDIF JWA_OMIT_SECTIONS}