1 /*------------------------------------------------------------------------------------------
6 MSO routines for bullet-proofing a document that might be corrupt. Sniffs out
7 corruption and tries to fix it.
9 ------------------------------------------------------------------------------------------*/
17 typedef enum // number of stack levels for Resetting the BPL Error watcher
24 typedef enum // BulletProofing Success Code
26 bpscNone
= 0, // no problem
40 #define msobplekSttb 5
45 #define msobplekTableProps 10
46 #define msobplekTableChars 11
47 #define msobplekFieldChars 12
48 #define msobplekLists 13
49 #define msobplekStyles 14
50 #define msobplekOleFld 15
51 #define msobplekOleOcx 16
52 #define msobplekOleObjd 17
53 #define msobplekNumberedStyles 18
54 #define msobplekSections 19
55 #define msobplekFootnotes 20
56 #define msobplekEndnotes 21
57 #define msobplekComments 22
58 #define msobplekDrawnObjects 23
59 #define msobplekTextbox 24
60 #define msobplekFsr 25
61 #define msobplekRsl 26
62 #define msobplekUim 27
63 #define msobplekPictures 28
64 #define msobplekDivs 29
65 #define msobplekBookmarks 30
66 #define msobplekDataRecoveryOpen 31
67 #define msobplekEscher 32
69 #define msobplekSumInfo 34
70 #define msobplekLinkedList 35
71 #define msobplekString 36
72 #define msobplekHyperlink 37
74 #define msobplekMax 38
77 typedef BPSC (*PFNBP
)(struct _BPL
*, void *, struct _SVI
*);
78 typedef struct _MSOBPCB
// MSO BulletProofing CallBack Block
80 // main BP logging routine
81 void (CALLBACK
*pfnLogFixBple
)(BPSC
*pbsc
, struct _BPL
*pbpl
, MSOBPLEK msobplek
);
83 // BPR helper routines
84 BPR (CALLBACK
*pfnBprResetBpl
)(void *pbpl
);
85 int (CALLBACK
*pfnFSawErrorBpr
)(void *pbpl
, BPR bpr
);
86 void (CALLBACK
*pfnSawErrorBpl
)(void *pbpl
);
94 MSOAPI_(void) MsoUpdateBpsc(BPSC
*pbpsc
, BPSC bpscNew
);
96 // generic pointer routines
97 MSOAPI_(void) MsoSetStackLimits(void); // REVIEW: PETERO: Is this a real routine?
98 MSOAPI_(BOOL
) MsoFTestCbPv(void *pv
, int cb
);
99 MSOAPI_(BOOL
) MsoFTestCbPvRO(const void *pv
, int cb
);
100 MSOAPI_(int) MsoCbActualFromPv(void *pv
, int cb
);
101 MSOAPI_(BOOL
) MsoFEnsureCbPv(void **ppv
, int cb
);
102 MSOAPI_(BOOL
) MsoFTestH(void **ppv
);
103 MSOAPI_(BOOL
) MsoFTestWz(WCHAR
*wz
, int cwchMaxPossible
);
104 MSOAPI_(BOOL
) MsoFTestSz(char *sz
, int cchMaxPossible
);
105 MSOAPI_(BOOL
) MsoFTestWt(WCHAR
*wt
);
106 MSOAPI_(BOOL
) MsoFTestSt(char *st
);
107 MSOAPI_(BOOL
) MsoFTestWtz(WCHAR
*wtz
);
108 MSOAPI_(BOOL
) MsoFTestStz(char *stz
);
109 MSOAPI_(BPSC
) MsoBpscBulletProofPx(void *pvPx
, void *pmsobpcb
, int cb
);
110 MSOAPI_(BPSC
) MsoBpscBulletProofLinkedList(MSOBPCB
*pmsobpcb
, BYTE
**ppbHead
, int cb
, int bpNext
, PFNBP pfnbp
, struct _SVI
*psvi
);