device-driver

Installing the filter driver programmatically?

纵饮孤独 提交于 2021-02-10 13:15:39
问题 I am trying to write C++ code programmatically installing NDIS 6.0 lightweight filter driver. After reviewing WinDDK, online examples and MSDN documentation I ended up with the code sample below. ************** hr = InstallSpecifiedComponent( ModuleFileName, L"MS_NdisLwf", &GUID_DEVCLASS_NETSERVICE ); ************** hr = HrInstallNetComponent( pnc, lpszPnpID, pguidClass, lpszInfFile ); ************** if ( !SetupCopyOEMInfW(lpszInfFullPath, DirWithDrive, // Other files are in the same dir.as

Installing the filter driver programmatically?

别来无恙 提交于 2021-02-10 13:14:31
问题 I am trying to write C++ code programmatically installing NDIS 6.0 lightweight filter driver. After reviewing WinDDK, online examples and MSDN documentation I ended up with the code sample below. ************** hr = InstallSpecifiedComponent( ModuleFileName, L"MS_NdisLwf", &GUID_DEVCLASS_NETSERVICE ); ************** hr = HrInstallNetComponent( pnc, lpszPnpID, pguidClass, lpszInfFile ); ************** if ( !SetupCopyOEMInfW(lpszInfFullPath, DirWithDrive, // Other files are in the same dir.as

C++11 atomics: does it make sense, or is it even possible, to use them with memory mapped I/O?

坚强是说给别人听的谎言 提交于 2021-02-08 23:32:51
问题 As I understand it, C volatile and optionally inline asm for memory fence have been used for implementing a device driver on top of memory mapped I/O. Several examples can be found in Linux kernel. If we forget about the risk of uncaught exceptions (if any,) does it make sense to replace them with C++11 atomics? Or, is it possible at all? 回答1: In general, you can replace memory fences with atomics, but not volatile , except where it is used together with a fence exclusively for inter thread

Is virtual memory used when using Port-mapped I/O?

谁都会走 提交于 2021-02-07 12:56:25
问题 If I have a Memory-mapped I/O device, and I want to write to a register for this device located at address 0x16D34 , the 0x16D34 address is actually a virtual address, and the CPU will translate it to a physical address first, and then write the data to the physical address. But what about Port-mapped I/O devices (for example: a serial port), so if I want to write to a register for a serial port located at address 0x3F8 , is the 0x3F8 address a physical address or a virtual address? Edit: I

Check whether a driver is installed for my USB device

寵の児 提交于 2021-01-27 09:33:36
问题 I used SetupDiGetClassDevs() , SetupDiEnumDeviceInfo() and SetupDiGetDeviceRegistryProperty() to enumerate my USB device and check whether my device is available or not. How can I check whether my proper driver is installed for my device or not? Is there any APIs available to check this? 回答1: You can get the driver information for the device and then check against that, if your driver is installed and up-to-data. Here is a bit of C++ code which might help you: bool fetchDriverDescription(

Check whether a driver is installed for my USB device

与世无争的帅哥 提交于 2021-01-27 09:33:26
问题 I used SetupDiGetClassDevs() , SetupDiEnumDeviceInfo() and SetupDiGetDeviceRegistryProperty() to enumerate my USB device and check whether my device is available or not. How can I check whether my proper driver is installed for my device or not? Is there any APIs available to check this? 回答1: You can get the driver information for the device and then check against that, if your driver is installed and up-to-data. Here is a bit of C++ code which might help you: bool fetchDriverDescription(

Which processor would execute hardware interrupt in a muticore system

こ雲淡風輕ζ 提交于 2020-03-18 09:13:45
问题 In general hardware interrupts need to be processed immediately, at least so as to acknowledge it and do some first level of processing. As I understand this is not scheduled activity. Please correct me. So the question is how to choose a processor that would actually execute this hardware interrupt handler? One can answer this for Linux and/or BSD systems 回答1: In general, this depends on the functionality offered by multi-core processor and OS. While using multi-core processors, you might

Miscellaneous Device Driver: Unable to open the device with open() system call

大兔子大兔子 提交于 2020-02-25 13:37:49
问题 I am trying to implement a system call interception for sys_open() call via kernel module and for that I have defined a miscellaneous device driver MyDevice which can be inserted as kernel module. Below is the code for my kernel module: #include <linux/version.h> #include <linux/module.h> #include <linux/miscdevice.h> #include <linux/fs.h> #include <linux/highmem.h> #include <asm/unistd.h> MODULE_LICENSE("GPL"); // IOCTL commands #define IOCTL_PATCH_TABLE 0x00000001 #define IOCTL_FIX_TABLE

Miscellaneous Device Driver: Unable to open the device with open() system call

☆樱花仙子☆ 提交于 2020-02-25 13:37:30
问题 I am trying to implement a system call interception for sys_open() call via kernel module and for that I have defined a miscellaneous device driver MyDevice which can be inserted as kernel module. Below is the code for my kernel module: #include <linux/version.h> #include <linux/module.h> #include <linux/miscdevice.h> #include <linux/fs.h> #include <linux/highmem.h> #include <asm/unistd.h> MODULE_LICENSE("GPL"); // IOCTL commands #define IOCTL_PATCH_TABLE 0x00000001 #define IOCTL_FIX_TABLE

is it possible to convert videos in Drive to other lower size video formats online and download?

做~自己de王妃 提交于 2020-02-05 09:15:36
问题 I have a bunch of HD videos in a shared link of Google drive. Is it possible to somehow convert these online into any other lower size video formats(360p,480p) and then download it? 回答1: I use this. It integrated directly with Drive. It doesn't do batch conversion, but it works. Edit: And if you don't use Chrome, you can visit the site directly. It'll still work. Edit 2: http://CloudConvert.com is also a valid option if you're not converting a lot of files at once and your files are smaller