//Copyright (c) 1998 - 1999 Microsoft Corporation
/*********************************************************************************************
*
*
* Module Name: 
*
*			CfgBkEnd.idl
*
* Abstract:
*			This is the IDL file for the CfgBkEnd Object.
* 
* Author:
*
* 
* Revision:  
*    
*
************************************************************************************************/

// This file will be processed by the MIDL tool to
// produce the type library (CfgBkEnd.tlb) and marshalling code.

struct _USERCONFIGW;
typedef struct _USERCONFIGW* PUSERCONFIG;

struct _ASYNCCONFIGW;
typedef struct _ASYNCCONFIGW* PASYNCCONFIG;

import "oaidl.idl";
import "ocidl.idl";

typedef PVOID PSECURITY_DESCRIPTOR;
typedef TCHAR * PWINSTATIONNAME;


import "idldefs.h";

cpp_quote("extern const CLSID CLSID_CfgComp;")
cpp_quote("#define CFGBKEND_ALREADY_INITIALIZED		          MAKE_HRESULT(SEVERITY_SUCCESS,FACILITY_ITF, 0xB020)")
cpp_quote("#define CFGBKEND_E_NOT_INITIALIZED                 MAKE_HRESULT(SEVERITY_ERROR,FACILITY_ITF, 0xB021)")
cpp_quote("#define CFGBKEND_EXTDELETE_FAILED                  MAKE_HRESULT(SEVERITY_SUCCESS, FACILITY_ITF, 0xB022)")
cpp_quote("#define CFGBKEND_ADAPTERENUM_FAILED				  MAKE_HRESULT(SEVERITY_SUCCESS,FACILITY_ITF,0xB023)")
cpp_quote("#define CFGBKEND_DEFAULT_SECURITY_UNKNOWN		  MAKE_HRESULT(SEVERITY_SUCCESS,FACILITY_ITF, 0xB024)")

cpp_quote("#define UPDATE_LANADAPTER                          0x00000001" )
cpp_quote("#define UPDATE_ENABLEWINSTATION                    0x00000002" )
cpp_quote("#define UPDATE_MAXINSTANCECOUNT                    0x00000004" )
cpp_quote("#define UPDATE_COMMENT                             0x00000008" )
cpp_quote("#define UPDATE_ALL                   UPDATE_LANADAPTER | UPDATE_ENABLEWINSTATION | UPDATE_MAXINSTANCECOUNT | UPDATE_COMMENT" )


	[
		object,
		local,
		uuid(BB0D7186-3C44-11D2-BB98-3078302C2030),
		helpstring("ICfgComp Interface"),
		pointer_default(unique)
		
	]
	interface ICfgComp : IUnknown
	{
		[helpstring("method GetSecurityDescriptor")] HRESULT GetSecurityDescriptor([in,string]PWINSTATIONNAME pWSName,[out] long * pSize,[out, size_is( , *pSize)]PSECURITY_DESCRIPTOR    *ppSecurityDescriptor);

		[helpstring("method SetSecurityDescriptor")] HRESULT SetSecurityDescriptor([in,string]PWINSTATIONNAME pWsName,[in] DWORD Size,[in,size_is(Size)]PSECURITY_DESCRIPTOR pSecurityDescriptor);

		[helpstring("method GetUserConfig")] HRESULT GetUserConfig([in,string]PWINSTATIONNAME pWsName, [out] long * pSize,[out, size_is( , *pSize)]PUSERCONFIG * ppUser, [in] BOOLEAN bPerformMerger);

		[helpstring("method GetEncryptionLevels")] HRESULT GetEncryptionLevels([in,string]WCHAR * pName, NameType Type,ULONG * pNumEncryptionLevels, Encryption ** ppEncryption);
		
        [helpstring("method Initialize")] HRESULT Initialize();
		
        [helpstring("method GetWinstationList")] HRESULT GetWinstationList([out]ULONG * NumWinstations,[out]ULONG * pSize,[out, size_is( , *pSize)]PWS * ppWS);
		
        [helpstring("method GetWdTypeList")] HRESULT GetWdTypeList([out]ULONG *pNumWd,[out]ULONG * pSize,[out, size_is( , *pSize)]WCHAR **ppData);
		
        [helpstring("method IsWSNameUnique")] HRESULT IsWSNameUnique([in,string]PWINSTATIONNAME pWSName,BOOL *pUnique);
		
        [helpstring("method GetTransportTypes")] HRESULT GetTransportTypes([in, string]WCHAR * Name, NameType Type,[out]ULONG *pNumPd,[out]ULONG * pSize,[out, size_is( , *pSize)]WCHAR **ppData);
		
        [helpstring("method GetLanAdapterList")] HRESULT GetLanAdapterList([in,string]WCHAR * pdName,[out]ULONG * pNumAdapters,[out]ULONG * pSize,[out, size_is( , *pSize)]WCHAR ** ppData);

		[helpstring("method GetLanAdapterList2")] HRESULT GetLanAdapterList2([in,string]WCHAR * pdName,[out]ULONG * pNumAdapters,[out]PGUIDTBL *);

		[helpstring("method BuildGuidTable")] HRESULT BuildGuidTable([in] PGUIDTBL * , [in] int , [ in ,string ]WCHAR * );
		
        [helpstring("method SetUserConfig")] HRESULT SetUserConfig([in,string]PWINSTATIONNAME pWsName, ULONG size, [in] PUSERCONFIG pUserConfig , [ out ] DWORD *);
		
        [helpstring("method EnableWinstation")] HRESULT EnableWinstation([in,string]PWINSTATIONNAME pWSName, BOOL fEnable);
		
        [helpstring("method RenameWinstation")] HRESULT RenameWinstation([in,string]PWINSTATIONNAME pOldWinstation,[in,string]PWINSTATIONNAME pNewWinstation);
		
        [helpstring("method IsSessionReadOnly")] HRESULT IsSessionReadOnly(BOOL * pReadOnly);
		
        [helpstring("method GetDefaultSecurityDescriptor")] HRESULT GetDefaultSecurityDescriptor([out]long * pSize,[out, size_is( , *pSize)]PSECURITY_DESCRIPTOR  *ppSecurityDescriptor);
		
        [helpstring("method UpDateWS")] HRESULT UpDateWS([in]PWS winstationInfo, DWORD Data , [ out ]DWORD *, [in] BOOLEAN bPerformMerger);
		
        [helpstring("method GetWSInfo")] HRESULT GetWSInfo(PWINSTATIONNAME pWSName,[out]long * pSize,[out, size_is( , *pSize)] WS** ppWS);
		
        [helpstring("method CreateNewWS")] HRESULT CreateNewWS(WS WinstationInfo,long UserCnfgSize, PUSERCONFIG pUserConfig,PASYNCCONFIG pAsyncConfig);
		
        [helpstring("method GetDefaultUserConfig")] HRESULT GetDefaultUserConfig([in, string]WCHAR * WdName,[out] long * pSize,[out, size_is( , *pSize)]PUSERCONFIG * ppUser);
		
        [helpstring("method IsNetWorkConnectionUnique")] HRESULT IsNetWorkConnectionUnique([in,string]WCHAR * WdName,[in, string]WCHAR * PdName, ULONG LanAdapter, BOOL * pUnique);

        [helpstring("method DeleteWS")] HRESULT DeleteWS([in, string]PWINSTATIONNAME pWs);

        [helpstring("method ForceUpdate")] HRESULT ForceUpdate( void );

        [helpstring("method Refresh")] HRESULT Refresh( void );

        [helpstring("method GetWdType")] HRESULT GetWdType( [ in ,string ]WCHAR * pWdName , [out]ULONG * pulType );

        [helpstring("method GetTransportType")] HRESULT GetTransportType( [ in , string ]WCHAR * , [ in , string ]WCHAR * , [ out ]DWORD * );

        [helpstring("method IsAsyncUnique")] HRESULT IsAsyncUnique( [in] WCHAR * , [in] WCHAR * , [out]BOOL * );

        [helpstring("method SetAsyncConfig")] HRESULT SetAsyncConfig( [ in ]WCHAR * , [in]NameType , [ in ]PASYNCCONFIG , [ out ]DWORD * );

        [helpstring("method GetAsyncConfig")] HRESULT GetAsyncConfig( [ in ]WCHAR * , [in]NameType , [ out ]PASYNCCONFIG );

        [helpstring("method GetDeviceList")] HRESULT GetDeviceList( [in]WCHAR * , [in]NameType , [out]ULONG * , [out]BYTE ** );

        [helpstring("method GetConnTypeName")] HRESULT GetConnTypeName( [in]int  , [out]WCHAR * );

        [helpstring("method GetHWReceiveName")] HRESULT GetHWReceiveName( [in]int ,  [out]WCHAR * );

        [helpstring("method GetHWTransmitName")] HRESULT GetHWTransmitName( [in]int , [out]WCHAR * );

        [helpstring("method GetModemCallbackString")] HRESULT GetModemCallbackString( [in]int , [out]WCHAR * );
        
        [helpstring("method GetCaps")] HRESULT GetCaps( [ in ]WCHAR * , [ out ]ULONG * );

        [helpstring("method QueryLoggedOnCount")] HRESULT QueryLoggedOnCount( [ in ] WCHAR * , [ out ]LONG * );

        // [helpstring("method GetNumofWinStations")] HRESULT GetNumofWinStations( [ out ]ULONG * );

        [helpstring("method GetNumofWinStations")] HRESULT GetNumofWinStations([ in ] WCHAR * WdName,[in] WCHAR * PdName,[ out ]ULONG * );

        [helpstring("method IsAsyncDeviceAvailable")] BOOL IsAsyncDeviceAvailable(LPCTSTR pDeviceName);

        [helpstring("method GetWdKey")] HRESULT GetWdKey( [ in ] WCHAR * , [ out , string ] WCHAR * );

        [helpstring("method UpdateSessionDirectory" )] HRESULT UpdateSessionDirectory( [ out ]DWORD * );

        [helpstring("method GetColorDepth")] HRESULT GetColorDepth( [ in , string ]PWINSTATIONNAME, [out] BOOL*, [out] DWORD * );
        [helpstring("method SetColorDepth")] HRESULT SetColorDepth( [ in , string ]PWINSTATIONNAME , [in] BOOL, [out] DWORD * );

        [helpstring("method GetKeepAliveTimeout")] HRESULT GetKeepAliveTimeout( [ in , string ]PWINSTATIONNAME, [out] BOOL*, [out] DWORD * );
        [helpstring("method SetKeepAliveTimeout")] HRESULT SetKeepAliveTimeout( [ in , string ]PWINSTATIONNAME , [in] BOOL, [out] DWORD * );				

	};

	[
		object,
		local,
		uuid(6E92F337-AF3E-11d2-A39B-00C04FB90546),
		helpstring("ISettingsComp Interface"),
		pointer_default(unique)
		
	]
	interface ISettingsComp : IUnknown
	{

        // [helpstring("method GetCachedSessions")] HRESULT GetCachedSessions(DWORD * pCachedSessions);
        // [helpstring("method SetCachedSessions")] HRESULT SetCachedSessions(DWORD dCachedSessions);
        [helpstring("method GetDelDirsOnExit")] HRESULT GetDelDirsOnExit(BOOL * pDelDirsOnExit);
        [helpstring("method SetDelDirsOnExit")] HRESULT SetDelDirsOnExit(BOOL bDelDirsOnExit);
        [helpstring("method GetUseTempDirPerSession")] HRESULT GetUseTempDirPerSession(BOOL *  pbTempDir);
        [helpstring("method SetUseTempDirPerSession")] HRESULT SetUseTempDirPerSession(BOOL bTempDirPerSession);
        [helpstring("method GetInternetConLic")] HRESULT GetInternetConLic( BOOL * pbInternetConLic , DWORD * );
        [helpstring("method SetInternetConLic")] HRESULT SetInternetConLic( BOOL bInternetConLic , DWORD * );
        // [helpstring("method GetDefaultSecurity")] HRESULT GetDefaultSecurity(ULONG * pDefaultSecurity);
        // [helpstring("method SetDefaultSecurity")] HRESULT SetDefaultSecurity(ULONG Offset);
        [helpstring("method SetActiveDesktopState")] HRESULT SetActiveDesktopState( [in] BOOL , [out] DWORD * );
        [helpstring("method GetActiveDesktopState")] HRESULT GetActiveDesktopState( [out] BOOL * , [out] DWORD * );
        [helpstring("method GetTermSrvMode")] HRESULT GetTermSrvMode( [out] DWORD * , [out] DWORD * );
        [helpstring("method GetUserPerm")] HRESULT GetUserPerm( [out] BOOL * , [out] DWORD * );
        [helpstring("method SetUserPerm")] HRESULT SetUserPerm( [in] BOOL , [out] DWORD * );

        [helpstring("method GetSalemHelpMode")] HRESULT GetSalemHelpMode( [out] BOOL*, [out] DWORD * );
        [helpstring("method SetSalemHelpMode")] HRESULT SetSalemHelpMode( [in] BOOL, [out] DWORD * );

        [helpstring("method GetDenyTSConnections")] HRESULT GetDenyTSConnections( [out] BOOL* , [out] DWORD* );
        [helpstring("method SetDenyTSConnections")] HRESULT SetDenyTSConnections( [in] BOOL , [out] DWORD* );

        [helpstring("method GetSingleSessionState")] HRESULT GetSingleSessionState(  [out] BOOL*, [out] DWORD * );
        [helpstring("method SetSingleSessionState")] HRESULT SetSingleSessionState(  [in] BOOL, [out] DWORD * );

        [helpstring("method GetProfilePath")] HRESULT GetProfilePath( [ out, string ]BSTR*,  [out] DWORD * );
        [helpstring("method SetProfilePath")] HRESULT SetProfilePath( [ in , string ]BSTR ,  [out] DWORD * );

        [helpstring("method GetHomeDir")] HRESULT GetHomeDir( [ out, string ]BSTR*,  [out] DWORD * );
        [helpstring("method SetHomeDir")] HRESULT SetHomeDir( [ in , string ]BSTR ,  [out] DWORD * );
		
	[helpstring("method GetLicensingMode")] HRESULT GetLicensingMode( ULONG * pulMode , DWORD * );
	[helpstring("method SetLicensingMode")] HRESULT SetLicensingMode( ULONG ulMode , DWORD *, DWORD * );

	[helpstring("method GetLicensingModeInfo")] HRESULT GetLicensingModeInfo( [in] ULONG ulMode , [out, string] WCHAR **pwszName, [out, string] WCHAR **pwszDescription, [out] DWORD * );

	[helpstring("method GetLicensingModeList")] HRESULT GetLicensingModeList( [out] ULONG *pcModes, [out, size_is( , *pcModes)] ULONG **prgulModes, [out] DWORD * );

    };

	[
		object,
		local,
		uuid(1c07e443-150e-4829-986a-a14e21dd50e5),
		helpstring("IUserSecurity Interface"),
		pointer_default(unique)
		
	]
	interface IUserSecurity : IUnknown
	{
	    [ helpstring( "method ModifyUserAccess" ) ] HRESULT ModifyUserAccess( [in] WCHAR * ,
                                                                                  [in] WCHAR *pwszAccountName ,
                                                                                  [in] DWORD dwMask ,
                                                                                  [in] BOOL fDel,
                                                                                  [in] BOOL fAllow ,
                                                                                  [in] BOOL ,
                                                                                  [in] BOOL ,
                                                                                  [out]DWORD *pdwStatus );

		[ helpstring( "method GetUserPermList" ) ] HRESULT GetUserPermList( [in] WCHAR *pwszWinstaName ,
                                                                                    [out]DWORD *pcbItems ,
                                                                                    [out]PUSERPERMLIST *ppUserPermList ,
                                                                                    [in] BOOL fAudit );

	    [ helpstring( "method ModifyDefaultSecurity" ) ] 
		HRESULT ModifyDefaultSecurity([in] WCHAR * ,
                                      [in] WCHAR *pwszAccountName ,
                                      [in] DWORD dwMask ,
                                      [in] BOOL fDel,
                                      [in] BOOL fAllow ,
                                      [in] BOOL ,
                                      [out]DWORD *pdwStatus );

	};


	[
		uuid(BB0D7187-3C44-11D2-BB98-3078302C2030),
		helpstring("CfgComp Class")
	]
	coclass CfgComp
	{
            [default] interface ICfgComp;
                      interface ISettingsComp;
                      interface IUserSecurity;
	};
/*
	[
	uuid(BB0D7179-3C44-11D2-BB98-3078302C2030),
	version(1.0),
	helpstring("CfgBkEnd 1.0 Type Library")
	]
library CFGBKENDLib
{
	importlib("stdole2.tlb");

	[
		uuid(BB0D7187-3C44-11D2-BB98-3078302C2030),
		helpstring("CfgComp Class")
	]
	coclass CfgComp
	{
		[default] interface ICfgComp;
	}; 
};*/