简体   繁体   中英

ioreg list multiple dext

I have written a system extension using DriverKit and USBDriverKit that seems to work well (running with developer mode on, SIP off, ... still waiting for entitlements).

When I plug my USB device and in terminal I type ioreg | grep com.myinc.mydriver ioreg | grep com.myinc.mydriver I see one entry:

+-o IOUserServer(com.myinc.mydriver ... registered, matched, active, busy 0 (0ms), retain 13

I unplug the device and do another ioreg and I get the same but with retain 9.

If I plug my device, then another ioreg now shows 2 entries (the previous one and a new one).

Is this normal? Why is the previous one still active?

In my dext I check that my Stop and free functions are called and I cannot think of anything I have missed.

Can someone please explain this to me or point me toward what I may have forgotten to do? Does retain 9 have anything to do with what I do in my code?

I figured out my problem and will leave an answer here in case it helps someone else...

I obtained my IOUSBHostInterface object using CopyInterface() (from IOUSBHostDevice ). Then on this object I called Open() .

In my Stop() implementation I called Close() on my interface object but I forgot to call release .

Now when I disconnect my device, once all my free() functions are called, in the console I get the message "no service left, exiting".

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM