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
0ce0af5f
Commit
0ce0af5f
authored
Dec 27, 2008
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Move AllocMappedBuffer/FreeMappedBuffer to thunk.c.
parent
186ca36d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
72 additions
and
73 deletions
+72
-73
heap.c
dlls/kernel32/heap.c
+0
-73
thunk.c
dlls/kernel32/thunk.c
+72
-0
No files found.
dlls/kernel32/heap.c
View file @
0ce0af5f
...
...
@@ -1119,79 +1119,6 @@ BOOL WINAPI LocalUnlock(
}
/**********************************************************************
* AllocMappedBuffer (KERNEL32.38)
*
* This is an undocumented KERNEL32 function that
* SMapLS's a GlobalAlloc'ed buffer.
*
* RETURNS
* EDI register: pointer to buffer
*
* NOTES
* The buffer is preceded by 8 bytes:
* ...
* edi+0 buffer
* edi-4 SEGPTR to buffer
* edi-8 some magic Win95 needs for SUnMapLS
* (we use it for the memory handle)
*
* The SEGPTR is used by the caller!
*/
void
WINAPI
__regs_AllocMappedBuffer
(
CONTEXT86
*
context
/* [in] EDI register: size of buffer to allocate */
)
{
HGLOBAL
handle
=
GlobalAlloc
(
0
,
context
->
Edi
+
8
);
DWORD
*
buffer
=
GlobalLock
(
handle
);
DWORD
ptr
=
0
;
if
(
buffer
)
if
(
!
(
ptr
=
MapLS
(
buffer
+
2
)))
{
GlobalUnlock
(
handle
);
GlobalFree
(
handle
);
}
if
(
!
ptr
)
context
->
Eax
=
context
->
Edi
=
0
;
else
{
buffer
[
0
]
=
(
DWORD
)
handle
;
buffer
[
1
]
=
ptr
;
context
->
Eax
=
ptr
;
context
->
Edi
=
(
DWORD
)(
buffer
+
2
);
}
}
#ifdef DEFINE_REGS_ENTRYPOINT
DEFINE_REGS_ENTRYPOINT
(
AllocMappedBuffer
,
0
,
0
)
#endif
/**********************************************************************
* FreeMappedBuffer (KERNEL32.39)
*
* Free a buffer allocated by AllocMappedBuffer
*
* RETURNS
* Nothing.
*/
void
WINAPI
__regs_FreeMappedBuffer
(
CONTEXT86
*
context
/* [in] EDI register: pointer to buffer */
)
{
if
(
context
->
Edi
)
{
DWORD
*
buffer
=
(
DWORD
*
)
context
->
Edi
-
2
;
UnMapLS
(
buffer
[
1
]);
GlobalUnlock
((
HGLOBAL
)
buffer
[
0
]);
GlobalFree
((
HGLOBAL
)
buffer
[
0
]);
}
}
#ifdef DEFINE_REGS_ENTRYPOINT
DEFINE_REGS_ENTRYPOINT
(
FreeMappedBuffer
,
0
,
0
)
#endif
/***********************************************************************
* GlobalMemoryStatusEx (KERNEL32.@)
* A version of GlobalMemoryStatus that can deal with memory over 4GB
...
...
dlls/kernel32/thunk.c
View file @
0ce0af5f
...
...
@@ -1185,6 +1185,78 @@ FreeSLCallback(
FIXME
(
"(0x%08x): stub
\n
"
,
x
);
}
/**********************************************************************
* AllocMappedBuffer (KERNEL32.38)
*
* This is an undocumented KERNEL32 function that
* SMapLS's a GlobalAlloc'ed buffer.
*
* RETURNS
* EDI register: pointer to buffer
*
* NOTES
* The buffer is preceded by 8 bytes:
* ...
* edi+0 buffer
* edi-4 SEGPTR to buffer
* edi-8 some magic Win95 needs for SUnMapLS
* (we use it for the memory handle)
*
* The SEGPTR is used by the caller!
*/
void
WINAPI
__regs_AllocMappedBuffer
(
CONTEXT86
*
context
/* [in] EDI register: size of buffer to allocate */
)
{
HGLOBAL
handle
=
GlobalAlloc
(
0
,
context
->
Edi
+
8
);
DWORD
*
buffer
=
GlobalLock
(
handle
);
DWORD
ptr
=
0
;
if
(
buffer
)
if
(
!
(
ptr
=
MapLS
(
buffer
+
2
)))
{
GlobalUnlock
(
handle
);
GlobalFree
(
handle
);
}
if
(
!
ptr
)
context
->
Eax
=
context
->
Edi
=
0
;
else
{
buffer
[
0
]
=
(
DWORD
)
handle
;
buffer
[
1
]
=
ptr
;
context
->
Eax
=
ptr
;
context
->
Edi
=
(
DWORD
)(
buffer
+
2
);
}
}
#ifdef DEFINE_REGS_ENTRYPOINT
DEFINE_REGS_ENTRYPOINT
(
AllocMappedBuffer
,
0
,
0
)
#endif
/**********************************************************************
* FreeMappedBuffer (KERNEL32.39)
*
* Free a buffer allocated by AllocMappedBuffer
*
* RETURNS
* Nothing.
*/
void
WINAPI
__regs_FreeMappedBuffer
(
CONTEXT86
*
context
/* [in] EDI register: pointer to buffer */
)
{
if
(
context
->
Edi
)
{
DWORD
*
buffer
=
(
DWORD
*
)
context
->
Edi
-
2
;
UnMapLS
(
buffer
[
1
]);
GlobalUnlock
((
HGLOBAL
)
buffer
[
0
]);
GlobalFree
((
HGLOBAL
)
buffer
[
0
]);
}
}
#ifdef DEFINE_REGS_ENTRYPOINT
DEFINE_REGS_ENTRYPOINT
(
FreeMappedBuffer
,
0
,
0
)
#endif
/**********************************************************************
* GetTEBSelectorFS (KERNEL.475)
...
...
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