Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
22d4b0af
Commit
22d4b0af
authored
Oct 13, 1999
by
Uwe Bonnes
Committed by
Alexandre Julliard
Oct 13, 1999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use LoadString16 for FormatMessage16 and handle
FORMAT_MESSAGE_ALLOCATE_BUFFER flag.
parent
81bc9dfb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
13 deletions
+16
-13
user.spec
if1632/user.spec
+1
-1
winuser16.h
include/wine/winuser16.h
+1
-1
lstr.c
misc/lstr.c
+14
-11
No files found.
if1632/user.spec
View file @
22d4b0af
...
...
@@ -485,7 +485,7 @@ file user.exe
602 stub SetCheckCursorTimer
604 stub BroadcastSystemMessage
605 stub HackTaskMonitor
606 pascal
FormatMessage(long
ptr word word ptr word ptr) FormatMessage16
606 pascal
16 FormatMessage(long seg
ptr word word ptr word ptr) FormatMessage16
608 pascal16 GetForegroundWindow() GetForegroundWindow16
609 pascal16 SetForegroundWindow(word) SetForegroundWindow16
610 pascal16 DestroyIcon32(word word) CURSORICON_Destroy
...
...
include/wine/winuser16.h
View file @
22d4b0af
...
...
@@ -712,7 +712,7 @@ INT16 WINAPI FillRect16(HDC16,const RECT16*,HBRUSH16);
HWND16
WINAPI
FindWindow16
(
SEGPTR
,
LPCSTR
);
HWND16
WINAPI
FindWindowEx16
(
HWND16
,
HWND16
,
SEGPTR
,
LPCSTR
);
BOOL16
WINAPI
FlashWindow16
(
HWND16
,
BOOL16
);
DWORD
WINAPI
FormatMessage16
(
DWORD
,
LPCVOID
,
WORD
,
WORD
,
LPSTR
,
WORD
,
LPDWORD
);
DWORD
WINAPI
FormatMessage16
(
DWORD
,
SEGPTR
,
WORD
,
WORD
,
LPSTR
,
WORD
,
LPDWORD
);
INT16
WINAPI
FrameRect16
(
HDC16
,
const
RECT16
*
,
HBRUSH16
);
HWND16
WINAPI
GetActiveWindow16
(
void
);
WORD
WINAPI
GetAsyncKeyState16
(
INT16
);
...
...
misc/lstr.c
View file @
22d4b0af
...
...
@@ -489,10 +489,10 @@ BOOL WINAPI IsCharUpperW(WCHAR x)
*/
DWORD
WINAPI
FormatMessage16
(
DWORD
dwFlags
,
LPCVOID
lpSource
,
SEGPTR
lpSource
,
/*not always a valid pointer*/
WORD
dwMessageId
,
WORD
dwLanguageId
,
LPSTR
lpBuffer
,
LPSTR
lpBuffer
,
/* *((HLOCAL16*)) for FORMAT_MESSAGE_ALLOCATE_BUFFER*/
WORD
nSize
,
LPDWORD
args
/* va_list *args */
)
{
...
...
@@ -503,26 +503,28 @@ DWORD WINAPI FormatMessage16(
LPSTR
from
,
f
;
DWORD
width
=
dwFlags
&
FORMAT_MESSAGE_MAX_WIDTH_MASK
;
DWORD
nolinefeed
=
0
;
LPSTR
allocstring
;
TRACE
(
"(0x%lx,%
p
,%d,0x%x,%p,%d,%p)
\n
"
,
TRACE
(
"(0x%lx,%
lx
,%d,0x%x,%p,%d,%p)
\n
"
,
dwFlags
,
lpSource
,
dwMessageId
,
dwLanguageId
,
lpBuffer
,
nSize
,
args
);
if
(
width
)
FIXME
(
"line wrapping not supported.
\n
"
);
from
=
NULL
;
if
(
dwFlags
&
FORMAT_MESSAGE_FROM_STRING
)
from
=
HEAP_strdupA
(
GetProcessHeap
(),
0
,
(
LPSTR
)
lpSource
);
from
=
HEAP_strdupA
(
GetProcessHeap
(),
0
,
PTR_SEG_TO_LIN
(
lpSource
)
);
if
(
dwFlags
&
FORMAT_MESSAGE_FROM_SYSTEM
)
{
from
=
HeapAlloc
(
GetProcessHeap
(),
0
,
200
);
sprintf
(
from
,
"Systemmessage, messageid = 0x%08x
\n
"
,
dwMessageId
);
}
if
(
dwFlags
&
FORMAT_MESSAGE_FROM_HMODULE
)
{
INT
bufsize
;
INT16
bufsize
;
HINSTANCE16
hinst16
=
((
HMODULE
)
lpSource
&
0xffff
);
dwMessageId
&=
0xFFFF
;
bufsize
=
Load
MessageA
((
HMODULE
)
lpSource
,
dwMessageId
,
dwLanguageId
,
NULL
,
10
0
);
bufsize
=
Load
String16
(
hinst16
,
dwMessageId
,
NULL
,
0
);
if
(
bufsize
)
{
from
=
HeapAlloc
(
GetProcessHeap
(),
0
,
bufsize
+
1
);
Load
MessageA
((
HMODULE
)
lpSource
,
dwMessageId
,
dwLangu
ageId
,
from
,
bufsize
+
1
);
from
=
HeapAlloc
(
GetProcessHeap
(),
0
,
bufsize
+
1
);
Load
String16
(
hinst16
,
dwMess
ageId
,
from
,
bufsize
+
1
);
}
}
target
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
100
);
...
...
@@ -642,14 +644,15 @@ DWORD WINAPI FormatMessage16(
TRACE
(
"-- %s
\n
"
,
debugstr_a
(
target
));
if
(
dwFlags
&
FORMAT_MESSAGE_ALLOCATE_BUFFER
)
{
/* nSize is the MINIMUM size */
*
((
LPVOID
*
)
lpBuffer
)
=
(
LPVOID
)
LocalAlloc
(
GMEM_ZEROINIT
,
talloced
);
memcpy
(
*
(
LPSTR
*
)
lpBuffer
,
target
,
talloced
);
*
((
HLOCAL16
*
)
lpBuffer
)
=
LocalAlloc16
(
LPTR
,
talloced
);
allocstring
=
PTR_SEG_OFF_TO_LIN
(
CURRENT_DS
,
*
((
HLOCAL16
*
)
lpBuffer
));
memcpy
(
allocstring
,
target
,
talloced
);
}
else
strncpy
(
lpBuffer
,
target
,
nSize
);
HeapFree
(
GetProcessHeap
(),
0
,
target
);
if
(
from
)
HeapFree
(
GetProcessHeap
(),
0
,
from
);
return
(
dwFlags
&
FORMAT_MESSAGE_ALLOCATE_BUFFER
)
?
strlen
(
*
(
LPSTR
*
)
lpBuffer
)
:
strlen
(
allocstring
)
:
strlen
(
lpBuffer
);
#else
return
0
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment