C# 클래스 Opc.Ua.Com.ComUtils

Exposes WIN32 and COM API functions.
파일 보기 프로젝트 열기: OPCFoundation/UA-.NET

Private Properties

프로퍼티 타입 설명
CloseHandle bool
CoCreateInstanceEx void
CoGetClassObject void
CoInitializeSecurity int
CoQueryProxyBlanket int
CoSetProxyBlanket int
ConvertCase char
DuplicateToken bool
FormatMessageW int
GetSystemDefaultLangID int
GetUserDefaultLangID int
IsLocalHost bool
LogonUser bool
NetApiBufferFree int
NetServerEnum int
VariantChangeTypeEx int
VariantClear void
VariantInit void
VariantToObjectArray System.Array

공개 메소드들

메소드 설명
ChangeTypeForCOM ( object source, VarEnum sourceType, VarEnum targetType, object &target ) : int

Converts a value to the specified type using COM conversion rules.

ChangeTypeForCOM ( object source, VarEnum targetType, object &target ) : int

Converts a value to the specified type using COM conversion rules.

CompareLocales ( int localeId, string locale, bool ignoreRegion ) : bool

Compares a string locale to a WIN32 localeId

CreateComException ( Exception e ) : Exception

Converts an exception to an exception that returns a COM error code.

CreateComException ( Exception e, int errorId ) : Exception

Converts an exception to an exception that returns a COM error code.

CreateComException ( int errorId ) : Exception

Converts an exception to an exception that returns a COM error code.

CreateComException ( string message, int errorId ) : Exception

Creates a COM exception.

CreateException ( Exception e, string function ) : Exception

Creates an error message for a failed COM function call.

CreateInstance ( System.Guid clsid, string hostName, UserIdentity identity ) : object

Creates an instance of a COM server using the specified license key.

CreateInstance1 ( System.Guid clsid, string hostName, UserIdentity identity ) : object

Creates an instance of a COM server.

CreateInstance2 ( System.Guid clsid, string hostName, UserIdentity identity ) : object

Creates an instance of a COM server using the specified license key.

CreateInstanceWithLicenseKey ( System.Guid clsid, string hostName, UserIdentity identity, string licenseKey ) : object

Creates an instance of a COM server using the specified license key.

EnumComputers ( ) : string[]

Enumerates computers on the local network.

GetAccessRights ( byte accessLevel ) : int

Converts the UA access level to DA access rights.

GetDataTypeId ( short input ) : NodeId

Converts the VARTYPE to a UA Data Type ID.

GetDataTypeId ( short input, bool &isArray ) : NodeId

Converts the VARTYPE to a UA Data Type ID.

GetDateTime ( IntPtr pFiletime ) : System.DateTime

Unmarshals a WIN32 FILETIME from a pointer.

GetDateTime ( System filetime ) : System.DateTime

Unmarshals a WIN32 FILETIME.

GetDateTimes ( IntPtr &pArray, int size, bool deallocate ) : System.DateTime[]

Unmarshals an array of WIN32 FILETIMEs as DateTimes.

GetErrorCode ( Exception e, int defaultCode ) : int

Gets the error code for the exception.

This method ignores the exception but makes it possible to keep track of ignored exceptions.

GetErrorText ( Type type, int error ) : string

Returns the symbolic name for the specified error.

GetFILETIME ( System.DateTime datetime ) : System.Runtime.InteropServices.ComTypes.FILETIME

Marshals a DateTime as a WIN32 FILETIME.

GetFILETIMEs ( System.DateTime datetimes ) : IntPtr

Marshals an array of DateTimes into an unmanaged array of FILETIMEs

GetFILETIMEs ( IntPtr &pArray, int size ) : System.Runtime.InteropServices.ComTypes.FILETIME[]

Unmarshals an array of FILETIMEs

GetGUIDs ( IntPtr &pInput, int size, bool deallocate ) : System.Guid[]

Unmarshals an array of WIN32 GUIDs as Guid.

GetHdaAggregateId ( uint aggregateId ) : NodeId

Converts a HDA Aggregate ID to a UA aggregate ID

GetHdaAggregateId ( NodeId nodeId ) : uint

Converts a UA Aggregate ID to a HDA aggregate ID

GetHdaQualityCode ( uint quality ) : StatusCode

Converts a HDA quality code to a StatusCode.

GetHdaQualityCode ( StatusCode input ) : uint

Converts a UA status code to a HDA quality code.

GetInt16s ( short input ) : IntPtr

Allocates and marshals an array of 16 bit integers.

GetInt16s ( IntPtr &pArray, int size, bool deallocate ) : short[]

Unmarshals and frees a array of 16 bit integers.

GetInt32s ( int input ) : IntPtr

Allocates and marshals an array of 32 bit integers.

GetInt32s ( IntPtr &pArray, int size, bool deallocate ) : int[]

Unmarshals and frees an array of 32 bit integers.

GetLocale ( string input ) : int

Converts a Locale string to a LCID.

GetLocale ( int input ) : string

Converts a LCID to a Locale string.

GetPrincipalFromUserIdentity ( UserIdentity user ) : WindowsPrincipal

Returns the WindowsIdentity associated with a UserIdentity.

GetQualityCode ( short quality ) : StatusCode

Converts a DA quality code to a status code.

GetQualityCode ( StatusCode input ) : short

Converts a UA status code to a DA quality code.

GetStatusCodes ( IntPtr &pArray, int size, bool deallocate ) : int[]

Unmarshals and frees an array of HRESULTs.

GetSystemMessage ( int error, int localeId ) : string

Retrieves the system message text for the specified error.

GetSystemType ( short input ) : Type

Converts the VARTYPE to a SystemType

GetUInt32s ( IntPtr &pArray, int size, bool deallocate ) : int[]

Unmarshals and frees an array of 32 bit integers.

GetUnicodeStrings ( string values ) : IntPtr

Marshals an array of strings into a unmanaged memory buffer

GetUnicodeStrings ( IntPtr &pArray, int size, bool deallocate ) : string[]

Unmarshals and frees a array of unicode strings.

GetVARIANT ( Variant source ) : object

Converts an object into a value that can be marshalled to a VARIANT.

GetVARIANT ( object source ) : object

Converts an object into a value that can be marshalled to a VARIANT.

GetVARIANT ( object source, TypeInfo typeInfo ) : object

Converts an object into a value that can be marshalled to a VARIANT.

GetVARIANTs ( object values, bool preprocess ) : IntPtr

Marshals an array objects into an unmanaged array of VARIANTs.

GetVARIANTs ( IntPtr &pArray, int size, bool deallocate ) : object[]

Unmarshals an array of VARIANTs as objects.

GetValueRank ( short input ) : int

Converts the VARTYPE to a UA ValueRank.

GetVarType ( System type ) : VarEnum

Converts the system type to a VARTYPE.

GetVarType ( TypeInfo typeInfo ) : VarEnum

Converts the TypeInfo to a VARTYPE.

GetVarType ( object input ) : VarEnum

Returns the VARTYPE for the value.

InitializeSecurity ( ) : void

Initializes COM security.

IsRpcError ( Exception e ) : bool

Checks if the error is an RPC error.

IsUnknownError ( Exception e ) : bool

Checks if the error for the exception is one of the recognized errors.

IsValidComType ( object input ) : bool

Returns true is the object is a valid COM type.

Match ( string target, string pattern, bool caseSensitive ) : bool

Tests if the specified string matches the specified pattern.

ProcessComValue ( object value ) : object

Converts a COM value to something that UA clients can deal with.

ReleaseServer ( object server ) : void

Releases the server if it is a true COM server.

SetProxySecurity ( object server, IntPtr pAuthInfo ) : void

Sets the security settings for the proxy.

SetProxySecurity ( object server, UserIdentity user ) : void

Sets the security settings for the proxy.

TraceComError ( Exception e, string format ) : void

Reports an unexpected exception during a COM operation.

비공개 메소드들

메소드 설명
CloseHandle ( IntPtr handle ) : bool
CoCreateInstanceEx ( System.Guid &clsid, [ punkOuter, uint dwClsCtx, [ pServerInfo, uint dwCount, [ pResults ) : void
CoGetClassObject ( [ clsid, uint dwClsContext, [ pServerInfo, [ riid, [ ppv ) : void
CoInitializeSecurity ( IntPtr pSecDesc, int cAuthSvc, SOLE_AUTHENTICATION_SERVICE asAuthSvc, IntPtr pReserved1, uint dwAuthnLevel, uint dwImpLevel, IntPtr pAuthList, uint dwCapabilities, IntPtr pReserved3 ) : int
CoQueryProxyBlanket ( [ pProxy, uint &pAuthnSvc, uint &pAuthzSvc, [ pServerPrincName, uint &pAuthnLevel, uint &pImpLevel, IntPtr &pAuthInfo, uint &pCapabilities ) : int
CoSetProxyBlanket ( [ pProxy, uint pAuthnSvc, uint pAuthzSvc, IntPtr pServerPrincName, uint pAuthnLevel, uint pImpLevel, IntPtr pAuthInfo, uint pCapabilities ) : int
ConvertCase ( char c, bool caseSensitive ) : char
DuplicateToken ( IntPtr ExistingTokenHandle, int SECURITY_IMPERSONATION_LEVEL, IntPtr &DuplicateTokenHandle ) : bool
FormatMessageW ( int dwFlags, IntPtr lpSource, int dwMessageId, int dwLanguageId, IntPtr lpBuffer, int nSize, IntPtr Arguments ) : int
GetSystemDefaultLangID ( ) : int
GetUserDefaultLangID ( ) : int
IsLocalHost ( string hostName ) : bool

Determines if the host is the local host.

LogonUser ( string lpszUsername, string lpszDomain, string lpszPassword, int dwLogonType, int dwLogonProvider, IntPtr &phToken ) : bool
NetApiBufferFree ( IntPtr buffer ) : int
NetServerEnum ( IntPtr servername, uint level, IntPtr &bufptr, int prefmaxlen, int &entriesread, int &totalentries, uint servertype, IntPtr domain, IntPtr resume_handle ) : int
VariantChangeTypeEx ( IntPtr pvargDest, IntPtr pvarSrc, int lcid, ushort wFlags, short vt ) : int
VariantClear ( IntPtr pVariant ) : void
VariantInit ( IntPtr pVariant ) : void
VariantToObjectArray ( Array input ) : Array

Converts a Variant array to an Object array.

메소드 상세

ChangeTypeForCOM() 공개 정적인 메소드

Converts a value to the specified type using COM conversion rules.
public static ChangeTypeForCOM ( object source, VarEnum sourceType, VarEnum targetType, object &target ) : int
source object
sourceType VarEnum
targetType VarEnum
target object
리턴 int

ChangeTypeForCOM() 공개 정적인 메소드

Converts a value to the specified type using COM conversion rules.
public static ChangeTypeForCOM ( object source, VarEnum targetType, object &target ) : int
source object
targetType VarEnum
target object
리턴 int

CompareLocales() 공개 정적인 메소드

Compares a string locale to a WIN32 localeId
public static CompareLocales ( int localeId, string locale, bool ignoreRegion ) : bool
localeId int
locale string
ignoreRegion bool
리턴 bool

CreateComException() 공개 정적인 메소드

Converts an exception to an exception that returns a COM error code.
public static CreateComException ( Exception e ) : Exception
e System.Exception
리턴 System.Exception

CreateComException() 공개 정적인 메소드

Converts an exception to an exception that returns a COM error code.
public static CreateComException ( Exception e, int errorId ) : Exception
e System.Exception
errorId int
리턴 System.Exception

CreateComException() 공개 정적인 메소드

Converts an exception to an exception that returns a COM error code.
public static CreateComException ( int errorId ) : Exception
errorId int
리턴 System.Exception

CreateComException() 공개 정적인 메소드

Creates a COM exception.
public static CreateComException ( string message, int errorId ) : Exception
message string
errorId int
리턴 System.Exception

CreateException() 공개 정적인 메소드

Creates an error message for a failed COM function call.
public static CreateException ( Exception e, string function ) : Exception
e System.Exception
function string
리턴 System.Exception

CreateInstance() 공개 정적인 메소드

Creates an instance of a COM server using the specified license key.
public static CreateInstance ( System.Guid clsid, string hostName, UserIdentity identity ) : object
clsid System.Guid
hostName string
identity UserIdentity
리턴 object

CreateInstance1() 공개 정적인 메소드

Creates an instance of a COM server.
public static CreateInstance1 ( System.Guid clsid, string hostName, UserIdentity identity ) : object
clsid System.Guid
hostName string
identity UserIdentity
리턴 object

CreateInstance2() 공개 정적인 메소드

Creates an instance of a COM server using the specified license key.
public static CreateInstance2 ( System.Guid clsid, string hostName, UserIdentity identity ) : object
clsid System.Guid
hostName string
identity UserIdentity
리턴 object

CreateInstanceWithLicenseKey() 공개 정적인 메소드

Creates an instance of a COM server using the specified license key.
public static CreateInstanceWithLicenseKey ( System.Guid clsid, string hostName, UserIdentity identity, string licenseKey ) : object
clsid System.Guid
hostName string
identity UserIdentity
licenseKey string
리턴 object

EnumComputers() 공개 정적인 메소드

Enumerates computers on the local network.
public static EnumComputers ( ) : string[]
리턴 string[]

GetAccessRights() 공개 정적인 메소드

Converts the UA access level to DA access rights.
public static GetAccessRights ( byte accessLevel ) : int
accessLevel byte
리턴 int

GetDataTypeId() 공개 정적인 메소드

Converts the VARTYPE to a UA Data Type ID.
public static GetDataTypeId ( short input ) : NodeId
input short
리턴 NodeId

GetDataTypeId() 공개 정적인 메소드

Converts the VARTYPE to a UA Data Type ID.
public static GetDataTypeId ( short input, bool &isArray ) : NodeId
input short
isArray bool
리턴 NodeId

GetDateTime() 공개 정적인 메소드

Unmarshals a WIN32 FILETIME from a pointer.
public static GetDateTime ( IntPtr pFiletime ) : System.DateTime
pFiletime System.IntPtr A pointer to a FILETIME structure.
리턴 System.DateTime

GetDateTime() 공개 정적인 메소드

Unmarshals a WIN32 FILETIME.
public static GetDateTime ( System filetime ) : System.DateTime
filetime System
리턴 System.DateTime

GetDateTimes() 공개 정적인 메소드

Unmarshals an array of WIN32 FILETIMEs as DateTimes.
public static GetDateTimes ( IntPtr &pArray, int size, bool deallocate ) : System.DateTime[]
pArray System.IntPtr
size int
deallocate bool
리턴 System.DateTime[]

GetErrorCode() 공개 정적인 메소드

Gets the error code for the exception.
This method ignores the exception but makes it possible to keep track of ignored exceptions.
public static GetErrorCode ( Exception e, int defaultCode ) : int
e System.Exception The exception.
defaultCode int The default code.
리턴 int

GetErrorText() 공개 정적인 메소드

Returns the symbolic name for the specified error.
public static GetErrorText ( Type type, int error ) : string
type System.Type
error int
리턴 string

GetFILETIME() 공개 정적인 메소드

Marshals a DateTime as a WIN32 FILETIME.
public static GetFILETIME ( System.DateTime datetime ) : System.Runtime.InteropServices.ComTypes.FILETIME
datetime System.DateTime The DateTime object to marshal
리턴 System.Runtime.InteropServices.ComTypes.FILETIME

GetFILETIMEs() 공개 정적인 메소드

Marshals an array of DateTimes into an unmanaged array of FILETIMEs
public static GetFILETIMEs ( System.DateTime datetimes ) : IntPtr
datetimes System.DateTime The array of DateTimes to marshal
리턴 System.IntPtr

GetFILETIMEs() 공개 정적인 메소드

Unmarshals an array of FILETIMEs
public static GetFILETIMEs ( IntPtr &pArray, int size ) : System.Runtime.InteropServices.ComTypes.FILETIME[]
pArray System.IntPtr
size int
리턴 System.Runtime.InteropServices.ComTypes.FILETIME[]

GetGUIDs() 공개 정적인 메소드

Unmarshals an array of WIN32 GUIDs as Guid.
public static GetGUIDs ( IntPtr &pInput, int size, bool deallocate ) : System.Guid[]
pInput System.IntPtr
size int
deallocate bool
리턴 System.Guid[]

GetHdaAggregateId() 공개 정적인 메소드

Converts a HDA Aggregate ID to a UA aggregate ID
public static GetHdaAggregateId ( uint aggregateId ) : NodeId
aggregateId uint The aggregate id.
리턴 NodeId

GetHdaAggregateId() 공개 정적인 메소드

Converts a UA Aggregate ID to a HDA aggregate ID
public static GetHdaAggregateId ( NodeId nodeId ) : uint
nodeId NodeId The node id.
리턴 uint

GetHdaQualityCode() 공개 정적인 메소드

Converts a HDA quality code to a StatusCode.
public static GetHdaQualityCode ( uint quality ) : StatusCode
quality uint
리턴 StatusCode

GetHdaQualityCode() 공개 정적인 메소드

Converts a UA status code to a HDA quality code.
public static GetHdaQualityCode ( StatusCode input ) : uint
input StatusCode
리턴 uint

GetInt16s() 공개 정적인 메소드

Allocates and marshals an array of 16 bit integers.
public static GetInt16s ( short input ) : IntPtr
input short
리턴 System.IntPtr

GetInt16s() 공개 정적인 메소드

Unmarshals and frees a array of 16 bit integers.
public static GetInt16s ( IntPtr &pArray, int size, bool deallocate ) : short[]
pArray System.IntPtr
size int
deallocate bool
리턴 short[]

GetInt32s() 공개 정적인 메소드

Allocates and marshals an array of 32 bit integers.
public static GetInt32s ( int input ) : IntPtr
input int
리턴 System.IntPtr

GetInt32s() 공개 정적인 메소드

Unmarshals and frees an array of 32 bit integers.
public static GetInt32s ( IntPtr &pArray, int size, bool deallocate ) : int[]
pArray System.IntPtr
size int
deallocate bool
리턴 int[]

GetLocale() 공개 정적인 메소드

Converts a Locale string to a LCID.
public static GetLocale ( string input ) : int
input string
리턴 int

GetLocale() 공개 정적인 메소드

Converts a LCID to a Locale string.
public static GetLocale ( int input ) : string
input int
리턴 string

GetPrincipalFromUserIdentity() 공개 정적인 메소드

Returns the WindowsIdentity associated with a UserIdentity.
public static GetPrincipalFromUserIdentity ( UserIdentity user ) : WindowsPrincipal
user UserIdentity
리턴 System.Security.Principal.WindowsPrincipal

GetQualityCode() 공개 정적인 메소드

Converts a DA quality code to a status code.
public static GetQualityCode ( short quality ) : StatusCode
quality short
리턴 StatusCode

GetQualityCode() 공개 정적인 메소드

Converts a UA status code to a DA quality code.
public static GetQualityCode ( StatusCode input ) : short
input StatusCode
리턴 short

GetStatusCodes() 공개 정적인 메소드

Unmarshals and frees an array of HRESULTs.
public static GetStatusCodes ( IntPtr &pArray, int size, bool deallocate ) : int[]
pArray System.IntPtr
size int
deallocate bool
리턴 int[]

GetSystemMessage() 공개 정적인 메소드

Retrieves the system message text for the specified error.
public static GetSystemMessage ( int error, int localeId ) : string
error int
localeId int
리턴 string

GetSystemType() 공개 정적인 메소드

Converts the VARTYPE to a SystemType
public static GetSystemType ( short input ) : Type
input short
리턴 System.Type

GetUInt32s() 공개 정적인 메소드

Unmarshals and frees an array of 32 bit integers.
public static GetUInt32s ( IntPtr &pArray, int size, bool deallocate ) : int[]
pArray System.IntPtr
size int
deallocate bool
리턴 int[]

GetUnicodeStrings() 공개 정적인 메소드

Marshals an array of strings into a unmanaged memory buffer
public static GetUnicodeStrings ( string values ) : IntPtr
values string The array of strings to marshal
리턴 System.IntPtr

GetUnicodeStrings() 공개 정적인 메소드

Unmarshals and frees a array of unicode strings.
public static GetUnicodeStrings ( IntPtr &pArray, int size, bool deallocate ) : string[]
pArray System.IntPtr
size int
deallocate bool
리턴 string[]

GetVARIANT() 공개 정적인 메소드

Converts an object into a value that can be marshalled to a VARIANT.
public static GetVARIANT ( Variant source ) : object
source Variant The object to convert.
리턴 object

GetVARIANT() 공개 정적인 메소드

Converts an object into a value that can be marshalled to a VARIANT.
public static GetVARIANT ( object source ) : object
source object The object to convert.
리턴 object

GetVARIANT() 공개 정적인 메소드

Converts an object into a value that can be marshalled to a VARIANT.
public static GetVARIANT ( object source, TypeInfo typeInfo ) : object
source object The object to convert.
typeInfo System.Reflection.TypeInfo The type info.
리턴 object

GetVARIANTs() 공개 정적인 메소드

Marshals an array objects into an unmanaged array of VARIANTs.
public static GetVARIANTs ( object values, bool preprocess ) : IntPtr
values object An array of the objects to be marshalled
preprocess bool Whether the objects should have troublesome types removed before marhalling.
리턴 System.IntPtr

GetVARIANTs() 공개 정적인 메소드

Unmarshals an array of VARIANTs as objects.
public static GetVARIANTs ( IntPtr &pArray, int size, bool deallocate ) : object[]
pArray System.IntPtr
size int
deallocate bool
리턴 object[]

GetValueRank() 공개 정적인 메소드

Converts the VARTYPE to a UA ValueRank.
public static GetValueRank ( short input ) : int
input short
리턴 int

GetVarType() 공개 정적인 메소드

Converts the system type to a VARTYPE.
public static GetVarType ( System type ) : VarEnum
type System
리턴 VarEnum

GetVarType() 공개 정적인 메소드

Converts the TypeInfo to a VARTYPE.
public static GetVarType ( TypeInfo typeInfo ) : VarEnum
typeInfo System.Reflection.TypeInfo
리턴 VarEnum

GetVarType() 공개 정적인 메소드

Returns the VARTYPE for the value.
public static GetVarType ( object input ) : VarEnum
input object
리턴 VarEnum

InitializeSecurity() 공개 정적인 메소드

Initializes COM security.
public static InitializeSecurity ( ) : void
리턴 void

IsRpcError() 공개 정적인 메소드

Checks if the error is an RPC error.
public static IsRpcError ( Exception e ) : bool
e System.Exception
리턴 bool

IsUnknownError() 공개 정적인 메소드

Checks if the error for the exception is one of the recognized errors.
public static IsUnknownError ( Exception e ) : bool
e System.Exception
리턴 bool

IsValidComType() 공개 정적인 메소드

Returns true is the object is a valid COM type.
public static IsValidComType ( object input ) : bool
input object
리턴 bool

Match() 공개 정적인 메소드

Tests if the specified string matches the specified pattern.
public static Match ( string target, string pattern, bool caseSensitive ) : bool
target string
pattern string
caseSensitive bool
리턴 bool

ProcessComValue() 공개 정적인 메소드

Converts a COM value to something that UA clients can deal with.
public static ProcessComValue ( object value ) : object
value object
리턴 object

ReleaseServer() 공개 정적인 메소드

Releases the server if it is a true COM server.
public static ReleaseServer ( object server ) : void
server object
리턴 void

SetProxySecurity() 공개 정적인 메소드

Sets the security settings for the proxy.
public static SetProxySecurity ( object server, IntPtr pAuthInfo ) : void
server object
pAuthInfo System.IntPtr
리턴 void

SetProxySecurity() 공개 정적인 메소드

Sets the security settings for the proxy.
public static SetProxySecurity ( object server, UserIdentity user ) : void
server object
user UserIdentity
리턴 void

TraceComError() 공개 정적인 메소드

Reports an unexpected exception during a COM operation.
public static TraceComError ( Exception e, string format ) : void
e System.Exception
format string
리턴 void