00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00020 #include <wdm.h>
00021 #include "cbm_driver.h"
00022
00023 #include "cbmioctl.h"
00024 #include "version.h"
00025
00051 NTSTATUS
00052 cbm_install(IN PDEVICE_EXTENSION Pdx, OUT PCBMT_I_INSTALL_OUT ReturnBuffer, IN OUT PULONG ReturnLength)
00053 {
00054 CBMT_I_INSTALL_OUT result;
00055
00056 FUNC_ENTER();
00057
00058 RtlZeroMemory(&result, sizeof(result));
00059
00060
00061
00062 result.DriverVersion =
00063 CBMT_I_INSTALL_OUT_MAKE_VERSION(CBM4WIN_VERSION_MAJOR, CBM4WIN_VERSION_MINOR,
00064 CBM4WIN_VERSION_SUBMINOR, CBM4WIN_VERSION_DEVEL);
00065
00066 result.DriverVersionEx =
00067 CBMT_I_INSTALL_OUT_MAKE_VERSION_EX(CBM4WIN_VERSION_PATCHLEVEL);
00068
00069
00070
00071 result.ErrorFlags = 0;
00072
00073
00074
00075 if (!Pdx->ParallelPortAllocatedInterrupt)
00076 {
00077
00078
00079
00080 if (!Pdx->IsNT4)
00081 {
00082 ParPortAllowInterruptIoctl(Pdx);
00083 }
00084
00085
00086
00087 result.ErrorFlags |= CBM_I_DRIVER_INSTALL_0M_NO_INTERRUPT;
00088 }
00089
00090
00091
00092
00093 if (*ReturnLength > sizeof(CBMT_I_INSTALL_OUT))
00094 {
00095 *ReturnLength = sizeof(CBMT_I_INSTALL_OUT);
00096 }
00097
00098
00099
00100 RtlCopyMemory(ReturnBuffer, &result, *ReturnLength);
00101
00102 FUNC_LEAVE_NTSTATUS_CONST(STATUS_SUCCESS);
00103 }