mirror of
https://github.com/reactos/reactos.git
synced 2025-08-04 02:15:47 +00:00
- Implement CaptureStringArg and CaptureAndConvertAnsiArg.
- FileExists: Restore error mode. - Move configuration manager functions to a separate file. - Add cfgmgr32.h. svn path=/trunk/; revision=13595
This commit is contained in:
parent
4b76287e18
commit
dd88251afc
6 changed files with 327 additions and 44 deletions
50
reactos/include/wine/cfgmgr32.h
Normal file
50
reactos/include/wine/cfgmgr32.h
Normal file
|
@ -0,0 +1,50 @@
|
|||
/*
|
||||
* Copyright (C) 2005 Mike McCormack
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef _CFGMGR32_H_
|
||||
#define _CFGMGR32_H_
|
||||
|
||||
typedef DWORD CONFIGRET;
|
||||
typedef HANDLE HMACHINE;
|
||||
typedef HMACHINE *PHMACHINE;
|
||||
|
||||
#define CR_SUCCESS 0x00000000
|
||||
#define CR_INVALID_DATA 0x0000001F
|
||||
#define CR_ACCESS_DENIED 0x00000033
|
||||
|
||||
|
||||
CONFIGRET WINAPI CM_Connect_MachineA( PCSTR, PHMACHINE );
|
||||
CONFIGRET WINAPI CM_Connect_MachineW( PCWSTR, PHMACHINE );
|
||||
#define CM_Connect_Machine WINELIB_NAME_AW(CM_Connect_Machine)
|
||||
|
||||
CONFIGRET WINAPI CM_Disconnect_Machine( HMACHINE );
|
||||
|
||||
CONFIGRET WINAPI CM_Get_Device_ID_ListA( PCSTR, PCHAR, ULONG, ULONG );
|
||||
CONFIGRET WINAPI CM_Get_Device_ID_ListW( PCWSTR, PWCHAR, ULONG, ULONG );
|
||||
#define CM_Get_Device_ID_List WINELIB_NAME_AW(CM_Get_Device_ID_List)
|
||||
CONFIGRET WINAPI CM_Get_Device_ID_List_ExA( PCSTR, PCHAR, ULONG, ULONG, HMACHINE );
|
||||
CONFIGRET WINAPI CM_Get_Device_ID_List_ExW( PCWSTR, PWCHAR, ULONG, ULONG, HMACHINE );
|
||||
#define CM_Get_Device_ID_List_Ex WINELIB_NAME_AW(CM_Get_Device_ID_List_Ex)
|
||||
CONFIGRET WINAPI CM_Get_Device_ID_List_SizeA( PULONG, PCSTR, ULONG );
|
||||
CONFIGRET WINAPI CM_Get_Device_ID_List_SizeW( PULONG, PCWSTR, ULONG );
|
||||
#define CM_Get_Device_ID_List_Size WINELIB_NAME_AW(CM_Get_Device_ID_List_Size)
|
||||
CONFIGRET WINAPI CM_Get_Device_ID_List_Size_ExA( PULONG, PCSTR, ULONG, HMACHINE );
|
||||
CONFIGRET WINAPI CM_Get_Device_ID_List_Size_ExW( PULONG, PCWSTR, ULONG, HMACHINE );
|
||||
#define CM_Get_Device_ID_List_Size_Ex WINELIB_NAME_AW(CM_Get_Device_ID_List_Size_Ex)
|
||||
|
||||
#endif /* _CFGMGR32_H_ */
|
|
@ -9,6 +9,7 @@ DELAYIMPORTS = shell32
|
|||
EXTRALIBS = $(LIBUNICODE)
|
||||
|
||||
C_SRCS = \
|
||||
cfgmgr.c \
|
||||
devinst.c \
|
||||
dirid.c \
|
||||
diskspace.c \
|
||||
|
|
183
reactos/lib/setupapi/cfgmgr.c
Normal file
183
reactos/lib/setupapi/cfgmgr.c
Normal file
|
@ -0,0 +1,183 @@
|
|||
/*
|
||||
* Configuration manager functions
|
||||
*
|
||||
* Copyright 2000 James Hatheway
|
||||
* Copyright 2005 Eric Kohl
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "wingdi.h"
|
||||
#include "winuser.h"
|
||||
#include "winnls.h"
|
||||
#include "winreg.h"
|
||||
#include "setupapi.h"
|
||||
#include "cfgmgr32.h"
|
||||
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(setupapi);
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* CM_Connect_MachineA [SETUPAPI.@]
|
||||
*/
|
||||
CONFIGRET WINAPI CM_Connect_MachineA(PCSTR UNCServerName, PHMACHINE phMachine)
|
||||
{
|
||||
PWSTR pServerNameW;
|
||||
CONFIGRET ret;
|
||||
|
||||
TRACE("%s %p\n", UNCServerName, phMachine);
|
||||
|
||||
if (UNCServerName == NULL || *UNCServerName == 0)
|
||||
{
|
||||
return CM_Connect_MachineW(NULL, phMachine);
|
||||
}
|
||||
|
||||
if (CaptureAndConvertAnsiArg(UNCServerName, &pServerNameW))
|
||||
{
|
||||
return CR_INVALID_DATA;
|
||||
}
|
||||
|
||||
ret = CM_Connect_MachineW(pServerNameW, phMachine);
|
||||
|
||||
MyFree(pServerNameW);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* CM_Connect_MachineW [SETUPAPI.@]
|
||||
*/
|
||||
CONFIGRET WINAPI CM_Connect_MachineW(PCWSTR UNCServerName, PHMACHINE phMachine)
|
||||
{
|
||||
FIXME("%s %p\n", debugstr_w(UNCServerName), phMachine);
|
||||
return CR_ACCESS_DENIED;
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* CM_Disconnect_Machine [SETUPAPI.@]
|
||||
*/
|
||||
CONFIGRET WINAPI CM_Disconnect_Machine(HMACHINE hMachine)
|
||||
{
|
||||
FIXME("%lx\n", hMachine);
|
||||
return CR_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* CM_Get_Device_ID_ListA [SETUPAPI.@]
|
||||
*/
|
||||
CONFIGRET WINAPI CM_Get_Device_ID_ListA(
|
||||
PCSTR pszFilter, PCHAR Buffer, ULONG BufferLen, ULONG ulFlags )
|
||||
{
|
||||
FIXME("%p %p %ld %ld\n", pszFilter, Buffer, BufferLen, ulFlags);
|
||||
memset(Buffer,0,2);
|
||||
return CR_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* CM_Get_Device_ID_ListW [SETUPAPI.@]
|
||||
*/
|
||||
CONFIGRET WINAPI CM_Get_Device_ID_ListW(
|
||||
PCWSTR pszFilter, PWCHAR Buffer, ULONG BufferLen, ULONG ulFlags )
|
||||
{
|
||||
TRACE("%p %p %ld %ld\n", pszFilter, Buffer, BufferLen, ulFlags);
|
||||
return CM_Get_Device_ID_List_ExW(pszFilter, Buffer, BufferLen,
|
||||
ulFlags, NULL);
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* CM_Get_Device_ID_List_ExA [SETUPAPI.@]
|
||||
*/
|
||||
CONFIGRET WINAPI CM_Get_Device_ID_List_ExA(
|
||||
PCSTR pszFilter, PCHAR Buffer, ULONG BufferLen, ULONG ulFlags,
|
||||
HMACHINE hMachine )
|
||||
{
|
||||
FIXME("%p %p %ld %ld %lx\n",
|
||||
pszFilter, Buffer, BufferLen, ulFlags, hMachine);
|
||||
memset(Buffer,0,2);
|
||||
return CR_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* CM_Get_Device_ID_List_ExW [SETUPAPI.@]
|
||||
*/
|
||||
CONFIGRET WINAPI CM_Get_Device_ID_List_ExW(
|
||||
PCWSTR pszFilter, PWCHAR Buffer, ULONG BufferLen, ULONG ulFlags,
|
||||
HMACHINE hMachine )
|
||||
{
|
||||
FIXME("%p %p %ld %ld %lx\n",
|
||||
pszFilter, Buffer, BufferLen, ulFlags, hMachine);
|
||||
memset(Buffer,0,2);
|
||||
return CR_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* CM_Get_Device_ID_List_SizeA [SETUPAPI.@]
|
||||
*/
|
||||
CONFIGRET WINAPI CM_Get_Device_ID_List_SizeA(
|
||||
PULONG pulLen, PCSTR pszFilter, ULONG ulFlags)
|
||||
{
|
||||
FIXME("%p %s %ld\n", pulLen, pszFilter, ulFlags);
|
||||
*pulLen = 2;
|
||||
return CR_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* CM_Get_Device_ID_List_SizeW [SETUPAPI.@]
|
||||
*/
|
||||
CONFIGRET WINAPI CM_Get_Device_ID_List_SizeW(
|
||||
PULONG pulLen, PCWSTR pszFilter, ULONG ulFlags)
|
||||
{
|
||||
FIXME("%p %s %ld\n", pulLen, debugstr_w(pszFilter), ulFlags);
|
||||
*pulLen = 2;
|
||||
return CR_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* CM_Get_Device_ID_List_Size_ExA [SETUPAPI.@]
|
||||
*/
|
||||
CONFIGRET WINAPI CM_Get_Device_ID_List_Size_ExA(
|
||||
PULONG pulLen, PCSTR pszFilter, ULONG ulFlags, HMACHINE hMachine)
|
||||
{
|
||||
FIXME("%p %s %ld %lx\n", pulLen, pszFilter, ulFlags, hMachine);
|
||||
*pulLen = 2;
|
||||
return CR_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* CM_Get_Device_ID_List_Size_ExW [SETUPAPI.@]
|
||||
*/
|
||||
CONFIGRET WINAPI CM_Get_Device_ID_List_Size_ExW(
|
||||
PULONG pulLen, PCWSTR pszFilter, ULONG ulFlags, HMACHINE hMachine)
|
||||
{
|
||||
FIXME("%p %s %ld %lx\n", pulLen, debugstr_w(pszFilter), ulFlags, hMachine);
|
||||
*pulLen = 2;
|
||||
return CR_SUCCESS;
|
||||
}
|
|
@ -463,6 +463,19 @@ BOOL WINAPI EnablePrivilege(LPCWSTR lpPrivilegeName, BOOL bEnable)
|
|||
}
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
* DelayedMove [SETUPAPI.@]
|
||||
*
|
||||
* Moves a file upon the next reboot.
|
||||
*
|
||||
* PARAMS
|
||||
* lpExistingFileName [I] Current file name
|
||||
* lpNewFileName [I] New file name
|
||||
*
|
||||
* RETURNS
|
||||
* Success: TRUE
|
||||
* Failure: FALSE
|
||||
*/
|
||||
BOOL WINAPI DelayedMove(LPCWSTR lpExistingFileName, LPCWSTR lpNewFileName)
|
||||
{
|
||||
if (OsVersionInfo.dwPlatformId != VER_PLATFORM_WIN32_NT)
|
||||
|
@ -476,6 +489,19 @@ BOOL WINAPI DelayedMove(LPCWSTR lpExistingFileName, LPCWSTR lpNewFileName)
|
|||
}
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
* FileExists [SETUPAPI.@]
|
||||
*
|
||||
* Checks whether a file exists.
|
||||
*
|
||||
* PARAMS
|
||||
* lpFileName [I] Name of the file to check
|
||||
* lpNewFileName [O] Optional information about the existing file
|
||||
*
|
||||
* RETURNS
|
||||
* Success: TRUE
|
||||
* Failure: FALSE
|
||||
*/
|
||||
BOOL WINAPI FileExists(LPCWSTR lpFileName, LPWIN32_FIND_DATAW lpFileFindData)
|
||||
{
|
||||
WIN32_FIND_DATAW FindData;
|
||||
|
@ -499,5 +525,61 @@ BOOL WINAPI FileExists(LPCWSTR lpFileName, LPWIN32_FIND_DATAW lpFileFindData)
|
|||
if (lpFileFindData)
|
||||
memcpy(lpFileFindData, &FindData, sizeof(WIN32_FIND_DATAW));
|
||||
|
||||
SetErrorMode(uErrorMode);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
* CaptureStringArg [SETUPAPI.@]
|
||||
*
|
||||
* Captures a UNICODE string.
|
||||
*
|
||||
* PARAMS
|
||||
* lpSrc [I] UNICODE string to be captured
|
||||
* lpDst [O] Pointer to the captured UNICODE string
|
||||
*
|
||||
* RETURNS
|
||||
* Success: ERROR_SUCCESS
|
||||
* Failure: ERROR_INVALID_PARAMETER
|
||||
*
|
||||
* NOTE
|
||||
* Call MyFree to release the captured UNICODE string.
|
||||
*/
|
||||
DWORD WINAPI CaptureStringArg(LPCWSTR pSrc, LPWSTR *pDst)
|
||||
{
|
||||
if (pDst == NULL)
|
||||
return ERROR_INVALID_PARAMETER;
|
||||
|
||||
*pDst = DuplicateString(pSrc);
|
||||
|
||||
return ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
* CaptureAndConvertAnsiArg [SETUPAPI.@]
|
||||
*
|
||||
* Captures an ANSI string and converts it to a UNICODE string.
|
||||
*
|
||||
* PARAMS
|
||||
* lpSrc [I] ANSI string to be captured
|
||||
* lpDst [O] Pointer to the captured UNICODE string
|
||||
*
|
||||
* RETURNS
|
||||
* Success: ERROR_SUCCESS
|
||||
* Failure: ERROR_INVALID_PARAMETER
|
||||
*
|
||||
* NOTE
|
||||
* Call MyFree to release the captured UNICODE string.
|
||||
*/
|
||||
DWORD WINAPI CaptureAndConvertAnsiArg(LPCSTR pSrc, LPWSTR *pDst)
|
||||
{
|
||||
if (pDst == NULL)
|
||||
return ERROR_INVALID_PARAMETER;
|
||||
|
||||
*pDst = MultiByteToUnicode(pSrc, CP_ACP);
|
||||
|
||||
return ERROR_SUCCESS;
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
@ stub CM_Add_Range
|
||||
@ stub CM_Add_Res_Des
|
||||
@ stub CM_Add_Res_Des_Ex
|
||||
@ stub CM_Connect_MachineA
|
||||
@ stdcall CM_Connect_MachineA(str ptr)
|
||||
@ stdcall CM_Connect_MachineW(wstr ptr)
|
||||
@ stub CM_Create_DevNodeA
|
||||
@ stub CM_Create_DevNodeW
|
||||
|
@ -75,14 +75,14 @@
|
|||
@ stub CM_Get_Device_IDW
|
||||
@ stub CM_Get_Device_ID_ExA
|
||||
@ stub CM_Get_Device_ID_ExW
|
||||
@ stdcall CM_Get_Device_ID_ListA(ptr ptr long long)
|
||||
@ stub CM_Get_Device_ID_ListW
|
||||
@ stub CM_Get_Device_ID_List_ExA
|
||||
@ stub CM_Get_Device_ID_List_ExW
|
||||
@ stub CM_Get_Device_ID_List_SizeA
|
||||
@ stub CM_Get_Device_ID_List_SizeW
|
||||
@ stub CM_Get_Device_ID_List_Size_ExA
|
||||
@ stub CM_Get_Device_ID_List_Size_ExW
|
||||
@ stdcall CM_Get_Device_ID_ListA(str str long long)
|
||||
@ stdcall CM_Get_Device_ID_ListW(wstr wstr long long)
|
||||
@ stdcall CM_Get_Device_ID_List_ExA(str str long long long)
|
||||
@ stdcall CM_Get_Device_ID_List_ExW(wstr wstr long long long)
|
||||
@ stdcall CM_Get_Device_ID_List_SizeA(ptr str long)
|
||||
@ stdcall CM_Get_Device_ID_List_SizeW(ptr wstr long)
|
||||
@ stdcall CM_Get_Device_ID_List_Size_ExA(ptr str long long)
|
||||
@ stdcall CM_Get_Device_ID_List_Size_ExW(ptr wstr long long)
|
||||
@ stub CM_Get_Device_ID_Size
|
||||
@ stub CM_Get_Device_ID_Size_Ex
|
||||
@ stub CM_Get_Device_Interface_AliasA
|
||||
|
@ -190,8 +190,8 @@
|
|||
@ stub CM_Unregister_Device_InterfaceW
|
||||
@ stub CM_Unregister_Device_Interface_ExA
|
||||
@ stub CM_Unregister_Device_Interface_ExW
|
||||
@ stub CaptureAndConvertAnsiArg
|
||||
@ stub CaptureStringArg
|
||||
@ stdcall CaptureAndConvertAnsiArg(str ptr)
|
||||
@ stdcall CaptureStringArg(wstr ptr)
|
||||
@ stub CenterWindowRelativeToParent
|
||||
@ stub ConcatenatePaths
|
||||
@ stdcall DelayedMove(wstr wstr)
|
||||
|
|
|
@ -90,39 +90,6 @@ HDEVINFO WINAPI SetupDiGetClassDevsExW(const GUID *class, PCWSTR filter, HWND pa
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* CM_Connect_MachineW (SETUPAPI.@)
|
||||
*/
|
||||
DWORD WINAPI CM_Connect_MachineW(LPCWSTR name, void * machine)
|
||||
{
|
||||
#define CR_SUCCESS 0x00000000
|
||||
#define CR_ACCESS_DENIED 0x00000033
|
||||
FIXME("\n");
|
||||
return CR_ACCESS_DENIED;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* CM_Disconnect_Machine (SETUPAPI.@)
|
||||
*/
|
||||
DWORD WINAPI CM_Disconnect_Machine(DWORD handle)
|
||||
{
|
||||
FIXME("\n");
|
||||
return CR_SUCCESS;
|
||||
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* CM_Get_Device_ID_ListA (SETUPAPI.@)
|
||||
*/
|
||||
|
||||
DWORD WINAPI CM_Get_Device_ID_ListA(
|
||||
PCSTR pszFilter, PCHAR Buffer, ULONG BufferLen, ULONG ulFlags )
|
||||
{
|
||||
FIXME("%p %p %ld %ld\n", pszFilter, Buffer, BufferLen, ulFlags );
|
||||
memset(Buffer,0,2);
|
||||
return CR_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* SetupCopyOEMInfA (SETUPAPI.@)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue