Source code of Windows XP (NT5)
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.

52 lines
1.1 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. SecName.cxx
  5. Abstract:
  6. Function(s) for manipulating the section name
  7. Author:
  8. Kamen Moutafov (kamenm) Dec 99 - Feb 2000
  9. Revision History:
  10. --*/
  11. #include <precomp.hxx>
  12. void GenerateSectionName(OUT RPC_CHAR *Buffer, IN int BufferLength,
  13. IN DWORD ProcessID, IN DWORD *pSectionNumbers OPTIONAL)
  14. {
  15. RPC_CHAR *CurrentPosition;
  16. ASSERT(BufferLength >= RpcSectionNameMaxSize);
  17. RpcpStringCopy(Buffer, RpcSectionPrefix);
  18. CurrentPosition = Buffer + RpcSectionPrefixSize;
  19. // add the PID
  20. _ultow(ProcessID, CurrentPosition, 16);
  21. if (pSectionNumbers)
  22. {
  23. // find the end of the conversion
  24. while (*CurrentPosition != 0)
  25. CurrentPosition ++;
  26. // add the first portion of the section number
  27. _ultow(pSectionNumbers[0], CurrentPosition, 16);
  28. // find the end of the conversion
  29. while (*CurrentPosition != 0)
  30. CurrentPosition ++;
  31. // add the second portion of the section number
  32. _ultow(pSectionNumbers[1], CurrentPosition, 16);
  33. }
  34. }