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
65bc1599
Commit
65bc1599
authored
Oct 07, 2009
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Move the k32 kernel32->user32 helpers to thunk.c.
parent
e0ce6dc3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
104 additions
and
113 deletions
+104
-113
kernel32.spec
dlls/kernel32/kernel32.spec
+7
-7
string.c
dlls/kernel32/string.c
+0
-106
thunk.c
dlls/kernel32/thunk.c
+97
-0
No files found.
dlls/kernel32/kernel32.spec
View file @
65bc1599
...
...
@@ -17,13 +17,13 @@
7 stdcall -noname -i386 -register VxDCall6(long) VxDCall
8 stdcall -noname -i386 -register VxDCall7(long) VxDCall
9 stdcall -noname -i386 -register VxDCall8(long) VxDCall
10 stdcall -noname k32CharToOemA(str ptr)
11 stdcall -noname k32CharToOemBuffA(str ptr long)
12 stdcall -noname k32OemToCharA(ptr ptr)
13 stdcall -noname k32OemToCharBuffA(ptr ptr long)
14 stdcall -noname k32LoadStringA(long long ptr long)
15 varargs -noname k32wsprintfA(str str)
16 stdcall -noname k32wvsprintfA(ptr str ptr)
10 stdcall -noname
-i386
k32CharToOemA(str ptr)
11 stdcall -noname
-i386
k32CharToOemBuffA(str ptr long)
12 stdcall -noname
-i386
k32OemToCharA(ptr ptr)
13 stdcall -noname
-i386
k32OemToCharBuffA(ptr ptr long)
14 stdcall -noname
-i386
k32LoadStringA(long long ptr long)
15 varargs -noname
-i386
k32wsprintfA(str str)
16 stdcall -noname
-i386
k32wvsprintfA(ptr str ptr)
17 stdcall -noname -i386 -register CommonUnimpStub()
18 stdcall -noname GetProcessDword(long long)
19 stub -noname ThunkTheTemplateHandle
...
...
dlls/kernel32/string.c
View file @
65bc1599
...
...
@@ -30,116 +30,10 @@
#define WINE_NO_INLINE_STRING
#include "windef.h"
#include "winbase.h"
#include "wine/winbase16.h"
#include "wine/unicode.h"
#include "wine/exception.h"
static
INT
(
WINAPI
*
pLoadStringA
)(
HINSTANCE
,
UINT
,
LPSTR
,
INT
);
static
INT
(
WINAPI
*
pwvsprintfA
)(
LPSTR
,
LPCSTR
,
__ms_va_list
);
/***********************************************************************
* Helper for k32 family functions
*/
static
void
*
user32_proc_address
(
const
char
*
proc_name
)
{
static
HMODULE
hUser32
;
if
(
!
hUser32
)
hUser32
=
LoadLibraryA
(
"user32.dll"
);
return
GetProcAddress
(
hUser32
,
proc_name
);
}
/***********************************************************************
* k32CharToOemBuffA (KERNEL32.11)
*/
BOOL
WINAPI
k32CharToOemBuffA
(
LPCSTR
s
,
LPSTR
d
,
DWORD
len
)
{
WCHAR
*
bufW
;
if
((
bufW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
)
)))
{
MultiByteToWideChar
(
CP_ACP
,
0
,
s
,
len
,
bufW
,
len
);
WideCharToMultiByte
(
CP_OEMCP
,
0
,
bufW
,
len
,
d
,
len
,
NULL
,
NULL
);
HeapFree
(
GetProcessHeap
(),
0
,
bufW
);
}
return
TRUE
;
}
/***********************************************************************
* k32CharToOemA (KERNEL32.10)
*/
BOOL
WINAPI
k32CharToOemA
(
LPCSTR
s
,
LPSTR
d
)
{
if
(
!
s
||
!
d
)
return
TRUE
;
return
k32CharToOemBuffA
(
s
,
d
,
strlen
(
s
)
+
1
);
}
/***********************************************************************
* k32OemToCharBuffA (KERNEL32.13)
*/
BOOL
WINAPI
k32OemToCharBuffA
(
LPCSTR
s
,
LPSTR
d
,
DWORD
len
)
{
WCHAR
*
bufW
;
if
((
bufW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
)
)))
{
MultiByteToWideChar
(
CP_OEMCP
,
0
,
s
,
len
,
bufW
,
len
);
WideCharToMultiByte
(
CP_ACP
,
0
,
bufW
,
len
,
d
,
len
,
NULL
,
NULL
);
HeapFree
(
GetProcessHeap
(),
0
,
bufW
);
}
return
TRUE
;
}
/***********************************************************************
* k32OemToCharA (KERNEL32.12)
*/
BOOL
WINAPI
k32OemToCharA
(
LPCSTR
s
,
LPSTR
d
)
{
return
k32OemToCharBuffA
(
s
,
d
,
strlen
(
s
)
+
1
);
}
/**********************************************************************
* k32LoadStringA (KERNEL32.14)
*/
INT
WINAPI
k32LoadStringA
(
HINSTANCE
instance
,
UINT
resource_id
,
LPSTR
buffer
,
INT
buflen
)
{
if
(
!
pLoadStringA
)
pLoadStringA
=
user32_proc_address
(
"LoadStringA"
);
return
pLoadStringA
(
instance
,
resource_id
,
buffer
,
buflen
);
}
/***********************************************************************
* k32wvsprintfA (KERNEL32.16)
*/
INT
WINAPI
k32wvsprintfA
(
LPSTR
buffer
,
LPCSTR
spec
,
__ms_va_list
args
)
{
if
(
!
pwvsprintfA
)
pwvsprintfA
=
user32_proc_address
(
"wvsprintfA"
);
return
(
*
pwvsprintfA
)(
buffer
,
spec
,
args
);
}
/***********************************************************************
* k32wsprintfA (KERNEL32.15)
*/
INT
WINAPIV
k32wsprintfA
(
LPSTR
buffer
,
LPCSTR
spec
,
...)
{
__ms_va_list
args
;
INT
res
;
__ms_va_start
(
args
,
spec
);
res
=
k32wvsprintfA
(
buffer
,
spec
,
args
);
__ms_va_end
(
args
);
return
res
;
}
/***********************************************************************
* lstrcatA (KERNEL32.@)
* lstrcat (KERNEL32.@)
...
...
dlls/kernel32/thunk.c
View file @
65bc1599
...
...
@@ -2176,6 +2176,103 @@ DWORD WINAPI _KERNEL32_99(DWORD x)
}
/***********************************************************************
* Helper for k32 family functions
*/
static
void
*
user32_proc_address
(
const
char
*
proc_name
)
{
static
HMODULE
hUser32
;
if
(
!
hUser32
)
hUser32
=
LoadLibraryA
(
"user32.dll"
);
return
GetProcAddress
(
hUser32
,
proc_name
);
}
/***********************************************************************
* k32CharToOemBuffA (KERNEL32.11)
*/
BOOL
WINAPI
k32CharToOemBuffA
(
LPCSTR
s
,
LPSTR
d
,
DWORD
len
)
{
WCHAR
*
bufW
;
if
((
bufW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
)
)))
{
MultiByteToWideChar
(
CP_ACP
,
0
,
s
,
len
,
bufW
,
len
);
WideCharToMultiByte
(
CP_OEMCP
,
0
,
bufW
,
len
,
d
,
len
,
NULL
,
NULL
);
HeapFree
(
GetProcessHeap
(),
0
,
bufW
);
}
return
TRUE
;
}
/***********************************************************************
* k32CharToOemA (KERNEL32.10)
*/
BOOL
WINAPI
k32CharToOemA
(
LPCSTR
s
,
LPSTR
d
)
{
if
(
!
s
||
!
d
)
return
TRUE
;
return
k32CharToOemBuffA
(
s
,
d
,
strlen
(
s
)
+
1
);
}
/***********************************************************************
* k32OemToCharBuffA (KERNEL32.13)
*/
BOOL
WINAPI
k32OemToCharBuffA
(
LPCSTR
s
,
LPSTR
d
,
DWORD
len
)
{
WCHAR
*
bufW
;
if
((
bufW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
)
)))
{
MultiByteToWideChar
(
CP_OEMCP
,
0
,
s
,
len
,
bufW
,
len
);
WideCharToMultiByte
(
CP_ACP
,
0
,
bufW
,
len
,
d
,
len
,
NULL
,
NULL
);
HeapFree
(
GetProcessHeap
(),
0
,
bufW
);
}
return
TRUE
;
}
/***********************************************************************
* k32OemToCharA (KERNEL32.12)
*/
BOOL
WINAPI
k32OemToCharA
(
LPCSTR
s
,
LPSTR
d
)
{
return
k32OemToCharBuffA
(
s
,
d
,
strlen
(
s
)
+
1
);
}
/**********************************************************************
* k32LoadStringA (KERNEL32.14)
*/
INT
WINAPI
k32LoadStringA
(
HINSTANCE
instance
,
UINT
resource_id
,
LPSTR
buffer
,
INT
buflen
)
{
static
INT
(
WINAPI
*
pLoadStringA
)(
HINSTANCE
,
UINT
,
LPSTR
,
INT
);
if
(
!
pLoadStringA
)
pLoadStringA
=
user32_proc_address
(
"LoadStringA"
);
return
pLoadStringA
(
instance
,
resource_id
,
buffer
,
buflen
);
}
/***********************************************************************
* k32wvsprintfA (KERNEL32.16)
*/
INT
WINAPI
k32wvsprintfA
(
LPSTR
buffer
,
LPCSTR
spec
,
__ms_va_list
args
)
{
static
INT
(
WINAPI
*
pwvsprintfA
)(
LPSTR
,
LPCSTR
,
__ms_va_list
);
if
(
!
pwvsprintfA
)
pwvsprintfA
=
user32_proc_address
(
"wvsprintfA"
);
return
(
*
pwvsprintfA
)(
buffer
,
spec
,
args
);
}
/***********************************************************************
* k32wsprintfA (KERNEL32.15)
*/
INT
WINAPIV
k32wsprintfA
(
LPSTR
buffer
,
LPCSTR
spec
,
...)
{
__ms_va_list
args
;
INT
res
;
__ms_va_start
(
args
,
spec
);
res
=
k32wvsprintfA
(
buffer
,
spec
,
args
);
__ms_va_end
(
args
);
return
res
;
}
/**********************************************************************
* Catch (KERNEL.55)
*
...
...
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