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.

107 lines
2.7 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1995
  5. //
  6. // File: ole.h
  7. //
  8. // Contents: Implements ntsd extensions to dump ole tables
  9. //
  10. // Functions:
  11. //
  12. //
  13. // History: 06-01-95 BruceMa Created
  14. //
  15. //
  16. //--------------------------------------------------------------------------
  17. #include <ntsdexts.h>
  18. ////////////////////////////////////////////////////////
  19. const UINT MAX_ARG = 64;
  20. const UINT MAX_FILESIZE = 128;
  21. ////////////////////////////////////////////////////////
  22. typedef char Arg[MAX_ARG];
  23. ////////////////////////////////////////////////////////
  24. #define until_(x) while(!(x))
  25. #define DEFINE_EXT(e) void e(HANDLE hProcess,HANDLE hThread,DWORD dwPc,PNTSD_EXTENSION_APIS lpExtensionApis,LPSTR lpArgumentString)
  26. #define Printf (*(lpExtensionApis->lpOutputRoutine))
  27. #define CheckForScm() checkForScm(lpExtensionApis)
  28. #define GetExpression (*(lpExtensionApis->lpGetExpressionRoutine))
  29. #define GetSymbol (*(lpExtensionApis->lpGetSymbolRoutine))
  30. #define CheckControlC (*(lpExtensionApis->lpCheckControlCRoutine))
  31. #define ReadMem(a,b,c) readMemory(hProcess, lpExtensionApis, (BYTE *) (a), (BYTE *) (b), (c))
  32. #define WriteMem(a,b,c) writeMemory(hProcess, lpExtensionApis, (BYTE *) (a), (BYTE *) (b), (c))
  33. #define OleAlloc(n) HeapAlloc(GetProcessHeap(),0,(n))
  34. #define OleFree(p) HeapFree(GetProcessHeap(),0,(p))
  35. #define GetArg(a) getArgument(&lpArgumentString, a)
  36. #define IsDecimal(x) ('0' <= (x) && (x) <= '9')
  37. #define Unicode2Ansi(x, y, z) AreFileApisANSI?WideCharToMultiByte(CP_ACP, WC_COMPOSITECHECK, y, -1, x, z, NULL, NULL):WideCharToMultiByte(CP_OEMCP, WC_COMPOSITECHECK, y, -1, x, z, NULL, NULL);
  38. #define NOTINSCM if(fInScm){NotInScm(lpExtensionApis);return;}
  39. #define NOTINOLE if(!fInScm){NotInOle(lpExtensionApis);return;}
  40. #define dbt(a, b, c) dbTrace(a, (DWORD *) b, (c) / (sizeof(DWORD)), lpExtensionApis)
  41. #define NOTIMPLEMENTED Printf("...Not implemented yet!\n");
  42. ////////////////////////////////////////////////////////
  43. void dbTrace(char *sz, DWORD *adr, ULONG amt,
  44. PNTSD_EXTENSION_APIS lpExtensionApis);
  45. void getArgument(LPSTR lpArgumentString, LPSTR a);
  46. void FormatCLSID(REFGUID rguid, LPWSTR lpsz);
  47. void readMemory(HANDLE hProcess, PNTSD_EXTENSION_APIS lpExtensionApis,
  48. BYTE *to, BYTE *from, INT cbSize);
  49. void writeMemory(HANDLE hProcess, PNTSD_EXTENSION_APIS lpExtensionApis,
  50. BYTE *to, BYTE *from, INT cbSize);
  51. // Common structures
  52. struct SMutexSem
  53. {
  54. CRITICAL_SECTION _cs;
  55. };
  56. struct SArrayFValue
  57. {
  58. BYTE **m_pData;
  59. UINT m_cbValue;
  60. int m_nSize;
  61. int m_nMaxSize;
  62. int m_nGrowBy;
  63. };
  64.