NetShareCheck or Net32ShareCheck

The NetShareCheck API queries whether a server is sharing a device. It is successful if a specified device is in the routing list of a spooler queue or serial device queue.