Replaced calls to OpenFile with the equivalent call to
CreateFile. Removes the need to cast the result to HANDLE.
This commit is contained in:
parent
12b352694b
commit
af68026c94
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue