1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-27 22:50:26 +03:00

r1838: Updates from the airplane:

- IDL fixes + adding comments
 - Start working on dcom infrastructure
(This used to be commit ef0fc269f06c82594c34ad8673c76c5ea099250e)
This commit is contained in:
Jelmer Vernooij 2004-08-16 19:03:22 +00:00 committed by Gerald (Jerry) Carter
parent d3e7a22630
commit d3e8a74551
37 changed files with 203 additions and 132 deletions

View File

@ -1,75 +0,0 @@
- Bind to IOXIDResolver
- ServerAlive2()
- Bind to ISystemActivator
with dcom, there is a new attribute for interfaces, 'object'. these
object-oriented interfaces support inheritance. Everything that has the
attribute 'object' has ([in] ORPCTHIS *this, [out] ORPCTHAT *that) as first
arguments.
OXID = Object Exporter ID
Everything based on IDispatch implements:
/*****************/
/* Function 0x00 */
HRESULT QueryInterface(
[in] ORPCTHIS *this,
[out] ORPCTHAT *that,
[in] IID *riid,
[out] /* [iid_is] */ void **ppvObject);
/*****************/
/* Function 0x01 */
ULONG AddRef (
[in] ORPCTHIS *this,
[out] ORPCTHAT *that
);
/*****************/
/* Function 0x02 */
ULONG Release(
[in] ORPCTHIS *this,
[out] ORPCTHAT *that
);
/*****************/
/* Function 0x03 */
HRESULT GetTypeInfoCount(
[in] ORPCTHIS *this,
[out] ORPCTHAT *that,
[out] UINT *pctinfo);
/*****************/
/* Function 0x04 */
HRESULT GetTypeInfo (
[in] ORPCTHIS *this,
[out] ORPCTHAT *that,
[in] UINT iTInfo,
[in] LCID lcid,
[out] ITypeInfo **ppTInfo);
/*****************/
/* Function 0x05 */
HRESULT GetIDsOfNames(
[in] ORPCTHIS *this,
[out] ORPCTHAT *that,
[in] IID *riid,
[size_is][in] LPOLESTR *rgszNames,
[in] UINT cNames,
[in] LCID lcid,
[size_is][out] DISPID *rgDispId);
/*****************/
/* Function 0x06 */
HRESULT Invoke(
[in] ORPCTHIS *this,
[out] ORPCTHAT *that,
[in] DISPID dispIdMember,
[in] IID *riid,
[in] LCID lcid,
[in] WORD wFlags,
[out][in] DISPPARAMS *pDispParams,
[out] VARIANT *pVarResult,
[out] EXCEPINFO *pExcepInfo,
[out] UINT *puArgErr);

View File

@ -1916,13 +1916,13 @@ sub parse_idl($$)
if($e->{TYPE} eq "FUNCTION") {
unshift(@{$e->{DATA}},
{ 'NAME' => 'ORPCthis',
'POINTERS' => 1,
'POINTERS' => 0,
'PROPERTIES' => { 'in' => '1' },
'TYPE' => 'ORPCTHIS'
});
unshift(@{$e->{DATA}},
{ 'NAME' => 'ORPCthat',
'POINTERS' => 1,
'POINTERS' => 0,
'PROPERTIES' => { 'out' => '1' },
'TYPE' => 'ORPCTHAT'
});

View File

@ -322,13 +322,13 @@ sub parse_idl($$)
if($e->{TYPE} eq "FUNCTION") {
unshift(@{$e->{DATA}},
{ 'NAME' => 'ORPCthis',
'POINTERS' => 1,
'POINTERS' => 0,
'PROPERTIES' => { 'in' => '1' },
'TYPE' => 'ORPCTHIS'
});
unshift(@{$e->{DATA}},
{ 'NAME' => 'ORPCthat',
'POINTERS' => 1,
'POINTERS' => 0,
'PROPERTIES' => { 'out' => '1' },
'TYPE' => 'ORPCTHAT'
});

View File

@ -0,0 +1 @@
SMB_SUBSYSTEM_MK(LIBDCOM,lib/dcom/config.mk)

View File

@ -0,0 +1,8 @@
################################################
# Start SUBSYSTEM LIBDCOM
[SUBSYSTEM::LIBDCOM]
INIT_OBJ_FILES = \
lib/dcom/main.o
#
# End SUBSYSTEM LIBDCOM
################################################

65
source4/lib/dcom/main.c Normal file
View File

@ -0,0 +1,65 @@
/*
Unix SMB/CIFS implementation.
Main DCOM functionality
Copyright (C) 2004 Jelmer Vernooij <jelmer@samba.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "includes.h"
void CoInitializeEx(void *reserved, uint32 thread_options)
{
/* FIXME */
}
void CoInitialize(void *reserved)
{
CoInitializeEx(reserved, 0);
}
void CoUnitialize(void)
{
/* FIXME */
}
void CoRegisterClassObject(void)
{
/* FIXME */
}
void CoUnregisterClassObject(void)
{
/* FIXME */
}
void CoCreateInstanceEx(struct GUID *clsid, void *iface, uint32 context, struct COSERVERINFO *pcsi, uint32 num, struct MULTI_QI *results)
{
/* FIXME: Connect to remote server and :*/
/* FIXME: Call RemoteActivation() */
/* FIXME: Call ServerAlive() on IOXIDResolver */
}
void CoCreateInstance(void)
{
CoCreateInstanceEx(/*FIXME*/);
}
void CoRegisterClassObject(void)
{
/* FIXME */
}

View File

@ -0,0 +1,8 @@
Required infrastructure:
- CoCreateInstance function
- Proxy and Stub (class ?)
- Bind to IOXIDResolver
- ServerAlive2()
- Bind to ISystemActivator

View File

@ -6,7 +6,8 @@
[ uuid(1ff70682-0a51-30e8-076d-740be8cee98b),
version(1.0),
pointer_default(unique)
pointer_default(unique),
helpstring("Queue/List/Remove jobs for later execution")
] interface atsvc
{
typedef struct {

View File

@ -1,6 +1,7 @@
[
uuid(0a74ef1c-41a4-4e06-83ae-dc74fb1cdd53),
version(1.0)
version(1.0),
helpstring("Audio Server")
] interface audiosrv
{
void audiosrv_CreatezoneFactoriesList();

View File

@ -1,6 +1,7 @@
[
uuid(6bffd098-a112-3610-9833-012892020162),
version(0.0)
version(0.0),
helpstring("Browsing")
]
interface browser
{

View File

@ -1,6 +1,7 @@
[
uuid(1d55b526-c137-46c5-ab79-638f2a68e869),
version(1.0)
version(1.0),
helpstring("Remote IDL debugger")
] interface dbgidl
{
void dummy_dbgidl();

View File

@ -11,7 +11,7 @@
[
uuid(18f70770-8e64-11cf-9af1-0020af6e72f4),
version(0.0)
] interface dcom_Uknown
] interface dcom_Unknown
{
void dcomu_UseProtSeq();
void dcomu_GetCustomProtseqInfo();
@ -88,6 +88,16 @@ interface ObjectRpcBaseTypes
uint16 MinorVersion; // Minor version number
} COMVERSION;
typedef [public] struct
{
uint32 reserved1;
uint32 reserved2;
} COSERVERINFO;
typedef [public] struct
{
uint32 FIXME;
} MULTI_QI;
// enumeration of additional information present in the call packet.
// Should be an enum but DCE IDL does not support sparse enumerators.
@ -258,12 +268,15 @@ interface ObjectRpcBaseTypes
[
object,
uuid(00000000-0000-0000-C000-000000000046)
uuid(00000000-0000-0000-C000-000000000046),
helpstring("Base interface for most COM interfaces")
]
interface IUnknown
{
/*****************/
/* Function 0x00 */
/* Returns the interface with the specified IID
if implemented by this object */
HRESULT QueryInterface([in] IID *riid
/*FIXME, [out] void **data*/);
@ -294,7 +307,7 @@ interface IUnknown
//////////////////////////////////////////////////////////////////
// The remote version of Iunknown. This interface exists on every
// The remote version of IUnknown. This interface exists on every
// OXID (whether an OXID represents either a thread or a process is
// implementation specific). It is used by clients to query for new
// interfaces, get additional references (for marshaling), and release
@ -304,7 +317,8 @@ interface IUnknown
[
uuid(00000131-0000-0000-C000-000000000046),
object,
version(0.0)
version(0.0),
helpstring("Remote version of IUnknown")
]
interface IRemUnknown : IUnknown
{
@ -349,9 +363,9 @@ interface IRemUnknown : IUnknown
// for objects that supply additional data beyond the STDOBJREF in their
// marshaled interface packets.
[
object,
uuid(00000143-0000-0000-C000-000000000046),
version(0.0)
object,
uuid(00000143-0000-0000-C000-000000000046),
version(0.0)
]
interface IRemUnknown2 : IRemUnknown
@ -365,7 +379,9 @@ interface IRemUnknown2 : IRemUnknown
);
}
[ uuid(99fcfec4-5260-101b-bbcb-00aa0021347a),
[
uuid(99fcfec4-5260-101b-bbcb-00aa0021347a),
helpstring("Object Exporter ID Resolver"),
pointer_default(unique)
]
interface IOXIDResolver
@ -378,7 +394,6 @@ interface IOXIDResolver
} ppdsaOxidBindingsArray;
[idempotent] WERROR ResolveOxid (
[in,ref] policy_handle *hRpc,
[in] OXID *pOxid,
[in] uint16 cRequestedProtseqs,
[in, size_is(cRequestedProtseqs)] uint16 arRequestedProtseqs[],
@ -393,7 +408,6 @@ interface IOXIDResolver
// Returns S_TRUE if the SetId is known by the object exporter,
// S_FALSE if not.
[idempotent] WERROR SimplePing (
[in,ref] policy_handle *hRpc,
[in] SETID *pSetId // Must not be zero
);
@ -401,7 +415,6 @@ interface IOXIDResolver
// whole set can subsequently be pinged using SimplePing,
// thus reducing network traffic.
[idempotent] WERROR ComplexPing (
[in,ref] policy_handle *hRpc,
[in, out] SETID *pSetId, // In of 0 on first call for new set.
[in] uint16 SequenceNum,
[in] uint16 cAddToSet,
@ -417,15 +430,13 @@ interface IOXIDResolver
// bindings have more then one TCP/IP binding) This call
// can be used to validate the binding
// from the client.
[idempotent] WERROR ServerAlive (
[in,ref] policy_handle *hRpc
);
[idempotent] WERROR ServerAlive ();
// Method to get the protocol sequences, string bindings,
// RemoteUnknown IPID and COM version for an object server
// given its OXID. Supported by DCOM
// version 5.2 and above.
[idempotent] WERROR ResolveOxid2 (
[in,ref] policy_handle *hRpc,
[in] OXID *pOxid,
[in] uint16 cRequestedProtseqs,
[in, size_is(cRequestedProtseqs)]
@ -445,8 +456,9 @@ interface IOXIDResolver
}
[
uuid(4d9f4ab8-7d1c-11cf-861e-0020af6e7c57),
uuid(4d9f4ab8-7d1c-11cf-861e-0020af6e7c57),
version(0.0),
object,
pointer_default(unique)
]
interface IRemoteActivation
@ -459,24 +471,29 @@ interface IRemoteActivation
DUALSTRINGARRAY *dualstringarray;
} REF_DUALSTRINGARRAY;
typedef struct {
/* Looks very much like a protocol tower to me, but it appears
to be aligned differently then it is in epmapper -jelmer
*/
uint8 FIXME[12];
} floor_tmp;
const uint32 MODE_GET_CLASS_OBJECT = 0xffffffff;
HRESULT RemoteActivation (
[in] ORPCTHIS ORPCthis,
[out] ORPCTHAT ORPCthat,
[in] GUID Clsid,
[in, unique] unistr *pwszObjectName,
[in, unique] MInterfacePointer *pObjectStorage,
[in] uint32 ClientImpLevel,
[in] uint32 Mode,
[in] uint32 Interfaces,
[in,unique,size_is(Interfaces)] IID *pIIDs,
[in] uint16 cRequestedProtseqs,
[in, size_is(cRequestedProtseqs)] uint16 RequestedProtseqs[],
[in, unique,size_is(Interfaces)] IID *pIIDs,
[in] uint16 num_protseqs,
[in, size_is(num_protseqs)] floor_tmp protseq[],
[out] OXID pOxid,
[out] DUALSTRINGARRAY *pdsaOxidBindings,
[out] IPID ipidRemUnknown,
[out] uint32 *pAuthnHint,
[out] COMVERSION *pServerVersion,
[out] uint32 pAuthnHint,
[out] COMVERSION pServerVersion,
[out] HRESULT *phr,
[out,size_is(Interfaces)] ppInterfaceDataArray *ppInterfaceData,
[out,size_is(Interfaces)] HRESULT *pResults

View File

@ -6,7 +6,8 @@
[ uuid(4fc742e0-4a10-11cf-8273-00aa004ae673),
version(3.0),
pointer_default(unique)
pointer_default(unique),
helpstring("Settings for Microsoft Distributed File System")
] interface netdfs
{
/******************/

View File

@ -1,6 +1,7 @@
[
uuid(ecec0d70-a603-11d0-96b1-00a0c91ece30),
version(1.0)
version(1.0),
helpstring("Backup support for Active Directory")
] interface ad_backup
{
void HrRBackupPrepare();
@ -16,7 +17,8 @@
[
uuid(16e0cf3a-a604-11d0-96b1-00a0c91ece30),
version(1.0)
version(1.0),
helpstring("Restoring Active Directory backups")
] interface ad_restore
{
void HrRIsNTDSOnline();

View File

@ -1,6 +1,7 @@
[
uuid(3919286a-b10c-11d0-9ba8-00c04fd92ef5),
version(0.0)
version(0.0),
helpstring("Active Directory Setup")
] interface dssetup
{
void DsRolerGetPrimaryDomainInformation();

View File

@ -4,7 +4,8 @@
[
uuid(60a15ec5-4de8-11d7-a637-005056a20182),
endpoints(rpcecho, TCP-0),
version(1.0)
version(1.0),
helpstring("Simple echo pipe")
]
interface rpcecho
{

View File

@ -1,6 +1,7 @@
[
uuid(c681d488-d850-11d0-8c52-00c04fd90f7e),
version(1.0)
version(1.0),
helpstring("Encrypted File System")
] interface efs
{
void EFS_Dummy();

View File

@ -5,7 +5,8 @@
*/
[ uuid(82273fdc-e32a-18c3-3f78-827929dc23ea),
version(0.0),
pointer_default(unique)
pointer_default(unique),
helpstring("Event Logger")
] interface eventlog
{
typedef struct {

View File

@ -6,7 +6,8 @@
/* Also seen as: 0d72a7d4-6148-11d1-b4aa-00c04fb66ea0 */
[
uuid(8d0ffe72-d252-11d0-bf8f-00c04fd9126b),
version(1.0)
version(1.0),
helpstring("Cryptographic Key Services")
]
interface keysvc
{

View File

@ -7,7 +7,8 @@
[ uuid(12345778-1234-abcd-ef00-0123456789ab),
version(0.0),
endpoints(lsarpc,lsass,TCP-0),
pointer_default(unique)
pointer_default(unique),
helpstring("Local Server Authentication(?)")
] interface lsarpc
{
/******************/

View File

@ -4,10 +4,10 @@
dcerpc remote management interface
*/
[
uuid(afa8bd80-7d8a-11c9-bef4-08002b102989),
version(1)
version(1.0),
helpstring("DCE/RPC Remote Management")
]
interface mgmt
{

View File

@ -1,6 +1,9 @@
/* Works over UDP */
[
uuid(17fdd703-1827-4e34-79d4-24a55c53bb37),
version(1.0)
version(1.0),
helpstring("Messaging Service")
] interface msgsvc
{
void NetrMessageNameAdd();

View File

@ -4,7 +4,8 @@
[
uuid(8d9f4e40-a03d-11ce-8f69-08003e30051b),
version(1.0)
version(1.0),
helpstring("Plug and Play services")
]
interface ntsvcs
{

View File

@ -2,7 +2,8 @@
/* IPSec policy agent (Win2k) */
[
uuid(d335b8f6-cb31-11d0-b0f9-006097ba4e54),
version(1.5)
version(1.5),
helpstring("IPSec Policy Agent")
] interface policyagent
{
/*****************/

View File

@ -4,7 +4,8 @@
[
uuid(93149ca2-973b-11d1-8c39-00c04fb984f9),
version(0.0)
version(0.0),
helpstring("Security Configuration Editor")
]
interface scerpc
{

View File

@ -7,7 +7,8 @@
[ uuid(12345678-1234-abcd-ef00-0123456789ab),
version(1.0),
endpoints(spoolss),
pointer_default(unique)
pointer_default(unique),
helpstring("Spooler SubSystem")
] interface spoolss
{
typedef struct {

View File

@ -6,7 +6,8 @@
[ uuid(4b324fc8-1670-01d3-1278-5a47bf6ee188),
version(3.0),
pointer_default(unique)
pointer_default(unique),
helpstring("Server Service")
] interface srvsvc
{
/**************************/

View File

@ -6,7 +6,8 @@
[ uuid(367abb81-9844-35f1-ad32-98f038001003),
version(2.0),
pointer_default(unique)
pointer_default(unique),
helpstring("Service Control")
] interface svcctl
{
typedef struct {

View File

@ -4,7 +4,8 @@
[
uuid(300f3532-38cc-11d0-a3f0-0020af6b0add),
version(1.2)
version(1.2),
helpstring("Distributed Key Tracking Service")
]
interface trkwks
{

View File

@ -5,7 +5,8 @@
[
uuid(8fb6d884-2388-11d0-8c35-00c04fda2795),
endpoints(srvsvc,atsvc,browser,keysvc,wkssvc),
version(4.1)
version(4.1),
helpstring("Win32 Time Server")
]
interface w32time
{

View File

@ -7,7 +7,8 @@
[ uuid(338cd001-2244-31f1-aaaa-900038001003),
version(1.0),
endpoints(winreg,TCP-0),
pointer_default(unique)
pointer_default(unique),
helpstring("Remote Registry Service")
] interface winreg
{
typedef struct {
@ -215,8 +216,13 @@
WERROR winreg_QueryValue(
[in,ref] policy_handle *handle,
[in] winreg_String valuename,
[out,ref] uint32 *type,
[in] uint32 *reserved,
[in] uint32 *offered,
[in] uint32 *unknown1,
[in] uint32 *unknown2,
[out] uint32 *type,
[out] uint8 *data,
[in,out] uint32 *offered2,
[in,out] uint32 *val_length
);

View File

@ -1,6 +1,7 @@
[
uuid(45f52c28-7f9f-101a-b52b-08002b2efabe),
version(1.0)
version(1.0),
helpstring("Server-to-Server WINS")
] interface WinsPipe
{
void WinsRecordAction();

View File

@ -6,7 +6,8 @@
[ uuid(6bffd098-a112-3610-9833-46c3f87e345a),
version(1.0),
pointer_default(unique)
pointer_default(unique),
helpstring("Workstation Service")
] interface wkssvc
{

View File

@ -4,7 +4,8 @@
[
uuid(378e52b0-c0a9-11cf-822d-00aa0051e40f),
version(1.0)
version(1.0),
helpstring("Wireless Configuration Service")
]
interface wzcsvc
{

View File

@ -2,3 +2,4 @@ dnl # utils subsystem
SMB_BINARY_MK(ndrdump, utils/config.mk)
SMB_BINARY_MK(ntlm_auth, utils/config.mk)
SMB_BINARY_MK(lookupuuid, utils/config.mk)

View File

@ -13,6 +13,19 @@ REQUIRED_SUBSYSTEMS = \
# End BINARY ndrdump
#################################
#################################
# Start BINARY lookupuuid
[BINARY::lookupuuid]
OBJ_FILES = \
utils/lookupuuid.o
REQUIRED_SUBSYSTEMS = \
CONFIG \
LIBCMDLINE \
LIBBASIC \
LIBSMB
# End BINARY lookupuuid
#################################
#################################
# Start BINARY ntlm_auth
[BINARY::ntlm_auth]

View File

@ -107,7 +107,7 @@ static void show_functions(const struct dcerpc_interface_table *p)
DEBUGLEVEL = 10;
setup_logging("smbtorture", DEBUG_STDOUT);
setup_logging("ndrdump", DEBUG_STDOUT);
if (argc < 2) {
show_pipes();