[MISC]: Cleanup a bunch of unused variables, in cases where it was obvious these variables were left-overs from debug code, debug prints, or in some cases commented-out functionality (in which case the variables were commented out instead of removed). If you own ACLUI, CLASS2, USB, USER32, or EXT2LIB you may want to check that these changes are accurate (i.e.: such as the last commit where the variable was actually not being used due to a bug).

svn path=/trunk/; revision=59527
This commit is contained in:
Alex Ionescu 2013-07-20 00:10:31 +00:00
parent d27393f669
commit df2c8e140c
15 changed files with 14 additions and 78 deletions

View file

@ -212,7 +212,7 @@ LookupSidInformation(IN PSIDCACHEMGR scm,
SID_NAME_USE SidNameUse = SidTypeUnknown;
PPOLICY_ACCOUNT_DOMAIN_INFO PolicyAccountDomainInfo = NULL;
NTSTATUS Status;
DWORD SidLength, AccountNameSize, DomainNameSize = 0;
DWORD AccountNameSize, DomainNameSize = 0;
PSIDREQRESULT ReqRet = NULL;
BOOL Ret = FALSE;
@ -223,7 +223,6 @@ LookupSidInformation(IN PSIDCACHEMGR scm,
&Names);
if (NT_SUCCESS(Status))
{
SidLength = GetLengthSid(pSid);
SidNameUse = Names->Use;
if (ReferencedDomain != NULL &&

View file

@ -396,7 +396,6 @@ WINAPI
SetErrorMode(IN UINT uMode)
{
UINT PrevErrMode, NewMode;
NTSTATUS Status;
/* Get the previous mode */
PrevErrMode = GetErrorMode();
@ -418,10 +417,10 @@ SetErrorMode(IN UINT uMode)
NewMode |= (PrevErrMode & SEM_NOALIGNMENTFAULTEXCEPT);
/* Set the new mode */
Status = NtSetInformationProcess(NtCurrentProcess(),
ProcessDefaultHardErrorMode,
(PVOID)&NewMode,
sizeof(NewMode));
NtSetInformationProcess(NtCurrentProcess(),
ProcessDefaultHardErrorMode,
(PVOID)&NewMode,
sizeof(NewMode));
/* Return the previous mode */
return PrevErrMode;

View file

@ -471,7 +471,7 @@ Return Value:
UNICODE_STRING unicodeDeviceName;
PFILE_OBJECT fileObject;
CCHAR deviceNameBuffer[256];
BOOLEAN deviceFound = FALSE;
/* BOOLEAN deviceFound = FALSE; See note at the end */
PCLASS_DRIVER_EXTENSION DriverExtension;
PUNICODE_STRING RegistryPath = Argument2;
@ -578,7 +578,7 @@ Return Value:
if (InitializationData->ClassFindDevices(DriverObject, Argument2, InitializationData,
portDeviceObject, DriverExtension->PortNumber)) {
deviceFound = TRUE;
/* deviceFound = TRUE; See note at the end */
}
}

View file

@ -311,7 +311,6 @@ USBCCGP_ScanConfigurationDescriptor(
{
PUSB_INTERFACE_DESCRIPTOR InterfaceDescriptor;
ULONG InterfaceIndex = 0;
PVOID CurrentPosition;
ULONG DescriptorCount;
//
@ -337,7 +336,6 @@ USBCCGP_ScanConfigurationDescriptor(
return STATUS_INSUFFICIENT_RESOURCES;
}
CurrentPosition = ConfigurationDescriptor;
do
{
//
@ -351,7 +349,6 @@ USBCCGP_ScanConfigurationDescriptor(
//
FDODeviceExtension->InterfaceList[FDODeviceExtension->InterfaceListCount].InterfaceDescriptor = InterfaceDescriptor;
FDODeviceExtension->InterfaceListCount++;
CurrentPosition = (PVOID)((ULONG_PTR)InterfaceDescriptor + InterfaceDescriptor->bLength);
}
else
{

View file

@ -436,7 +436,6 @@ NTSTATUS
QueryStatusChangeEndpoint(
IN PDEVICE_OBJECT DeviceObject)
{
NTSTATUS Status;
PDEVICE_OBJECT RootHubDeviceObject;
PIO_STACK_LOCATION Stack;
PHUB_DEVICE_EXTENSION HubDeviceExtension;
@ -520,7 +519,7 @@ QueryStatusChangeEndpoint(
//
DPRINT("DeviceObject is %x\n", DeviceObject);
DPRINT("Iocalldriver %x with irp %x\n", RootHubDeviceObject, HubDeviceExtension->PendingSCEIrp);
Status = IoCallDriver(RootHubDeviceObject, HubDeviceExtension->PendingSCEIrp);
IoCallDriver(RootHubDeviceObject, HubDeviceExtension->PendingSCEIrp);
return STATUS_PENDING;
}
@ -1509,16 +1508,12 @@ USBHUB_FdoStartDevice(
USBD_INTERFACE_LIST_ENTRY InterfaceList[2] = {{NULL, NULL}, {NULL, NULL}};
PURB ConfigUrb = NULL;
ULONG HubStatus;
PIO_STACK_LOCATION Stack;
NTSTATUS Status = STATUS_SUCCESS;
PHUB_DEVICE_EXTENSION HubDeviceExtension;
PDEVICE_OBJECT RootHubDeviceObject;
PVOID HubInterfaceBusContext , UsbDInterfaceBusContext;
PVOID HubInterfaceBusContext;
PORT_STATUS_CHANGE StatusChange;
// get current stack location
Stack = IoGetCurrentIrpStackLocation(Irp);
// get hub device extension
HubDeviceExtension = (PHUB_DEVICE_EXTENSION) DeviceObject->DeviceExtension;
@ -1610,8 +1605,6 @@ USBHUB_FdoStartDevice(
return Status;
}
UsbDInterfaceBusContext = HubDeviceExtension->UsbDInterface.BusContext;
// Get Root Hub Device Handle
Status = SubmitRequestToRootHub(RootHubDeviceObject,
IOCTL_INTERNAL_USB_GET_DEVICE_HANDLE,

View file

@ -54,7 +54,6 @@ FowardUrbToRootHub(
OUT PVOID OutParameter1,
OUT PVOID OutParameter2)
{
NTSTATUS Status;
PIRP ForwardIrp;
IO_STATUS_BLOCK IoStatus;
PIO_STACK_LOCATION ForwardStack, CurrentStack;
@ -115,7 +114,7 @@ FowardUrbToRootHub(
TRUE,
TRUE);
Status = IoCallDriver(RootHubDeviceObject, ForwardIrp);
IoCallDriver(RootHubDeviceObject, ForwardIrp);
//
// Always return pending as the completion routine will take care of it
@ -194,8 +193,6 @@ USBHUB_PdoHandleInternalDeviceControl(
{
case IOCTL_INTERNAL_USB_GET_PARENT_HUB_INFO:
{
PHUB_DEVICE_EXTENSION DeviceExtension;
DPRINT("IOCTL_INTERNAL_USB_GET_PARENT_HUB_INFO\n");
if (Irp->AssociatedIrp.SystemBuffer == NULL
|| Stack->Parameters.DeviceIoControl.OutputBufferLength != sizeof(PVOID))
@ -205,7 +202,6 @@ USBHUB_PdoHandleInternalDeviceControl(
else
{
PVOID* pHubPointer;
DeviceExtension = (PHUB_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
pHubPointer = (PVOID*)Irp->AssociatedIrp.SystemBuffer;
// FIXME
@ -497,10 +493,8 @@ USBHUB_PdoQueryDeviceText(
PUNICODE_STRING SourceString = NULL;
PWCHAR ReturnString = NULL;
NTSTATUS Status = STATUS_SUCCESS;
LCID LocaleId;
DeviceTextType = IoGetCurrentIrpStackLocation(Irp)->Parameters.QueryDeviceText.DeviceTextType;
LocaleId = IoGetCurrentIrpStackLocation(Irp)->Parameters.QueryDeviceText.LocaleId;
ChildDeviceExtension = (PHUB_CHILDDEVICE_EXTENSION)DeviceObject->DeviceExtension;
//

View file

@ -245,21 +245,14 @@ NTAPI
ErrorHandlerWorkItemRoutine(
PVOID Context)
{
NTSTATUS Status;
PFDO_DEVICE_EXTENSION FDODeviceExtension;
PERRORHANDLER_WORKITEM_DATA WorkItemData = (PERRORHANDLER_WORKITEM_DATA)Context;
//
// get fdo
//
FDODeviceExtension = WorkItemData->Context->FDODeviceExtension;
if (WorkItemData->Context->ErrorIndex == 2)
{
//
// reset device
//
Status = USBSTOR_HandleTransferError(WorkItemData->DeviceObject, WorkItemData->Context);
USBSTOR_HandleTransferError(WorkItemData->DeviceObject, WorkItemData->Context);
}
else
{

View file

@ -544,7 +544,6 @@ USBSTOR_StartIo(
PFDO_DEVICE_EXTENSION FDODeviceExtension;
PPDO_DEVICE_EXTENSION PDODeviceExtension;
KIRQL OldLevel;
NTSTATUS Status;
BOOLEAN ResetInProgress;
DPRINT("USBSTOR_StartIo\n");
@ -660,7 +659,7 @@ USBSTOR_StartIo(
//
// execute scsi
//
Status = USBSTOR_HandleExecuteSCSI(IoStack->DeviceObject, Irp, 0);
USBSTOR_HandleExecuteSCSI(IoStack->DeviceObject, Irp, 0);
//
// FIXME: handle error

View file

@ -181,9 +181,7 @@ USBSTOR_CSWCompletionRoutine(
PREAD_CAPACITY_DATA_EX CapacityDataEx;
PREAD_CAPACITY_DATA CapacityData;
PUFI_CAPACITY_RESPONSE Response;
NTSTATUS Status;
PURB Urb;
//
// access context
@ -274,7 +272,6 @@ USBSTOR_CSWCompletionRoutine(
ASSERT(Request);
Status = Irp->IoStatus.Status;
Urb = &Context->Urb;
//
// get SCSI command data block

View file

@ -402,7 +402,6 @@ CHubController::HandlePnp(
IN OUT PIRP Irp)
{
PIO_STACK_LOCATION IoStack;
PCOMMON_DEVICE_EXTENSION DeviceExtension;
PDEVICE_CAPABILITIES DeviceCapabilities;
PPNP_BUS_INFORMATION BusInformation;
PDEVICE_RELATIONS DeviceRelations;
@ -413,16 +412,6 @@ CHubController::HandlePnp(
WCHAR Buffer[300];
LPWSTR DeviceName;
//
// get device extension
//
DeviceExtension = (PCOMMON_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
//
// sanity check
//
ASSERT(DeviceExtension->IsFDO == FALSE);
//
// get current stack location
//
@ -2189,7 +2178,6 @@ CHubController::HandleDeviceControl(
IN OUT PIRP Irp)
{
PIO_STACK_LOCATION IoStack;
PCOMMON_DEVICE_EXTENSION DeviceExtension;
PURB Urb;
NTSTATUS Status = STATUS_NOT_IMPLEMENTED;
@ -2198,11 +2186,6 @@ CHubController::HandleDeviceControl(
//
IoStack = IoGetCurrentIrpStackLocation(Irp);
//
// get device extension
//
DeviceExtension = (PCOMMON_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
//
// determine which request should be performed
//

View file

@ -308,7 +308,6 @@ CUSBDevice::SetDeviceAddress(
{
PUSB_DEFAULT_PIPE_SETUP_PACKET CtrlSetup;
NTSTATUS Status;
UCHAR OldAddress;
UCHAR Index;
DPRINT1("[%s] SetDeviceAddress> Address %x\n", m_USBType, DeviceAddress);
@ -341,9 +340,6 @@ CUSBDevice::SetDeviceAddress(
// lets have a short nap
KeStallExecutionProcessor(300);
// back up old address
OldAddress = m_DeviceAddress;
// store new device address
m_DeviceAddress = DeviceAddress;

View file

@ -220,7 +220,6 @@ bool ext2_expand_inode( PEXT2_FILESYS Ext2Sys,
PEXT2_SUPER_BLOCK pExt2Sb = Ext2Sys->ext2_sb;
int i = 0;
bool bRet = true;
bool bDirty = false;
ULONG TotalBlocks;
TotalBlocks = Inode->i_blocks / (Ext2Sys->blocksize / SECTOR_SIZE);
@ -245,7 +244,6 @@ bool ext2_expand_inode( PEXT2_FILESYS Ext2Sys,
if (i == 0)
{
Inode->i_block[Index] = newBlk;
bDirty = true;
}
else
{
@ -256,7 +254,6 @@ bool ext2_expand_inode( PEXT2_FILESYS Ext2Sys,
if (ext2_alloc_block(Ext2Sys, 0, &dwBlk))
{
Inode->i_block[(i + 12 - 1)] = dwBlk;
bDirty = true;
Inode->i_blocks += (Ext2Sys->blocksize / SECTOR_SIZE);
}

View file

@ -120,7 +120,7 @@ void set_fs_defaults(const char *fs_type,
bool zero_blocks(PEXT2_FILESYS fs, ULONG blk, ULONG num,
ULONG *ret_blk, ULONG *ret_count)
{
ULONG j, count, next_update, next_update_incr;
ULONG j, count;
static unsigned char *buf;
bool retval;
@ -153,11 +153,6 @@ bool zero_blocks(PEXT2_FILESYS fs, ULONG blk, ULONG num,
}
/* OK, do the write loop */
next_update = 0;
next_update_incr = num / 100;
if (next_update_incr < 1)
next_update_incr = 1;
for (j=0; j < num; j += STRIDE_LENGTH, blk += STRIDE_LENGTH)
{
if (num-j > STRIDE_LENGTH)

View file

@ -67,7 +67,6 @@ IntVideoPortChildQueryId(
{
PWCHAR Buffer = NULL, StaticBuffer;
UNICODE_STRING UnicodeStr;
ULONG Length;
switch (IrpSp->Parameters.QueryId.IdType)
{
@ -78,7 +77,6 @@ IntVideoPortChildQueryId(
if (ChildExtension->EdidValid)
{
StaticBuffer = L"DISPLAY\\";
Length = 8 * sizeof(WCHAR);
Buffer = ExAllocatePool(PagedPool, (wcslen(StaticBuffer) + 8) * sizeof(WCHAR));
if (!Buffer) return STATUS_NO_MEMORY;
@ -92,7 +90,6 @@ IntVideoPortChildQueryId(
else
{
StaticBuffer = L"DISPLAY\\Default_Monitor";
Length = wcslen(StaticBuffer) * sizeof(WCHAR);
Buffer = ExAllocatePool(PagedPool, (wcslen(StaticBuffer) + 1) * sizeof(WCHAR));
if (!Buffer) return STATUS_NO_MEMORY;
@ -121,7 +118,6 @@ IntVideoPortChildQueryId(
if (ChildExtension->EdidValid)
{
StaticBuffer = L"MONITOR\\";
Length = 8 * sizeof(WCHAR);
Buffer = ExAllocatePool(PagedPool, (wcslen(StaticBuffer) + 9) * sizeof(WCHAR));
if (!Buffer) return STATUS_NO_MEMORY;
@ -138,7 +134,6 @@ IntVideoPortChildQueryId(
else
{
StaticBuffer = L"MONITOR\\Default_Monitor";
Length = wcslen(StaticBuffer) * sizeof(WCHAR);
Buffer = ExAllocatePool(PagedPool, (wcslen(StaticBuffer) + 2) * sizeof(WCHAR));
if (!Buffer) return STATUS_NO_MEMORY;

View file

@ -593,7 +593,6 @@ LRESULT WINAPI StaticWndProcW( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara
static void STATIC_PaintOwnerDrawfn( HWND hwnd, HDC hdc, DWORD style )
{
DRAWITEMSTRUCT dis;
HBRUSH hBrush;
HFONT font, oldFont = NULL;
UINT id = (UINT)GetWindowLongPtrW( hwnd, GWLP_ID );
@ -609,7 +608,7 @@ static void STATIC_PaintOwnerDrawfn( HWND hwnd, HDC hdc, DWORD style )
font = (HFONT)GetWindowLongPtrW( hwnd, HFONT_GWL_OFFSET );
if (font) oldFont = SelectObject( hdc, font );
hBrush = STATIC_SendWmCtlColorStatic(hwnd, hdc);
/* hBrush = */ STATIC_SendWmCtlColorStatic(hwnd, hdc);
SendMessageW( GetParent(hwnd), WM_DRAWITEM, id, (LPARAM)&dis );
if (font) SelectObject( hdc, oldFont );
}