Commit 3dbc7881 authored by Uwe Bonnes's avatar Uwe Bonnes Committed by Alexandre Julliard

Fix GetTempDrive behaviour.

parent e1e2a42c
......@@ -193,10 +193,18 @@ UINT32 DIR_GetSystemUnixDir( LPSTR path, UINT32 count )
*/
BYTE WINAPI GetTempDrive( BYTE ignored )
{
char buffer[2];
char *buffer;
BYTE ret;
UINT32 len = GetTempPath32A( 0, NULL );
if (!(buffer = HeapAlloc( GetProcessHeap(), 0, len + 1 )) )
return DRIVE_GetCurrentDrive() + 'A';
/* FIXME: apparently Windows does something with the ignored byte */
if (!GetTempPath32A( sizeof(buffer), buffer )) buffer[0] = 'C';
return toupper(buffer[0]);
if (!GetTempPath32A( len, buffer )) buffer[0] = 'C';
ret = buffer[0];
HeapFree( GetProcessHeap(), 0, buffer );
return toupper(ret);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment