setupapi: Implement SetupPromptForDiskA by wrapping around W version.

This commit is contained in:
Ricardo Filipe 2009-03-02 16:21:28 +00:00 committed by Alexandre Julliard
parent 54845cd40a
commit 24a10fc9ac
2 changed files with 45 additions and 14 deletions

View File

@ -182,6 +182,51 @@ static INT_PTR CALLBACK promptdisk_proc(HWND hwnd, UINT msg, WPARAM wParam, LPAR
return FALSE;
}
/***********************************************************************
* SetupPromptForDiskA (SETUPAPI.@)
*/
UINT WINAPI SetupPromptForDiskA(HWND hwndParent, PCSTR DialogTitle, PCSTR DiskName,
PCSTR PathToSource, PCSTR FileSought, PCSTR TagFile, DWORD DiskPromptStyle,
PSTR PathBuffer, DWORD PathBufferSize, PDWORD PathRequiredSize)
{
WCHAR *DialogTitleW, *DiskNameW, *PathToSourceW;
WCHAR *FileSoughtW, *TagFileW, PathBufferW[MAX_PATH];
UINT ret, length;
TRACE("%p, %s, %s, %s, %s, %s, 0x%08x, %p, %d, %p\n", hwndParent, debugstr_a(DialogTitle),
debugstr_a(DiskName), debugstr_a(PathToSource), debugstr_a(FileSought),
debugstr_a(TagFile), DiskPromptStyle, PathBuffer, PathBufferSize,
PathRequiredSize);
DialogTitleW = strdupAtoW(DialogTitle);
DiskNameW = strdupAtoW(DiskName);
PathToSourceW = strdupAtoW(PathToSource);
FileSoughtW = strdupAtoW(FileSought);
TagFileW = strdupAtoW(TagFile);
ret = SetupPromptForDiskW(hwndParent, DialogTitleW, DiskNameW, PathToSourceW,
FileSoughtW, TagFileW, DiskPromptStyle, PathBufferW, MAX_PATH, PathRequiredSize);
HeapFree(GetProcessHeap(), 0, DialogTitleW);
HeapFree(GetProcessHeap(), 0, DiskNameW);
HeapFree(GetProcessHeap(), 0, PathToSourceW);
HeapFree(GetProcessHeap(), 0, FileSoughtW);
HeapFree(GetProcessHeap(), 0, TagFileW);
if(ret == DPROMPT_SUCCESS)
{
length = WideCharToMultiByte(CP_ACP, 0, PathBufferW, -1, NULL, 0, NULL, NULL);
if(PathRequiredSize) *PathRequiredSize = length;
if(PathBuffer)
{
if(length > PathBufferSize)
return DPROMPT_BUFFERTOOSMALL;
WideCharToMultiByte(CP_ACP, 0, PathBufferW, -1, PathBuffer, length, NULL, NULL);
}
}
return ret;
}
/***********************************************************************
* SetupPromptForDiskW (SETUPAPI.@)
*/

View File

@ -246,20 +246,6 @@ BOOL WINAPI SetupDiGetClassImageList(PSP_CLASSIMAGELIST_DATA ClassImageListData)
return FALSE;
}
/***********************************************************************
* SetupPromptForDiskA (SETUPAPI.@)
*/
UINT WINAPI SetupPromptForDiskA(HWND hwndParent, PCSTR DialogTitle, PCSTR DiskName,
PCSTR PathToSource, PCSTR FileSought, PCSTR TagFile, DWORD DiskPromptStyle,
PSTR PathBuffer, DWORD PathBufferSize, PDWORD PathRequiredSize)
{
FIXME("%p %s %s %s %s %s %d %p %d %p: stub\n", hwndParent, debugstr_a(DialogTitle),
debugstr_a(DiskName), debugstr_a(PathToSource), debugstr_a(FileSought),
debugstr_a(TagFile), DiskPromptStyle, PathBuffer, PathBufferSize,
PathRequiredSize);
return 0;
}
/***********************************************************************
* CM_Locate_DevNodeA (SETUPAPI.@)
*/