https://bugs.winehq.org/show_bug.cgi?id=53781
--- Comment #1 from Janne janne.kekkonen@gmail.com --- Based on the logs, here is my proposal for the implementation of CM_MapCrToWin32Err.
DWORD WINAPI CM_MapCrToWin32Err(DWORD CmReturnCode, DWORD DefaultErr) { FIXME("stub\n"); DWORD conversiontable[22][2] = { {CR_SUCCESS,ERROR_SUCCESS}, {CR_OUT_OF_MEMORY,ERROR_NOT_ENOUGH_MEMORY}, {CR_INVALID_POINTER,ERROR_INVALID_USER_BUFFER}, {CR_INVALID_FLAG,ERROR_INVALID_FLAGS}, {CR_INVALID_DEVNODE,ERROR_INVALID_DATA}, {CR_NO_SUCH_DEVNODE,ERROR_NOT_FOUND}, {CR_ALREADY_SUCH_DEVNODE,ERROR_ALREADY_EXISTS}, {CR_BUFFER_SMALL,ERROR_INSUFFICIENT_BUFFER}, {CR_NO_REGISTRY_HANDLE,ERROR_INVALID_HANDLE}, {CR_REGISTRY_ERROR,ERROR_REGISTRY_CORRUPT}, {CR_INVALID_DEVICE_ID,ERROR_INVALID_DATA}, {CR_NO_SUCH_VALUE,ERROR_NOT_FOUND}, {CR_NO_SUCH_REGISTRY_KEY,ERROR_FILE_NOT_FOUND}, {CR_INVALID_MACHINENAME,ERROR_INVALID_DATA}, {CR_REMOTE_COMM_FAILURE,ERROR_SERVICE_NOT_ACTIVE}, {CR_MACHINE_UNAVAILABLE,ERROR_SERVICE_NOT_ACTIVE}, {CR_ACCESS_DENIED,ERROR_ACCESS_DENIED}, {CR_NO_CM_SERVICES,ERROR_SERVICE_NOT_ACTIVE}, {CR_CALL_NOT_IMPLEMENTED,ERROR_CALL_NOT_IMPLEMENTED}, {CR_INVALID_PROPERTY,ERROR_INVALID_DATA}, {CR_NO_SUCH_DEVICE_INTERFACE,ERROR_NOT_FOUND}, {CR_INVALID_REFERENCE_STRING,ERROR_INVALID_DATA}, }; int i=0;
for(i=0;i<22;i++) { if (conversiontable[i][0]==CmReturnCode) { return conversiontable[i][1]; } }
return DefaultErr; }