UPSInit function (upssvc.h)
The UPSInit function initializes a UPS minidriver, opens communication to the UPS unit, updates the registry, and causes the minidriver to start monitoring the UPS unit.
Syntax
DWORD UPSInit();
Return value
The UPSInit function returns one of the following DWORD values:
Return code | Description |
---|---|
|
No errors were encountered during initialization. |
|
An error occurred while accessing the registry. |
|
An error occurred while opening the COM port. |
|
An error occurred while setting up the COM port. |
|
An unidentified error occurred. |
Remarks
The UPSInit function is the first function exported by a UPS minidriver that is called by the UPS service. The function must complete all initialization operations for the minidriver, including the following:
- Opening a communication path to the UPS unit
- Determining the initial state of the UPS unit
- Updating UPS registry entries
- Beginning the monitoring of the UPS unit
Requirements
Requirement | Value |
---|---|
Target Platform | Desktop |
Header | upssvc.h (include Upssvc.h) |