Main Page File List Globals

# skeyinst.h File Reference

SmartKey Driver Installation. More...

Go to the source code of this file.

## Probing

- #define SKEYINST_PROBE_USB_INSTALLED 1
    Check if the USB driver is installed.
- #define SKEYINST_PROBE_USB_RUNNING 2
    Check if the USB driver is active.
- #define SKEYINST_PROBE_USB_VERSION 13
    Return the version of the installed USB driver.
- #define SKEYINST_PROBE_PARALLEL_INSTALLED 3
    Check if the Parallel driver is installed.
- #define SKEYINST_PROBE_PARALLEL_RUNNING 4
    Check if the Parallel driver is active.
- #define SKEYINST_PROBE_PARALLEL_VERSION 14
    Return the version of the installed Parallel driver.
- #define SKEYINST_PROBE_GSS2_INSTALLED 11
    Check if the GSS 2 driver is installed.
- #define SKEYINST_PROBE_GSS2_RUNNING 12
    Check if the GSS 2 driver is active.
- #define SKEYINST_PROBE_GSS2_VERSION 15
    Return the version of the installed GSS 2 driver.
- #define SKEYINST_PROBE_INSTALL_BUSY 9
    Check if the Windows Installer is busy.
- #define SKEYINST_PROBE_ADMINISTRATOR_PERMISSION 10
    Check if the current user has the Administrator permission.

## Error

- #define SKEYINST_ERROR_WAIT -3
    Another installation is in progress.
- #define SKEYINST_ERROR_UNSUPPORTED -2
    This operation is unsupported in this operating system.
- #define SKEYINST_ERROR_FAIL -1
    Generic failure.
- #define SKEYINST_OK 0
    Operation completed successfully.
- #define SKEYINST_WARNING_MUST_REBOOT 1
    Operation completed successfully, but you must reboot to complete the operation.
- #define SKEYINST_WARNING_MUST_INSERT 2
    Operation completed successfully, but you must insert the token to complete the operation.

## Defines

- #define SKEYINST_LINK __declspec(dllimport)
- #define SKEYINST_CALL __stdcall

## Functions

- DWORD SkeyInstallUSB (void)
    Installation of the USB driver.
- DWORD SkeyInstallPar (void)
    Installation of the Parallel driver.
- DWORD SkeyInstallGSS2 (void)
    Installation of the GSS 2 (eugss*.sys) driver.
- DWORD SkeyUnInstallUSB (void)
    Uninstallation of the USB driver.
- DWORD SkeyUnInstallPar (void)
    Uninstallation of the Parallel driver.
- DWORD SkeyUnInstallGSS2 (void)
    Uninstallation of the GSS 2 (eugss*.sys) driver.
- DWORD SkeyForceUnInstallUSB (void)
    Forced uninstallation of the USB driver.
- DWORD SkeyForceUnInstallPar (void)
    Forced uninstallation of the Parallel driver.
- DWORD SkeyForceUnInstallGSS2 (void)
    Forced uninstallation of the GSS 2 (eugss*.sys) driver.
- DWORD SkeyGetLastError (void)
    Get the last Windows error code.
- DWORD SkeyProbe (DWORD Code, DWORD *Found)
    Probe for a driver status information.
- DWORD SkeyLogFile (const char *Path)
    Select the log file to use.

## Detailed Description

SmartKey Driver Installation.

To suggested way to install the SmartKey drivers is to simply call only the required SkeyInstallPar(), SkeyInstallUSB() and SkeyInstallGSS2() functions.

If a function fails with the error code SKEYINST_PROBE_INSTALL_BUSY you need to ask at the user to close any other installation process and retry. If a function fails with the error code SKEYINST_PROBE_FAIL and with GetLastError() equal at ERROR_ACCESS_DENIED (5) you need to ask at the user to became Administrator and restart the installation. If a function fails with any other error code the installation is failed.

If a function returns with the code SKEYINST_OK, the operation is completed with success. If a function returns with the code SKEYINST_WARNING_MUST_REBOOT, you must reboot the system to complete the operation. If a function returns with the code SKEYINST_WARNING_MUST_INSERT, you need to ask at the used to insert the SmartKey to complete the process.

You can eventually use the SkeyProbe() function to check the Not Administrator and Busy conditions in advance.

Please note that you don't need to check if a driver is already installed before calling the Install() functions. If the driver is already installed and updated these functions do nothing.

## Define Documentation

#define SKEYINST_ERROR_FAIL -1

| Generic failure. The operation is failed for a generic error. You can call the SkeyGetLastError() function to get the Windows error code. If an install operation is done without the Administrator rights the SkeyGetLastError() function returns the value 5 (ERROR_ACCESS_DENIED).

#define SKEYINST_ERROR_UNSUPPORTED -2

| This operation is unsupported in this operating system. You can't call the function in this operation system.

#define SKEYINST_ERROR_WAIT -3

| Another installation is in progress. You must ask at the user to complete any installation process in progress and then retry. A good behaviours is: Try the first time Wait 5 seconds and retry Ask the user to complete and to close any installation window and retry Repeat the last step Note that the Windows XP tooltip, shown on the lower right corner of the screen after an hardware installation, must be closed because is part of the installation process.

#define SKEYINST_OK 0

| Operation completed successfully.

#define SKEYINST_PROBE_ADMINISTRATOR_PERMISSION 10

| Check if the current user has the Administrator permission. In Windows 9x it always returns TRUE.

#define SKEYINST_PROBE_GSS2_INSTALLED 11

| Check if the GSS 2 driver is installed.

#define SKEYINST_PROBE_GSS2_RUNNING 12

| Check if the GSS 2 driver is active.

#define SKEYINST_PROBE_GSS2_VERSION 15

| Return the version of the installed GSS 2 driver. The version number is a 4 byte code packed in a DWORD value.

#define SKEYINST_PROBE_INSTALL_BUSY 9

| Check if the Windows Installer is busy. Until the Windows Installer is busy you cannot call any other function.

#define SKEYINST_PROBE_PARALLEL_INSTALLED 3

| Check if the Parallel driver is installed.

#define SKEYINST_PROBE_PARALLEL_RUNNING 4

| Check if the Parallel driver is active.

#define SKEYINST_PROBE_PARALLEL_VERSION 14

| Return the version of the installed Parallel driver. The version number is a 4 byte code packed in a DWORD value.

#define SKEYINST_PROBE_USB_INSTALLED 1

| Check if the USB driver is installed. This command doesn't check if the correct driver is installed, but only if a generic driver connected at the token is installed. If the user install manually the "Windows Null Driver", this function reports that a driver is installed.

#define SKEYINST_PROBE_USB_RUNNING 2

| Check if the USB driver is active.

#define SKEYINST_PROBE_USB_VERSION 13

| Return the version of the installed USB driver. The version number is a 4 byte code packed in a DWORD value.

#define SKEYINST_WARNING_MUST_INSERT 2

| Operation completed successfully, but you must insert the token to complete the operation. This code is generally returned after the installation of the USB Driver on Windows 9x/Me/2000/XP.

#define SKEYINST_WARNING_MUST_REBOOT 1

| Operation completed successfully, but you must reboot to complete the operation. This code is generally returned after the forced uninstallation.

## Function Documentation

DWORD SkeyForceUnInstallGSS2 | ( | void |  | ) |

| Forced uninstallation of the GSS 2 (eugss*.sys) driver. The driver is uninstalled with force removing any reference on the filesystem and registry. Note: Use only in extreme cases to recover from wrong installation. After a forced uninstallation you MUST always reboot. Returns : A SKEYINST_* code.

DWORD SkeyForceUnInstallPar | ( | void |  | ) |

| Forced uninstallation of the Parallel driver. The driver is uninstalled with force removing any reference on the filesystem and registry. Note: Use only in extreme cases to recover from wrong installation. After a forced uninstallation you MUST always reboot. Returns : A SKEYINST_* code.

DWORD SkeyForceUnInstallUSB | ( | void |  | ) |

| Forced uninstallation of the USB driver. The driver is uninstalled with force removing any reference on the filesystem and registry. Note: Use only in extreme cases to recover from wrong installation. After a forced uninstallation you MUST always reboot. Returns : A SKEYINST_* code.

DWORD SkeyGetLastError | ( | void |  | ) |

| Get the last Windows error code. Returns : the last Windows error code like the GetLastError() function.

DWORD SkeyInstallGSS2 | ( | void |  | ) |

| Installation of the GSS 2 (eugss*.sys) driver. All the required drivers for the GSS2 SmartKey are installed. If in the current operating systen no driver is needed, nothing is done and the function returns with success. Note: The files eugss*.sys and psapi.dll must reside in the same directory of the DLL. Returns : A SKEYINST_* code.

DWORD SkeyInstallPar | ( | void |  | ) |

| Installation of the Parallel driver. All the required drivers for the Parallel SmartKey are installed. If in the current operating systen no driver is needed, nothing is done and the function returns with success. Note: The file eusk2par.sys must reside in the same directory of the DLL. Returns : A SKEYINST_* code.

DWORD SkeyInstallUSB | ( | void |  | ) |

| Installation of the USB driver. All the required drivers for the USB SmartKey are installed. On Windows NT the USB Phoenix stack is also installed. Note: The files skeyusb.inf, skeyusbnt.inf, skeyusb.sys, skeyusbnt.sys and usbdrv.sys must reside in the same directory of the DLL. Returns : A SKEYINST_* code.

DWORD SkeyLogFile | ( | const char * | Path | ) |

  | Select the log file to use. If you specify a log file, when you call one of the install or uninstall functions a very detailed report of all the operations is generated. This report can be used to debug problematic installation cases. Parameters:
  Path | Complete path of the log file. Use NULL to disable it.
Returns : A SKEYINST_* code.

DWORD SkeyProbe | ( | DWORD | Code,
|  | DWORD * | Found
| ) |

  | Probe for a driver status information. Parameters:
  Code | A SKEYINST_PROBE_* code.
  Found | Output variable. This variable is set only if SKEYINST_OK is returned.
Returns : A SKEYINST_* code.

DWORD SkeyUnInstallGSS2 | ( | void |  | ) |

| Uninstallation of the GSS 2 (eugss*.sys) driver. Returns : A SKEYINST_* code.

DWORD SkeyUnInstallPar | ( | void |  | ) |

| Uninstallation of the Parallel driver. The previous installed Parallel drivers are uninstalled. If no driver is installed nothing is done and the function returns with success. Returns : A SKEYINST_* code.

DWORD SkeyUnInstallUSB | ( | void |  | ) |

| Uninstallation of the USB driver. The previous installed USB drivers are uninstalled. If no driver is installed nothing is done and the function returns with success. Returns : A SKEYINST_* code.