Warning fixes.

This commit is contained in:
Alexandre Julliard 2002-11-15 04:17:00 +00:00
parent 56ab2b3e91
commit 9f029b7d5e
2 changed files with 13 additions and 11 deletions

View File

@ -426,12 +426,13 @@ BOOL WINAPI GetComputerNameExA(COMPUTER_NAME_FORMAT type, LPSTR name, LPDWORD si
memcpy( name, buf, len );
name[len] = 0;
*size = len;
ret = TRUE;
}
}
__EXCEPT(page_fault)
{
SetLastError( ERROR_INVALID_PARAMETER );
ret = FALSE;
return FALSE;
}
__ENDTRY
}
@ -476,26 +477,27 @@ BOOL WINAPI GetComputerNameExW( COMPUTER_NAME_FORMAT type, LPWSTR name, LPDWORD
TRACE ("-> %s (%d)\n", debugstr_a (buf), len);
__TRY
{
int len = MultiByteToWideChar( CP_ACP, 0, buf, len, NULL, 0 );
if ( *size < len )
int lenW = MultiByteToWideChar( CP_ACP, 0, buf, len, NULL, 0 );
if ( *size < lenW )
{
MultiByteToWideChar( CP_ACP, 0, buf, len, name, *size );
name[*size] = 0;
*size = len;
*size = lenW;
SetLastError( ERROR_MORE_DATA );
ret = FALSE;
}
else
{
MultiByteToWideChar( CP_ACP, 0, buf, len, name, len );
name[len] = 0;
*size = len;
MultiByteToWideChar( CP_ACP, 0, buf, len, name, lenW );
name[lenW] = 0;
*size = lenW;
ret = TRUE;
}
}
__EXCEPT(page_fault)
{
SetLastError( ERROR_INVALID_PARAMETER );
ret = FALSE;
return FALSE;
}
__ENDTRY
}

View File

@ -101,7 +101,7 @@ int main(int argc, char* argv[])
/* try loading the UNICODE version first */
strcpy(szEntryPoint,comma+1);
strcat(szEntryPoint,"W");
pfEntryPointW=LoadProc(szDllName, szEntryPoint, &DllHandle);
pfEntryPointW=(EntryPointW)LoadProc(szDllName, szEntryPoint, &DllHandle);
if(pfEntryPointW!=NULL)
{
WCHAR wszCmdLine[2048];
@ -112,11 +112,11 @@ int main(int argc, char* argv[])
{
strcpy(szEntryPoint,comma+1);
strcat(szEntryPoint,"A");
pfEntryPointA=LoadProc(szDllName, szEntryPoint, &DllHandle);
pfEntryPointA=(EntryPointA)LoadProc(szDllName, szEntryPoint, &DllHandle);
if(pfEntryPointA==NULL)
{
strcpy(szEntryPoint,comma+1);
pfEntryPointA=LoadProc(szDllName, szEntryPoint, &DllHandle);
pfEntryPointA=(EntryPointA)LoadProc(szDllName, szEntryPoint, &DllHandle);
if(pfEntryPointA==NULL)
return 0;
}