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.

129 lines
4.2 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1997 - 1999
  6. //
  7. // File: exp.cxx
  8. //
  9. //--------------------------------------------------------------------------
  10. // drt that mainly puts things into the locator
  11. //
  12. //
  13. #include "drt.hxx"
  14. void __cdecl main(int argc, char **argv)
  15. {
  16. RPC_STATUS status;
  17. RPC_BINDING_VECTOR * pBindingVector = NULL;
  18. RPC_IF_HANDLE IfSpec;
  19. UUID_VECTOR * objuuid;
  20. RPC_IF_ID intfid;
  21. int fFailed = 0;
  22. intfid.Uuid = ifid[0];
  23. intfid.VersMajor = 42;
  24. intfid.VersMinor = 42;
  25. FormBindingVector(Bindings, 1, &pBindingVector);
  26. FormObjUuid(objid, 2, &objuuid);
  27. // form a dynamic endpoint.
  28. unsigned int cMinCalls = 1;
  29. unsigned int cMaxCalls = 20;
  30. unsigned char * pszSecurity = NULL;
  31. status = RpcServerUseProtseq(L"ncacn_ip_tcp", cMaxCalls, pszSecurity);
  32. printf("RpcServerUseProtseqs returned 0x%x\n", status);
  33. if (status)
  34. fFailed = 1;
  35. status = RpcServerInqBindings(&pBindingVector);
  36. printf("RpcServerInqBindings returned 0x%x\n", status);
  37. if (status)
  38. fFailed = 1;
  39. FormIfHandle(ifid[1], &IfSpec);
  40. status = RpcNsBindingExport(RPC_C_NS_SYNTAX_DEFAULT,
  41. szDynSrvEntryName,
  42. IfSpec,
  43. pBindingVector,
  44. NULL);
  45. printf("RpcNsBindingExport returned 0x%x\n", status);
  46. if (status)
  47. fFailed = 1;
  48. status = RpcNsMgmtEntryCreate(RPC_C_NS_SYNTAX_DEFAULT,
  49. szGrpEntryName[0]);
  50. if (status)
  51. fFailed = 1;
  52. printf("RpcNsMgmtEntryCreate returned 0x%x\n", status);
  53. FormIfHandle(ifid[0], &IfSpec);
  54. status = RpcNsBindingExport(RPC_C_NS_SYNTAX_DEFAULT, // name syntax type
  55. szSrvEntryName[0], // nsi entry name
  56. IfSpec,
  57. pBindingVector,
  58. objuuid); // UUID vector
  59. if (status)
  60. fFailed = 1;
  61. printf("RpcNsBindingExport returned 0x%x\n", status);
  62. status = RpcNsGroupMbrAdd(RPC_C_NS_SYNTAX_DEFAULT, // name syntax type
  63. szGrpEntryName[0],
  64. RPC_C_NS_SYNTAX_DEFAULT, // name syntax type
  65. szSrvEntryName[0]);
  66. printf("RpcNsGroupMbrAdd 1 returned 0x%x\n", status);
  67. if (status)
  68. fFailed = 1;
  69. status = RpcNsGroupMbrAdd(RPC_C_NS_SYNTAX_DEFAULT, // name syntax type
  70. szGrpEntryName[0],
  71. RPC_C_NS_SYNTAX_DEFAULT, // name syntax type
  72. szSrvEntryName[1]);
  73. printf("RpcNsGroupMbrAdd 2 returned 0x%x\n", status);
  74. if (status)
  75. fFailed = 1;
  76. status = RpcNsProfileEltAdd(
  77. RPC_C_NS_SYNTAX_DEFAULT, // name syntax type
  78. szPrfEntryName[0],
  79. &intfid,
  80. RPC_C_NS_SYNTAX_DEFAULT, // name syntax type
  81. szGrpEntryName[0],
  82. 1,
  83. L"Group Entry 1 Trying to test the length of the string possible");
  84. printf("RpcNsProfileEltAdd 1 returned 0x%x\n", status);
  85. if (status)
  86. fFailed = 1;
  87. status = RpcNsProfileEltAdd(
  88. RPC_C_NS_SYNTAX_DEFAULT, // name syntax type
  89. szPrfEntryName[0],
  90. &intfid,
  91. RPC_C_NS_SYNTAX_DEFAULT, // name syntax type
  92. szGrpEntryName[1],
  93. 2,
  94. L"Group Entry 2");
  95. printf("RpcNsProfileEltAdd 2 returned 0x%x\n", status);
  96. if (status)
  97. fFailed = 1;
  98. if (fFailed)
  99. printf("Export Test FAILED\n");
  100. else
  101. printf("Export Test PASSED\n");
  102. }