CreateFileMapping problem

  • Thread starter Thread starter DonDilworth
  • Start date Start date
D

DonDilworth

Guest
My code creates mapped memory that is used by several processes. This works, but later when a Fortran program executes a RETURN statement, it crashes with an "Access violation reading location ..." error.

There are some arguments in the call to CreateFileMapping that I do not understand. Perhaps one of them would help. Here is the code:

int size = 6015401 + 128;

TCHAR derivfilename[]= TEXT("SYNOPSYS_DERIV_DATA");

hMapping = CreateFileMapping( NULL ,nullptr, PAGE_READWRITE, 0, (size*sizeof(double)), derivfilename );

double *deriv = static_cast<double*> (MapViewOfFile(hMapping, FILE_MAP_ALL_ACCESS, 0, 0, 0 ));

Can anyone think of a security setting that I can change? Perhaps in the nullptr argument?

Continue reading...
 
Back
Top