' ########################################################################################
' Microsoft Windows
' File: DSAdmin.inc
' Contents: DS Admin Object Creation public header
' 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_DSAdmin_PBI)
#DEFINE PBX_DSAdmin_PBI
%EQUATE `DSADMIN_INC = 1
#INCLUDE ONCE "Legacy/System/Iads.inc"
'//
'// CoClass for the Object creation dialog object
'//
$CLSID_DsAdminCreateObj = GUID$("{E301A009-F901-11D2-82B9-00C04F68928B}")
'//
'// Interface GUIDs
'//
$IID_IDsAdminCreateObj = GUID$("{53554A38-F902-11D2-82B9-00C04F68928B}")
$IID_IDsAdminNewObj = GUID$("{F2573587-E6FC-11D2-82AF-00C04F68928B}")
$IID_IDsAdminNewObjPrimarySite = GUID$("{BE2B487E-F904-11D2-82B9-00C04F68928B}")
$IID_IDsAdminNewObjExt = GUID$("{6088EAE2-E7BF-11D2-82AF-00C04F68928B}")
$IID_IDsAdminNotifyHandler = GUID$("{E4A2B8B3-5A18-11D2-97C1-00A0C9A06D2D}")
' ########################################################################################
' Interface name = IDsAdminCreateObj
' IID = 53554A38-F902-11D2-82B9-00C04F68928B
' Inherited interface = IUnknown
' Implemented by the object (implemented by the system) CLSID_DsAdminCreateObj
' Used by: any client needing to invoke the creation UI
' ########################################################################################
INTERFACE IDsAdminCreateObj $IID_IDsAdminCreateObj
 INHERIT IUnknown
 ' =====================================================================================
 METHOD Initialize ( ' VTable offset = 12
 BYVAL pADsContainerObj AS IADsContainer
 , BYVAL pADsCopySource AS IADs
 , BYREF lpszClassName AS WSTRINGZ
 ) AS LONG
 ' =====================================================================================
 METHOD CreateModal ( ' VTable offset = 16
 BYVAL hwndParent AS DWORD
 , BYREF ppADsObj AS IADs
 ) AS LONG
 ' =====================================================================================
END INTERFACE
' ########################################################################################
' Interface name = IDsAdminNewObj
' IID = F2573587-E6FC-11D2-82AF-00C04F68928B
' Inherited interface = IUnknown
' Implemented by: DS Admin
' Used by: creation extension in proc server (both primary and regular)
' ########################################################################################
INTERFACE IDsAdminNewObj $IID_IDsAdminNewObj
 INHERIT IUnknown
 ' =====================================================================================
 METHOD SetButtons ( ' VTable offset = 12
 BYVAL nCurrIndex AS DWORD
 , BYVAL bValid AS LONG
 ) AS LONG
 ' =====================================================================================
 METHOD GetPageCounts ( ' VTable offset = 16
 BYREF pnTotal AS LONG
 , BYREF pnStartIndex AS LONG
 ) AS LONG
 ' =====================================================================================
END INTERFACE
' ########################################################################################
' Interface name = IDsAdminNewObjPrimarySite
' IID = BE2B487E-F904-11D2-82B9-00C04F68928B
' Inherited interface = IUnknown
' Implemented by: DS Admin
' Used by: creation extension in proc server (primary only)
' ########################################################################################
INTERFACE IDsAdminNewObjPrimarySite $IID_IDsAdminNewObjPrimarySite
 INHERIT IUnknown
 ' =====================================================================================
 METHOD CreateNew ( ' VTable offset = 12
 BYREF pszName AS WSTRINGZ
 ) AS LONG
 ' =====================================================================================
 METHOD Commit ( ' VTable offset = 16
 ) AS LONG
 ' =====================================================================================
END INTERFACE
'//
'// struct passed to IDsAdminNewObjExt::Initialize()
'//
'// it contains information regarding UI look
'//
' // Size = 16 bytes
TYPE DSA_NEWOBJ_DISPINFO DWORD
 dwSize AS DWORD ' DWORD // size of struct, for versioning
 hObjClassIcon AS DWORD ' HICON // class icon for the object to be created
 lpszWizTitle AS WSTRINGZ PTR ' LPWSTR // title of the wizard
 lpszContDisplayName AS WSTRINGZ PTR ' LPWSTR // container display name (canonical name)
END TYPE
'//
'// context flags passed to IDsAdminNewObjExt::OnError() and to IDsAdminNewObjExt::WriteData()
'//
%EQUATE `DSA_NEWOBJ_CTX_PRECOMMIT = &H00000001 ' // before SetInfo()
%EQUATE `DSA_NEWOBJ_CTX_COMMIT = &H00000002 ' // SetInfo(), commit phase
%EQUATE `DSA_NEWOBJ_CTX_POSTCOMMIT = &H00000003 ' // after SetInfo()
%EQUATE `DSA_NEWOBJ_CTX_CLEANUP = &H00000004 ' // on post commit fail
' ########################################################################################
' Interface name = IDsAdminNewObjExt
' IID = 6088EAE2-E7BF-11D2-82AF-00C04F68928B
' Inherited interface = IUnknown
' Implemented by: creation extension in proc server (both primary and regular)
' Used by: DS Admin
' ########################################################################################
INTERFACE IDsAdminNewObjExt $IID_IDsAdminNewObjExt
 INHERIT IUnknown
 ' =====================================================================================
 METHOD Initialize ( ' VTable offset = 12
 BYVAL pADsContainerObj AS IADsContainer
 , BYVAL pADsCopySource AS IADs
 , BYREF lpszClassName AS WSTRINGZ
 , BYVAL pDsAdminNewObj AS IDsAdminNewObj
 , BYREF pDispInfo AS DSA_NEWOBJ_DISPINFO
 ) AS LONG
 ' =====================================================================================
 METHOD AddPages ( ' VTable offset = 16
 BYVAL lpfnAddPage AS DWORD
 , BYVAL lParam AS LONG
 ) AS LONG
 ' =====================================================================================
 METHOD SetObject ( ' VTable offset = 20
 BYVAL pADsObj AS IADs
 ) AS LONG
 ' =====================================================================================
 METHOD WriteData ( ' VTable offset = 24
 BYVAL hWnd AS DWORD
 , BYVAL uContext AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD OnError ( ' VTable offset = 28
 BYVAL hWnd AS DWORD
 , BYVAL hr AS LONG
 , BYVAL uContext AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetSummaryInfo ( ' VTable offset = 32
 BYREF pBstrText AS WSTRING
 ) AS LONG
 ' =====================================================================================
END INTERFACE
'//
'// Notification opcodes for IDsAdminNotifyHandler
'//
%EQUATE `DSA_NOTIFY_DEL = &H00000001 ' // delete
%EQUATE `DSA_NOTIFY_REN = &H00000002 ' // rename
%EQUATE `DSA_NOTIFY_MOV = &H00000004 ' // move
%EQUATE `DSA_NOTIFY_PROP = &H00000008 ' // property change
%EQUATE `DSA_NOTIFY_ALL = (%DSA_NOTIFY_DEL OR %DSA_NOTIFY_REN OR %DSA_NOTIFY_MOV OR %DSA_NOTIFY_PROP)
'//
'// TODO: add explaination
'//
'// flags to handle additional data
'//
%EQUATE `DSA_NOTIFY_FLAG_ADDITIONAL_DATA = &H00000002 ' // process additional extension data?
%EQUATE `DSA_NOTIFY_FLAG_FORCE_ADDITIONAL_DATA = &H00000001 ' // operation forced
' ########################################################################################
' Interface name = IDsAdminNotifyHandler
' IID = E4A2B8B3-5A18-11D2-97C1-00A0C9A06D2D
' Inherited interface = IUnknown
' Implemented by: notification handler in proc server
' Used by: DS Admin
' ########################################################################################
INTERFACE IDsAdminNotifyHandler $IID_IDsAdminNotifyHandler
 INHERIT IUnknown
 ' =====================================================================================
 METHOD Initialize ( ' VTable offset = 12
 BYVAL pExtraInfo AS IDataObject
 , BYREF puEventFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD Begin ( ' VTable offset = 16
 BYVAL uEvent AS DWORD
 , BYVAL pArg1 AS IDataObject
 , BYVAL pArg2 AS IDataObject
 , BYREF puFlags AS DWORD
 , BYREF pBstr AS WSTRING
 ) AS LONG
 ' =====================================================================================
 METHOD Notify ( ' VTable offset = 20
 BYVAL nItem AS DWORD
 , BYVAL uFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD End ( ' VTable offset = 24
 ) AS LONG
 ' =====================================================================================
END INTERFACE
#ENDIF
