Index: base/applications/atactl/atactl.cpp =================================================================== --- base/applications/atactl/atactl.cpp (revision 58564) +++ base/applications/atactl/atactl.cpp (working copy) @@ -337,7 +337,7 @@ { ULONG status; PSCSI_PASS_THROUGH_WITH_BUFFERS sptwb; - ULONG data_len = BufferLength; + //ULONG data_len = BufferLength; ULONG len; len = BufferLength + offsetof(SCSI_PASS_THROUGH_WITH_BUFFERS, ucDataBuf); @@ -1065,7 +1065,7 @@ { char dev_name[64]; HANDLE h; - BOOLEAN uniata_driven; + //BOOLEAN uniata_driven; if(bus_id == -1) { for(bus_id=0; TRUE; bus_id++) { @@ -1074,7 +1074,7 @@ } return TRUE; } - uniata_driven = ata_adapter_info(bus_id, g_adapter_info); + /*uniata_driven =*/ ata_adapter_info(bus_id, g_adapter_info); sprintf(dev_name, "\\\\.\\Scsi%d:", bus_id); h = ata_open_dev(dev_name); if(!h) @@ -1230,8 +1230,13 @@ &to, sizeof(to), NULL, 0, &returned); + if(!status) { + printf("Delete failed\n"); + } else { + printf("Device is detached\n"); + } ata_close_dev(h); - return TRUE; + return status ? TRUE : FALSE; } // end ata_hide() BOOLEAN @@ -1289,7 +1294,7 @@ FALSE); } ata_close_dev(h); - return TRUE; + return status ? TRUE : FALSE; } // end ata_scan() CHAR* @@ -1656,7 +1661,7 @@ NULL, 0, FALSE, &senseData, &returned); ata_close_dev(h); - return TRUE; + return status ? TRUE : FALSE; } // end ata_power_mode() int Index: drivers/storage/ide/uniata/atapi.h =================================================================== --- drivers/storage/ide/uniata/atapi.h (revision 58564) +++ drivers/storage/ide/uniata/atapi.h (working copy) @@ -334,6 +334,8 @@ #define ATA_SA300 0x48 /*0x81*/ #define ATA_SA600 0x49 /*0x82*/ +#define ATA_MODE_NOT_SPEC ((ULONG)(-1)) /*0x82*/ + // // IDE command definitions // Index: drivers/storage/ide/uniata/bm_devs.h =================================================================== --- drivers/storage/ide/uniata/bm_devs.h (revision 58564) +++ drivers/storage/ide/uniata/bm_devs.h (working copy) @@ -66,7 +66,7 @@ ULONG nDeviceId; ULONG nRevId; ULONG MaxTransferMode; - PCHAR FullDevName; + PVEN_STR FullDevName; ULONG RaidFlags; CHAR VendorIdStr[4]; CHAR DeviceIdStr[4]; @@ -665,7 +665,7 @@ #ifdef USER_MODE #define PCI_DEV_HW_SPEC_BM(idhi, idlo, rev, mode, name, flags) \ - { (PVEN_STR) #idlo, 4, 0x##idlo, (PVEN_STR) #idhi, 4, 0x##idhi, rev, mode, name, flags} + { (PVEN_STR) #idlo, 4, 0x##idlo, (PVEN_STR) #idhi, 4, 0x##idhi, rev, mode, (PVEN_STR)name, flags} #else #define PCI_DEV_HW_SPEC_BM(idhi, idlo, rev, mode, name, flags) \ { (PVEN_STR) #idlo, 4, 0x##idlo, (PVEN_STR) #idhi, 4, 0x##idhi, rev, mode, NULL, flags} Index: drivers/storage/ide/uniata/id_ata.cpp =================================================================== --- drivers/storage/ide/uniata/id_ata.cpp (revision 58564) +++ drivers/storage/ide/uniata/id_ata.cpp (working copy) @@ -1354,7 +1354,7 @@ ULONG waitCount = 50000; ULONG j; UCHAR statusByte; - UCHAR statusByte2; + //UCHAR statusByte2; UCHAR signatureLow, signatureHigh; BOOLEAN atapiDev = FALSE; @@ -1393,7 +1393,7 @@ AtapiStallExecution(10); statusByte = WaitOnBusyLong(chan); // Check that the status register makes sense. - GetBaseStatus(chan, statusByte2); + GetBaseStatus(chan, statusByte); } if (Command == IDE_COMMAND_IDENTIFY) { @@ -1435,11 +1435,11 @@ } } while ((statusByte & IDE_STATUS_BUSY) && waitCount--); - GetBaseStatus(chan, statusByte2); + GetBaseStatus(chan, statusByte); SelectDrive(chan, DeviceNumber); } else { - GetBaseStatus(chan, statusByte2); + GetBaseStatus(chan, statusByte); } // Another check for signature, to deal with one model Atapi that doesn't assert signature after // a soft reset. @@ -3121,7 +3121,7 @@ } else if (!(LunExt->DeviceFlags & DFLAGS_CHANGER_INITED)){ ULONG j; - BOOLEAN isSanyo = FALSE; + //BOOLEAN isSanyo = FALSE; CCHAR vendorId[26]; KdPrint2((PRINT_PREFIX "AtapiHwInitialize: ATAPI/Changer branch\n")); @@ -3142,7 +3142,7 @@ // acting like 1) a multi-lun device and 2) building the 'special' TUR's. LunExt->DeviceFlags |= (DFLAGS_CHANGER_INITED | DFLAGS_SANYO_ATAPI_CHANGER); LunExt->DiscsPresent = 3; - isSanyo = TRUE; + //isSanyo = TRUE; } } } @@ -4533,7 +4533,9 @@ BOOLEAN atapiDev = FALSE; +#ifdef DBG UCHAR Channel; +#endif //DBG UCHAR lChannel; UCHAR DeviceNumber; BOOLEAN DmaTransfer = FALSE; @@ -4564,9 +4566,12 @@ PHW_LU_EXTENSION LunExt; lChannel = c; + +#ifdef DBG Channel = (UCHAR)(deviceExtension->Channel + lChannel); KdPrint2((PRINT_PREFIX " cntrlr %#x:%d, irql %#x, c %d\n", deviceExtension->DevIndex, Channel, KeGetCurrentIrql(), c)); +#endif //DBG if((chan->ChannelCtrlFlags & CTRFLAGS_DMA_ACTIVE) || (AtaReq && (AtaReq->Flags & REQ_FLAG_DMA_OPERATION)) || @@ -5525,11 +5530,20 @@ } else if (interruptReason == (ATAPI_IR_IO_toHost | ATAPI_IR_COD_Cmd) && !(statusByte & IDE_STATUS_DRQ)) { KdPrint2((PRINT_PREFIX "AtapiInterrupt: interruptReason = CompleteRequest\n")); - // Command complete. + // Command complete. We exactly know this because os IReason. + if(DmaTransfer) { KdPrint2((PRINT_PREFIX "AtapiInterrupt: CompleteRequest, was DmaTransfer\n")); - AtaReq->WordsTransfered = AtaReq->WordsLeft; + AtaReq->WordsTransfered += AtaReq->WordsLeft; AtaReq->WordsLeft = 0; + } else { + KdPrint2((PRINT_PREFIX "AtapiInterrupt: CompleteRequest, was PIO\n")); + + wordCount = AtaReq->WordsLeft; + // Advance data buffer pointer and bytes left. + AtaReq->DataBuffer += wordCount; + AtaReq->WordsLeft -= wordCount; + AtaReq->WordsTransfered += wordCount; } //if (AtaReq->WordsLeft) { // status = SRB_STATUS_DATA_OVERRUN; @@ -9905,7 +9919,7 @@ ULONG statusToReturn, newStatus; PUNICODE_STRING RegistryPath = (PUNICODE_STRING)Argument2; BOOLEAN ReEnter = FALSE; - WCHAR a; +// WCHAR a; #ifndef USE_REACTOS_DDK NTSTATUS status; #endif @@ -9918,7 +9932,7 @@ Connect_DbgPrint(); KdPrint2((PRINT_PREFIX "%s", (PCCHAR)ver_string)); - a = (WCHAR)strlen(ver_string); + //a = (WCHAR)strlen(ver_string); g_opt_Verbose = (BOOLEAN)AtapiRegCheckDevValue(NULL, CHAN_NOT_SPECIFIED, DEVNUM_NOT_SPECIFIED, L"PrintLogo", 0); if(g_opt_Verbose) { @@ -10752,7 +10766,7 @@ } if(deviceExtension->AdapterInterfaceType == PCIBus) { // we must never get here for non-PCI - status = UniataDisconnectIntr2(HwDeviceExtension); + /*status =*/ UniataDisconnectIntr2(HwDeviceExtension); BMList[deviceExtension->DevIndex].Isr2Enable = FALSE; } break; @@ -10765,16 +10779,18 @@ AtapiChipInit(HwDeviceExtension, DEVNUM_NOT_SPECIFIED, CHAN_NOT_SPECIFIED); status = UniataConnectIntr2(HwDeviceExtension); - for (c = 0; c < numberChannels; c++) { - AtapiChipInit(HwDeviceExtension, DEVNUM_NOT_SPECIFIED, c); - FindDevices(HwDeviceExtension, 0, c); - AtapiEnableInterrupts(deviceExtension, c); - AtapiHwInitialize__(deviceExtension, c); + if(NT_SUCCESS(status)) { + for (c = 0; c < numberChannels; c++) { + AtapiChipInit(HwDeviceExtension, DEVNUM_NOT_SPECIFIED, c); + FindDevices(HwDeviceExtension, 0, c); + AtapiEnableInterrupts(deviceExtension, c); + AtapiHwInitialize__(deviceExtension, c); + } + if(deviceExtension->Isr2DevObj) { + // we must never get here for non-PCI + BMList[deviceExtension->DevIndex].Isr2Enable = TRUE; + } } - if(deviceExtension->Isr2DevObj) { - // we must never get here for non-PCI - BMList[deviceExtension->DevIndex].Isr2Enable = TRUE; - } break; } @@ -10808,13 +10824,13 @@ ... ) { - int len; + //int len; UCHAR dbg_print_tmp_buff[DEBUG_MSG_BUFFER_SIZE]; // UNICODE_STRING msgBuff; va_list ap; va_start(ap, DebugMessage); - len = _vsnprintf((PCHAR)&dbg_print_tmp_buff[0], DEBUG_MSG_BUFFER_SIZE-1, DebugMessage, ap); + /*len =*/ _vsnprintf((PCHAR)&dbg_print_tmp_buff[0], DEBUG_MSG_BUFFER_SIZE-1, DebugMessage, ap); dbg_print_tmp_buff[DEBUG_MSG_BUFFER_SIZE-1] = 0; Index: drivers/storage/ide/uniata/id_init.cpp =================================================================== --- drivers/storage/ide/uniata/id_init.cpp (revision 58564) +++ drivers/storage/ide/uniata/id_init.cpp (working copy) @@ -359,10 +359,10 @@ }; static BUSMASTER_CONTROLLER_INFORMATION const ViaSouthAdapters[] = { - PCI_DEV_HW_SPEC_BM( 3112, 1106, 0x00, -1, "VIA 8361", VIASOUTH ), - PCI_DEV_HW_SPEC_BM( 0305, 1106, 0x00, -1, "VIA 8363", VIASOUTH ), - PCI_DEV_HW_SPEC_BM( 0391, 1106, 0x00, -1, "VIA 8371", VIASOUTH ), - PCI_DEV_HW_SPEC_BM( 3102, 1106, 0x00, -1, "VIA 8662", VIASOUTH ), + PCI_DEV_HW_SPEC_BM( 3112, 1106, 0x00, ATA_MODE_NOT_SPEC, "VIA 8361", VIASOUTH ), + PCI_DEV_HW_SPEC_BM( 0305, 1106, 0x00, ATA_MODE_NOT_SPEC, "VIA 8363", VIASOUTH ), + PCI_DEV_HW_SPEC_BM( 0391, 1106, 0x00, ATA_MODE_NOT_SPEC, "VIA 8371", VIASOUTH ), + PCI_DEV_HW_SPEC_BM( 3102, 1106, 0x00, ATA_MODE_NOT_SPEC, "VIA 8662", VIASOUTH ), PCI_DEV_HW_SPEC_BM( ffff, ffff, 0xff, BMLIST_TERMINATOR, NULL , BMLIST_TERMINATOR ) }; @@ -785,9 +785,9 @@ ChangePciConfig1(0x57, (a | 0x80)); } else { static BUSMASTER_CONTROLLER_INFORMATION const SiSSouthAdapters[] = { - PCI_DEV_HW_SPEC_BM( 0008, 1039, 0x10, -1, "SiS 961", 0 ), -// PCI_DEV_HW_SPEC_BM( 0008, 1039, 0x00, -1, "SiS 961", 0 ), - PCI_DEV_HW_SPEC_BM( ffff, ffff, 0xff, -1, NULL , -1 ) + PCI_DEV_HW_SPEC_BM( 0008, 1039, 0x10, ATA_MODE_NOT_SPEC, "SiS 961", 0 ), +// PCI_DEV_HW_SPEC_BM( 0008, 1039, 0x00, ATA_MODE_NOT_SPEC, "SiS 961", 0 ), + PCI_DEV_HW_SPEC_BM( ffff, ffff, 0xff, ATA_MODE_NOT_SPEC, NULL , -1 ) }; // Save settings GetPciConfig1(0x4a, tmp8); @@ -798,8 +798,8 @@ -1, HwDeviceExtension, SystemIoBusNumber, PCISLOTNUM_NOT_SPECIFIED, NULL); if(i != BMLIST_TERMINATOR) { deviceExtension->HwFlags = (deviceExtension->HwFlags & ~CHIPTYPE_MASK) | SIS133OLD; - //deviceExtension->MaxTransferMode = ATA_UDMA6; - deviceExtension->MaxTransferMode = SiSSouthAdapters[i].MaxTransferMode; + deviceExtension->MaxTransferMode = ATA_UDMA6; + //deviceExtension->MaxTransferMode = SiSSouthAdapters[i].MaxTransferMode; if(SiSSouthAdapters[i].RaidFlags & UNIATA_SATA) { deviceExtension->HwFlags |= UNIATA_SATA; if(SiSSouthAdapters[i].nDeviceId == 0x1182) { @@ -1651,7 +1651,7 @@ PHW_CHANNEL chan; UCHAR tmp8; USHORT tmp16; - ULONG tmp32; + //ULONG tmp32; ULONG c; // logical channel (for Compatible Mode controllers) BOOLEAN CheckCable = FALSE; BOOLEAN GlobalInit = FALSE; @@ -2142,15 +2142,15 @@ chan = &deviceExtension->chan[c]; /* dont block interrupts */ //ChangePciConfig4(0x48, (a & ~0x03c00000)); - tmp32 = AtapiReadPortEx4(NULL, (ULONGIO_PTR)(&deviceExtension->BaseIoAddressSATA_0),0x48); + /*tmp32 =*/ AtapiReadPortEx4(NULL, (ULONGIO_PTR)(&deviceExtension->BaseIoAddressSATA_0),0x48); AtapiWritePortEx4(NULL, (ULONGIO_PTR)(&deviceExtension->BaseIoAddressSATA_0),0x48, (1 << 22) << c); // flush - tmp32 = AtapiReadPortEx4(NULL, (ULONGIO_PTR)(&deviceExtension->BaseIoAddressSATA_0),0x48); + /*tmp32 =*/ AtapiReadPortEx4(NULL, (ULONGIO_PTR)(&deviceExtension->BaseIoAddressSATA_0),0x48); /* Initialize FIFO PCI bus arbitration */ GetPciConfig1(offsetof(PCI_COMMON_CONFIG, CacheLineSize), tmp8); if(tmp8) { - KdPrint2((PRINT_PREFIX "SII: CacheLine=%d\n", tmp32)); + KdPrint2((PRINT_PREFIX "SII: CacheLine=%d\n", tmp8)); tmp8 = (tmp8/8)+1; AtapiWritePort2(chan, IDX_BM_DeviceSpecific1, ((USHORT)tmp8) << 8 | tmp8); } else { Index: drivers/storage/ide/uniata/id_probe.cpp =================================================================== --- drivers/storage/ide/uniata/id_probe.cpp (revision 58564) +++ drivers/storage/ide/uniata/id_probe.cpp (working copy) @@ -127,6 +127,10 @@ // reread config space busDataRead = HalGetBusData(PCIConfiguration, busNumber, slotNumber, pciData, PCI_COMMON_HDR_LENGTH); + if(busDataRead < PCI_COMMON_HDR_LENGTH) { + KdPrint2((PRINT_PREFIX "HalGetBusData() failed %#x\n", busDataRead)); + break; + } KdPrint2((PRINT_PREFIX "New pciData.Command = %#x\n", pciData->Command)); } KdPrint2((PRINT_PREFIX "InterruptLine = %#x\n", pciData->u.type0.InterruptLine)); @@ -287,7 +291,7 @@ ) { // PHW_DEVICE_EXTENSION deviceExtension = (PHW_DEVICE_EXTENSION)HwDeviceExtension; - PVOID HwDeviceExtension; +// PVOID HwDeviceExtension; PHW_DEVICE_EXTENSION deviceExtension = NULL; PCI_SLOT_NUMBER slotData; PCI_COMMON_CONFIG pciData; @@ -328,7 +332,7 @@ deviceStrPtr = deviceString; slotData.u.AsULONG = 0; - HwDeviceExtension = + /*HwDeviceExtension =*/ deviceExtension = (PHW_DEVICE_EXTENSION)ExAllocatePool(NonPagedPool, sizeof(HW_DEVICE_EXTENSION)); if(!deviceExtension) { return(SP_RETURN_NOT_FOUND); @@ -920,12 +924,13 @@ ULONG slotNumber; ULONG busDataRead; ULONG SystemIoBusNumber; - +/* UCHAR vendorString[5]; UCHAR deviceString[5]; + PUCHAR vendorStrPtr; PUCHAR deviceStrPtr; - +*/ UCHAR BaseClass; UCHAR SubClass; ULONG VendorID; @@ -1025,10 +1030,10 @@ return SP_RETURN_ERROR; } RtlZeroMemory(deviceExtension, sizeof(HW_DEVICE_EXTENSION)); - +/* vendorStrPtr = vendorString; deviceStrPtr = deviceString; - +*/ slotNumber = BMList[i].slotNumber; SystemIoBusNumber = BMList[i].busNumber; @@ -2108,7 +2113,7 @@ ULONG irq=0; ULONG portBase; ULONG retryCount; - BOOLEAN atapiOnly; +// BOOLEAN atapiOnly; UCHAR statusByte; BOOLEAN preConfig = FALSE; // @@ -2457,12 +2462,12 @@ if (AtapiParseArgumentString(ArgumentString, "dump") == 1) { KdPrint2((PRINT_PREFIX "AtapiFindController: Crash dump\n")); - atapiOnly = FALSE; + //atapiOnly = FALSE; deviceExtension->DriverMustPoll = TRUE; } else { KdPrint2((PRINT_PREFIX "AtapiFindController: Atapi Only\n")); - atapiOnly = TRUE; + //atapiOnly = TRUE; deviceExtension->DriverMustPoll = FALSE; } #endif //UNIATA_CORE @@ -2470,17 +2475,17 @@ KdPrint2((PRINT_PREFIX "AtapiFindController: Atapi Only (2)\n")); - atapiOnly = TRUE; + //atapiOnly = TRUE; deviceExtension->DriverMustPoll = FALSE; } } else { - atapiOnly = FALSE; + //atapiOnly = FALSE; } } else { - atapiOnly = FALSE; + //atapiOnly = FALSE; deviceExtension->DriverMustPoll = FALSE; }// preConfig check Index: drivers/storage/ide/uniata/id_sata.cpp =================================================================== --- drivers/storage/ide/uniata/id_sata.cpp (revision 58564) +++ drivers/storage/ide/uniata/id_sata.cpp (working copy) @@ -645,7 +645,9 @@ PHW_CHANNEL chan; ULONG offs; ULONG BaseMemAddress; +#ifdef DBG ULONG PI; +#endif //DBG ULONG CAP; ULONG GHC; BOOLEAN MemIo = FALSE; @@ -722,9 +724,11 @@ if(CAP & AHCI_CAP_SAM) { KdPrint2((PRINT_PREFIX " AHCI legasy SATA\n")); } +#ifdef DBG /* get the number of HW channels */ PI = UniataAhciReadHostPort4(deviceExtension, IDX_AHCI_PI); KdPrint2((PRINT_PREFIX " AHCI PI %#x\n", PI)); +#endif //DBG /* clear interrupts */ UniataAhciWriteHostPort4(deviceExtension, IDX_AHCI_IS, @@ -837,9 +841,11 @@ ULONG CAP; ULONG CAP2; ULONG GHC, GHC0; +#ifdef DBG ULONG BOHC; + ULONG v_Mn, v_Mj; +#endif //DBG ULONG NumberChannels; - ULONG v_Mn, v_Mj; ULONG BaseMemAddress; BOOLEAN MemIo = FALSE; BOOLEAN found = FALSE; @@ -905,10 +911,12 @@ KdPrint2((PRINT_PREFIX " 64bit")); //deviceExtension->Host64 = TRUE; // this is just DETECT, do not update anything } +#ifdef DBG if(CAP2 & AHCI_CAP2_BOH) { BOHC = UniataAhciReadHostPort4(deviceExtension, IDX_AHCI_BOHC); KdPrint2((PRINT_PREFIX " BOHC %#x", BOHC)); } +#endif //DBG if(CAP & AHCI_CAP_NCQ) { KdPrint2((PRINT_PREFIX " NCQ")); } @@ -950,6 +958,7 @@ goto exit_detect; } +#ifdef DBG v_Mj = ((version >> 20) & 0xf0) + ((version >> 16) & 0x0f); v_Mn = ((version >> 4) & 0xf0) + (version & 0x0f); @@ -957,6 +966,7 @@ v_Mj, v_Mn, NumberChannels, PI)); KdPrint((" AHCI SATA Gen %d\n", (((CAP & AHCI_CAP_ISS_MASK) >> 20)) )); +#endif //DBG if(CAP & AHCI_CAP_SPM) { KdPrint2((PRINT_PREFIX " PM supported\n")); @@ -2166,11 +2176,11 @@ ULONG tag=0; //ULONG i; PIDE_AHCI_CMD_LIST AHCI_CL = &(chan->AhciCtlBlock->cmd_list[tag]); - PHW_LU_EXTENSION LunExt; + //PHW_LU_EXTENSION LunExt; KdPrint2(("UniataAhciEndTransaction: lChan %d\n", chan->lChannel)); - LunExt = chan->lun[DeviceNumber]; + //LunExt = chan->lun[DeviceNumber]; TFD = UniataAhciReadChannelPort4(chan, IDX_AHCI_P_TFD); KdPrint2((" TFD %#x\n", TFD)); @@ -2474,7 +2484,9 @@ PUCHAR prd_base0; ULONGLONG prd_base64_0; }; +#ifdef DBG ULONG d; +#endif // DBG prd_base64_0 = prd_base64 = 0; prd_base = (PUCHAR)(&AtaReq->ahci_cmd0); @@ -2482,8 +2494,10 @@ prd_base64 = (prd_base64 + max(FIELD_OFFSET(ATA_REQ, ahci_cmd0), AHCI_CMD_ALIGNEMENT_MASK+1)) & ~AHCI_CMD_ALIGNEMENT_MASK; +#ifdef DBG d = (ULONG)(prd_base64 - prd_base64_0); KdPrint2((PRINT_PREFIX " AtaReq %#x: cmd aligned %I64x, d=%x\n", AtaReq, prd_base64, d)); +#endif // DBG AtaReq->ahci.ahci_cmd_ptr = (PIDE_AHCI_CMD)prd_base64; KdPrint2((PRINT_PREFIX " ahci_cmd_ptr %#x\n", AtaReq->ahci.ahci_cmd_ptr)); Index: drivers/storage/ide/uniata/uniata_ver.h =================================================================== --- drivers/storage/ide/uniata/uniata_ver.h (revision 58564) +++ drivers/storage/ide/uniata/uniata_ver.h (working copy) @@ -1,10 +1,10 @@ -#define UNIATA_VER_STR "44b1" -#define UNIATA_VER_DOT 0.44.2.1 +#define UNIATA_VER_STR "44d" +#define UNIATA_VER_DOT 0.44.3.0 #define UNIATA_VER_MJ 0 #define UNIATA_VER_MN 44 -#define UNIATA_VER_SUB_MJ 2 -#define UNIATA_VER_SUB_MN 1 -#define UNIATA_VER_DOT_COMMA 0,44,2,1 -#define UNIATA_VER_DOT_STR "0.44.2.1" -#define UNIATA_VER_YEAR 2012 -#define UNIATA_VER_YEAR_STR "2012" +#define UNIATA_VER_SUB_MJ 3 +#define UNIATA_VER_SUB_MN 0 +#define UNIATA_VER_DOT_COMMA 0,44,3,0 +#define UNIATA_VER_DOT_STR "0.44.3.0" +#define UNIATA_VER_YEAR 2013 +#define UNIATA_VER_YEAR_STR "2013" Index: drivers/storage/ide/uniata/warningfixes.diff =================================================================== --- drivers/storage/ide/uniata/warningfixes.diff (revision 58564) +++ drivers/storage/ide/uniata/warningfixes.diff (working copy) @@ -1,589 +0,0 @@ -Index: atapi.h -=================================================================== ---- atapi.h (revision 38451) -+++ atapi.h (working copy) -@@ -138,6 +138,10 @@ - - #else // _DEBUG - -+#ifdef KdPrint -+#undef KdPrint -+#endif -+ - #define PRINT_PREFIX "UniATA: " - - //#define KdPrint3(_x_) {if(LOG_ON_RAISED_IRQL_W2K || MajorVersion < 0x05 || KeGetCurrentIrql() <= 2){/*DbgPrint("%x: ", PsGetCurrentThread()) ;*/ DbgPrint _x_ ; if(g_LogToDisplay){ PrintNtConsole _x_ ;} }} -@@ -1063,8 +1067,8 @@ - - ULONG - AtapiParseArgumentString( -- IN PCHAR String, -- IN PCHAR KeyWord -+ IN PCCH String, -+ IN PCCH KeyWord - ); - - BOOLEAN -@@ -1202,15 +1206,15 @@ - IN PVOID HwDeviceExtension, - IN ULONG chan, - IN ULONG dev, -- IN PWSTR Name, -+ IN PCWSTR Name, - IN ULONG Default - ); - - extern ULONG - AtapiRegCheckParameterValue( - IN PVOID HwDeviceExtension, -- IN PWSTR PathSuffix, -- IN PWSTR Name, -+ IN PCWSTR PathSuffix, -+ IN PCWSTR Name, - IN ULONG Default - ); - -@@ -1220,7 +1224,7 @@ - VOID - _cdecl - _PrintNtConsole( -- PCHAR DebugMessage, -+ PCCH DebugMessage, - ... - ); - -Index: id_sata.cpp -=================================================================== ---- id_sata.cpp (revision 38451) -+++ id_sata.cpp (working copy) -@@ -7,7 +7,7 @@ - ) - { - PHW_DEVICE_EXTENSION deviceExtension = (PHW_DEVICE_EXTENSION)HwDeviceExtension; -- ULONG Channel = deviceExtension->Channel + lChannel; -+ //ULONG Channel = deviceExtension->Channel + lChannel; - PHW_CHANNEL chan = &deviceExtension->chan[lChannel]; - SATA_SSTATUS_REG SStatus; - ULONG i; -@@ -126,7 +126,7 @@ - { - PHW_DEVICE_EXTENSION deviceExtension = (PHW_DEVICE_EXTENSION)HwDeviceExtension; - PHW_CHANNEL chan = &deviceExtension->chan[lChannel]; -- ULONG ChipFlags = deviceExtension->HwFlags & CHIPFLAG_MASK; -+ //ULONG ChipFlags = deviceExtension->HwFlags & CHIPFLAG_MASK; - SATA_SSTATUS_REG SStatus; - SATA_SERROR_REG SError; - -Index: ntddk_ex.h -=================================================================== ---- ntddk_ex.h (revision 38451) -+++ ntddk_ex.h (working copy) -@@ -1,15 +1,12 @@ - #ifndef __NTDDK_EX__H__ - #define __NTDDK_EX__H__ - --#ifndef __REACTOS__ -+#ifdef ASSERT - #undef ASSERT --#define ASSERT --#else --#undef ASSERT --#define ASSERT //(x) if (!(x)) {RtlAssert("#x",__FILE__,__LINE__, ""); } --#endif //__REACTOS__ -+#define ASSERT(x) ((void)0) -+// #define ASSERT(x) if (!(x)) { RtlAssert("#x",__FILE__,__LINE__, ""); } -+#endif - -- - #ifndef FILE_CHARACTERISTIC_PNP_DEVICE // DDK 2003 - - #define FILE_CHARACTERISTIC_PNP_DEVICE 0x00000800 -Index: id_dma.cpp -=================================================================== ---- id_dma.cpp (revision 38451) -+++ id_dma.cpp (working copy) -@@ -219,7 +219,7 @@ - PHW_CHANNEL chan = &(deviceExtension->chan[lChannel]); - PATA_REQ AtaReq = (PATA_REQ)(Srb->SrbExtension); - BOOLEAN use_DB_IO = FALSE; -- BOOLEAN use_AHCI = FALSE; -+ //BOOLEAN use_AHCI = FALSE; - ULONG orig_count = count; - ULONG max_entries = (deviceExtension->HwFlags & UNIATA_AHCI) ? ATA_AHCI_DMA_ENTRIES : ATA_DMA_ENTRIES; - -@@ -281,7 +281,7 @@ - if(!dma_count || ((LONG)(dma_base) == -1)) { - KdPrint2((PRINT_PREFIX "AtapiDmaSetup: No 1st block\n" )); - //AtaReq->dma_base = NULL; -- AtaReq->ahci_base64 = NULL; -+ AtaReq->ahci_base64 = 0; - return FALSE; - } - -@@ -303,7 +303,7 @@ - if (i >= max_entries) { - KdPrint2((PRINT_PREFIX "too many segments in DMA table\n" )); - //AtaReq->dma_base = NULL; -- AtaReq->ahci_base64 = NULL; -+ AtaReq->ahci_base64 = 0; - return FALSE; - } - KdPrint2((PRINT_PREFIX " get Phys(data[n]=%x)\n", data )); -@@ -321,7 +321,7 @@ - } else - if(!dma_count || !dma_base || ((LONG)(dma_base) == -1)) { - //AtaReq->dma_base = NULL; -- AtaReq->ahci_base64 = NULL; -+ AtaReq->ahci_base64 = 0; - KdPrint2((PRINT_PREFIX "AtapiDmaSetup: No NEXT block\n" )); - return FALSE; - } -@@ -596,7 +596,7 @@ - ) - { - PHW_LU_EXTENSION LunExt = &(deviceExtension->lun[ldev]); -- CHAR apiomode; -+ SCHAR apiomode; - - apiomode = (CHAR)AtaPioMode(&(LunExt->IdentifyData)); - -@@ -612,7 +612,7 @@ - } - - if((deviceExtension->HbaCtrlFlags & HBAFLAGS_DMA_DISABLED_LBA48) && -- (AtaReq->lba >= ATA_MAX_LBA28) && -+ (AtaReq->lba >= (LONGLONG)ATA_MAX_LBA28) && - (LunExt->TransferMode > ATA_PIO5) ) { - KdPrint2((PRINT_PREFIX - "AtapiDmaReinit: FORCE_DOWNRATE on Device %d for LBA48\n", ldev & 1)); -@@ -623,7 +623,7 @@ - if(AtaReq->Flags & REQ_FLAG_FORCE_DOWNRATE) { - KdPrint2((PRINT_PREFIX - "AtapiDmaReinit: FORCE_DOWNRATE on Device %d\n", ldev & 1)); -- if(AtaReq->lba >= ATA_MAX_LBA28) { -+ if(AtaReq->lba >= (LONGLONG)ATA_MAX_LBA28) { - limit_lba48: - LunExt->DeviceFlags |= REQ_FLAG_FORCE_DOWNRATE_LBA48; - limit_pio: -@@ -754,9 +754,9 @@ - IN ULONG DeviceNumber, - IN ULONG lChannel, // logical channel, - // is always 0 except simplex-only controllers -- IN CHAR apiomode, -- IN CHAR wdmamode, -- IN CHAR udmamode -+ IN SCHAR apiomode, -+ IN SCHAR wdmamode, -+ IN SCHAR udmamode - ) - { - PHW_DEVICE_EXTENSION deviceExtension = (PHW_DEVICE_EXTENSION)HwDeviceExtension; -@@ -1488,7 +1488,7 @@ - AtaSetTransferMode(deviceExtension, DeviceNumber, lChannel, LunExt, ATA_PIO0 + apiomode); - - SetPciConfig1(mreg, mode | (mask & 0x11)); -- SetPciConfig2(ureg - 0x8, sil_pio_modes[i]); -+ SetPciConfig2(ureg - 0x8, sil_pio_modes[apiomode]); - return; - - } else { -@@ -1538,7 +1538,7 @@ - /*******/ - /* SiS */ - /*******/ -- PULONG sis_modes; -+ PULONG sis_modes = NULL; - static const ULONG sis_modes_new133[] = - { 0x28269008, 0x0c266008, 0x04263008, 0x0c0a3008, 0x05093008, - 0x22196008, 0x0c0a3008, 0x05093008, 0x050939fc, 0x050936ac, -@@ -1553,9 +1553,9 @@ - { 0x00cb, 0x0067, 0x0044, 0x0033, 0x0031, 0x0044, 0x0033, 0x0031, - 0x8b31, 0x8731, 0x8531, 0x8431, 0x8231, 0x8131 }; - -- ULONG reg; -+ ULONG reg = 0; - UCHAR reg57; -- ULONG reg_size; -+ ULONG reg_size = 0; - ULONG offs; - - switch(ChipType) { -@@ -1731,8 +1731,8 @@ - AtaSetTransferMode(deviceExtension, DeviceNumber, lChannel, LunExt, ATA_PIO0 + apiomode); - ChangePciConfig1(0x50, a | (1 << (dev + 3)) ); - GetPciConfig1(0x54 + offset, reg54); -- if(reg54 < chtiming[i]) { -- SetPciConfig1(0x54 + offset, chtiming[i]); -+ if(reg54 < chtiming[apiomode]) { -+ SetPciConfig1(0x54 + offset, chtiming[apiomode]); - } - return; - } -@@ -1901,7 +1901,7 @@ - ULONG ChipType = deviceExtension->HwFlags & CHIPTYPE_MASK; - //ULONG ChipFlags = deviceExtension->HwFlags & CHIPFLAG_MASK; - -- ULONG timing; -+ ULONG timing = 0; - - if(mode == ATA_PIO5) - mode = ATA_PIO4; -Index: id_badblock.cpp -=================================================================== ---- id_badblock.cpp (revision 38451) -+++ id_badblock.cpp (working copy) -@@ -159,7 +159,11 @@ - L"UniATA\\Parameters\\BadBlocks", - QueryTable, 0, 0); - -+#ifdef _DEBUG - KdPrint(( "InitBadBlocks returned: %#x\n", status)); -+#else -+ UNREFERENCED_PARAMETER(status); -+#endif - } else { - - KdPrint(( "InitBadBlocks local\n")); -Index: id_init.cpp -=================================================================== ---- id_init.cpp (revision 38451) -+++ id_init.cpp (working copy) -@@ -52,11 +52,11 @@ - ) - { - PHW_DEVICE_EXTENSION deviceExtension = (PHW_DEVICE_EXTENSION)HwDeviceExtension; -- ULONG slotNumber = deviceExtension->slotNumber; -- ULONG SystemIoBusNumber = deviceExtension->SystemIoBusNumber; -+ //ULONG slotNumber = deviceExtension->slotNumber; -+ //ULONG SystemIoBusNumber = deviceExtension->SystemIoBusNumber; - ULONG VendorID = deviceExtension->DevID & 0xffff; -- ULONG DeviceID = (deviceExtension->DevID >> 16) & 0xffff; -- ULONG RevID = deviceExtension->RevID; -+ //ULONG DeviceID = (deviceExtension->DevID >> 16) & 0xffff; -+ //ULONG RevID = deviceExtension->RevID; - ULONG ChipType = deviceExtension->HwFlags & CHIPTYPE_MASK; - ULONG ChipFlags= deviceExtension->HwFlags & CHIPFLAG_MASK; - -@@ -216,7 +216,7 @@ - PCI_DEV_HW_SPEC_BM( 0730, 1039, 0x00, ATA_UDMA5, "SiS 730" , SIS100OLD ), - - PCI_DEV_HW_SPEC_BM( 0646, 1039, 0x00, ATA_UDMA6, "SiS 645DX", SIS133NEW ), --/* PCI_DEV_HW_SPEC_BM( 0645, 1039, 0x00, ATA_UDMA6, "SiS 645" , SIS133NEW ), -+/* PCI_DEV_HW_SPEC_BM( 0645, 1039, 0x00, ATA_UDMA6, "SiS 645" , SIS133NEW ),*/ - /* PCI_DEV_HW_SPEC_BM( 0640, 1039, 0x00, ATA_UDMA4, "SiS 640" , SIS_SOUTH ),*/ - PCI_DEV_HW_SPEC_BM( 0635, 1039, 0x00, ATA_UDMA5, "SiS 635" , SIS100NEW ), - PCI_DEV_HW_SPEC_BM( 0633, 1039, 0x00, ATA_UDMA5, "SiS 633" , SIS100NEW ), -@@ -419,7 +419,7 @@ - BaseIoAddressBM = AtapiGetIoRange(HwDeviceExtension, ConfigInfo, pciData, SystemIoBusNumber, - 4, 0, deviceExtension->NumberChannels*sizeof(IDE_BUSMASTER_REGISTERS)); - for(c=0; cNumberChannels; c++) { -- ULONG unit01 = (c & 1); -+ //ULONG unit01 = (c & 1); - ULONG unit10 = (c & 2); - chan = &deviceExtension->chan[c]; - -@@ -987,7 +987,7 @@ - IN ULONG slotNumber - ) - { -- PHW_DEVICE_EXTENSION deviceExtension = (PHW_DEVICE_EXTENSION)HwDeviceExtension; -+ //PHW_DEVICE_EXTENSION deviceExtension = (PHW_DEVICE_EXTENSION)HwDeviceExtension; - PCI_COMMON_CONFIG pciData; - ULONG funcNumber; - ULONG busDataRead; -@@ -1039,7 +1039,7 @@ - IN ULONG c - ) - { -- PHW_DEVICE_EXTENSION deviceExtension = (PHW_DEVICE_EXTENSION)HwDeviceExtension; -+ //PHW_DEVICE_EXTENSION deviceExtension = (PHW_DEVICE_EXTENSION)HwDeviceExtension; - PCI_COMMON_CONFIG pciData; - ULONG funcNumber; - ULONG busDataRead; -@@ -1174,7 +1174,7 @@ - ULONG slotNumber = deviceExtension->slotNumber; - ULONG SystemIoBusNumber = deviceExtension->SystemIoBusNumber; - -- ULONG ChipType = deviceExtension->HwFlags & CHIPTYPE_MASK; -+ //ULONG ChipType = deviceExtension->HwFlags & CHIPTYPE_MASK; - PHW_CHANNEL chan; - ULONG c; // logical channel (for Compatible Mode controllers) - UCHAR tmp8; -@@ -1332,7 +1332,9 @@ - ULONG slotNumber = deviceExtension->slotNumber; - ULONG SystemIoBusNumber = deviceExtension->SystemIoBusNumber; - ULONG VendorID = deviceExtension->DevID & 0xffff; -+#ifdef _DEBUG - ULONG DeviceID = (deviceExtension->DevID >> 16) & 0xffff; -+#endif - ULONG RevID = deviceExtension->RevID; - // ULONG i; - // BUSMASTER_CONTROLLER_INFORMATION* DevTypeInfo; -Index: id_ata.cpp -=================================================================== ---- id_ata.cpp (revision 38451) -+++ id_ata.cpp (working copy) -@@ -1864,7 +1864,9 @@ - ULONG slotNumber = deviceExtension->slotNumber; - ULONG SystemIoBusNumber = deviceExtension->SystemIoBusNumber; - ULONG VendorID = deviceExtension->DevID & 0xffff; -+#ifdef _DEBUG - ULONG DeviceID = (deviceExtension->DevID >> 16) & 0xffff; -+#endif - //ULONG RevID = deviceExtension->RevID; - ULONG ChipFlags = deviceExtension->HwFlags & CHIPFLAG_MASK; - UCHAR tmp8; -@@ -2859,12 +2861,12 @@ - --*/ - ULONG - AtapiParseArgumentString( -- IN PCHAR String, -- IN PCHAR KeyWord -+ IN PCCH String, -+ IN PCCH KeyWord - ) - { -- PCHAR cptr; -- PCHAR kptr; -+ PCCH cptr; -+ PCCH kptr; - ULONG value; - ULONG stringLength = 0; - ULONG keyWordLength = 0; -@@ -2877,24 +2879,15 @@ - return 0; - } - -- // Calculate the string length and lower case all characters. -+ // Calculate the string length. - cptr = String; -- while (*cptr) { -- if (*cptr >= 'A' && *cptr <= 'Z') { -- *cptr = *cptr + ('a' - 'A'); -- } -- cptr++; -+ while (*cptr++) { - stringLength++; - } - -- // Calculate the keyword length and lower case all characters. -- cptr = KeyWord; -- while (*cptr) { -- -- if (*cptr >= 'A' && *cptr <= 'Z') { -- *cptr = *cptr + ('a' - 'A'); -- } -- cptr++; -+ // Calculate the keyword length. -+ kptr = KeyWord; -+ while (*kptr++) { - keyWordLength++; - } - -@@ -2920,18 +2913,21 @@ - } - - kptr = KeyWord; -- while (*cptr++ == *kptr++) { -+ while ((*cptr == *kptr) || -+ (*cptr <= 'Z' && *cptr + ('a' - 'A') == *kptr) || -+ (*cptr >= 'a' && *cptr - ('a' - 'A') == *kptr)) { -+ cptr++; -+ kptr++; - -- if (*(cptr - 1) == '\0') { -+ if (*cptr == '\0') { - // end of string - return 0; - } - } - -- if (*(kptr - 1) == '\0') { -+ if (*kptr == '\0') { - - // May have a match backup and check for blank or equals. -- cptr--; - while (*cptr == ' ' || *cptr == '\t') { - cptr++; - } -@@ -2967,7 +2963,7 @@ - } - - value = 0; -- if ((*cptr == '0') && (*(cptr + 1) == 'x')) { -+ if ((*cptr == '0') && ((*(cptr + 1) == 'x') || (*(cptr + 1) == 'X'))) { - // Value is in Hex. Skip the "0x" - cptr += 2; - for (index = 0; *(cptr + index); index++) { -@@ -2983,6 +2979,8 @@ - } else { - if ((*(cptr + index) >= 'a') && (*(cptr + index) <= 'f')) { - value = (16 * value) + (*(cptr + index) - 'a' + 10); -+ } else if ((*(cptr + index) >= 'A') && (*(cptr + index) <= 'F')) { -+ value = (16 * value) + (*(cptr + index) - 'A' + 10); - } else { - // Syntax error, return not found. - return 0; -@@ -8752,10 +8750,10 @@ - ULONG - AtapiRegCheckDevLunValue( - IN PVOID HwDeviceExtension, -- IN PWCHAR NamePrefix, -+ IN PCWCH NamePrefix, - IN ULONG chan, - IN ULONG dev, -- IN PWSTR Name, -+ IN PCWSTR Name, - IN ULONG Default - ) - { -@@ -8822,7 +8820,7 @@ - IN PVOID HwDeviceExtension, - IN ULONG chan, - IN ULONG dev, -- IN PWSTR Name, -+ IN PCWSTR Name, - IN ULONG Default - ) - { -@@ -8940,8 +8938,8 @@ - ULONG - AtapiRegCheckParameterValue( - IN PVOID HwDeviceExtension, -- IN PWSTR PathSuffix, -- IN PWSTR Name, -+ IN PCWSTR PathSuffix, -+ IN PCWSTR Name, - IN ULONG Default - ) - { -@@ -9108,7 +9106,7 @@ - VOID - _cdecl - _PrintNtConsole( -- PCHAR DebugMessage, -+ PCCH DebugMessage, - ... - ) - { -Index: id_probe.cpp -=================================================================== ---- id_probe.cpp (revision 38451) -+++ id_probe.cpp (working copy) -@@ -76,7 +76,6 @@ - VOID - AtapiDoNothing(VOID) - { -- ULONG i = 0; - return; - } // end AtapiDoNothing() - -@@ -504,8 +503,8 @@ - /* if(known) { - RtlCopyMemory(newBMListPtr, (PVOID)&(BusMasterAdapters[i]), sizeof(BUSMASTER_CONTROLLER_INFORMATION)); - } else {*/ -- sprintf((PCHAR)vendorStrPtr, "%4.4x", VendorID); -- sprintf((PCHAR)deviceStrPtr, "%4.4x", DeviceID); -+ sprintf((PCHAR)vendorStrPtr, "%4.4lx", VendorID); -+ sprintf((PCHAR)deviceStrPtr, "%4.4lx", DeviceID); - - RtlCopyMemory(&(newBMListPtr->VendorIdStr), (PCHAR)vendorStrPtr, 4); - RtlCopyMemory(&(newBMListPtr->DeviceIdStr), (PCHAR)deviceStrPtr, 4); -@@ -874,7 +873,11 @@ - BOOLEAN found = FALSE; - BOOLEAN MasterDev; - BOOLEAN simplexOnly = FALSE; -+#ifndef UNIATA_CORE -+#ifdef UNIATA_INIT_ON_PROBE - BOOLEAN skip_find_dev = FALSE; -+#endif -+#endif - BOOLEAN AltInit = FALSE; - - SCSI_PHYSICAL_ADDRESS IoBasePort1; -@@ -1712,7 +1715,7 @@ - ) - { - PHW_DEVICE_EXTENSION deviceExtension = (PHW_DEVICE_EXTENSION)HwDeviceExtension; -- PHW_CHANNEL chan = NULL; -+ //PHW_CHANNEL chan = NULL; - // this buffer must be global for UNIATA_CORE build - PCI_COMMON_CONFIG pciData; - -@@ -1743,8 +1746,8 @@ - BOOLEAN found = FALSE; - BOOLEAN MasterDev; - BOOLEAN simplexOnly = FALSE; -- BOOLEAN skip_find_dev = FALSE; -- BOOLEAN AltInit = FALSE; -+ //BOOLEAN skip_find_dev = FALSE; -+ //BOOLEAN AltInit = FALSE; - - PIDE_BUSMASTER_REGISTERS BaseIoAddressBM_0 = NULL; - -@@ -1797,7 +1800,7 @@ - &pciData, - PCI_COMMON_HDR_LENGTH); - -- if (busDataRead < PCI_COMMON_HDR_LENGTH) { -+ if (busDataRead < (ULONG)PCI_COMMON_HDR_LENGTH) { - KdPrint2((PRINT_PREFIX "busDataRead < PCI_COMMON_HDR_LENGTH => SP_RETURN_ERROR\n")); - goto exit_error; - } -@@ -2207,7 +2210,7 @@ - PHW_DEVICE_EXTENSION deviceExtension = (PHW_DEVICE_EXTENSION)HwDeviceExtension; - PHW_CHANNEL chan; - PULONG adapterCount = (PULONG)Context; -- PUCHAR ioSpace; -+ PUCHAR ioSpace = NULL; - ULONG i; - ULONG irq=0; - ULONG portBase; -@@ -2217,7 +2220,7 @@ - BOOLEAN preConfig = FALSE; - // - PIDE_REGISTERS_1 BaseIoAddress1; -- PIDE_REGISTERS_2 BaseIoAddress2; -+ PIDE_REGISTERS_2 BaseIoAddress2 = NULL; - - // The following table specifies the ports to be checked when searching for - // an IDE controller. A zero entry terminates the search. -Index: bm_devs.h -=================================================================== ---- bm_devs.h (revision 38451) -+++ bm_devs.h (working copy) -@@ -482,7 +482,7 @@ - { #idlo, 4, 0x##idlo, #idhi, 4, 0x##idhi, rev, mode, name, flags} - #else - #define PCI_DEV_HW_SPEC_BM(idhi, idlo, rev, mode, name, flags) \ -- { #idlo, 4, 0x##idlo, #idhi, 4, 0x##idhi, rev, mode, NULL, flags} -+ { (PCHAR) #idlo, 4, 0x##idlo, (PCHAR) #idhi, 4, 0x##idhi, rev, mode, NULL, flags} - #endif - - #define BMLIST_TERMINATOR (0xffffffffL) -Index: bsmaster.h -=================================================================== ---- bsmaster.h (revision 38451) -+++ bsmaster.h (working copy) -@@ -987,7 +987,7 @@ - BOOLEAN opt_AtapiDmaRawRead; // default TRUE - BOOLEAN opt_AtapiDmaReadWrite; // default TRUE - -- PCHAR FullDevName; -+ PCCH FullDevName; - - } HW_DEVICE_EXTENSION, *PHW_DEVICE_EXTENSION; - -@@ -1172,9 +1172,9 @@ - IN ULONG DeviceNumber, - IN ULONG lChannel, // logical channel, - // is always 0 except simplex-only controllers -- IN CHAR apiomode, -- IN CHAR wdmamode, -- IN CHAR udmamode -+ IN SCHAR apiomode, -+ IN SCHAR wdmamode, -+ IN SCHAR udmamode - ); - - extern BOOLEAN NTAPI