' ########################################################################################
' Microsoft Windows
' File: RasDlg.inc
' Contents: Remote Access Common Dialog APIs
' 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_RasDlg_PBI)
#DEFINE PBX_RasDlg_PBI
%EQUATE `RASDLG_INC = 1
'#include <pshpack4.h>
#INCLUDE ONCE "Legacy/System/Ras.inc"
'/* RasPhonebookDlg API callback.
'*/
'typedef VOID (WINAPI* RASPBDLGFUNCW)( ULONG_PTR, DWORD, LPWSTR, LPVOID );
'typedef VOID (WINAPI* RASPBDLGFUNCA)( ULONG_PTR, DWORD, LPSTR, LPVOID );
%EQUATE `RASPBDEVENT_AddEntry = 1
%EQUATE `RASPBDEVENT_EditEntry = 2
%EQUATE `RASPBDEVENT_RemoveEntry = 3
%EQUATE `RASPBDEVENT_DialEntry = 4
%EQUATE `RASPBDEVENT_EditGlobals = 5
%EQUATE `RASPBDEVENT_NoUser = 6
%EQUATE `RASPBDEVENT_NoUserEdit = 7
%EQUATE `RASNOUSER_SmartCard = &H00000001
'/* Defines the information passed in the 4th argument of RASPBDLGFUNC on
'** "NoUser" and "NoUserEdit" events. Usage shown is for "NoUser". For
'** "NoUserEdit", the timeout is ignored and the three strings are INs.
'*/
'#define RASNOUSERW struct tagRASNOUSERW
' // Size = 1072 bytes
TYPE tagRASNOUSERW ' Must be 4 byte aligned
 dwSize AS DWORD
 dwFlags AS DWORD
 dwTimeoutMs AS DWORD
 szUserName AS WSTRINGZ * %UNLEN + 1 ' WCHAR[UNLEN]
 szPassword AS WSTRINGZ * %PWLEN + 1 ' WCHAR[PWLEN]
 szDomain AS WSTRINGZ * %DNLEN + 1 ' WCHAR[DNLEN]
END TYPE
'#define RASNOUSERA struct tagRASNOUSERA
' // Size = 544 bytes
TYPE tagRASNOUSERA ' Must be 4 byte aligned
 dwSize AS DWORD
 dwFlags AS DWORD
 dwTimeoutMs AS DWORD
 szUserName AS ASCIIZ * %UNLEN + 1 ' CHAR[UNLEN]
 szPassword AS ASCIIZ * %PWLEN + 1 ' CHAR[PWLEN]
 szDomain AS ASCIIZ * %DNLEN + 1 ' CHAR[DNLEN]
 alignment__(1) AS BYTE
END TYPE
#IF %DEF(%UNICODE)
 MACRO tagRASNOUSER = tagRASNOUSERW
#ELSE
 MACRO tagRASNOUSER = tagRASNOUSERA
#ENDIF
'/* RasPhonebookDlg API parameters.
'*/
%EQUATE `RASPBDFLAG_PositionDlg = &H00000001
%EQUATE `RASPBDFLAG_ForceCloseOnDial = &H00000002
%EQUATE `RASPBDFLAG_NoUser = &H00000010
%EQUATE `RASPBDFLAG_UpdateDefaults = &H80000000
'#define RASPBDLGW struct tagRASPBDLGW
' // Size = 40 bytes
TYPE tagRASPBDLGW ' Must be 4 byte aligned
 dwSize AS DWORD
 hwndOwner AS DWORD
 dwFlags AS DWORD
 xDlg AS LONG
 yDlg AS LONG
 dwCallbackId AS DWORD ' ULONG_PTR
 pCallback AS DWORD ' RASPBDLGFUNCW
 dwError AS DWORD
 reserved AS DWORD ' ULONG_PTR
 reserved2 AS DWORD ' ULONG_PTR
END TYPE
'#define RASPBDLGA struct tagRASPBDLGA
' // Size = 40 bytes
TYPE tagRASPBDLGA ' Must be 4 byte aligned
 dwSize AS DWORD
 hwndOwner AS DWORD
 dwFlags AS DWORD
 xDlg AS LONG
 yDlg AS LONG
 dwCallbackId AS DWORD ' ULONG_PTR
 pCallback AS DWORD ' RASPBDLGFUNCA
 dwError AS DWORD
 reserved AS DWORD ' ULONG_PTR
 reserved2 AS DWORD ' ULONG_PTR
END TYPE
#IF %DEF(%UNICODE)
 MACRO tagRASPBDLG = tagRASPBDLGW
#ELSE
 MACRO tagRASPBDLG = tagRASPBDLGA
#ENDIF
'/* RasEntryDlg API parameters.
'*/
%EQUATE `RASEDFLAG_PositionDlg = &H00000001
%EQUATE `RASEDFLAG_NewEntry = &H00000002
'#if (WINVER < 0x600)
%EQUATE `RASEDFLAG_CloneEntry = &H00000004
'#endif // (WINVER < 0x600)
%EQUATE `RASEDFLAG_NoRename = &H00000008
%EQUATE `RASEDFLAG_ShellOwned = &H40000000
%EQUATE `RASEDFLAG_NewPhoneEntry = &H00000010
%EQUATE `RASEDFLAG_NewTunnelEntry = &H00000020
'#if (WINVER < 0x600)
%EQUATE `RASEDFLAG_NewDirectEntry = &H00000040
'#endif // (WINVER < 0x600)
%EQUATE `RASEDFLAG_NewBroadbandEntry = &H00000080
%EQUATE `RASEDFLAG_InternetEntry = &H00000100
%EQUATE `RASEDFLAG_NAT = &H00000200
'#if (WINVER >= 0x600)
%EQUATE `RASEDFLAG_IncomingConnection = &H00000400
'#endif
'#define RASENTRYDLGW struct tagRASENTRYDLGW
' // Size = 548 bytes
TYPE tagRASENTRYDLGW ' Must be 4e byte aligned
 dwSize AS DWORD
 hwndOwner AS DWORD
 dwFlags AS DWORD
 xDlg AS LONG
 yDlg AS LONG
 szEntry AS WSTRINGZ * %RAS_MaxEntryName + 1 ' WCHAR[RAS_MaxEntryName + 1]
 dwError AS DWORD
 reserved AS DWORD ' ULONG_PTR
 reserved2 AS DWORD ' ULONG_PTR
 alignment__(1) AS BYTE
END TYPE
'#define RASENTRYDLGA struct tagRASENTRYDLGA
' // Size = 292 bytes
TYPE tagRASENTRYDLGA ' Must be 4 byte aligned
 dwSize AS DWORD
 hwndOwner AS DWORD
 dwFlags AS DWORD
 xDlg AS LONG
 yDlg AS LONG
 szEntry AS ASCIIZ * %RAS_MaxEntryName + 1 ' CHAR[RAS_MaxEntryName + 1]
 dwError AS DWORD
 reserved AS DWORD ' ULONG_PTR
 reserved2 AS DWORD ' ULONG_PTR
 alignment__(2) AS BYTE
END TYPE
#IF %DEF(%UNICODE)
 MACRO tagRASENTRYDLG = tagRASENTRYDLGW
#ELSE
 MACRO tagRASENTRYDLG = tagRASENTRYDLGA
#ENDIF
'/* RasDialDlg API parameters.
'*/
%EQUATE `RASDDFLAG_PositionDlg = &H00000001
%EQUATE `RASDDFLAG_NoPrompt = &H00000002
%EQUATE `RASDDFLAG_LinkFailure = &H80000000
'#define RASDIALDLG struct tagRASDIALDLG
' // Size = 36 bytes
TYPE tagRASDIALDLG ' Must be 4 byte aligned
 dwSize AS DWORD
 hwndOwner AS DWORD
 dwFlags AS DWORD
 xDlg AS LONG
 yDlg AS LONG
 dwSubEntry AS DWORD
 dwError AS DWORD
 reserved AS DWORD ' ULONG_PTR
 reserved2 AS DWORD ' ULONG_PTR
END TYPE
' --- RASMONITORDLG is not supported after Windows 2000 ------------------------------------
'/* RasMonitorDlg API parameters.
'*/
#IF %WINVER <= &H500
%EQUATE `RASMDPAGE_Status = 0
%EQUATE `RASMDPAGE_Summary = 1
%EQUATE `RASMDPAGE_Preferences = 2
%EQUATE `RASMDFLAG_PositionDlg = &H00000001
%EQUATE `RASMDFLAG_UpdateDefaults = &H80000000
'#define RASMONITORDLG struct tagRASMONITORDLG
' // Size = 36 bytes
TYPE tagRASMONITORDLG ' Must be 4 byte aligned
 dwSize AS DWORD
 hwndOwner AS DWORD
 dwFlags AS DWORD
 dwStartPage AS DWORD
 xDlg AS LONG
 yDlg AS LONG
 dwError AS DWORD
 reserved AS DWORD ' ULONG_PTR
 reserved2 AS DWORD ' ULONG_PTR
END TYPE
#ENDIF
' ------------------------------------------------------------------------------------------
#IF %WINVER >= &H500
'typedef BOOL (WINAPI *RasCustomDialDlgFn) (
' HINSTANCE hInstDll,
' DWORD dwFlags,
' LPWSTR lpszPhonebook,
' LPWSTR lpszEntry,
' LPWSTR lpszPhoneNumber,
' LPRASDIALDLG lpInfo,
' PVOID pvInfo
' );
'FUNCTION RasCustomDialDlgFn ( ' BYVAL hInstDll AS DWORD ' HINSTANCE hInstDll
' , BYVAL dwFlags AS DWORD ' DWORD dwFlags
' , BYREF lpszPhonebook AS WSTRINGZ ' LPWSTR lpszPhonebook
' , BYREF lpszEntry AS WSTRINGZ ' LPWSTR lpszEntry
' , BYREF lpszPhoneNumber AS WSTRINGZ ' LPWSTR lpszPhoneNumber
' , BYREF lpInfo AS tagRASDIALDLG ' LPRASDIALDLG lpInfo
' , BYVAL pvInfo AS DWORD ' PVOID pvInfo
' ) AS LONG
'END FUNCTION
'typedef BOOL (WINAPI *RasCustomEntryDlgFn) (
' HINSTANCE hInstDll,
' LPWSTR lpszPhonebook,
' LPWSTR lpszEntry,
' LPRASENTRYDLG lpInfo,
' DWORD dwFlags
' );
'FUNCTION RasCustomEntryDlgFn ( ' BYVAL hInstDll AS DWORD ' HINSTANCE hInstDll
' , BYREF lpszPhonebook AS WSTRINGZ ' LPWSTR lpszPhonebook
' , BYREF lpszEntry AS WSTRINGZ ' LPWSTR lpszEntry
' , BYREF lpInfo AS tagRASENTRYDLG ' LPRASENTRYDLG lpInfo
' , BYVAL dwFlags AS DWORD ' DWORD dwFlags
' ) AS LONG
'END FUNCTION
#ENDIF
'/* RAS common dialog API prototypes.
'*/
DECLARE FUNCTION RasPhonebookDlgA LIB "rasdlg.dll" ALIAS "RasPhonebookDlgA" ( BYREF lpszPhonebook AS ASCIIZ , BYREF lpszEntry AS ASCIIZ , BYREF lpInfo AS tagRASPBDLGA ) AS LONG
DECLARE FUNCTION RasPhonebookDlgW LIB "rasdlg.dll" ALIAS "RasPhonebookDlgW" ( BYREF lpszPhonebook AS WSTRINGZ
 , BYREF lpszEntry AS WSTRINGZ
 , BYREF lpInfo AS tagRASPBDLGW
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO RasPhonebookDlg = RasPhonebookDlgW
#ELSE
 MACRO RasPhonebookDlg = RasPhonebookDlgA
#ENDIF
DECLARE FUNCTION RasEntryDlgA LIB "rasdlg.dll" ALIAS "RasEntryDlgA" ( BYREF lpszPhonebook AS ASCIIZ , BYREF lpszEntry AS ASCIIZ , BYREF lpInfo AS tagRASENTRYDLGA ) AS LONG
DECLARE FUNCTION RasEntryDlgW LIB "rasdlg.dll" ALIAS "RasEntryDlgW" ( BYREF lpszPhonebook AS WSTRINGZ
 , BYREF lpszEntry AS WSTRINGZ
 , BYREF lpInfo AS tagRASENTRYDLGW
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO RasEntryDlg = RasEntryDlgW
#ELSE
 MACRO RasEntryDlg = RasEntryDlgA
#ENDIF
DECLARE FUNCTION RasDialDlgA LIB "rasdlg.dll" ALIAS "RasDialDlgA" ( BYREF lpszPhonebook AS ASCIIZ , BYREF lpszEntry AS ASCIIZ , BYREF lpszPhoneNumber AS ASCIIZ , BYREF lpInfo AS tagRASDIALDLG ) AS LONG
DECLARE FUNCTION RasDialDlgW LIB "rasdlg.dll" ALIAS "RasDialDlgW" ( BYREF lpszPhonebook AS WSTRINGZ
 , BYREF lpszEntry AS WSTRINGZ
 , BYREF lpszPhoneNumber AS WSTRINGZ
 , BYREF lpInfo AS tagRASDIALDLG
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO RasDialDlg = RasDialDlgW
#ELSE
 MACRO RasDialDlg = RasDialDlgA
#ENDIF
' // This function is not supported after Windows 2000.
#IF %WINVER <= &H500
DECLARE FUNCTION RasMonitorDlgA LIB "rasdlg.dll" ALIAS "RasMonitorDlgA" ( BYREF lpszDeviceName AS ASCIIZ , BYREF lpInfo AS tagRASMONITORDLG ) AS LONG
DECLARE FUNCTION RasMonitorDlgW LIB "rasdlg.dll" ALIAS "RasMonitorDlgW" ( BYREF lpszDeviceName AS WSTRINGZ
 , BYREF lpInfo AS tagRASMONITORDLG
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO RasMonitorDlg = RasMonitorDlgW
#ELSE
 MACRO RasMonitorDlg = RasMonitorDlgA
#ENDIF
#ENDIF
'#include <poppack.h>
#ENDIF
