opcsec.pas
来自「OPC 源程序示例」· PAS 代码 · 共 80 行
PAS
80 行
{*******************************************************}
{ }
{ OPC Security 1.0 }
{ }
{ Delphi conversion maintained and supplied by }
{ Mike Dillamore }
{ OPC Programmers' Connection }
{ http://www.opcconnect.com/ }
{ mailto:opc@opcconnect.com }
{ }
{ Originally contributed by }
{ Illya Kysil }
{ mailto:ikysil@ua.fm }
{ }
{*******************************************************}
unit OPCSEC;
{$IFDEF VER150}
{$WARN UNSAFE_TYPE OFF}
{$ENDIF}
// ************************************************************************ //
// Type Lib: opcSec_PS.dll
// IID\LCID: {7AA83AFF-6C77-11D3-84F9-00008630A38B}\0
// ************************************************************************ //
interface
uses
Windows, ActiveX, OPCtypes;
// *********************************************************************//
// GUIDS declared in the TypeLibrary //
// *********************************************************************//
const
LIBID_OPCSEC: TIID = '{7AA83AFF-6C77-11D3-84F9-00008630A38B}';
IID_IOPCSecurityNT: TIID = '{7AA83A01-6C77-11D3-84F9-00008630A38B}';
IID_IOPCSecurityPrivate: TIID = '{7AA83A02-6C77-11D3-84F9-00008630A38B}';
type
// *********************************************************************//
// Forward declaration of types defined in TypeLibrary //
// *********************************************************************//
IOPCSecurityNT = interface;
IOPCSecurityPrivate = interface;
// *********************************************************************//
// Interface: IOPCSecurityNT
// GUID: {7AA83A01-6C77-11D3-84F9-00008630A38B}
// *********************************************************************//
IOPCSecurityNT = interface(IUnknown)
['{7AA83A01-6C77-11D3-84F9-00008630A38B}']
function IsAvailableNT(
out pbAvailable: BOOL): HResult; stdcall;
function QueryMinImpersonationLevel(
out pdwMinImpLevel: DWORD): HResult; stdcall;
function ChangeUser: HResult; stdcall;
end;
// *********************************************************************//
// Interface: IOPCSecurityPrivate
// GUID: {7AA83A02-6C77-11D3-84F9-00008630A38B}
// *********************************************************************//
IOPCSecurityPrivate = interface(IUnknown)
['{7AA83A02-6C77-11D3-84F9-00008630A38B}']
function IsAvailablePriv(
out pbAvailable: BOOL): HResult; stdcall;
function Logon(
szUserID: POleStr;
szPassword: POleStr): HResult; stdcall;
function Logoff: HResult; stdcall;
end;
implementation
end.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?