Annotation of win32/development/msvcee/eeparser3.cpp, revision 1.1
1.1 ! paf 1: #include <stdio.h>
! 2: #include <string.h>
! 3: #include <tchar.h>
! 4:
! 5: #include "custview.h"
! 6:
! 7: #include "eeparser3.h"
! 8: #include "cord/include/cord.h"
! 9:
! 10: // Helper routine that converts a system time into ASCII
! 11:
! 12: struct String {
! 13: enum Language {
! 14: L_UNSPECIFIED=0, ///< no real string has parts of this lange: it's just convinient to check when string's empty
! 15: // these two must go before others, there are checks for >L_AS_IS
! 16: L_CLEAN='1', ///< clean
! 17: L_AS_IS, ///< leave all characters intact
! 18:
! 19: L_PASS_APPENDED,
! 20: /**<
! 21: leave lang built into string being appended.
! 22: just a flag, that value not stored
! 23: */
! 24: L_TAINTED, ///< tainted, untaint lang as assigned later
! 25: // untaint langs. assigned by ^untaint[lang]{...}
! 26: L_FILE_SPEC, ///< file specification
! 27: L_HTTP_HEADER, ///< text in HTTP response header
! 28: L_MAIL_HEADER, ///< text in mail header
! 29: L_URI, ///< text in uri
! 30: L_TABLE, ///< ^table:set body
! 31: L_SQL, ///< ^table:sql body
! 32: L_JS, ///< JavaScript code
! 33: L_XML, ///< ^dom:set xml
! 34: L_HTML, ///< HTML code (for editing)
! 35: L_OPTIMIZE_BIT = 0x80 ///< flag, requiring cstr whitespace optimization
! 36: };
! 37:
! 38: class Languages {
! 39: union {
! 40: struct {
! 41: Language lang:8;
! 42: int is_not_just_lang:sizeof(CORD)*8-8;
! 43: };
! 44: CORD langs;
! 45: };
! 46: } langs;
! 47: CORD body;
! 48: };
! 49:
! 50: ADDIN_API HRESULT WINAPI AddIn_Parser3String( String* s, DEBUGHELPER *pHelper, int nBase, BOOL bUniStrings, char *pResult, size_t max, DWORD reserved )
! 51: {
! 52: /*String s;
! 53: HRESULT r=pHelper->ReadDebuggeeMemory( pHelper, dwAddress,
! 54: sizeof(s), &s, &nGot );*/
! 55:
! 56:
! 57: try {
! 58: #if 0
! 59: //MessageBox(0, "test", "stop", 0);
! 60: char buf[100];
! 61: _snprintf(buf, sizeof(buf), "=!0x%p!=", s->body);
! 62: strncpy(pResult, buf, max);
! 63: #else
! 64: strncpy(pResult, CORD_to_const_char_star(pHelper, D(D(s)->body)), max);
! 65: #endif
! 66: } catch(...) {
! 67: strncpy(pResult, "!EE-ERROR!", max);
! 68: }
! 69: return 0;
! 70: }
E-mail: