mirror of
https://github.com/reactos/reactos.git
synced 2025-07-31 07:12:22 +00:00
[REACTOS] Fix misc 64 bit issues (#783)
* [WIN32K] Fix handle calculation in DbgGdiHTIntegrityCheck * [NOTEPAD] Fix MSVC warnings * [PSDK] Simplify *PROC definitions in windef.h * [VIDEOPRT] Don't try to use NtVdmControl on x64 * [FREELDR] Fix some macros * [CRT] Make qsort 64 bit compatible * [NTOS] Use #ifndef _WIN64 instead of #ifdef _M_IX86 around C_ASSERTs * [FAST486] Fix 64 bit warnings and change DWORD to ULONG, so it can be used in kernel mode * [APPHELP_APITEST] Fix 64 bit issue
This commit is contained in:
parent
d67156fa98
commit
cfd1647914
16 changed files with 54 additions and 42 deletions
|
@ -1095,7 +1095,7 @@ DIALOG_GoTo_DialogProc(HWND hwndDialog, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
switch(uMsg) {
|
||||
case WM_INITDIALOG:
|
||||
hTextBox = GetDlgItem(hwndDialog, ID_LINENUMBER);
|
||||
_sntprintf(szText, ARRAY_SIZE(szText), _T("%ld"), lParam);
|
||||
_sntprintf(szText, ARRAY_SIZE(szText), _T("%Id"), lParam);
|
||||
SetWindowText(hTextBox, szText);
|
||||
break;
|
||||
case WM_COMMAND:
|
||||
|
|
|
@ -42,10 +42,6 @@ typedef enum
|
|||
ENCODING_UTF16BE = 2,
|
||||
ENCODING_UTF8 = 3
|
||||
} ENCODING;
|
||||
// #define ENCODING_ANSI 0
|
||||
#define ENCODING_UNICODE 1
|
||||
#define ENCODING_UNICODE_BE 2
|
||||
// #define ENCODING_UTF8 3
|
||||
|
||||
// #define MIN_ENCODING 0
|
||||
// #define MAX_ENCODING 3
|
||||
|
|
|
@ -85,12 +85,12 @@ ReadText(HANDLE hFile, LPWSTR *ppszText, DWORD *pdwTextLen, ENCODING *pencFile,
|
|||
/* Look for Byte Order Marks */
|
||||
if ((dwSize >= 2) && (pBytes[0] == 0xFF) && (pBytes[1] == 0xFE))
|
||||
{
|
||||
encFile = ENCODING_UNICODE;
|
||||
encFile = ENCODING_UTF16LE;
|
||||
dwPos += 2;
|
||||
}
|
||||
else if ((dwSize >= 2) && (pBytes[0] == 0xFE) && (pBytes[1] == 0xFF))
|
||||
{
|
||||
encFile = ENCODING_UNICODE_BE;
|
||||
encFile = ENCODING_UTF16BE;
|
||||
dwPos += 2;
|
||||
}
|
||||
else if ((dwSize >= 3) && (pBytes[0] == 0xEF) && (pBytes[1] == 0xBB) && (pBytes[2] == 0xBF))
|
||||
|
@ -101,7 +101,7 @@ ReadText(HANDLE hFile, LPWSTR *ppszText, DWORD *pdwTextLen, ENCODING *pencFile,
|
|||
|
||||
switch(encFile)
|
||||
{
|
||||
case ENCODING_UNICODE_BE:
|
||||
case ENCODING_UTF16BE:
|
||||
for (i = dwPos; i < dwSize-1; i += 2)
|
||||
{
|
||||
b = pBytes[i+0];
|
||||
|
@ -110,7 +110,7 @@ ReadText(HANDLE hFile, LPWSTR *ppszText, DWORD *pdwTextLen, ENCODING *pencFile,
|
|||
}
|
||||
/* fall through */
|
||||
|
||||
case ENCODING_UNICODE:
|
||||
case ENCODING_UTF16LE:
|
||||
pszText = (LPWSTR) &pBytes[dwPos];
|
||||
dwCharCount = (dwSize - dwPos) / sizeof(WCHAR);
|
||||
break;
|
||||
|
@ -239,13 +239,13 @@ static BOOL WriteEncodedText(HANDLE hFile, LPCWSTR pszText, DWORD dwTextLen, ENC
|
|||
{
|
||||
switch(encFile)
|
||||
{
|
||||
case ENCODING_UNICODE:
|
||||
case ENCODING_UTF16LE:
|
||||
pBytes = (LPBYTE) &pszText[dwPos];
|
||||
dwByteCount = (dwTextLen - dwPos) * sizeof(WCHAR);
|
||||
dwPos = dwTextLen;
|
||||
break;
|
||||
|
||||
case ENCODING_UNICODE_BE:
|
||||
case ENCODING_UTF16BE:
|
||||
dwByteCount = (dwTextLen - dwPos) * sizeof(WCHAR);
|
||||
if (dwByteCount > sizeof(buffer))
|
||||
dwByteCount = sizeof(buffer);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue