色婷婷狠狠18禁久久YY,CHINESE性内射高清国产,国产女人18毛片水真多1,国产AV在线观看

內(nèi)存如何建立映射表

錢良釵2年前15瀏覽0評論

內(nèi)存如何建立映射表?

#include <iostream>

#include <assert.h>

#include <Windows.h>

#include <WinBase.h>

#define BAD_POS 0xFFFFFFFF // returned by SetFilePointer and GetFileSize

#define SUCCESS 0

using namespace std;

typedef DWORD mmf_share_mode;

typedef DWORD mmf_access_mode;

typedef DWORD mmf_flags;

int main() {

cout << "create memorymapfile..." << endl;

const char* shared_name = "testMmf";

const char* file_name = "d:\\testMmf.mmf";

const DWORD mmf_size = 512 * 1024;

//存取模式

mmf_access_mode access_mode = (GENERIC_READ | GENERIC_WRITE);

//共享模式

mmf_share_mode share_mode = FILE_SHARE_READ | FILE_SHARE_WRITE;

//文件屬性

mmf_flags flags = FILE_FLAG_SEQUENTIAL_SCAN;//|FILE_FLAG_WRITE_THROUGH|FILE_FLAG_NO_BUFFERING;

DWORD error_code;

//創(chuàng)建文件

HANDLE mmHandle =

CreateFile(file_name,

access_mode,

share_mode,

NULL,

OPEN_ALWAYS,

flags,

NULL);

if (mmHandle == INVALID_HANDLE_VALUE) {

error_code = GetLastError();

cout << "創(chuàng)建mmf失敗:" << error_code << endl;

}

else {

DWORD

mapfile java,內(nèi)存如何建立映射表