mirror of
git://source.winehq.org/git/wine.git
synced 2024-08-31 08:54:06 +00:00
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)
|
void LoadBufferFromFile(LPCSTR szFileName)
|
||||||
{
|
{
|
||||||
HANDLE hFile;
|
HANDLE hFile;
|
||||||
OFSTRUCT ofs;
|
|
||||||
CHAR *pTemp;
|
CHAR *pTemp;
|
||||||
DWORD size,i,len,bytes_left,bytes_read;
|
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)
|
if(hFile == INVALID_HANDLE_VALUE)
|
||||||
return;
|
return;
|
||||||
size = BUFFERCHUNKSIZE;
|
size = BUFFERCHUNKSIZE;
|
||||||
|
|
|
@ -132,10 +132,9 @@ LRESULT CALLBACK WndProc(HWND hwnd,
|
||||||
BOOL FileIsPlaceable( LPCSTR szFileName )
|
BOOL FileIsPlaceable( LPCSTR szFileName )
|
||||||
{
|
{
|
||||||
HFILE hInFile;
|
HFILE hInFile;
|
||||||
OFSTRUCT inof;
|
|
||||||
APMFILEHEADER apmh;
|
APMFILEHEADER apmh;
|
||||||
|
|
||||||
if( (hInFile = OpenFile( szFileName, &inof, OF_READ ) ) == HFILE_ERROR )
|
if( (hInFile = _lopen( szFileName, OF_READ ) ) == HFILE_ERROR )
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if( _lread( hInFile, &apmh, sizeof(APMFILEHEADER) )
|
if( _lread( hInFile, &apmh, sizeof(APMFILEHEADER) )
|
||||||
|
@ -157,11 +156,10 @@ HMETAFILE GetPlaceableMetaFile( HWND hwnd, LPCSTR szFileName )
|
||||||
APMFILEHEADER APMHeader;
|
APMFILEHEADER APMHeader;
|
||||||
HFILE fh;
|
HFILE fh;
|
||||||
HMETAFILE hmf;
|
HMETAFILE hmf;
|
||||||
OFSTRUCT inof;
|
|
||||||
WORD checksum, *p;
|
WORD checksum, *p;
|
||||||
int i;
|
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);
|
_llseek(fh, 0, 0);
|
||||||
if (!_lread(fh, (LPSTR)&APMHeader, sizeof(APMFILEHEADER))) return 0;
|
if (!_lread(fh, (LPSTR)&APMHeader, sizeof(APMFILEHEADER))) return 0;
|
||||||
_llseek(fh, sizeof(APMFILEHEADER), 0);
|
_llseek(fh, sizeof(APMFILEHEADER), 0);
|
||||||
|
|
Loading…
Reference in a new issue