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
09d1c52f
Commit
09d1c52f
authored
Oct 15, 2009
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Move 16-bit resource functions to user16.c.
parent
a7adbf78
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
79 additions
and
66 deletions
+79
-66
resource.c
dlls/user32/resource.c
+0
-66
user16.c
dlls/user32/user16.c
+79
-0
No files found.
dlls/user32/resource.c
View file @
09d1c52f
...
@@ -26,9 +26,6 @@
...
@@ -26,9 +26,6 @@
#include "winerror.h"
#include "winerror.h"
#include "winternl.h"
#include "winternl.h"
#include "winnls.h"
#include "winnls.h"
#include "wine/winbase16.h"
#include "wine/winuser16.h"
#include "wownt32.h"
#include "wine/debug.h"
#include "wine/debug.h"
#include "user_private.h"
#include "user_private.h"
...
@@ -53,24 +50,6 @@ struct accelerator
...
@@ -53,24 +50,6 @@ struct accelerator
};
};
/**********************************************************************
/**********************************************************************
* LoadAccelerators [USER.177]
*/
HACCEL16
WINAPI
LoadAccelerators16
(
HINSTANCE16
instance
,
LPCSTR
lpTableName
)
{
HRSRC16
hRsrc
;
TRACE_
(
accel
)(
"%04x %s
\n
"
,
instance
,
debugstr_a
(
lpTableName
)
);
if
(
!
(
hRsrc
=
FindResource16
(
instance
,
lpTableName
,
(
LPSTR
)
RT_ACCELERATOR
)))
{
WARN_
(
accel
)(
"couldn't find accelerator table resource
\n
"
);
return
0
;
}
TRACE_
(
accel
)(
"returning HACCEL 0x%x
\n
"
,
hRsrc
);
return
LoadResource16
(
instance
,
hRsrc
);
}
/**********************************************************************
* LoadAcceleratorsW (USER32.@)
* LoadAcceleratorsW (USER32.@)
*/
*/
HACCEL
WINAPI
LoadAcceleratorsW
(
HINSTANCE
instance
,
LPCWSTR
name
)
HACCEL
WINAPI
LoadAcceleratorsW
(
HINSTANCE
instance
,
LPCWSTR
name
)
...
@@ -254,51 +233,6 @@ BOOL WINAPI DestroyAcceleratorTable( HACCEL handle )
...
@@ -254,51 +233,6 @@ BOOL WINAPI DestroyAcceleratorTable( HACCEL handle )
}
}
/**********************************************************************
/**********************************************************************
* LoadString (USER.176)
*/
INT16
WINAPI
LoadString16
(
HINSTANCE16
instance
,
UINT16
resource_id
,
LPSTR
buffer
,
INT16
buflen
)
{
HGLOBAL16
hmem
;
HRSRC16
hrsrc
;
unsigned
char
*
p
;
int
string_num
;
int
i
;
TRACE
(
"inst=%04x id=%04x buff=%p len=%d
\n
"
,
instance
,
resource_id
,
buffer
,
buflen
);
hrsrc
=
FindResource16
(
instance
,
MAKEINTRESOURCEA
((
resource_id
>>
4
)
+
1
),
(
LPSTR
)
RT_STRING
);
if
(
!
hrsrc
)
return
0
;
hmem
=
LoadResource16
(
instance
,
hrsrc
);
if
(
!
hmem
)
return
0
;
p
=
LockResource16
(
hmem
);
string_num
=
resource_id
&
0x000f
;
for
(
i
=
0
;
i
<
string_num
;
i
++
)
p
+=
*
p
+
1
;
TRACE
(
"strlen = %d
\n
"
,
(
int
)
*
p
);
if
(
buffer
==
NULL
)
return
*
p
;
i
=
min
(
buflen
-
1
,
*
p
);
if
(
i
>
0
)
{
memcpy
(
buffer
,
p
+
1
,
i
);
buffer
[
i
]
=
'\0'
;
}
else
{
if
(
buflen
>
1
)
{
buffer
[
0
]
=
'\0'
;
return
0
;
}
WARN
(
"Don't know why caller gave buflen=%d *p=%d trying to obtain string '%s'
\n
"
,
buflen
,
*
p
,
p
+
1
);
}
FreeResource16
(
hmem
);
TRACE
(
"'%s' loaded !
\n
"
,
buffer
);
return
i
;
}
/**********************************************************************
* LoadStringW (USER32.@)
* LoadStringW (USER32.@)
*/
*/
INT
WINAPI
LoadStringW
(
HINSTANCE
instance
,
UINT
resource_id
,
INT
WINAPI
LoadStringW
(
HINSTANCE
instance
,
UINT
resource_id
,
...
...
dlls/user32/user16.c
View file @
09d1c52f
...
@@ -612,6 +612,85 @@ HBITMAP16 WINAPI LoadBitmap16(HINSTANCE16 hInstance, LPCSTR name)
...
@@ -612,6 +612,85 @@ HBITMAP16 WINAPI LoadBitmap16(HINSTANCE16 hInstance, LPCSTR name)
return
HBITMAP_16
(
LoadBitmapA
(
HINSTANCE_32
(
hInstance
),
name
));
return
HBITMAP_16
(
LoadBitmapA
(
HINSTANCE_32
(
hInstance
),
name
));
}
}
/**********************************************************************
* LoadString (USER.176)
*/
INT16
WINAPI
LoadString16
(
HINSTANCE16
instance
,
UINT16
resource_id
,
LPSTR
buffer
,
INT16
buflen
)
{
HGLOBAL16
hmem
;
HRSRC16
hrsrc
;
unsigned
char
*
p
;
int
string_num
;
int
ret
;
TRACE
(
"inst=%04x id=%04x buff=%p len=%d
\n
"
,
instance
,
resource_id
,
buffer
,
buflen
);
hrsrc
=
FindResource16
(
instance
,
MAKEINTRESOURCEA
((
resource_id
>>
4
)
+
1
),
(
LPSTR
)
RT_STRING
);
if
(
!
hrsrc
)
return
0
;
hmem
=
LoadResource16
(
instance
,
hrsrc
);
if
(
!
hmem
)
return
0
;
p
=
LockResource16
(
hmem
);
string_num
=
resource_id
&
0x000f
;
while
(
string_num
--
)
p
+=
*
p
+
1
;
if
(
buffer
==
NULL
)
ret
=
*
p
;
else
{
ret
=
min
(
buflen
-
1
,
*
p
);
if
(
ret
>
0
)
{
memcpy
(
buffer
,
p
+
1
,
ret
);
buffer
[
ret
]
=
'\0'
;
}
else
if
(
buflen
>
1
)
{
buffer
[
0
]
=
'\0'
;
ret
=
0
;
}
TRACE
(
"%s loaded
\n
"
,
debugstr_a
(
buffer
));
}
FreeResource16
(
hmem
);
return
ret
;
}
/**********************************************************************
* LoadAccelerators (USER.177)
*/
HACCEL16
WINAPI
LoadAccelerators16
(
HINSTANCE16
instance
,
LPCSTR
lpTableName
)
{
HRSRC16
hRsrc
;
HGLOBAL16
hMem
;
ACCEL16
*
table16
;
HACCEL
ret
=
0
;
TRACE
(
"%04x %s
\n
"
,
instance
,
debugstr_a
(
lpTableName
)
);
if
(
!
(
hRsrc
=
FindResource16
(
instance
,
lpTableName
,
(
LPSTR
)
RT_ACCELERATOR
))
||
!
(
hMem
=
LoadResource16
(
instance
,
hRsrc
)))
{
WARN
(
"couldn't find %04x %s
\n
"
,
instance
,
debugstr_a
(
lpTableName
));
return
0
;
}
if
((
table16
=
LockResource16
(
hMem
)))
{
DWORD
i
,
count
=
SizeofResource16
(
instance
,
hRsrc
)
/
sizeof
(
*
table16
);
ACCEL
*
table
=
HeapAlloc
(
GetProcessHeap
(),
0
,
count
*
sizeof
(
*
table
)
);
if
(
table
)
{
for
(
i
=
0
;
i
<
count
;
i
++
)
{
table
[
i
].
fVirt
=
table16
[
i
].
fVirt
&
0x7f
;
table
[
i
].
key
=
table16
[
i
].
key
;
table
[
i
].
cmd
=
table16
[
i
].
cmd
;
}
ret
=
CreateAcceleratorTableA
(
table
,
count
);
HeapFree
(
GetProcessHeap
(),
0
,
table
);
}
}
FreeResource16
(
hMem
);
return
HACCEL_16
(
ret
);
}
/***********************************************************************
/***********************************************************************
* GetSystemMetrics (USER.179)
* GetSystemMetrics (USER.179)
...
...
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