Click here to Skip to main content
15,897,187 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Log file structures Pin
Mark Salsbery11-Feb-07 9:21
Mark Salsbery11-Feb-07 9:21 
GeneralRe: Log file structures Pin
Waldermort11-Feb-07 9:40
Waldermort11-Feb-07 9:40 
GeneralRe: Log file structures Pin
Mark Salsbery11-Feb-07 10:28
Mark Salsbery11-Feb-07 10:28 
GeneralRe: Log file structures Pin
Waldermort11-Feb-07 20:40
Waldermort11-Feb-07 20:40 
GeneralRe: Log file structures Pin
kakan12-Feb-07 1:17
professionalkakan12-Feb-07 1:17 
GeneralRe: Log file structures Pin
Waldermort12-Feb-07 2:00
Waldermort12-Feb-07 2:00 
GeneralRe: Log file structures Pin
kakan12-Feb-07 2:04
professionalkakan12-Feb-07 2:04 
QuestionCreateFileMapping/MapViewOfFile and 0xC0000005 (ACCESS_DENIED) Pin
Jeffrey Walton11-Feb-07 3:59
Jeffrey Walton11-Feb-07 3:59 
Hi All,

Here's an interesting one... Debug is Broken, Release is OK. I've got test cases down to failures on LARGE files in Debug Builds. The reason the large file does not exist in Release: Debug information is stripped (I'm literally probing my own EXE).

The original FileMapping code was shamelessly ripped from Matt Pietrek's An In-Depth Look into the Win32 Portable Executable File Format[^]. I can't seem to find what is wrong with the original useage.

I suspect this has to do with the Memory Manager's ability to keep up... Any ideas? Below is how I am using CreateFileMapping/MapViewOfFile.

Jeff

/////////////////////////////////////////////////
if( 0 == GetModuleFileName( NULL, szFilename, PATH_SIZE ) )
{
    std::cout << _T("Error Retrieving Process Filename") << std::endl;
    __leave;
}


/////////////////////////////////////////////////////////////
hFile = CreateFile( szFilename, GENERIC_READ, FILE_SHARE_READ,
    NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);

if ( hFile == INVALID_HANDLE_VALUE )
{
    std::cout << _T("Error - CreateFile()") << std::endl;
    __leave;
}

/////////////////////////////////////////////////////////////
hFileMapping = CreateFileMapping(hFile, NULL,
    PAGE_READONLY, 0, 0, NULL);
if ( NULL == hFileMapping )
{
    std::cout << _T("Error - CreateFileMapping()") << std::endl;
    __leave;
}

/////////////////////////////////////////////////////////////
PVOID pMappedFile = NULL;
pMappedFile = MapViewOfFile(hFileMapping, FILE_MAP_READ, 0, 0, 0);
if ( NULL == pMappedFile )
{
    std::cout << _T("Error - MapViewOfFile()") << std::endl;
    __leave;
}

AnswerRe: CreateFileMapping/MapViewOfFile and 0xC0000005 (ACCESS_DENIED) Pin
Waldermort11-Feb-07 4:06
Waldermort11-Feb-07 4:06 
GeneralRe: CreateFileMapping/MapViewOfFile and 0xC0000005 (ACCESS_DENIED) Pin
Jeffrey Walton11-Feb-07 10:06
Jeffrey Walton11-Feb-07 10:06 
GeneralRe: CreateFileMapping/MapViewOfFile and 0xC0000005 (ACCESS_DENIED) Pin
Jeffrey Walton11-Feb-07 10:13
Jeffrey Walton11-Feb-07 10:13 
GeneralRe: CreateFileMapping/MapViewOfFile and 0xC0000005 (ACCESS_DENIED) Pin
Waldermort11-Feb-07 20:27
Waldermort11-Feb-07 20:27 
AnswerRe: CreateFileMapping/MapViewOfFile and 0xC0000005 (ACCESS_DENIED) Pin
Jeffrey Walton11-Feb-07 10:09
Jeffrey Walton11-Feb-07 10:09 
GeneralRe: CreateFileMapping/MapViewOfFile and 0xC0000005 (ACCESS_DENIED) Pin
Mark Salsbery11-Feb-07 10:41
Mark Salsbery11-Feb-07 10:41 
QuestionWeb service in the MFC, who can answer??????? Pin
Tarek Jabri11-Feb-07 2:39
Tarek Jabri11-Feb-07 2:39 
AnswerRe: Web service in the MFC, who can answer??????? Pin
Christian Graus11-Feb-07 11:43
protectorChristian Graus11-Feb-07 11:43 
QuestionXML Packet Pin
Member 292037811-Feb-07 2:37
Member 292037811-Feb-07 2:37 
AnswerRe: XML Packet Pin
Hamid_RT12-Feb-07 6:46
Hamid_RT12-Feb-07 6:46 
QuestionUML drawings of class diagrams for a general dialog based GUI application Pin
dtraj110-Feb-07 21:20
dtraj110-Feb-07 21:20 
QuestionPlease Clarify. Pin
ashwath197910-Feb-07 19:45
ashwath197910-Feb-07 19:45 
AnswerRe: Please Clarify. Pin
Hamid_RT10-Feb-07 20:51
Hamid_RT10-Feb-07 20:51 
AnswerRe: Please Clarify. Pin
Sauce!10-Feb-07 23:21
Sauce!10-Feb-07 23:21 
QuestionRe: Please Clarify. Pin
David Crow12-Feb-07 3:00
David Crow12-Feb-07 3:00 
QuestionVisual Studio 2005 application deployment Pin
bigdenny20010-Feb-07 14:28
bigdenny20010-Feb-07 14:28 
AnswerRe: Visual Studio 2005 application deployment Pin
Christian Graus10-Feb-07 14:49
protectorChristian Graus10-Feb-07 14:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.