driver

RegistryCallback and RegCreateKeyEx

隐身守侯 提交于 2019-12-16 18:07:24
问题 I want to monitor a windows machine. I created a windows service, and my purpose is to be notified when a process tries to create a new registry key. I use RegistryCallback with the following signature NTSTATUS RegistryCallback( _In_ PVOID CallbackContext, _In_opt_ PVOID Argument1, _In_opt_ PVOID Argument2 ) The RegistryCallback was registered with CmRegisterCallback . The problem is I am notified for every registry key creation , however I want to be notified only for creation of new

How do I inform a user space application that the driver has received an interrupt in linux?

﹥>﹥吖頭↗ 提交于 2019-12-14 04:19:41
问题 I have a PCIe device that will send a hardware interrupt when a data buffer is ready to be read. I believe the best approach for this is to use signals but I'm not entirely sure how. What I believe I need to do is: Save the PID of the user space application so the driver knows where to send the signal In the interrupt handler of the PCIe device driver, send a signal to the user space application In the User space application implement a signal handler function for processing the signal I'm

initialise driver in C with xc8 compiler with gpio pins

一世执手 提交于 2019-12-14 04:01:34
问题 Lets say I have a driver "foo.h" and "foo.c" implementation. The driver interacts with the gpio pins on a microcontroller. In Arduino, each GPIO pin has it's own pin number (just an integer). Then you can initialise foo with the function initFoo(1) or initFoo(2), to choose the pin you want to use. In Mbed online c++ compiler, each GPIO can be controlled with a DigitalIn or DigitalOut object. In JAL (Just Another Language) that I'm also familiar with, they use the alias keyword. alias x is pin

Cannot Use Google USB Driver

核能气质少年 提交于 2019-12-14 03:53:23
问题 I have an LG G4 and would like to use it for debugging apps during development. However, I cannot get the device to show up. I have followed the steps to set the phone into debugging mode. I have Android Studio and used SDK manager to download the latest SDKs and tools and also installed the Google USB driver. I cannot see my phone in chrome://inspect nor does it list with "adb devices" nor does it show up in Android Studio. 回答1: Sorry that this answer isn't more clear for anyone who stumbles

How to get bus/device/number from struct pci_dev?

为君一笑 提交于 2019-12-14 03:08:11
问题 https://elixir.bootlin.com/linux/latest/source/include/linux/pci.h#L286 In struct pci_dev, I can only see bus and function: struct pci_bus *bus; and unsigned int devfn; seems no device (of B/D/F) information? and struct pci_slot *slot; In my test, the *slot point to NULL, why ? 回答1: I found: device = PCI_SLOT(pdev->devfn); fn = PCI_FUNC(pdev->devfn); https://elixir.bootlin.com/linux/v3.5/source/include/linux/pci.h#L31 回答2: Devfn contains the device number in bits 7:3 and the function number

PowerShell Find Driver Version

被刻印的时光 ゝ 提交于 2019-12-14 02:20:02
问题 Using DevCon utility, I ran this command to get the list of all of the drivers installed in the computer. devcon.exe driverfiles * > drivers.txt The output looks like this: USB\ROOT_HUB20\4&361B340A&0 Name: USB Root Hub Driver installed from C:\windows\INF\usbport.inf [ROOTHUB.Dev]. 2 file(s) used by driver: C:\windows\system32\drivers\usbhub.sys C:\windows\system32\drivers\usbd.sys ACPI\PNP0C09\1 USB\ROOT_HUB20\4&361B340A&1 Name: USB Root Hub Driver installed from C:\windows\INF\usbport.inf

Windows printer driver

风格不统一 提交于 2019-12-13 23:20:05
问题 we currently have bought a program for calculation etc, but which us don't allow duplex print. But our real Printer does support it. I wanted to ask if it is possible to set a "printer driver" between the application and the real printer, which i can send the document too. In this driver i say that it should print in duplex. im currently programming only with C# and .NET and i had never been further with c++ or c can you give me some hints to get started with that? 回答1: The duplex class is

Allow Driver to Stop in Windows?

痴心易碎 提交于 2019-12-13 18:50:26
问题 Some drivers on Windows, like Null and Beep , can be arbitrarily stopped and re-started through the ControlService(..., SERVICE_CONTROL_STOP, ...) operation. Most other drivers, however, cannot be stopped and restarted while the system is running. I'm making my own driver. How can I tell Windows that my driver can be stopped? 回答1: It turns out that you need to add a DriverUnload function: VOID NTAPI DriverUnload(IN DRIVER_OBJECT *DriverObject) { } NTSTATUS NTAPI DriverEntry(IN PDRIVER_OBJECT

In Linux Driver, how to disable a specific USB Device [closed]

♀尐吖头ヾ 提交于 2019-12-13 17:08:49
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . Assume a USB devices is powered by USB bus. Sometimes the firmware in the USB device encounter a problem and can't recovery by itself. I have to unplug and plug the USB device from the host. Is there a way that I can dis-power the USB device, and later re-enable the USB device in Linux driver or in shell command

LibUSB driver issues: timeout

て烟熏妆下的殇ゞ 提交于 2019-12-13 17:06:34
问题 I am attempting to write a linux driver for a printer. I have run USBSnoop on windows XP and obtained the log. In this log it sets wMaxPacketSize to 1026. After i set the interface i get the response of 75 bytes. If i set it to 64 (in the lsusb output) i obviously only get 64 bytes back. My issue is on a bulk transfer to/from the device i get timeouts. I think i have the same problem as here: http://libusb.6.n5.nabble.com/libusb-bulk-transfer-return-timeout-error-and-transferred-set-to-0