Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

79 lines
2.1 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1997 - 1999
  6. //
  7. // File: drtcom.cxx
  8. //
  9. //--------------------------------------------------------------------------
  10. // the common functions req'd by more than 1 exe in this drts
  11. #include "rpc.h"
  12. #include "rpcnsi.h"
  13. #include "stdio.h"
  14. #include "stdlib.h"
  15. WCHAR *ep[] = { L"1025",
  16. L"1026"
  17. };
  18. void FormIfHandle(GUID ifid, RPC_IF_HANDLE *IfSpec)
  19. {
  20. RPC_SERVER_INTERFACE *intf = new RPC_SERVER_INTERFACE;
  21. RPC_DISPATCH_TABLE *pdispatch = new RPC_DISPATCH_TABLE;
  22. RPC_DISPATCH_FUNCTION *pfn = new RPC_DISPATCH_FUNCTION;
  23. intf->Length = sizeof(RPC_SERVER_INTERFACE);
  24. (intf->InterfaceId).SyntaxGUID = ifid;
  25. (intf->InterfaceId).SyntaxVersion.MajorVersion = 1;
  26. (intf->InterfaceId).SyntaxVersion.MinorVersion = 0;
  27. (intf->TransferSyntax).SyntaxGUID = ifid;
  28. (intf->TransferSyntax).SyntaxVersion.MajorVersion = 1;
  29. (intf->TransferSyntax).SyntaxVersion.MinorVersion = 0;
  30. intf->RpcProtseqEndpointCount = 0;
  31. intf->RpcProtseqEndpoint = NULL;
  32. intf->InterpreterInfo = NULL;
  33. intf->Flags = 0;
  34. pfn[0] = NULL;
  35. pdispatch->DispatchTableCount = 1;
  36. pdispatch->DispatchTable = pfn;
  37. pdispatch->Reserved = 0;
  38. intf->DispatchTable = pdispatch; // &m_DispatchTable;
  39. *IfSpec = (RPC_IF_HANDLE)intf;
  40. }
  41. void FormBindingVector(WCHAR **Binding, ULONG num, RPC_BINDING_VECTOR **BindVec)
  42. {
  43. ULONG i;
  44. RPC_BINDING_HANDLE *pBindHandle;
  45. RPC_STATUS status = 0;
  46. // RpcStringBindingCompose(NULL, L"", L"0.0.0.0",
  47. for (i = 0; i < num; i++) {
  48. status = RpcServerUseProtseqEp(Binding[i], 20, ep[i], NULL);
  49. }
  50. status = RpcServerInqBindings(BindVec);
  51. }
  52. void FormObjUuid(GUID *pguid, ULONG num, UUID_VECTOR **objuuid)
  53. {
  54. ULONG i;
  55. *objuuid = (UUID_VECTOR *)malloc(sizeof(ULONG)+sizeof(UUID *)*num);
  56. (*objuuid)->Count = num;
  57. for (i = 0; i < num; i++) {
  58. (*objuuid)->Uuid[i] = pguid+i;
  59. }
  60. }
  61.