Fix a few warnings

svn path=/trunk/; revision=24373
This commit is contained in:
Hervé Poussineau 2006-10-03 14:28:21 +00:00
parent 640d89daad
commit 30189808bf

View file

@ -88,6 +88,8 @@ RpcServerThread(LPVOID lpParameter)
{
RPC_STATUS Status;
UNREFERENCED_PARAMETER(lpParameter);
DPRINT("RpcServerThread() called\n");
Status = RpcServerUseProtseqEpW(L"ncacn_np",
@ -157,6 +159,8 @@ CONFIGRET
PNP_GetVersion(handle_t BindingHandle,
unsigned short *Version)
{
UNREFERENCED_PARAMETER(BindingHandle);
*Version = 0x0400;
return CR_SUCCESS;
}
@ -168,6 +172,9 @@ PNP_GetGlobalState(handle_t BindingHandle,
unsigned long *State,
unsigned long Flags)
{
UNREFERENCED_PARAMETER(BindingHandle);
UNREFERENCED_PARAMETER(Flags);
*State = CM_GLOBAL_STATE_CAN_DO_UI | CM_GLOBAL_STATE_SERVICES_AVAILABLE;
return CR_SUCCESS;
}
@ -177,6 +184,8 @@ PNP_GetGlobalState(handle_t BindingHandle,
CONFIGRET
PNP_InitDetection(handle_t BindingHandle)
{
UNREFERENCED_PARAMETER(BindingHandle);
DPRINT("PNP_InitDetection() called\n");
return CR_SUCCESS;
}
@ -190,6 +199,8 @@ PNP_ReportLogOn(handle_t BindingHandle,
{
HANDLE hProcess;
UNREFERENCED_PARAMETER(BindingHandle);
DPRINT1("PNP_ReportLogOn(%lu, %lu) called\n", Admin, ProcessId);
/* Get the users token */
@ -225,23 +236,13 @@ PNP_ValidateDeviceInstance(handle_t BindingHandle,
unsigned long Flags)
{
CONFIGRET ret = CR_SUCCESS;
HKEY hEnumKey = NULL;
HKEY hDeviceKey = NULL;
UNREFERENCED_PARAMETER(BindingHandle);
DPRINT("PNP_ValidateDeviceInstance(%S %lx) called\n",
DeviceInstance, Flags);
if (RegOpenKeyExW(HKEY_LOCAL_MACHINE,
L"System\\CurrentControlSet\\Enum",
0,
KEY_ALL_ACCESS,
&hEnumKey))
{
DPRINT("Could not open the Enum Key!\n");
ret = CR_FAILURE;
goto Done;
}
if (RegOpenKeyExW(hEnumKey,
DeviceInstance,
0,
@ -259,9 +260,6 @@ Done:
if (hDeviceKey != NULL)
RegCloseKey(hDeviceKey);
if (hEnumKey != NULL)
RegCloseKey(hEnumKey);
DPRINT("PNP_ValidateDeviceInstance() done (returns %lx)\n", ret);
return ret;
@ -276,6 +274,8 @@ PNP_GetRootDeviceInstance(handle_t BindingHandle,
{
CONFIGRET ret = CR_SUCCESS;
UNREFERENCED_PARAMETER(BindingHandle);
DPRINT("PNP_GetRootDeviceInstance() called\n");
if (Length < lstrlenW(szRootDeviceId) + 1)
@ -307,6 +307,9 @@ PNP_GetRelatedDeviceInstance(handle_t BindingHandle,
CONFIGRET ret = CR_SUCCESS;
NTSTATUS Status;
UNREFERENCED_PARAMETER(BindingHandle);
UNREFERENCED_PARAMETER(Flags);
DPRINT("PNP_GetRelatedDeviceInstance() called\n");
DPRINT(" Relationship %ld\n", Relationship);
DPRINT(" DeviceId %S\n", DeviceId);
@ -351,6 +354,9 @@ PNP_EnumerateSubKeys(handle_t BindingHandle,
HKEY hKey;
DWORD dwError;
UNREFERENCED_PARAMETER(BindingHandle);
UNREFERENCED_PARAMETER(Flags);
DPRINT("PNP_EnumerateSubKeys() called\n");
switch (Branch)
@ -398,6 +404,10 @@ PNP_GetDeviceListSize(handle_t BindingHandle,
unsigned long *Length,
DWORD Flags)
{
UNREFERENCED_PARAMETER(BindingHandle);
UNREFERENCED_PARAMETER(Filter);
UNREFERENCED_PARAMETER(Flags);
DPRINT("PNP_GetDeviceListSize() called\n");
/* FIXME */
@ -418,6 +428,9 @@ PNP_GetDepth(handle_t BindingHandle,
CONFIGRET ret = CR_SUCCESS;
NTSTATUS Status;
UNREFERENCED_PARAMETER(BindingHandle);
UNREFERENCED_PARAMETER(Flags);
DPRINT("PNP_GetDepth() called\n");
RtlInitUnicodeString(&PlugPlayData.DeviceInstance,
@ -458,6 +471,9 @@ PNP_GetDeviceRegProp(handle_t BindingHandle,
HKEY hKey = 0;
NTSTATUS Status;
UNREFERENCED_PARAMETER(BindingHandle);
UNREFERENCED_PARAMETER(Flags);
DPRINT("PNP_GetDeviceRegProp() called\n");
switch (Property)
@ -643,6 +659,9 @@ PNP_SetDeviceRegProp(handle_t BindingHandle,
LPWSTR lpValueName = NULL;
HKEY hKey = 0;
UNREFERENCED_PARAMETER(BindingHandle);
UNREFERENCED_PARAMETER(Flags);
DPRINT("PNP_SetDeviceRegProp() called\n");
DPRINT("DeviceId: %S\n", DeviceId);
@ -751,6 +770,11 @@ PNP_GetClassInstance(handle_t BindingHandle,
{
CONFIGRET ret = CR_SUCCESS;
UNREFERENCED_PARAMETER(BindingHandle);
UNREFERENCED_PARAMETER(DeviceId);
UNREFERENCED_PARAMETER(Buffer);
UNREFERENCED_PARAMETER(Length);
DPRINT("PNP_Get_Class_Instance() called\n");
DPRINT("PNP_Get_Class_Instance() done (returns %lx)\n", ret);
@ -768,6 +792,11 @@ PNP_CreateKey(handle_t BindingHandle,
{
CONFIGRET ret = CR_SUCCESS;
UNREFERENCED_PARAMETER(BindingHandle);
UNREFERENCED_PARAMETER(SubKey);
UNREFERENCED_PARAMETER(samDesired);
UNREFERENCED_PARAMETER(Flags);
DPRINT("PNP_CreateKey() called\n");
DPRINT("PNP_CreateKey() done (returns %lx)\n", ret);
@ -786,6 +815,12 @@ PNP_DeleteRegistryKey(handle_t BindingHandle,
{
CONFIGRET ret = CR_SUCCESS;
UNREFERENCED_PARAMETER(BindingHandle);
UNREFERENCED_PARAMETER(DeviceId);
UNREFERENCED_PARAMETER(ParentKey);
UNREFERENCED_PARAMETER(ChildKey);
UNREFERENCED_PARAMETER(Flags);
DPRINT("PNP_DeleteRegistryKey() called\n");
DPRINT("PNP_DeleteRegistryKey() done (returns %lx)\n", ret);
@ -804,6 +839,8 @@ PNP_GetClassCount(handle_t BindingHandle,
HANDLE hKey = NULL;
DWORD dwError;
UNREFERENCED_PARAMETER(BindingHandle);
dwError = RegOpenKeyExW(HKEY_LOCAL_MACHINE,
pszRegPathClass,
0,
@ -846,6 +883,9 @@ PNP_GetClassName(handle_t BindingHandle,
HKEY hKey = NULL;
ULONG ulSize;
UNREFERENCED_PARAMETER(BindingHandle);
UNREFERENCED_PARAMETER(Flags);
DPRINT("PNP_GetClassName() called\n");
lstrcpyW(szKeyName, L"System\\CurrentControlSet\\Control\\Class");
@ -893,6 +933,8 @@ PNP_DeleteClassKey(handle_t BindingHandle,
{
CONFIGRET ret = CR_SUCCESS;
UNREFERENCED_PARAMETER(BindingHandle);
DPRINT("PNP_GetClassName(%S, %lx) called\n", ClassGuid, Flags);
if (Flags & CM_DELETE_CLASS_SUBKEYS)
@ -922,6 +964,12 @@ PNP_CreateDevInst(handle_t BindingHandle,
{
CONFIGRET ret = CR_CALL_NOT_IMPLEMENTED;
UNREFERENCED_PARAMETER(BindingHandle);
UNREFERENCED_PARAMETER(DeviceId);
UNREFERENCED_PARAMETER(ParentDeviceId);
UNREFERENCED_PARAMETER(Length);
UNREFERENCED_PARAMETER(Flags);
DPRINT1("PNP_CreateDevInst() called\n");
DPRINT1("PNP_CreateDevInst() done (returns %lx)\n", ret);
@ -940,6 +988,11 @@ PNP_DeviceInstanceAction(handle_t BindingHandle,
{
CONFIGRET ret = CR_SUCCESS;
UNREFERENCED_PARAMETER(BindingHandle);
UNREFERENCED_PARAMETER(MinorAction);
UNREFERENCED_PARAMETER(DeviceInstance1);
UNREFERENCED_PARAMETER(DeviceInstance2);
DPRINT("PNP_DeviceInstanceAction() called\n");
switch (MajorAction)
@ -997,6 +1050,9 @@ PNP_GetDeviceStatus(handle_t BindingHandle,
CONFIGRET ret = CR_SUCCESS;
NTSTATUS Status;
UNREFERENCED_PARAMETER(BindingHandle);
UNREFERENCED_PARAMETER(Flags);
DPRINT("PNP_GetDeviceStatus() called\n");
RtlInitUnicodeString(&PlugPlayData.DeviceInstance,
@ -1031,6 +1087,11 @@ PNP_SetDeviceProblem(handle_t BindingHandle,
{
CONFIGRET ret = CR_SUCCESS;
UNREFERENCED_PARAMETER(BindingHandle);
UNREFERENCED_PARAMETER(DeviceInstance);
UNREFERENCED_PARAMETER(Problem);
UNREFERENCED_PARAMETER(Flags);
DPRINT1("PNP_SetDeviceProblem() called\n");
/* FIXME */
@ -1049,6 +1110,10 @@ PNP_UninstallDevInst(handle_t BindingHandle,
{
CONFIGRET ret = CR_SUCCESS;
UNREFERENCED_PARAMETER(BindingHandle);
UNREFERENCED_PARAMETER(DeviceInstance);
UNREFERENCED_PARAMETER(Flags);
DPRINT1("PNP_UninstallDevInst() called\n");
/* FIXME */
@ -1070,7 +1135,7 @@ CheckForDeviceId(LPWSTR lpDeviceIdList,
while (*lpPtr != 0)
{
dwLength = wcslen(lpPtr);
if (!_wcsicmp(lpPtr, lpDeviceId))
if (0 == _wcsicmp(lpPtr, lpDeviceId))
return TRUE;
lpPtr += (dwLength + 1);
@ -1114,6 +1179,8 @@ PNP_AddID(handle_t BindingHandle,
DWORD dwDeviceIdListSize;
WCHAR szDeviceIdList[512];
UNREFERENCED_PARAMETER(BindingHandle);
DPRINT("PNP_AddID() called\n");
DPRINT(" DeviceInstance: %S\n", DeviceInstance);
DPRINT(" DeviceId: %S\n", DeviceId);
@ -1186,6 +1253,8 @@ PNP_IsDockStationPresent(handle_t BindingHandle,
DWORD dwSize;
CONFIGRET ret = CR_SUCCESS;
UNREFERENCED_PARAMETER(BindingHandle);
DPRINT1("PNP_IsDockStationPresent() called\n");
*Present = FALSE;
@ -1232,6 +1301,8 @@ PNP_RequestEjectPC(handle_t BindingHandle)
{
CONFIGRET ret = CR_SUCCESS;
UNREFERENCED_PARAMETER(BindingHandle);
DPRINT1("PNP_RequestEjectPC() called\n");
ret = CR_FAILURE; /* FIXME */
@ -1253,6 +1324,13 @@ PNP_HwProfFlags(handle_t BindingHandle,
{
CONFIGRET ret = CR_SUCCESS;
UNREFERENCED_PARAMETER(BindingHandle);
UNREFERENCED_PARAMETER(Action);
UNREFERENCED_PARAMETER(DeviceId);
UNREFERENCED_PARAMETER(ProfileId);
UNREFERENCED_PARAMETER(Value);
UNREFERENCED_PARAMETER(Flags);
DPRINT1("PNP_HwProfFlags() called\n");
ret = CR_CALL_NOT_IMPLEMENTED; /* FIXME */
@ -1273,6 +1351,11 @@ PNP_AddEmptyLogConf(handle_t BindingHandle,
{
CONFIGRET ret = CR_SUCCESS;
UNREFERENCED_PARAMETER(BindingHandle);
UNREFERENCED_PARAMETER(DeviceInstance);
UNREFERENCED_PARAMETER(ulPriority);
UNREFERENCED_PARAMETER(ulFlags);
DPRINT1("PNP_AddEmptyLogConf() called\n");
*pulLogConfTag = 0; /* FIXME */
@ -1293,6 +1376,12 @@ PNP_FreeLogConf(handle_t BindingHandle,
{
CONFIGRET ret = CR_SUCCESS;
UNREFERENCED_PARAMETER(BindingHandle);
UNREFERENCED_PARAMETER(DeviceInstance);
UNREFERENCED_PARAMETER(ulType);
UNREFERENCED_PARAMETER(ulLogConfTag);
UNREFERENCED_PARAMETER(ulFlags);
DPRINT1("PNP_FreeLogConf() called\n");
@ -1312,6 +1401,11 @@ PNP_GetFirstLogConf(handle_t BindingHandle,
{
CONFIGRET ret = CR_SUCCESS;
UNREFERENCED_PARAMETER(BindingHandle);
UNREFERENCED_PARAMETER(DeviceInstance);
UNREFERENCED_PARAMETER(ulPriority);
UNREFERENCED_PARAMETER(ulFlags);
DPRINT1("PNP_GetFirstLogConf() called\n");
*pulLogConfTag = 0; /* FIXME */
@ -1333,6 +1427,12 @@ PNP_GetNextLogConf(handle_t BindingHandle,
{
CONFIGRET ret = CR_SUCCESS;
UNREFERENCED_PARAMETER(BindingHandle);
UNREFERENCED_PARAMETER(DeviceInstance);
UNREFERENCED_PARAMETER(ulLogConfType);
UNREFERENCED_PARAMETER(ulCurrentTag);
UNREFERENCED_PARAMETER(ulFlags);
DPRINT1("PNP_GetNextLogConf() called\n");
*pulNextTag = 0; /* FIXME */
@ -1354,6 +1454,12 @@ PNP_GetLogConfPriority(handle_t BindingHandle,
{
CONFIGRET ret = CR_SUCCESS;
UNREFERENCED_PARAMETER(BindingHandle);
UNREFERENCED_PARAMETER(DeviceInstance);
UNREFERENCED_PARAMETER(ulLogConfType);
UNREFERENCED_PARAMETER(ulCurrentTag);
UNREFERENCED_PARAMETER(ulFlags);
DPRINT1("PNP_GetLogConfPriority() called\n");
*pPriority = 0; /* FIXME */
@ -1369,6 +1475,9 @@ CONFIGRET
PNP_RunDetection(handle_t BindingHandle,
unsigned long Flags)
{
UNREFERENCED_PARAMETER(BindingHandle);
UNREFERENCED_PARAMETER(Flags);
DPRINT("PNP_RunDetection() called\n");
return CR_CALL_NOT_IMPLEMENTED;
}
@ -1396,12 +1505,12 @@ InstallDevice(PCWSTR DeviceInstance, BOOL SetupIsActive)
if (!NT_SUCCESS(Status))
return FALSE;
if (PlugPlayData.DeviceStatus & DNF_STARTED || PlugPlayData.DeviceStatus & DNF_START_FAILED)
if ((PlugPlayData.DeviceStatus & (DNF_STARTED | DNF_START_FAILED)) != 0)
/* Device is already started, or disabled due to some problem. Don't install it */
return TRUE;
/* Install device */
SetEnvironmentVariable(L"USERPROFILE", L"."); /* FIXME: why is it needed? */
SetEnvironmentVariableW(L"USERPROFILE", L"."); /* FIXME: why is it needed? */
hNewDev = LoadLibraryW(L"newdev.dll");
if (!hNewDev)
@ -1467,6 +1576,8 @@ DeviceInstallThread(LPVOID lpParameter)
DeviceInstallParams* Params;
BOOL setupActive;
UNREFERENCED_PARAMETER(lpParameter);
setupActive = SetupIsActive();
SetEnvironmentVariable(L"USERPROFILE", L"."); /* FIXME: why is it needed? */
@ -1476,7 +1587,7 @@ DeviceInstallThread(LPVOID lpParameter)
#ifdef HAVE_SLIST_ENTRY_IMPLEMENTED
ListEntry = InterlockedPopEntrySList(&DeviceInstallListHead);
#else
if (IsListEmpty(&DeviceInstallListHead))
if ((BOOL)IsListEmpty(&DeviceInstallListHead))
ListEntry = NULL;
else
ListEntry = RemoveHeadList(&DeviceInstallListHead);
@ -1484,13 +1595,11 @@ DeviceInstallThread(LPVOID lpParameter)
if (ListEntry == NULL)
{
SetEvent(hNoPendingInstalls);
DPRINT1("*** EVENT SETTED\n");
WaitForSingleObject(hDeviceInstallListNotEmpty, INFINITE);
}
else
{
ResetEvent(hNoPendingInstalls);
DPRINT1("*** EVENT RESETTED\n");
Params = CONTAINING_RECORD(ListEntry, DeviceInstallParams, ListEntry);
InstallDevice(Params->DeviceIds, setupActive);
}
@ -1508,6 +1617,8 @@ PnpEventThread(LPVOID lpParameter)
NTSTATUS Status;
RPC_STATUS RpcStatus;
UNREFERENCED_PARAMETER(lpParameter);
PnpEventSize = 0x1000;
PnpEvent = HeapAlloc(GetProcessHeap(), 0, PnpEventSize);
if (PnpEvent == NULL)
@ -1581,6 +1692,9 @@ ServiceMain(DWORD argc, LPTSTR *argv)
HANDLE hThread;
DWORD dwThreadId;
UNREFERENCED_PARAMETER(argc);
UNREFERENCED_PARAMETER(argv);
DPRINT("ServiceMain() called\n");
hNoPendingInstalls = CreateEventW(NULL,
@ -1624,6 +1738,9 @@ main(int argc, char *argv[])
{
DWORD dwError;
UNREFERENCED_PARAMETER(argc);
UNREFERENCED_PARAMETER(argv);
DPRINT("Umpnpmgr: main() started\n");
hInstallEvent = CreateEvent(NULL, TRUE, FALSE, NULL);