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
4f2df51f
Commit
4f2df51f
authored
Jan 15, 2001
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replaced GLOBAL_Alloc by GlobalAlloc16 where possible.
parent
a41b2cfd
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
15 deletions
+18
-15
builtin.c
if1632/builtin.c
+2
-2
module.c
loader/ne/module.c
+5
-6
resource.c
loader/ne/resource.c
+9
-5
task.c
loader/task.c
+2
-2
No files found.
if1632/builtin.c
View file @
4f2df51f
...
...
@@ -17,7 +17,6 @@
#include "module.h"
#include "miscemu.h"
#include "stackframe.h"
#include "task.h"
#include "debugtools.h"
#include "toolhelp.h"
...
...
@@ -85,8 +84,9 @@ static HMODULE16 BUILTIN_DoLoadModule16( const BUILTIN16_DESCRIPTOR *descr )
minsize
=
pSegTable
->
minsize
?
pSegTable
->
minsize
:
0x10000
;
minsize
+=
pModule
->
heap_size
;
if
(
minsize
>
0x10000
)
minsize
=
0x10000
;
pSegTable
->
hSeg
=
G
LOBAL_Alloc
(
GMEM_FIXED
,
minsize
,
hModule
,
WINE_LDT_FLAGS_DATA
);
pSegTable
->
hSeg
=
G
lobalAlloc16
(
GMEM_FIXED
,
minsize
);
if
(
!
pSegTable
->
hSeg
)
return
0
;
FarSetOwner16
(
pSegTable
->
hSeg
,
hModule
);
if
(
pSegTable
->
minsize
)
memcpy
(
GlobalLock16
(
pSegTable
->
hSeg
),
descr
->
data_start
,
pSegTable
->
minsize
);
if
(
pModule
->
heap_size
)
...
...
loader/ne/module.c
View file @
4f2df51f
...
...
@@ -19,7 +19,6 @@
#include "file.h"
#include "heap.h"
#include "task.h"
#include "global.h"
#include "snoop.h"
#include "builtin16.h"
#include "stackframe.h"
...
...
@@ -710,13 +709,13 @@ static HMODULE16 NE_LoadExeHeader( HANDLE hFile, LPCSTR path )
if
(
ne_header
.
ne_cbnrestab
)
{
pModule
->
nrname_handle
=
GLOBAL_Alloc
(
0
,
ne_header
.
ne_cbnrestab
,
hModule
,
WINE_LDT_FLAGS_DATA
);
pModule
->
nrname_handle
=
GlobalAlloc16
(
0
,
ne_header
.
ne_cbnrestab
);
if
(
!
pModule
->
nrname_handle
)
{
GlobalFree16
(
hModule
);
return
(
HMODULE16
)
11
;
/* invalid exe */
}
FarSetOwner16
(
pModule
->
nrname_handle
,
hModule
);
buffer
=
GlobalLock16
(
pModule
->
nrname_handle
);
_llseek
(
hFile
,
ne_header
.
ne_nrestab
,
SEEK_SET
);
if
(
_lread
(
hFile
,
buffer
,
ne_header
.
ne_cbnrestab
)
...
...
@@ -733,15 +732,15 @@ static HMODULE16 NE_LoadExeHeader( HANDLE hFile, LPCSTR path )
if
(
pModule
->
modref_count
)
{
pModule
->
dlls_to_init
=
GLOBAL_Alloc
(
GMEM_ZEROINIT
,
(
pModule
->
modref_count
+
1
)
*
sizeof
(
HMODULE16
),
hModule
,
WINE_LDT_FLAGS_DATA
);
pModule
->
dlls_to_init
=
GlobalAlloc16
(
GMEM_ZEROINIT
,
(
pModule
->
modref_count
+
1
)
*
sizeof
(
HMODULE16
)
);
if
(
!
pModule
->
dlls_to_init
)
{
if
(
pModule
->
nrname_handle
)
GlobalFree16
(
pModule
->
nrname_handle
);
GlobalFree16
(
hModule
);
return
(
HMODULE16
)
11
;
/* invalid exe */
}
FarSetOwner16
(
pModule
->
dlls_to_init
,
hModule
);
}
else
pModule
->
dlls_to_init
=
0
;
...
...
loader/ne/resource.c
View file @
4f2df51f
...
...
@@ -17,7 +17,6 @@
#include "wine/port.h"
#include "wine/winbase16.h"
#include "wine/library.h"
#include "global.h"
#include "module.h"
#include "callback.h"
#include "debugtools.h"
...
...
@@ -367,6 +366,7 @@ HGLOBAL16 WINAPI AllocResource16( HMODULE16 hModule, HRSRC16 hRsrc, DWORD size)
{
NE_NAMEINFO
*
pNameInfo
=
NULL
;
WORD
sizeShift
;
HGLOBAL16
ret
;
NE_MODULE
*
pModule
=
NE_GetPtr
(
hModule
);
if
(
!
pModule
||
!
pModule
->
res_table
||
!
hRsrc
)
return
0
;
...
...
@@ -377,7 +377,9 @@ HGLOBAL16 WINAPI AllocResource16( HMODULE16 hModule, HRSRC16 hRsrc, DWORD size)
pNameInfo
=
(
NE_NAMEINFO
*
)((
char
*
)
pModule
+
hRsrc
);
if
(
size
<
(
DWORD
)
pNameInfo
->
length
<<
sizeShift
)
size
=
(
DWORD
)
pNameInfo
->
length
<<
sizeShift
;
return
GLOBAL_Alloc
(
GMEM_FIXED
,
size
,
hModule
,
WINE_LDT_FLAGS_DATA
);
ret
=
GlobalAlloc16
(
GMEM_FIXED
,
size
);
if
(
ret
)
FarSetOwner16
(
ret
,
hModule
);
return
ret
;
}
...
...
@@ -389,13 +391,15 @@ HGLOBAL16 WINAPI AllocResource16( HMODULE16 hModule, HRSRC16 hRsrc, DWORD size)
HGLOBAL16
WINAPI
DirectResAlloc16
(
HINSTANCE16
hInstance
,
WORD
wType
,
UINT16
wSize
)
{
TRACE
(
"(%04x,%04x,%04x)
\n
"
,
hInstance
,
wType
,
wSize
);
HGLOBAL16
ret
;
TRACE
(
"(%04x,%04x,%04x)
\n
"
,
hInstance
,
wType
,
wSize
);
if
(
!
(
hInstance
=
GetExePtr
(
hInstance
)))
return
0
;
if
(
wType
!=
0x10
)
/* 0x10 is the only observed value, passed from
CreateCursorIndirect. */
TRACE
(
"(wType=%x)
\n
"
,
wType
);
return
GLOBAL_Alloc
(
GMEM_MOVEABLE
,
wSize
,
hInstance
,
WINE_LDT_FLAGS_DATA
);
ret
=
GlobalAlloc16
(
GMEM_MOVEABLE
,
wSize
);
if
(
ret
)
FarSetOwner16
(
ret
,
hInstance
);
return
ret
;
}
...
...
loader/task.c
View file @
4f2df51f
...
...
@@ -226,10 +226,10 @@ BOOL TASK_Create( NE_MODULE *pModule, UINT16 cmdShow, TEB *teb, LPCSTR cmdline,
/* Allocate the task structure */
hTask
=
GLOBAL_Alloc
(
GMEM_FIXED
|
GMEM_ZEROINIT
,
sizeof
(
TDB
),
pModule
->
self
,
WINE_LDT_FLAGS_DATA
);
hTask
=
GlobalAlloc16
(
GMEM_FIXED
|
GMEM_ZEROINIT
,
sizeof
(
TDB
)
);
if
(
!
hTask
)
return
FALSE
;
pTask
=
(
TDB
*
)
GlobalLock16
(
hTask
);
FarSetOwner16
(
hTask
,
pModule
->
self
);
/* Fill the task structure */
...
...
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