Kext reference from user-space application

I've got Kext which give service to user-space client that is using iokit service communication.


I'd like that the client will take reference on the kext, so that it wouldn't be possible to unload the kext while the client is sill up, and when the client goes down, the kext should terminate as well.


according to the documentation I can use

IOServiceOpen
and
IOConnectAddRef
, but
kextunload stills removes the driver.


kextstat
also shows that no references are taken on the driver, those are references by other drivers as it mentioned in the documentation, but I thought that the above commands will do the trick.


Index Refs Address Size Wired Name (Version) UUID <Linked Against>
1 100 0xffffff7f80a46000 0x9d90 0x9d90 com.apple.kpi.bsd (16.7.0) 410B3B98-9DAB-4590-9086-7C57A5B3099A
2 8 0xffffff7f80fc3000 0x3940 0x3940 com.apple.kpi.dsep (16.7.0) FA744B47-913C-4B5D-8C16-2F8005D85935
3 127 0xffffff7f80a04000 0x21040 0x21040 com.apple.kpi.iokit (16.7.0) 80F2DA67-C67B-4583-9B09-082DB11F69FC
...
170 0 0xffffff7f80a04000 0x21040 0x21040 com.my-driver.noo (1.0.0) 53390CCD-55F0-315F-BBD7-21645800E4A0


what should I do in order to increase the #Refs from the above chart ?