Fix a crash in winhelp caused by hmemcpy16 without prototype.
Fix some compiler warnings.
This commit is contained in:
parent
6953d6756c
commit
9cc9d591ef
|
@ -706,7 +706,7 @@ static BYTE *HLPFILE_Uncompress1(BYTE *ptr, BYTE *end, BYTE *newptr)
|
||||||
INT code = GET_USHORT(ptr, 0);
|
INT code = GET_USHORT(ptr, 0);
|
||||||
INT len = 3 + (code >> 12);
|
INT len = 3 + (code >> 12);
|
||||||
INT offset = code & 0xfff;
|
INT offset = code & 0xfff;
|
||||||
hmemcpy16(newptr, newptr - offset - 1, len);
|
memcpy(newptr, newptr - offset - 1, len);
|
||||||
newptr += len;
|
newptr += len;
|
||||||
ptr += 2;
|
ptr += 2;
|
||||||
}
|
}
|
||||||
|
@ -738,7 +738,7 @@ static BOOL HLPFILE_Uncompress1_Phrases()
|
||||||
if (!phrases.hBuffer) return FALSE;
|
if (!phrases.hBuffer) return FALSE;
|
||||||
newbuf = phrases.buf = GlobalLock(phrases.hBuffer);
|
newbuf = phrases.buf = GlobalLock(phrases.hBuffer);
|
||||||
|
|
||||||
hmemcpy16(newbuf, buf + 0x11, 2 * num + 2);
|
memcpy(newbuf, buf + 0x11, 2 * num + 2);
|
||||||
HLPFILE_Uncompress1(buf + 0x13 + 2 * num, end, newbuf + 2 * num + 2);
|
HLPFILE_Uncompress1(buf + 0x13 + 2 * num, end, newbuf + 2 * num + 2);
|
||||||
|
|
||||||
for (i = 0; i < num; i++)
|
for (i = 0; i < num; i++)
|
||||||
|
@ -856,7 +856,7 @@ static VOID HLPFILE_Uncompress2(BYTE **pptr, BYTE *end, BYTE *newptr)
|
||||||
phptr = phrases.buf + GET_USHORT(phrases.buf, 2 * index);
|
phptr = phrases.buf + GET_USHORT(phrases.buf, 2 * index);
|
||||||
phend = phrases.buf + GET_USHORT(phrases.buf, 2 * index + 2);
|
phend = phrases.buf + GET_USHORT(phrases.buf, 2 * index + 2);
|
||||||
|
|
||||||
hmemcpy16(newptr, phptr, phend - phptr);
|
memcpy(newptr, phptr, phend - phptr);
|
||||||
newptr += phend - phptr;
|
newptr += phend - phptr;
|
||||||
if (space) *newptr++ = ' ';
|
if (space) *newptr++ = ' ';
|
||||||
|
|
||||||
|
|
|
@ -286,7 +286,7 @@ VOID MACRO_FileOpen(VOID)
|
||||||
openfilename.lpTemplateName = 0;
|
openfilename.lpTemplateName = 0;
|
||||||
|
|
||||||
if (GetOpenFileName(&openfilename))
|
if (GetOpenFileName(&openfilename))
|
||||||
WINHELP_CreateHelpWindow(szPath, 0, "main", FALSE, NULL, NULL, SW_SHOWNORMAL);
|
WINHELP_CreateHelpWindow(szPath, 0, "main", FALSE, 0, NULL, SW_SHOWNORMAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID MACRO_Find(VOID)
|
VOID MACRO_Find(VOID)
|
||||||
|
@ -375,7 +375,7 @@ BOOL MACRO_IsNotMark(LPCSTR str)
|
||||||
|
|
||||||
VOID MACRO_JumpContents(LPCSTR lpszPath, LPCSTR lpszWindow)
|
VOID MACRO_JumpContents(LPCSTR lpszPath, LPCSTR lpszWindow)
|
||||||
{
|
{
|
||||||
WINHELP_CreateHelpWindow(lpszPath, 0, lpszWindow, FALSE, NULL, NULL, SW_NORMAL);
|
WINHELP_CreateHelpWindow(lpszPath, 0, lpszWindow, FALSE, 0, NULL, SW_NORMAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID MACRO_JumpContext(LPCSTR lpszPath, LPCSTR lpszWindow, LONG context)
|
VOID MACRO_JumpContext(LPCSTR lpszPath, LPCSTR lpszWindow, LONG context)
|
||||||
|
@ -385,7 +385,7 @@ VOID MACRO_JumpContext(LPCSTR lpszPath, LPCSTR lpszWindow, LONG context)
|
||||||
|
|
||||||
VOID MACRO_JumpHash(LPCSTR lpszPath, LPCSTR lpszWindow, LONG lHash)
|
VOID MACRO_JumpHash(LPCSTR lpszPath, LPCSTR lpszWindow, LONG lHash)
|
||||||
{
|
{
|
||||||
WINHELP_CreateHelpWindow(lpszPath, lHash, lpszWindow, FALSE, NULL, NULL, SW_NORMAL);
|
WINHELP_CreateHelpWindow(lpszPath, lHash, lpszWindow, FALSE, 0, NULL, SW_NORMAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID MACRO_JumpHelpOn(VOID)
|
VOID MACRO_JumpHelpOn(VOID)
|
||||||
|
|
|
@ -161,7 +161,7 @@ UpdateWindow|UW yylval = (YYSTYPE)MACRO_UpdateWindow; return VOID_FUNCTION_2ST
|
||||||
#include "winhelp.h"
|
#include "winhelp.h"
|
||||||
static CHAR szTestMacro[256];
|
static CHAR szTestMacro[256];
|
||||||
|
|
||||||
static LRESULT MACRO_TestDialogProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
|
static LRESULT CALLBACK MACRO_TestDialogProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
if (msg == WM_COMMAND && wParam == IDOK)
|
if (msg == WM_COMMAND && wParam == IDOK)
|
||||||
{
|
{
|
||||||
|
|
|
@ -15,9 +15,9 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static BOOL WINHELP_RegisterWinClasses();
|
static BOOL WINHELP_RegisterWinClasses();
|
||||||
static LRESULT WINHELP_MainWndProc(HWND, UINT, WPARAM, LPARAM);
|
static LRESULT CALLBACK WINHELP_MainWndProc(HWND, UINT, WPARAM, LPARAM);
|
||||||
static LRESULT WINHELP_TextWndProc(HWND, UINT, WPARAM, LPARAM);
|
static LRESULT CALLBACK WINHELP_TextWndProc(HWND, UINT, WPARAM, LPARAM);
|
||||||
static LRESULT WINHELP_ButtonBoxWndProc(HWND, UINT, WPARAM, LPARAM);
|
static LRESULT CALLBACK WINHELP_ButtonBoxWndProc(HWND, UINT, WPARAM, LPARAM);
|
||||||
static VOID WINHELP_CheckPopup(UINT);
|
static VOID WINHELP_CheckPopup(UINT);
|
||||||
static BOOL WINHELP_SplitLines(HWND hWnd, LPSIZE);
|
static BOOL WINHELP_SplitLines(HWND hWnd, LPSIZE);
|
||||||
static VOID WINHELP_InitFonts(HWND hWnd);
|
static VOID WINHELP_InitFonts(HWND hWnd);
|
||||||
|
@ -328,7 +328,7 @@ VOID WINHELP_CreateHelpWindow(LPCSTR lpszFile, LONG lHash, LPCSTR lpszWindow,
|
||||||
* WINHELP_MainWndProc
|
* WINHELP_MainWndProc
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static LRESULT WINHELP_MainWndProc (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
static LRESULT CALLBACK WINHELP_MainWndProc (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
WINHELP_WINDOW *win;
|
WINHELP_WINDOW *win;
|
||||||
WINHELP_BUTTON *button;
|
WINHELP_BUTTON *button;
|
||||||
|
@ -426,7 +426,7 @@ static LRESULT WINHELP_MainWndProc (HWND hWnd, UINT msg, WPARAM wParam, LPARAM l
|
||||||
* WINHELP_ButtonBoxWndProc
|
* WINHELP_ButtonBoxWndProc
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static LRESULT WINHELP_ButtonBoxWndProc (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
static LRESULT CALLBACK WINHELP_ButtonBoxWndProc (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
WINDOWPOS *winpos;
|
WINDOWPOS *winpos;
|
||||||
WINHELP_WINDOW *win;
|
WINHELP_WINDOW *win;
|
||||||
|
@ -497,7 +497,7 @@ static LRESULT WINHELP_ButtonBoxWndProc (HWND hWnd, UINT msg, WPARAM wParam, LPA
|
||||||
* WINHELP_TextWndProc
|
* WINHELP_TextWndProc
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static LRESULT WINHELP_TextWndProc (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
static LRESULT CALLBACK WINHELP_TextWndProc (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
WINHELP_WINDOW *win;
|
WINHELP_WINDOW *win;
|
||||||
WINHELP_LINE *line;
|
WINHELP_LINE *line;
|
||||||
|
@ -885,7 +885,7 @@ static BOOL WINHELP_AppendText(WINHELP_LINE ***linep, WINHELP_LINE_PART ***partp
|
||||||
ptr += sizeof(WINHELP_LINE_PART);
|
ptr += sizeof(WINHELP_LINE_PART);
|
||||||
}
|
}
|
||||||
|
|
||||||
hmemcpy16(ptr, text, textlen);
|
memcpy(ptr, text, textlen);
|
||||||
part->rect.left = line->rect.right + (*partp ? space->cx : 0);
|
part->rect.left = line->rect.right + (*partp ? space->cx : 0);
|
||||||
part->rect.right = part->rect.left + textsize->cx;
|
part->rect.right = part->rect.left + textsize->cx;
|
||||||
line->rect.right = part->rect.right;
|
line->rect.right = part->rect.right;
|
||||||
|
|
Loading…
Reference in New Issue