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
8ad6c255
Commit
8ad6c255
authored
May 19, 2005
by
Dimi Paun
Committed by
Alexandre Julliard
May 19, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove LOCAL_*() calls from USER, use Local*16() instead.
parent
442f8937
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
75 additions
and
19 deletions
+75
-19
user_private.h
dlls/user/user_private.h
+38
-1
syscolor.c
windows/syscolor.c
+8
-3
user.c
windows/user.c
+29
-15
No files found.
dlls/user/user_private.h
View file @
8ad6c255
...
...
@@ -28,10 +28,47 @@
#include "winuser.h"
#include "winreg.h"
#include "winternl.h"
#include "local.h"
#include "wine/windef16.h"
#include "wine/winbase16.h"
extern
WORD
USER_HeapSel
;
static
inline
HLOCAL16
LOCAL_Alloc
(
HANDLE16
ds
,
UINT16
flags
,
WORD
size
)
{
STACK16FRAME
*
stack16
=
MapSL
((
SEGPTR
)
NtCurrentTeb
()
->
WOW32Reserved
);
HANDLE16
oldDS
=
stack16
->
ds
;
HLOCAL16
ret
;
stack16
->
ds
=
ds
;
ret
=
LocalAlloc16
(
flags
,
size
);
stack16
->
ds
=
oldDS
;
return
ret
;
}
static
inline
HLOCAL16
LOCAL_ReAlloc
(
HANDLE16
ds
,
HLOCAL16
handle
,
WORD
size
,
UINT16
flags
)
{
STACK16FRAME
*
stack16
=
MapSL
((
SEGPTR
)
NtCurrentTeb
()
->
WOW32Reserved
);
HANDLE16
oldDS
=
stack16
->
ds
;
HLOCAL16
ret
;
stack16
->
ds
=
ds
;
ret
=
LocalReAlloc16
(
handle
,
size
,
flags
);
stack16
->
ds
=
oldDS
;
return
ret
;
}
static
inline
HLOCAL16
LOCAL_Free
(
HANDLE16
ds
,
HLOCAL16
handle
)
{
STACK16FRAME
*
stack16
=
MapSL
((
SEGPTR
)
NtCurrentTeb
()
->
WOW32Reserved
);
HANDLE16
oldDS
=
stack16
->
ds
;
HLOCAL16
ret
;
stack16
->
ds
=
ds
;
ret
=
LocalFree16
(
handle
);
stack16
->
ds
=
oldDS
;
return
ret
;
}
#define USER_HEAP_ALLOC(size) \
((HANDLE)(ULONG_PTR)LOCAL_Alloc( USER_HeapSel, LMEM_FIXED, (size) ))
#define USER_HEAP_REALLOC(handle,size) \
...
...
windows/syscolor.c
View file @
8ad6c255
...
...
@@ -32,7 +32,7 @@
#include "winuser.h"
#include "wownt32.h"
#include "winreg.h"
#include "
loca
l.h"
#include "
wintern
l.h"
#include "gdi.h"
/* sic */
#include "wine/debug.h"
...
...
@@ -105,14 +105,19 @@ static void SYSCOLOR_MakeObjectSystem( HGDIOBJ16 handle, BOOL set)
if
(
!
heap_sel
)
heap_sel
=
LoadLibrary16
(
"gdi"
);
if
(
heap_sel
>=
32
)
{
ptr
=
(
LPWORD
)
LOCAL_Lock
(
heap_sel
,
handle
);
STACK16FRAME
*
stack16
=
MapSL
((
SEGPTR
)
NtCurrentTeb
()
->
WOW32Reserved
);
HANDLE16
oldDS
=
stack16
->
ds
;
stack16
->
ds
=
heap_sel
;
ptr
=
MapSL
(
LocalLock16
(
handle
));
/* touch the "system" bit of the wMagic field of a GDIOBJHDR */
if
(
set
)
*
ptr
&=
~
OBJECT_NOSYSTEM
;
else
*
ptr
|=
OBJECT_NOSYSTEM
;
LOCAL_Unlock
(
heap_sel
,
handle
);
LocalUnlock16
(
handle
);
stack16
->
ds
=
oldDS
;
}
}
...
...
windows/user.c
View file @
8ad6c255
...
...
@@ -35,7 +35,6 @@
#include "win.h"
#include "controls.h"
#include "cursoricon.h"
#include "local.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
user
);
...
...
@@ -73,6 +72,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(user);
*/
WORD
WINAPI
GetFreeSystemResources16
(
WORD
resType
)
{
STACK16FRAME
*
stack16
=
MapSL
((
SEGPTR
)
NtCurrentTeb
()
->
WOW32Reserved
);
HANDLE16
oldDS
=
stack16
->
ds
;
HINSTANCE16
gdi_inst
;
WORD
gdi_heap
;
int
userPercent
,
gdiPercent
;
...
...
@@ -83,22 +84,25 @@ WORD WINAPI GetFreeSystemResources16( WORD resType )
switch
(
resType
)
{
case
GFSR_USERRESOURCES
:
userPercent
=
(
int
)
LOCAL_CountFree
(
USER_HeapSel
)
*
100
/
LOCAL_HeapSize
(
USER_HeapSel
);
stack16
->
ds
=
USER_HeapSel
;
userPercent
=
(
int
)
LocalCountFree16
()
*
100
/
LocalHeapSize16
(
);
gdiPercent
=
100
;
stack16
->
ds
=
oldDS
;
break
;
case
GFSR_GDIRESOURCES
:
gdiPercent
=
(
int
)
LOCAL_CountFree
(
gdi_inst
)
*
100
/
LOCAL_HeapSize
(
gdi_inst
);
stack16
->
ds
=
gdi_inst
;
gdiPercent
=
(
int
)
LocalCountFree16
()
*
100
/
LocalHeapSize16
(
);
userPercent
=
100
;
stack16
->
ds
=
oldDS
;
break
;
case
GFSR_SYSTEMRESOURCES
:
userPercent
=
(
int
)
LOCAL_CountFree
(
USER_HeapSel
)
*
100
/
LOCAL_HeapSize
(
USER_HeapSel
);
gdiPercent
=
(
int
)
LOCAL_CountFree
(
gdi_inst
)
*
100
/
LOCAL_HeapSize
(
gdi_inst
);
stack16
->
ds
=
USER_HeapSel
;
userPercent
=
(
int
)
LocalCountFree16
()
*
100
/
LocalHeapSize16
();
stack16
->
ds
=
gdi_inst
;
gdiPercent
=
(
int
)
LocalCountFree16
()
*
100
/
LocalHeapSize16
();
stack16
->
ds
=
oldDS
;
break
;
default:
...
...
@@ -546,23 +550,33 @@ BOOL WINAPI EnumDisplayDevicesW(
*/
DWORD
WINAPI
UserSeeUserDo16
(
WORD
wReqType
,
WORD
wParam1
,
WORD
wParam2
,
WORD
wParam3
)
{
STACK16FRAME
*
stack16
=
MapSL
((
SEGPTR
)
NtCurrentTeb
()
->
WOW32Reserved
);
HANDLE16
oldDS
=
stack16
->
ds
;
DWORD
ret
=
(
DWORD
)
-
1
;
stack16
->
ds
=
USER_HeapSel
;
switch
(
wReqType
)
{
case
USUD_LOCALALLOC
:
return
LOCAL_Alloc
(
USER_HeapSel
,
wParam1
,
wParam3
);
ret
=
LocalAlloc16
(
wParam1
,
wParam3
);
break
;
case
USUD_LOCALFREE
:
return
LOCAL_Free
(
USER_HeapSel
,
wParam1
);
ret
=
LocalFree16
(
wParam1
);
break
;
case
USUD_LOCALCOMPACT
:
return
LOCAL_Compact
(
USER_HeapSel
,
wParam3
);
ret
=
LocalCompact16
(
wParam3
);
break
;
case
USUD_LOCALHEAP
:
return
USER_HeapSel
;
ret
=
USER_HeapSel
;
break
;
case
USUD_FIRSTCLASS
:
FIXME
(
"return a pointer to the first window class.
\n
"
);
return
(
DWORD
)
-
1
;
break
;
default:
WARN
(
"wReqType %04x (unknown)
\n
"
,
wReqType
);
return
(
DWORD
)
-
1
;
}
stack16
->
ds
=
oldDS
;
return
ret
;
}
/***********************************************************************
...
...
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