|
After much deliberation i eventually decided on purchasing a decent NAS box for home.
Went for a QNAP TS-509 Pro, and filled it with 5 x 1.5TB drives, configured in RAID 5.
Then after i got it up and running, started reading about problems with Seagate 1.5TB drives and how they were killing RAID arrays.
Turns out all my drives were not part of the ones with the defective firmware revisions.
Breathed HUGE sigh of relief. (Looks like there is a firmware revision now available if you have affected drives, but you have to request it from seagate support directly).
Now i am going through the tedious process of ripping all my DVD's onto this thing to stream them to my TVIX media jukebox's. So far it has worked a treat.
modified on Friday, November 28, 2008 1:20 PM
|
|
|
|
|
Hi everybody
First, I'm sorry, my english is bad.
Problem:
My driver attaches "\\Device\\Video0" with IoAttachDevice() as TargetDeivce in initialization.
Then, the device driver of the display adaptor doesn't operate normally,
and the screen cannot be displayed.
My driver want to be capturing display for remote control.
I'm making on VC++6.0, and working at Windows Vista.(with Intel 82945G Express Chipset Family)
thanks in advance.
|
|
|
|
|
Hi to everybody
First, sorry for my english is so bad, I know.
I´m having a problem with the function HalGetInterruptVector and IoConnectInterrupt, my code try to be connected with the irq5. I send this to the HalGetInterruptVector function, and withoot errors I get the InterruptVector, Irql and Affinity, and with these informations I try to connect with the irq5, and the IoConnectInterrupt returns no error, but when my hardware generates an interrupt my driver does nothing.
So do you have some idea about what could be my problem?
this is the code
DeviceExtension->Level = 5;
DeviceExtension->Vector = DeviceExtension->Level;
MappedVector = HalGetInterruptVector(0,0,DeviceExtension->Level, DeviceExtension->Vector,&Irql, &DeviceExtension->Affinity);
if (MappedVector == 0)
DbgPrint("Interrupt.sys: HalGetInterruptVector failed ");
IoInitializeDpcRequest(DeviceObject,InterruptDpcRoutine);
status = IoConnectInterrupt(&DeviceExtension->InterruptObject, (PKSERVICE_ROUTINE)InterruptIsr, DeviceObject, NULL,
MappedVector,
Irql, Irql, Latched, FALSE, DeviceExtension->Affinity, FALSE);
if (!NT_SUCCESS (status))
DbgPrint("Interrupt.sys: IoConnectInterrupt Failed ");
thanks in advance,
|
|
|
|
|
Hello,
I am new to driver development and currently developing a my simple driver that will simply ask a directory (or folder) as input from user-mode (e.g "z:\") and display all the files/folders exists in it. By the way, the directory input is passed-on to the kernel and then the kernel will processed the request; then the kernel sends a message containing the list of files/folders that will be parsed by the user-mode for display..
i've read the msdn about ZwQueryDirectoryFile that returns various kind of information about files in the directory and i don't know how to used it. ^_^
Can you help me how can i get all the files/folders exists in a directory?
If im in the right track of using ZwQueryDirectoryFile, can you help me how to use this routine on getting files/folders?..
And If you have other ways aside from using ZwQueryDirectoryFile routine, can you give me an idea HOW and if you have sample snippets can you show it to me?..
Any help will be greatly appriciated.
Thanks in advance to you guys.. ^_^
-taDo-
|
|
|
|
|
noobDriverDev wrote: Can you help me how can i get all the files/folders exists in a directory?
Here is a usermode application I wrote to demonstrate ZwQueryDirectoryFile. In this example I am filtering out everything but directories. if you only want the file/directory names you can replace the FILE_DIRECTORY_INFORMATION structure with the FILE_NAMES_INFORMATION structure and pass the enum of FileNamesInformation. It is sometimes easier to experiment with exported kernel functions from usermode rather than compiling/loading drivers and copying to the virtual machine. Once you get it working as desired simply copy the code into your driver.
#include "stdafx.h"
#include <windows.h>
typedef LONG NTSTATUS;
#define NT_SUCCESS(Status) ((NTSTATUS)(Status) >= 0 && Status < 0x3FFFFFFF)
#define NT_STATUS(x)((NTSTATUS) { x })
#define STATUS_NO_MORE_FILES 0x80000006
typedef struct _UNICODE_STRING
{
USHORT Length;
USHORT MaximumLength;
PWSTR Buffer;
} UNICODE_STRING, *PUNICODE_STRING;
typedef struct _IO_STATUS_BLOCK
{
union
{
NTSTATUS Status;
PVOID Pointer;
};
ULONG_PTR Information;
} IO_STATUS_BLOCK, *PIO_STATUS_BLOCK;
typedef struct _FILE_NAMES_INFORMATION
{
ULONG NextEntryOffset;
ULONG FileIndex;
ULONG FileNameLength;
WCHAR FileName[_MAX_PATH +1];
} FILE_NAMES_INFORMATION, *PFILE_NAMES_INFORMATION;
typedef enum _FILE_INFORMATION_CLASS
{
FileDirectoryInformation = 1, FileNamesInformation = 12
} FILE_INFORMATION_CLASS, *PFILE_INFORMATION_CLASS;
typedef struct _FILE_DIRECTORY_INFORMATION
{
ULONG NextEntryOffset;
ULONG FileIndex;
LARGE_INTEGER CreationTime;
LARGE_INTEGER LastAccessTime;
LARGE_INTEGER LastWriteTime;
LARGE_INTEGER ChangeTime;
LARGE_INTEGER EndOfFile;
LARGE_INTEGER AllocationSize;
ULONG FileAttributes;
ULONG FileNameLength;
WCHAR FileName[_MAX_PATH +1];
} FILE_DIRECTORY_INFORMATION, *PFILE_DIRECTORY_INFORMATION;
typedef VOID (NTAPI *PIO_APC_ROUTINE)\
(IN PVOID ApcContext,IN PIO_STATUS_BLOCK IoStatusBlock,IN ULONG Reserved);
NTSTATUS (NTAPI *ZwQueryDirectoryFile)\
(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,PVOID,ULONG,FILE_INFORMATION_CLASS,BOOLEAN,PUNICODE_STRING,BOOLEAN);
int _tmain(int argc, _TCHAR* argv[])
{
HANDLE hFolder = CreateFile(argv[1],FILE_LIST_DIRECTORY,FILE_SHARE_READ,NULL,OPEN_EXISTING,FILE_FLAG_BACKUP_SEMANTICS,NULL);
if(INVALID_HANDLE_VALUE != hFolder)
{
*(FARPROC*)&ZwQueryDirectoryFile = GetProcAddress(GetModuleHandle(L"ntdll.dll"),"ZwQueryDirectoryFile");
if(NULL != ZwQueryDirectoryFile)
{
NTSTATUS status = NOERROR;
FILE_DIRECTORY_INFORMATION fi;
IO_STATUS_BLOCK st;
while(NT_SUCCESS(status))
{
WCHAR wszFolder[MAX_PATH+1] = {0};
RtlZeroMemory(&st,sizeof(IO_STATUS_BLOCK));
RtlZeroMemory(&fi,sizeof(FILE_NAMES_INFORMATION));
status = ZwQueryDirectoryFile(hFolder,0,0,0,&st,&fi,
sizeof(FILE_DIRECTORY_INFORMATION),
FileDirectoryInformation,TRUE,NULL,FALSE);
if(fi.FileAttributes & FILE_ATTRIBUTE_DIRECTORY)
{
memcpy(wszFolder,fi.FileName,fi.FileNameLength);
*(wszFolder + fi.FileNameLength) =0;
printf("%S\n",wszFolder);
}
}
}
CloseHandle(hFolder);
}
else
{
printf("ERROR: Invalid Directory!\n");
}
return 0;
}
Some documentation:
http://msdn.microsoft.com/en-us/library/ms801001.aspx[^]
http://msdn.microsoft.com/en-us/library/ms791517.aspx[^]
http://msdn.microsoft.com/en-us/library/ms791536.aspx[^]
http://www.nirsoft.net/kernel_struct/vista/FILE_INFORMATION_CLASS.html[^]
Best Wishes,
-David Delaune
modified on Wednesday, November 26, 2008 1:59 PM
|
|
|
|
|
Hello Mr. David Delaune,
Thanks for your very quick response.. ^_^ Thanks also for the code snippet and links that you've provided, it really gives a lot of help for my driver.. ^_^ Thanks..
I have a follow-up question regarding this files/folders in a specified directory. My next step is to have these files/folders be hidden or unhidden (or vice-versa).
I have read some articles about rootkits that has the ability of hiding files/folders. I found out some rootkits issues that they are most likely detected by ani-virus softwares because of they might give harm or threat to the system. And for my simple driver development, it just simply hide or unhide (or vice-versa) these specified files/folders without making harm or threat to my system and even friendly to anti-virus softwares.
Can you give me an idea how i can be able to hide or unhide (or vice-versa) these files/folders?
Thanks Mr. David Delaune
Best wishes,
-taDo-
|
|
|
|
|
Hello,
In my opinion there is never a valid reason for hiding files and directories. There have been some software companies in the recent past who have implemented rootkit-like techniques for software protection schemes. This type of software protection is intrusive and can often be exploited by worms or viruses because the device driver generally does not check the identity of the calling process.
May I ask what your intentions are? Why do you need to hide files and directories?
Best Wishes,
-David Delaune
|
|
|
|
|
Thank you for asking. ^_^
To give you a detail about my intentions regarding hiding/unhidden these specific files, this is how it works.
I have a specific directory containing the application-generated-based files that starts and ends with, for example, "Xxxx_myFile.xxx" file; and I also have an application where contents/details of these files can only be viewed or modified.
To ensure confidentiality and avoiding these files/directories viewable (or modifiable/removable) to the users (including explorers and command "dir" viewing), other than using the application, these files/directories needs to be hidden for security purposes. And my driver will gets-in to the picture on hiding/unhidden these specific files (including the transaction logs and also viewable to the application).
Rest assured that this application will is not an exploitative type. ^_^
Hope that this will give you a view to the driver that I’ve currently developing with.
Best wishes,
-taDo-
|
|
|
|
|
Hi,
I have an Modem device (Mobile Data card) which I can open for communication via HyperTerminal at an Baud Rate("Maximum Port Speed") of 115200Bps only.
I can obviously change the Baud Rate value from the Device Manager for this modem device, but i want the Baud Rate to be changed from it's default value to 115200 programatically.
I did some googling and found that the Baud Rate for an device can be set using IOCTL, that is using IOCTL_SERIAL_SET_BAUD_RATE along with the function DeviceIoControl().
Found that this IOCTL_SERIAL_SET_BAUD_RATE is defined in the "ntddser.h" file.
Not able to figure out the location of this file and I am stuck here.
Could any body guide me on these lines.
Code snippet containing similar implementation would be of great help.
Do i need to install some Driver Development Package?
I am working on VC++8.0 on Windows XP.
Regards.
|
|
|
|
|
Marimuthu.r wrote: Found that this IOCTL_SERIAL_SET_BAUD_RATE is defined in the "ntddser.h" file.
The headers are available in the Windows Driver Kit[^]
Marimuthu.r wrote: Do i need to install some Driver Development Package?
No, its not required in your case. You can just copy the #defines to your VS2008 project and call the DeviceIoControl Function[^]
Here are the definitions you will need:
#define METHOD_BUFFERED 0
#define FILE_ANY_ACCESS 0
#define FILE_DEVICE_SERIAL_PORT 0x0000001b
#define CTL_CODE( DeviceType, Function, Method, Access ) (((DeviceType) << 16) | ((Access) << 14) | ((Function) << 2) | (Method))
#define IOCTL_SERIAL_SET_BAUD_RATE CTL_CODE (FILE_DEVICE_SERIAL_PORT, 1, METHOD_BUFFERED, FILE_ANY_ACCESS)
ULONG BaudRate = 9600;
NSSTATUS status = DeviceIoControl(hModemDevice, IOCTL_SERIAL_SET_BAUD_RATE,&BaudRate, sizeof(BaudRate), NULL, NULL);
Best Wishes,
-David Delaune
|
|
|
|
|
You dont need to use the IOCTL directly since there is a wrapper API in Windows to do this for you. Look at the various SetCommxxx() functions.
Morality is indistinguishable from social proscription
|
|
|
|
|
Don't know about doing it from within a device driver, but it's "easy" from user mode.
Have a look at the DCB[^] structure, BuildCmmDCB , GetCommState and SetCommState .
Enjoy,
Iain.
|
|
|
|
|
Hi, I'm using laptop Sony VGN-TZ398U[^] which is just purchase last month. The problem is when I fully charge the battery and turn it off and take it to use again 3 days later without touching it, i found that the battery reduce 30%. I don't know why this cause the problem. Could any one give me any idea about the cause of the problem? Thank in advance
|
|
|
|
|
I can think of two possible reasons for that.
0. The battery is having a really high leak current and is emptying itself really quickly. Check if it's down to <50% after a week without touching it. If that is the case I would contact Sony for a replacement. Just keep in mind that leak currents go up quickly with temperature. So bad storage of the laptop might also be the reason.
1. The battery capacity is usually measured by its voltage. The problem is that the battery is reaching its max voltage already when it's 70 - 90% full (while charging) and that the rest of the charging takes pretty long time. The charging and discharging curves are also not identical and the battery meter is adjusted for the discharge curve.
|
|
|
|
|
Jörgen Andersson wrote: The problem is that the battery is reaching its max voltage already when it's 70 - 90% full (while charging) and that the rest of the charging takes pretty long time
Thank you very much for your comment, But why does the battery already reach it ma voltage? Thank in advance
|
|
|
|
|
It's a safety measure. You can learn more on the charging of Li-Ion batteries here[^], check page ten in the pdf.
Battery University[^] is also good reading.
|
|
|
|
|
Lithium batteries may not fully charge at ambient high temperatures due to over temp protection.
Also all batteries have a self discharge rate: i.e. they start losing charge as soon as you disconnect the charger even if they are not being used. At 20deg C, a car battery will lose ~5% per month, Nickel Metal Hydride ~30% per month, Lithium ~3% per month. The discharge rates will increase significantly at higher temperatures.
Is it possible that there is still a drain on the batteries? For example do you hibernate the laptop instead of shutting it off? Do you have wake on lan or other settings turned on which will keep the computer running at low power?
If possible, charge the batteries fully, take them out of the laptop and put them in the refrigerator (NOT the freezer) for a few days. See what the charge is when you put them back into the laptop. If they are down more than a few percent they probably have an internal short, in which case you should definately stop using them and have them replaced.
Let us know what happens.
|
|
|
|
|
Member 4723455 wrote: At 20deg C, a car battery will lose ~5% per month, Nickel Metal Hydride ~30% per month, Lithium ~3% per month. The discharge rates will increase significantly at higher temperatures.
This battery laptop lose 30% from 100% to 70% within 3 days without touching it. So it lose 10% for one day. I think that is the problem.
Member 4723455 wrote: Is it possible that there is still a drain on the batteries? For example do you hibernate the laptop instead of shutting it off? Do you have wake on lan or other settings turned on which will keep the computer running at low power?
I'm sure that I'm shutting down the computer, now hibernate. For the other option such as wake on LAN, I didn't configure anything yet. I just using this laptop after it came out of the box.
Member 4723455 wrote: If possible, charge the batteries fully, take them out of the laptop and put them in the refrigerator (NOT the freezer) for a few days. See what the charge is when you put them back into the laptop. If they are down more than a few percent they probably have an internal short, in which case you should definately stop using them and have them replaced.
Oh, I don't dare to do it.
|
|
|
|
|
If it's brand new, out of the box, the battery meter has to "learn" the recharge and consumption curves. This takes time and it gets more acurate the more the power is drained from the battery and recharged.
Now, if the laptop stays powered off for a week and dies, then you've got a hardware issue with either the motherboard in the laptop or the battery.
|
|
|
|
|
Dave Kreskowiak wrote: If it's brand new, out of the box, the battery meter has to "learn" the recharge and consumption curves. This takes time and it gets more acurate the more the power is drained from the battery and recharged.
I used it as a brand new out of the box nearly 2 months. So I think the battery meter already the recharged and consumption curves.
Dave Kreskowiak wrote: Now, if the laptop stays powered off for a week and dies, then you've got a hardware issue with either the motherboard in the laptop or the battery.
Is there any method that I could isolate and identified whether the problem come from battery, mother board or any hardware related issue? Thank for your comment!!!
|
|
|
|
|
Yeah, replace one piece of hardware, like the battery, and watch what happens.
|
|
|
|
|
charge the battery, remove it from the laptop for a few days, put it back in. That'll see if the battery is bad or something in the laptop is draining power.
Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots.
-- Robert Royall
|
|
|
|
|
Mekong River wrote: For the other option such as wake on LAN, I didn't configure anything yet. I just using this laptop after it came out of the box.
How did it come configured out of the box? It is possible that Sony has enabled wake on lan, bluetooth, etc, so these features are using battery power even though the laptop is "off".
<blockquote class="FQ"><div class="FQA">Mekong River wrote:</div>Oh, I don't dare to do it.</blockquote>
The battery should just slide/snap in. You may need to release the lock(s), these will be slides as well. The laptop should run fine from the charger w/o the battery installed. If fact that is the recommended way to use if it is going to be powered from the charger all the time.
This would be the definitive test. If it loses 30% after 3 days in the frig, you definately have an internal short in the battery & should not continue to use it.
|
|
|
|
|
are you sure that it`s not a operating system eror?!!
i`ve seen it on some vista based laptops too
it`s Bcuz in vista the red botten that has the logo of shutdown just takes takes it on sleep mode !!!
if you have vista operating system ... might the same problem
|
|
|
|
|
Yes, I'm sure that I'm shutdown, not sleep mode. Because I already properly choose shutdown from the drop down menu.
|
|
|
|
|