Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
937d0b24
Commit
937d0b24
authored
Nov 04, 2002
by
Ryan Cumming
Committed by
Alexandre Julliard
Nov 04, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle FORMAT_MESSAGE_FROM_HMODULE and FORMAT_MESSAGE_FROM_SYSTEM both
being set at once.
parent
4ce28377
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
76 additions
and
44 deletions
+76
-44
format_msg.c
dlls/kernel/format_msg.c
+76
-44
No files found.
dlls/kernel/format_msg.c
View file @
937d0b24
...
...
@@ -171,8 +171,6 @@ DWORD WINAPI FormatMessageA(
TRACE
(
"(0x%lx,%p,%ld,0x%lx,%p,%ld,%p)
\n
"
,
dwFlags
,
lpSource
,
dwMessageId
,
dwLanguageId
,
lpBuffer
,
nSize
,
args
);
if
((
dwFlags
&
FORMAT_MESSAGE_FROM_SYSTEM
)
&&
(
dwFlags
&
FORMAT_MESSAGE_FROM_HMODULE
))
return
0
;
if
((
dwFlags
&
FORMAT_MESSAGE_FROM_STRING
)
&&
((
dwFlags
&
FORMAT_MESSAGE_FROM_SYSTEM
)
||
(
dwFlags
&
FORMAT_MESSAGE_FROM_HMODULE
)))
return
0
;
...
...
@@ -186,29 +184,47 @@ DWORD WINAPI FormatMessageA(
strcpy
(
from
,
(
LPSTR
)
lpSource
);
}
else
{
if
(
dwFlags
&
FORMAT_MESSAGE_FROM_SYSTEM
)
hmodule
=
GetModuleHandleA
(
"kernel32"
);
bufsize
=
load_messageA
(
hmodule
,
dwMessageId
,
dwLanguageId
,
NULL
,
100
);
if
(
!
bufsize
)
{
if
(
dwLanguageId
)
{
SetLastError
(
ERROR_RESOURCE_LANG_NOT_FOUND
);
return
0
;
bufsize
=
0
;
if
(
dwFlags
&
FORMAT_MESSAGE_FROM_HMODULE
)
{
bufsize
=
load_messageA
(
hmodule
,
dwMessageId
,
dwLanguageId
,
NULL
,
100
);
if
((
!
bufsize
)
&&
(
!
dwLanguageId
))
{
bufsize
=
load_messageA
(
hmodule
,
dwMessageId
,
MAKELANGID
(
LANG_NEUTRAL
,
SUBLANG_NEUTRAL
),
NULL
,
100
);
if
(
!
bufsize
)
bufsize
=
load_messageA
(
hmodule
,
dwMessageId
,
MAKELANGID
(
LANG_NEUTRAL
,
SUBLANG_DEFAULT
),
NULL
,
100
);
if
(
!
bufsize
)
bufsize
=
load_messageA
(
hmodule
,
dwMessageId
,
MAKELANGID
(
LANG_NEUTRAL
,
SUBLANG_SYS_DEFAULT
),
NULL
,
100
);
if
(
!
bufsize
)
bufsize
=
load_messageA
(
hmodule
,
dwMessageId
,
MAKELANGID
(
LANG_NEUTRAL
,
SUBLANG_SYS_DEFAULT
),
NULL
,
100
);
if
(
!
bufsize
)
bufsize
=
load_messageA
(
hmodule
,
dwMessageId
,
MAKELANGID
(
LANG_ENGLISH
,
SUBLANG_ENGLISH_US
),
NULL
,
100
);
}
bufsize
=
load_messageA
(
hmodule
,
dwMessageId
,
MAKELANGID
(
LANG_NEUTRAL
,
SUBLANG_NEUTRAL
),
NULL
,
100
);
if
(
!
bufsize
)
bufsize
=
load_messageA
(
hmodule
,
dwMessageId
,
MAKELANGID
(
LANG_NEUTRAL
,
SUBLANG_DEFAULT
),
NULL
,
100
);
if
(
!
bufsize
)
bufsize
=
load_messageA
(
hmodule
,
dwMessageId
,
MAKELANGID
(
LANG_NEUTRAL
,
SUBLANG_SYS_DEFAULT
),
NULL
,
100
);
if
(
!
bufsize
)
bufsize
=
load_messageA
(
hmodule
,
dwMessageId
,
MAKELANGID
(
LANG_NEUTRAL
,
SUBLANG_SYS_DEFAULT
),
NULL
,
100
);
if
(
!
bufsize
)
bufsize
=
load_messageA
(
hmodule
,
dwMessageId
,
MAKELANGID
(
LANG_ENGLISH
,
SUBLANG_ENGLISH_US
),
NULL
,
100
);
if
(
!
bufsize
)
{
SetLastError
(
ERROR_RESOURCE_LANG_NOT_FOUND
);
return
0
;
}
if
((
dwFlags
&
FORMAT_MESSAGE_FROM_SYSTEM
)
&&
(
!
bufsize
))
{
hmodule
=
GetModuleHandleA
(
"kernel32"
);
bufsize
=
load_messageA
(
hmodule
,
dwMessageId
,
dwLanguageId
,
NULL
,
100
);
if
((
!
bufsize
)
&&
(
!
dwLanguageId
))
{
bufsize
=
load_messageA
(
hmodule
,
dwMessageId
,
MAKELANGID
(
LANG_NEUTRAL
,
SUBLANG_NEUTRAL
),
NULL
,
100
);
if
(
!
bufsize
)
bufsize
=
load_messageA
(
hmodule
,
dwMessageId
,
MAKELANGID
(
LANG_NEUTRAL
,
SUBLANG_DEFAULT
),
NULL
,
100
);
if
(
!
bufsize
)
bufsize
=
load_messageA
(
hmodule
,
dwMessageId
,
MAKELANGID
(
LANG_NEUTRAL
,
SUBLANG_SYS_DEFAULT
),
NULL
,
100
);
if
(
!
bufsize
)
bufsize
=
load_messageA
(
hmodule
,
dwMessageId
,
MAKELANGID
(
LANG_NEUTRAL
,
SUBLANG_SYS_DEFAULT
),
NULL
,
100
);
if
(
!
bufsize
)
bufsize
=
load_messageA
(
hmodule
,
dwMessageId
,
MAKELANGID
(
LANG_ENGLISH
,
SUBLANG_ENGLISH_US
),
NULL
,
100
);
}
}
if
(
!
bufsize
)
{
SetLastError
(
ERROR_RESOURCE_LANG_NOT_FOUND
);
return
0
;
}
from
=
HeapAlloc
(
GetProcessHeap
(),
0
,
bufsize
+
1
);
load_messageA
(
hmodule
,
dwMessageId
,
dwLanguageId
,
from
,
bufsize
+
1
);
}
...
...
@@ -406,8 +422,6 @@ DWORD WINAPI FormatMessageW(
TRACE
(
"(0x%lx,%p,%ld,0x%lx,%p,%ld,%p)
\n
"
,
dwFlags
,
lpSource
,
dwMessageId
,
dwLanguageId
,
lpBuffer
,
nSize
,
args
);
if
((
dwFlags
&
FORMAT_MESSAGE_FROM_SYSTEM
)
&&
(
dwFlags
&
FORMAT_MESSAGE_FROM_HMODULE
))
return
0
;
if
((
dwFlags
&
FORMAT_MESSAGE_FROM_STRING
)
&&
((
dwFlags
&
FORMAT_MESSAGE_FROM_SYSTEM
)
||
(
dwFlags
&
FORMAT_MESSAGE_FROM_HMODULE
)))
return
0
;
...
...
@@ -419,29 +433,47 @@ DWORD WINAPI FormatMessageW(
from
=
HEAP_strdupWtoA
(
GetProcessHeap
(),
0
,(
LPWSTR
)
lpSource
);
}
else
{
if
(
dwFlags
&
FORMAT_MESSAGE_FROM_SYSTEM
)
hmodule
=
GetModuleHandleA
(
"kernel32"
);
bufsize
=
load_messageA
(
hmodule
,
dwMessageId
,
dwLanguageId
,
NULL
,
100
);
if
(
!
bufsize
)
{
if
(
dwLanguageId
)
{
SetLastError
(
ERROR_RESOURCE_LANG_NOT_FOUND
);
return
0
;
bufsize
=
0
;
if
(
dwFlags
&
FORMAT_MESSAGE_FROM_HMODULE
)
{
bufsize
=
load_messageA
(
hmodule
,
dwMessageId
,
dwLanguageId
,
NULL
,
100
);
if
((
!
bufsize
)
&&
(
!
dwLanguageId
))
{
bufsize
=
load_messageA
(
hmodule
,
dwMessageId
,
MAKELANGID
(
LANG_NEUTRAL
,
SUBLANG_NEUTRAL
),
NULL
,
100
);
if
(
!
bufsize
)
bufsize
=
load_messageA
(
hmodule
,
dwMessageId
,
MAKELANGID
(
LANG_NEUTRAL
,
SUBLANG_DEFAULT
),
NULL
,
100
);
if
(
!
bufsize
)
bufsize
=
load_messageA
(
hmodule
,
dwMessageId
,
MAKELANGID
(
LANG_NEUTRAL
,
SUBLANG_SYS_DEFAULT
),
NULL
,
100
);
if
(
!
bufsize
)
bufsize
=
load_messageA
(
hmodule
,
dwMessageId
,
MAKELANGID
(
LANG_NEUTRAL
,
SUBLANG_SYS_DEFAULT
),
NULL
,
100
);
if
(
!
bufsize
)
bufsize
=
load_messageA
(
hmodule
,
dwMessageId
,
MAKELANGID
(
LANG_ENGLISH
,
SUBLANG_ENGLISH_US
),
NULL
,
100
);
}
bufsize
=
load_messageA
(
hmodule
,
dwMessageId
,
MAKELANGID
(
LANG_NEUTRAL
,
SUBLANG_NEUTRAL
),
NULL
,
100
);
if
(
!
bufsize
)
bufsize
=
load_messageA
(
hmodule
,
dwMessageId
,
MAKELANGID
(
LANG_NEUTRAL
,
SUBLANG_DEFAULT
),
NULL
,
100
);
if
(
!
bufsize
)
bufsize
=
load_messageA
(
hmodule
,
dwMessageId
,
MAKELANGID
(
LANG_NEUTRAL
,
SUBLANG_SYS_DEFAULT
),
NULL
,
100
);
if
(
!
bufsize
)
bufsize
=
load_messageA
(
hmodule
,
dwMessageId
,
MAKELANGID
(
LANG_NEUTRAL
,
SUBLANG_SYS_DEFAULT
),
NULL
,
100
);
if
(
!
bufsize
)
bufsize
=
load_messageA
(
hmodule
,
dwMessageId
,
MAKELANGID
(
LANG_ENGLISH
,
SUBLANG_ENGLISH_US
),
NULL
,
100
);
if
(
!
bufsize
)
{
SetLastError
(
ERROR_RESOURCE_LANG_NOT_FOUND
);
return
0
;
}
if
((
dwFlags
&
FORMAT_MESSAGE_FROM_SYSTEM
)
&&
(
!
bufsize
))
{
hmodule
=
GetModuleHandleA
(
"kernel32"
);
bufsize
=
load_messageA
(
hmodule
,
dwMessageId
,
dwLanguageId
,
NULL
,
100
);
if
((
!
bufsize
)
&&
(
!
dwLanguageId
))
{
bufsize
=
load_messageA
(
hmodule
,
dwMessageId
,
MAKELANGID
(
LANG_NEUTRAL
,
SUBLANG_NEUTRAL
),
NULL
,
100
);
if
(
!
bufsize
)
bufsize
=
load_messageA
(
hmodule
,
dwMessageId
,
MAKELANGID
(
LANG_NEUTRAL
,
SUBLANG_DEFAULT
),
NULL
,
100
);
if
(
!
bufsize
)
bufsize
=
load_messageA
(
hmodule
,
dwMessageId
,
MAKELANGID
(
LANG_NEUTRAL
,
SUBLANG_SYS_DEFAULT
),
NULL
,
100
);
if
(
!
bufsize
)
bufsize
=
load_messageA
(
hmodule
,
dwMessageId
,
MAKELANGID
(
LANG_NEUTRAL
,
SUBLANG_SYS_DEFAULT
),
NULL
,
100
);
if
(
!
bufsize
)
bufsize
=
load_messageA
(
hmodule
,
dwMessageId
,
MAKELANGID
(
LANG_ENGLISH
,
SUBLANG_ENGLISH_US
),
NULL
,
100
);
}
}
if
(
!
bufsize
)
{
SetLastError
(
ERROR_RESOURCE_LANG_NOT_FOUND
);
return
0
;
}
from
=
HeapAlloc
(
GetProcessHeap
(),
0
,
bufsize
+
1
);
load_messageA
(
hmodule
,
dwMessageId
,
dwLanguageId
,
from
,
bufsize
+
1
);
}
...
...
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