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.

53 lines
1.2 KiB

  1. /*++
  2. Copyright (C) 1996-2000 Microsoft Corporation
  3. Module Name:
  4. EXPORTV9.CPP
  5. Abstract:
  6. Exporting
  7. History:
  8. --*/
  9. #include "precomp.h"
  10. #include "Time.h"
  11. #include "WbemCli.h"
  12. #include "DbRep.h"
  13. #include "Export.h"
  14. #include "WbemUtil.h"
  15. void CRepExporterV9::DumpNamespaceSecurity(NSREP *pNsRep)
  16. {
  17. //Default version does not have a security descriptor, so we need to
  18. //just dump a blank entry.
  19. DWORD dwSize = 0;
  20. DWORD dwBuffer[2];
  21. dwBuffer[0] = REP_EXPORT_NAMESPACE_SEC_TAG;
  22. if (pNsRep->m_poSecurity)
  23. dwBuffer[1] = g_pDbArena->Size(pNsRep->m_poSecurity);
  24. else
  25. dwBuffer[1] = 0;
  26. if ((WriteFile(g_hFile, dwBuffer, 8, &dwSize, NULL) == 0) || (dwSize != 8))
  27. {
  28. DEBUGTRACE((LOG_WBEMCORE, "Failed to write namespace security header, %S.\n", Fixup(pNsRep->m_poName)));
  29. throw FAILURE_WRITE;
  30. }
  31. if (dwBuffer[1] != 0)
  32. {
  33. if ((WriteFile(g_hFile, (void*)Fixup(pNsRep->m_poSecurity), dwBuffer[1], &dwSize, NULL) == 0) || (dwSize != dwBuffer[1]))
  34. {
  35. DEBUGTRACE((LOG_WBEMCORE, "Failed to write namespace security block, %S.\n", Fixup(pNsRep->m_poName)));
  36. throw FAILURE_WRITE;
  37. }
  38. }
  39. }
  40.