Created
March 30, 2018 03:13
-
-
Save j2doll/3ce86586f212ece091b7df319a44f5d3 to your computer and use it in GitHub Desktop.
AfxWriteStringLength
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void AFXAPI AfxWriteStringLength(CArchive& ar, UINT_PTR nLength, BOOL bUnicode) | |
| { | |
| if (bUnicode) | |
| { | |
| // Tag Unicode strings | |
| ar<<(BYTE)0xff; | |
| ar<<(WORD)0xfffe; | |
| } | |
| if (nLength < 255) | |
| { | |
| ar<<(BYTE)nLength; | |
| } | |
| else if (nLength < 0xfffe) | |
| { | |
| ar<<(BYTE)0xff; | |
| ar<<(WORD)nLength; | |
| } | |
| else if (nLength < 0xffffffff) | |
| { | |
| ar<<(BYTE)0xff; | |
| ar<<(WORD)0xffff; | |
| ar<<(DWORD)nLength; | |
| } | |
| else | |
| { | |
| ar<<(BYTE)0xff; | |
| ar<<(WORD)0xffff; | |
| ar<<(DWORD)0xffffffff; | |
| ar<<(ULONGLONG)nLength; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment