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.

74 lines
3.0 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1996.
  5. //
  6. // File: oleprint.hxx
  7. //
  8. // Contents: internal header for oleprint.cxx
  9. //
  10. // Functions: print functions for writing OLE types
  11. //
  12. // History: 11-Jul-95 t-stevan Created
  13. //
  14. //----------------------------------------------------------------------------
  15. #ifndef __OLEPRINT_HXX__
  16. #define __OLEPRINT_HXX__
  17. #include "buffer.hxx"
  18. // *** Defines, Constants, and Macros ***
  19. // *** Function Prototypes
  20. // our actual print function
  21. void __cdecl oleprintf(int depth, const char *pscApiName, const char *pscFormat, va_list args);
  22. // OLE type writing functions
  23. void WriteIntCommon(CTextBufferA& buf, unsigned int param, BOOL fUnsigned);
  24. void WritePointerCommon(CTextBufferA& buf, void *pPointer, BOOL fCaps, BOOL fKnownBad, BOOL fXlatSym);
  25. void WriteLargeCommon(CTextBufferA& buf, const __int64 *pInt, BOOL fUnsigned);
  26. void WriteHexCommon(CTextBufferA& buf, ULONG param, BOOL fCaps);
  27. void WriteBoolCommon(CTextBufferA& buf, BOOL param, BOOL fCaps);
  28. void WriteStringCommon(CTextBufferA& buf, const char *pString, BOOL fQuote=FALSE);
  29. void WriteWideStringCommon(CTextBufferA& buf, const WCHAR *pwString, BOOL fQuote=FALSE);
  30. void WriteGUIDCommon(CTextBufferA &buf, const GUID *pGUID);
  31. // OLE structure writing functions
  32. void WriteFILETIME(CTextBufferA& buf, FILETIME *pFileTime);
  33. void WriteRECT(CTextBufferA& buf, RECT *pRect);
  34. void WriteSIZE(CTextBufferA& buf, SIZE *pSize);
  35. void WriteLOGPALETTE(CTextBufferA& buf, LOGPALETTE *plp);
  36. void WritePOINT(CTextBufferA& buf, POINT *pPoint);
  37. void WriteMSG(CTextBufferA& buf, MSG *pMsg);
  38. void WriteSTGMEDIUM(CTextBufferA& buf, STGMEDIUM *pStg);
  39. void WriteFORMATETC(CTextBufferA& buf, FORMATETC *pFte);
  40. void WriteDVTARGETDEVICE(CTextBufferA& buf, DVTARGETDEVICE *pDvtdv);
  41. void WriteBIND_OPTS(CTextBufferA& buf, BIND_OPTS *pOpts);
  42. void WriteSTATSTG(CTextBufferA& buf, STATSTG *pStat);
  43. void WriteOLEINPLACEFRAMEINFO(CTextBufferA& buf, OLEINPLACEFRAMEINFO *pInfo);
  44. void WriteOLEMENUGROUPWIDTHS(CTextBufferA& buf, OLEMENUGROUPWIDTHS *pWidths);
  45. void WriteINTERFACEINFO(CTextBufferA &buf, INTERFACEINFO *pInfo);
  46. // *** Inline Functions ***
  47. //+---------------------------------------------------------------------------
  48. //
  49. // Function: ExceptionFilter
  50. //
  51. // Synopsis: Catches exceptions which result from a bad pointer
  52. //
  53. // Arguments: [code] - exception code
  54. //
  55. // Returns: 1 if this exception is to be processed, 0 otherwise
  56. //
  57. // History: 15-Jul-95 t-stevan Created
  58. //
  59. //----------------------------------------------------------------------------
  60. inline int ExceptionFilter(DWORD code)
  61. {
  62. return (code == EXCEPTION_ACCESS_VIOLATION)
  63. || (code == EXCEPTION_ARRAY_BOUNDS_EXCEEDED)
  64. || (code == EXCEPTION_DATATYPE_MISALIGNMENT)
  65. || (code == EXCEPTION_PRIV_INSTRUCTION);
  66. }
  67. #endif