Replaced calls to OpenFile with the equivalent call to

CreateFile. Removes the need to cast the result to HANDLE.
This commit is contained in:
François Gouget 2001-01-02 20:44:02 +00:00 committed by Alexandre Julliard
parent 12b352694b
commit af68026c94
2 changed files with 4 additions and 6 deletions

View File

@ -444,11 +444,11 @@ DWORD CreateLine(
void LoadBufferFromFile(LPCSTR szFileName)
{
HANDLE hFile;
OFSTRUCT ofs;
CHAR *pTemp;
DWORD size,i,len,bytes_left,bytes_read;
hFile = (HANDLE)OpenFile(szFileName, &ofs, OF_READ);
hFile = CreateFile(szFileName, GENERIC_READ, FILE_SHARE_READ, NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if(hFile == INVALID_HANDLE_VALUE)
return;
size = BUFFERCHUNKSIZE;

View File

@ -132,10 +132,9 @@ LRESULT CALLBACK WndProc(HWND hwnd,
BOOL FileIsPlaceable( LPCSTR szFileName )
{
HFILE hInFile;
OFSTRUCT inof;
APMFILEHEADER apmh;
if( (hInFile = OpenFile( szFileName, &inof, OF_READ ) ) == HFILE_ERROR )
if( (hInFile = _lopen( szFileName, OF_READ ) ) == HFILE_ERROR )
return FALSE;
if( _lread( hInFile, &apmh, sizeof(APMFILEHEADER) )
@ -157,11 +156,10 @@ HMETAFILE GetPlaceableMetaFile( HWND hwnd, LPCSTR szFileName )
APMFILEHEADER APMHeader;
HFILE fh;
HMETAFILE hmf;
OFSTRUCT inof;
WORD checksum, *p;
int i;
if( (fh = OpenFile( szFileName, &inof, OF_READ ) ) == HFILE_ERROR ) return 0;
if( (fh = _lopen( szFileName, OF_READ ) ) == HFILE_ERROR ) return 0;
_llseek(fh, 0, 0);
if (!_lread(fh, (LPSTR)&APMHeader, sizeof(APMFILEHEADER))) return 0;
_llseek(fh, sizeof(APMFILEHEADER), 0);