2 * Copyright (C) 2023 Mohamad Al-Jaf
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #include "wine/debug.h"
22 WINE_DEFAULT_DEBUG_CHANNEL(setupapi
);
24 /***********************************************************************
25 * CM_MapCrToWin32Err (cfgmgr32.@)
27 DWORD WINAPI
CM_MapCrToWin32Err( CONFIGRET code
, DWORD default_error
)
29 TRACE( "code: %#lx, default_error: %ld\n", code
, default_error
);
33 case CR_SUCCESS
: return ERROR_SUCCESS
;
34 case CR_OUT_OF_MEMORY
: return ERROR_NOT_ENOUGH_MEMORY
;
35 case CR_INVALID_POINTER
: return ERROR_INVALID_USER_BUFFER
;
36 case CR_INVALID_FLAG
: return ERROR_INVALID_FLAGS
;
37 case CR_INVALID_DEVNODE
:
38 case CR_INVALID_DEVICE_ID
:
39 case CR_INVALID_MACHINENAME
:
40 case CR_INVALID_PROPERTY
:
41 case CR_INVALID_REFERENCE_STRING
: return ERROR_INVALID_DATA
;
42 case CR_NO_SUCH_DEVNODE
:
43 case CR_NO_SUCH_VALUE
:
44 case CR_NO_SUCH_DEVICE_INTERFACE
: return ERROR_NOT_FOUND
;
45 case CR_ALREADY_SUCH_DEVNODE
: return ERROR_ALREADY_EXISTS
;
46 case CR_BUFFER_SMALL
: return ERROR_INSUFFICIENT_BUFFER
;
47 case CR_NO_REGISTRY_HANDLE
: return ERROR_INVALID_HANDLE
;
48 case CR_REGISTRY_ERROR
: return ERROR_REGISTRY_CORRUPT
;
49 case CR_NO_SUCH_REGISTRY_KEY
: return ERROR_FILE_NOT_FOUND
;
50 case CR_REMOTE_COMM_FAILURE
:
51 case CR_MACHINE_UNAVAILABLE
:
52 case CR_NO_CM_SERVICES
: return ERROR_SERVICE_NOT_ACTIVE
;
53 case CR_ACCESS_DENIED
: return ERROR_ACCESS_DENIED
;
54 case CR_CALL_NOT_IMPLEMENTED
: return ERROR_CALL_NOT_IMPLEMENTED
;