Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Side by Side Diff: third_party/lzma/v4_65/files/CPP/Windows/FileMapping.h

Issue 624713003: Keep only base/extractor.[cc|h]. (Closed) Base URL: https://chromium.googlesource.com/external/omaha.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Windows/FileMapping.h
2
3 #ifndef __WINDOWS_FILEMAPPING_H
4 #define __WINDOWS_FILEMAPPING_H
5
6 #include "Windows/Handle.h"
7 #include "Windows/Defs.h"
8
9 namespace NWindows {
10 // namespace NFile {
11 // namespace NMapping {
12
13 class CFileMapping: public CHandle
14 {
15 public:
16 bool Create(HANDLE file, LPSECURITY_ATTRIBUTES attributes,
17 DWORD protect, UINT64 maximumSize, LPCTSTR name)
18 {
19 _handle = ::CreateFileMapping(file, attributes,
20 protect, DWORD(maximumSize >> 32), DWORD(maximumSize), name);
21 return (_handle != NULL);
22 }
23
24 bool Open(DWORD desiredAccess, bool inheritHandle, LPCTSTR name)
25 {
26 _handle = ::OpenFileMapping(desiredAccess, BoolToBOOL(inheritHandle), name);
27 return (_handle != NULL);
28 }
29
30 LPVOID MapViewOfFile(DWORD desiredAccess, UINT64 fileOffset,
31 SIZE_T numberOfBytesToMap)
32 {
33 return ::MapViewOfFile(_handle, desiredAccess,
34 DWORD(fileOffset >> 32), DWORD(fileOffset), numberOfBytesToMap);
35 }
36
37 LPVOID MapViewOfFileEx(DWORD desiredAccess, UINT64 fileOffset,
38 SIZE_T numberOfBytesToMap, LPVOID baseAddress)
39 {
40 return ::MapViewOfFileEx(_handle, desiredAccess,
41 DWORD(fileOffset >> 32), DWORD(fileOffset),
42 numberOfBytesToMap, baseAddress);
43 }
44
45
46 };
47
48 }
49
50 #endif
OLDNEW
« no previous file with comments | « third_party/lzma/v4_65/files/CPP/Windows/FileIO.cpp ('k') | third_party/lzma/v4_65/files/CPP/Windows/FileMapping.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698