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.

59 lines
1.5 KiB

  1. /****************************** Module Header ******************************\
  2. * Module Name: process.h
  3. *
  4. * Copyright (c) 1985 - 1999, Microsoft Corporation
  5. *
  6. * This module contains processor specific routines.
  7. *
  8. * History:
  9. * 25-Oct-1995 JimA Created.
  10. \***************************************************************************/
  11. #include "precomp.h"
  12. #include <imagehlp.h>
  13. #include <wdbgexts.h>
  14. #include <ntsdexts.h>
  15. #include <stdexts.h>
  16. extern ULONG (*GetEThreadFieldInfo)(ETHREADFIELD, PULONG);
  17. extern ULONG (*GetEProcessFieldInfo)(EPROCESSFIELD, PULONG);
  18. PVOID GetEProcessData(
  19. PEPROCESS pEProcess,
  20. EPROCESSFIELD epf,
  21. PVOID pBuffer)
  22. {
  23. PVOID pvData;
  24. ULONG ulSize;
  25. pvData = (PBYTE)pEProcess + GetEProcessFieldInfo(epf, &ulSize);
  26. if (pBuffer != NULL) {
  27. if (!tryMoveBlock(pBuffer, pvData, ulSize)) {
  28. DEBUGPRINT("GetEProcessData failed to move block. EProcess:%p epf:%d \n", pEProcess, epf);
  29. return NULL;
  30. }
  31. }
  32. return pvData;
  33. }
  34. PVOID GetEThreadData(
  35. PETHREAD pEThread,
  36. ETHREADFIELD etf,
  37. PVOID pBuffer)
  38. {
  39. PVOID pvData;
  40. ULONG ulSize;
  41. pvData = (PBYTE)pEThread + GetEThreadFieldInfo(etf, &ulSize);
  42. if (pBuffer != NULL) {
  43. if (!tryMoveBlock(pBuffer, pvData, ulSize)) {
  44. DEBUGPRINT("GetEThreadData failed to move block. EThread:%p etf:%d \n", pEThread, etf);
  45. return NULL;
  46. }
  47. }
  48. return pvData;
  49. }