Hey,
Im working on Windows Embedded and writing in C++.
At the moment I'm writing a program to rename a harddisk from a driver. Im renaming the hard disk right after the first boot of the system.
The program is working fine. After the program is finished it has to reboot my computer.
But here is the problem:
The program has to check whether my system settings has changed or not.
If they changed, i have to wait, until the Dialog "Systems Settings Changed" poped up and restart.
Otherwise,I don't have to wait.
By now i found out, that windows is using the newdev.dll for installing devices.
Can i check somehow if the newdev.dll is in use?
I tried it with CreateFile() with READ and WRITE.
HANDLE hwnd;
hwnd=CreateFile(L"C:\\Windows\\System32\\newdev.dll",GENERIC_WRITE,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
std::cout << GetLastError();
In addtion I tried to load it with LoadLibrary. But that failed too.
HMODULE hwnd;
hwnd= LoadLibrary("C:\\Windows\\System32\\newdev.dll");
IF(hwnd == NULL)
{
printf("In Use");
}
I hope you can help me.
Regards
Chris