' ########################################################################################
' Microsoft Windows
' File: WcnDevice.inc
' Copyright (c) 2011 Jos? Roca
' Portions Copyright (c) Microsoft Corporation.
' All Rights Reserved.
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
' MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
' ########################################################################################
#IF NOT %DEF(PBX_WcnDevice_PBI)
#DEFINE PBX_WcnDevice_PBI
%EQUATE `WCNDEVICE_INC = 1
'/* header files for imported files */
#INCLUDE ONCE "Legacy/COM/ObjIdl.inc"
#INCLUDE ONCE "Legacy/System/WcnTypes.inc"
'#if NTDDI_VERSION >= NTDDI_WIN7
'EXTERN_C const IID LIBID_WCNDeviceObjectLibrary;
$CLSID_WCNDeviceObject = GUID$("{C100BEA7-D33A-4a4b-BF23-BBEF4663D017}")
%EQUATE `WCN_API_MAX_BUFFER_SIZE = 2096
' enum WCN_PASSWORD_TYPE
%EQUATE `WCN_PASSWORD_TYPE_PUSH_BUTTON = 0
%EQUATE `WCN_PASSWORD_TYPE_PIN = %WCN_PASSWORD_TYPE_PUSH_BUTTON + 1
' enum WCN_SESSION_STATUS
%EQUATE `WCN_SESSION_STATUS_SUCCESS = 0
%EQUATE `WCN_SESSION_STATUS_FAILURE_GENERIC = %WCN_SESSION_STATUS_SUCCESS + 1
%EQUATE `WCN_SESSION_STATUS_FAILURE_TIMEOUT = %WCN_SESSION_STATUS_FAILURE_GENERIC + 1
TYPE WCN_VENDOR_EXTENSION_SPEC DWORD
 VendorId AS DWORD
 SubType AS DWORD
 Index AS DWORD
 Flags AS DWORD
END TYPE
%EQUATE `WCN_MICROSOFT_VENDOR_ID = 311&
%EQUATE `WCN_NO_SUBTYPE = &Hfffffffe
%EQUATE `WCN_FLAG_DISCOVERY_VE = &H1
%EQUATE `WCN_FLAG_AUTHENTICATED_VE = &H2
%EQUATE `WCN_FLAG_ENCRYPTED_VE = &H4
' ########################################################################################
' IWCNDevice interface
' IID = C100BE9C-D33A-4a4b-BF23-BBEF4663D017
' Inherited interface = IUnknown
' ########################################################################################
#IF NOT %DEF(%IWCNDevice_INTERFACE_DEFINED)
 %IWCNDevice_INTERFACE_DEFINED = 1
$IID_IWCNDevice = GUID$("{C100BE9C-D33A-4a4b-BF23-BBEF4663D017}")
INTERFACE IWCNDevice $IID_IWCNDevice
 INHERIT IUnknown
 ' =====================================================================================
 METHOD SetPassword ( ' VTable offset = 12
 BYVAL Type AS LONG
 , BYVAL dwPasswordLength AS DWORD
 , BYVAL pbPassword AS BYTE PTR
 ) AS LONG
 ' =====================================================================================
 METHOD Connect ( ' VTable offset = 16
 BYVAL pNotify AS IWCNConnectNotify
 ) AS LONG
 ' =====================================================================================
 METHOD GetAttribute ( ' VTable offset = 20
 BYVAL AttributeType AS LONG
 , BYVAL dwMaxBufferSize AS DWORD
 , BYVAL pbBuffer AS BYTE PTR
 , BYREF pdwBufferUsed AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetIntegerAttribute ( ' VTable offset = 24
 BYVAL AttributeType AS LONG
 , BYREF puInteger AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetStringAttribute ( ' VTable offset = 28
 BYVAL AttributeType AS LONG
 , BYVAL cchMaxString AS DWORD
 , BYREF wszString AS WSTRINGZ
 ) AS LONG
 ' =====================================================================================
 METHOD GetNetworkProfile ( ' VTable offset = 32
 BYVAL cchMaxStringLength AS DWORD
 , BYREF wszProfile AS WSTRINGZ
 ) AS LONG
 ' =====================================================================================
 METHOD SetNetworkProfile ( ' VTable offset = 36
 BYREF pszProfileXml AS WSTRINGZ
 ) AS LONG
 ' =====================================================================================
 METHOD GetVendorExtension ( ' VTable offset = 40
 BYREF pVendorExtSpec AS WCN_VENDOR_EXTENSION_SPEC
 , BYVAL dwMaxBufferSize AS DWORD
 , BYVAL pbBuffer AS BYTE PTR
 , BYREF pdwBufferUsed AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD SetVendorExtension ( ' VTable offset = 44
 BYREF pVendorExtSpec AS WCN_VENDOR_EXTENSION_SPEC
 , BYVAL cbBuffer AS DWORD
 , BYVAL pbBuffer AS BYTE PTR
 ) AS LONG
 ' =====================================================================================
 METHOD Unadvise ( ' VTable offset = 48
 ) AS LONG
 ' =====================================================================================
END INTERFACE
#ENDIF ' /* __IWCNDevice_INTERFACE_DEFINED__ */
' ########################################################################################
' IWCNConnectNotify interface
' IID = C100BE9F-D33A-4a4b-BF23-BBEF4663D017
' Inherited interface = IUnknown
' ########################################################################################
#IF NOT %DEF(%IWCNConnectNotify_INTERFACE_DEFINED)
 %IWCNConnectNotify_INTERFACE_DEFINED = 1
$IID_IWCNConnectNotify = GUID$("{C100BE9F-D33A-4a4b-BF23-BBEF4663D017}")
INTERFACE IWCNConnectNotify $IID_IWCNConnectNotify
 INHERIT IUnknown
 ' =====================================================================================
 METHOD ConnectSucceeded ( ' VTable offset = 12
 ) AS LONG
 ' =====================================================================================
 METHOD ConnectFailed ( ' VTable offset = 16
 BYVAL hrFailure AS LONG
 ) AS LONG
 ' =====================================================================================
END INTERFACE
#ENDIF ' /* __IWCNConnectNotify_INTERFACE_DEFINED__ */
'#endif // NTDDI_VERSION >= NTDDI_WIN7
#ENDIF
