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
19aa3a79
Commit
19aa3a79
authored
Oct 18, 1998
by
Turchanov Sergey
Committed by
Alexandre Julliard
Oct 18, 1998
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added VIRTUAL_MapFileW to map file to memory in one function call.
parent
656eb965
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
0 deletions
+28
-0
global.h
include/global.h
+1
-0
virtual.c
memory/virtual.c
+27
-0
No files found.
include/global.h
View file @
19aa3a79
...
...
@@ -33,6 +33,7 @@ extern WORD WINAPI GlobalHandleToSel( HGLOBAL16 handle );
extern
BOOL32
VIRTUAL_Init
(
void
);
extern
DWORD
VIRTUAL_GetPageSize
(
void
);
extern
DWORD
VIRTUAL_GetGranularity
(
void
);
extern
LPVOID
VIRTUAL_MapFileW
(
LPCWSTR
name
);
typedef
BOOL32
(
*
HANDLERPROC
)(
LPVOID
,
LPVOID
);
extern
BOOL32
VIRTUAL_SetFaultHandler
(
LPVOID
addr
,
HANDLERPROC
proc
,
LPVOID
arg
);
...
...
memory/virtual.c
View file @
19aa3a79
...
...
@@ -1447,3 +1447,30 @@ BOOL32 WINAPI UnmapViewOfFile(
VIRTUAL_DeleteView
(
view
);
return
TRUE
;
}
/***********************************************************************
* VIRTUAL_MapFileW
*
* Helper function to map a file to memory:
* name - file name
* [RETURN] ptr - pointer to mapped file
*/
LPVOID
VIRTUAL_MapFileW
(
LPCWSTR
name
)
{
HANDLE32
hFile
,
hMapping
;
LPVOID
ptr
=
NULL
;
hFile
=
CreateFile32W
(
name
,
GENERIC_READ
,
FILE_SHARE_READ
,
NULL
,
OPEN_EXISTING
,
FILE_FLAG_RANDOM_ACCESS
,
0
);
if
(
hFile
!=
INVALID_HANDLE_VALUE32
)
{
hMapping
=
CreateFileMapping32A
(
hFile
,
NULL
,
PAGE_READONLY
,
0
,
0
,
NULL
);
CloseHandle
(
hFile
);
if
(
hMapping
)
{
ptr
=
MapViewOfFile
(
hMapping
,
FILE_MAP_READ
,
0
,
0
,
0
);
CloseHandle
(
hMapping
);
}
}
return
ptr
;
}
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