Skip to content

Commit

Permalink
Merge pull request #6 from Shuzhengz/fixFan2
Browse files Browse the repository at this point in the history
Fix issues regarding checking fan 2 status
  • Loading branch information
Shuzhengz authored Nov 16, 2021
2 parents 18fd393 + 2477cb3 commit 631739a
Show file tree
Hide file tree
Showing 13 changed files with 3,681 additions and 3,181 deletions.
864 changes: 447 additions & 417 deletions fancontrol/SystemTraySDK.cpp

Large diffs are not rendered by default.

146 changes: 89 additions & 57 deletions fancontrol/TVicPort.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,79 +20,111 @@ extern "C" {
#pragma pack(1)

typedef struct _HDDInfo {
ULONG BufferSize;
ULONG DoubleTransfer;
ULONG ControllerType;
ULONG ECCMode;
ULONG SectorsPerInterrupt;
ULONG Cylinders;
ULONG Heads;
ULONG SectorsPerTrack;
char Model[41];
char SerialNumber[21];
char Revision[9];
ULONG BufferSize;
ULONG DoubleTransfer;
ULONG ControllerType;
ULONG ECCMode;
ULONG SectorsPerInterrupt;
ULONG Cylinders;
ULONG Heads;
ULONG SectorsPerTrack;
char Model[41];
char SerialNumber[21];
char Revision[9];
} HDDInfo, *pHDDInfo;


void VICFN CloseTVicPort();

void VICFN CloseTVicPort();
BOOL VICFN OpenTVicPort();
BOOL VICFN IsDriverOpened();
BOOL VICFN OpenTVicPort();

BOOL VICFN TestHardAccess();
void VICFN SetHardAccess(BOOL bNewValue);
BOOL VICFN IsDriverOpened();

UCHAR VICFN ReadPort (USHORT PortAddr);
void VICFN WritePort (USHORT PortAddr, UCHAR nNewValue);
USHORT VICFN ReadPortW (USHORT PortAddr);
void VICFN WritePortW(USHORT PortAddr, USHORT nNewValue);
ULONG VICFN ReadPortL (USHORT PortAddr);
void VICFN WritePortL(USHORT PortAddr, ULONG nNewValue);
BOOL VICFN TestHardAccess();

void VICFN ReadPortFIFO (USHORT PortAddr, ULONG NumPorts, UCHAR * Buffer);
void VICFN WritePortFIFO (USHORT PortAddr, ULONG NumPorts, UCHAR * Buffer);
void VICFN ReadPortWFIFO (USHORT PortAddr, ULONG NumPorts, USHORT * Buffer);
void VICFN WritePortWFIFO(USHORT PortAddr, ULONG NumPorts, USHORT * Buffer);
void VICFN ReadPortLFIFO (USHORT PortAddr, ULONG NumPorts, ULONG * Buffer);
void VICFN WritePortLFIFO(USHORT PortAddr, ULONG NumPorts, ULONG * Buffer);
void VICFN SetHardAccess(BOOL bNewValue);

USHORT VICFN GetLPTNumber();
void VICFN SetLPTNumber(USHORT nNewValue);
USHORT VICFN GetLPTNumPorts();
USHORT VICFN GetLPTBasePort();
UCHAR VICFN AddNewLPT(USHORT PortBaseAddress);
UCHAR VICFN ReadPort(USHORT PortAddr);

BOOL VICFN GetPin(USHORT nPin);
void VICFN SetPin(USHORT nPin, BOOL bNewValue);
void VICFN WritePort(USHORT PortAddr, UCHAR nNewValue);

BOOL VICFN GetLPTAckwl();
BOOL VICFN GetLPTBusy();
BOOL VICFN GetLPTPaperEnd();
BOOL VICFN GetLPTSlct();
BOOL VICFN GetLPTError();
USHORT VICFN ReadPortW(USHORT PortAddr);

void VICFN LPTInit();
void VICFN LPTSlctIn();
void VICFN LPTStrobe();
void VICFN LPTAutofd(BOOL Flag);
void VICFN WritePortW(USHORT PortAddr, USHORT nNewValue);

void VICFN GetHDDInfo (UCHAR IdeNumber, UCHAR Master, pHDDInfo Info);
ULONG VICFN ReadPortL(USHORT PortAddr);

ULONG VICFN MapPhysToLinear(ULONG PhAddr, ULONG PhSize);
void VICFN UnmapMemory (ULONG PhAddr, ULONG PhSize);
void VICFN WritePortL(USHORT PortAddr, ULONG nNewValue);

UCHAR VICFN GetMem (ULONG MappedAddr, ULONG Offset);
void VICFN SetMem (ULONG MappedAddr, ULONG Offset, UCHAR nNewValue);
USHORT VICFN GetMemW(ULONG MappedAddr, ULONG Offset);
void VICFN SetMemW(ULONG MappedAddr, ULONG Offset, USHORT nNewValue);
ULONG VICFN GetMemL(ULONG MappedAddr, ULONG Offset);
void VICFN SetMemL(ULONG MappedAddr, ULONG Offset, ULONG nNewValue);
void VICFN ReadPortFIFO(USHORT PortAddr, ULONG NumPorts, UCHAR *Buffer);

void VICFN SetLPTReadMode();
void VICFN SetLPTWriteMode();
void VICFN WritePortFIFO(USHORT PortAddr, ULONG NumPorts, UCHAR *Buffer);

void VICFN LaunchWeb();
void VICFN LaunchMail();
void VICFN ReadPortWFIFO(USHORT PortAddr, ULONG NumPorts, USHORT *Buffer);

void VICFN WritePortWFIFO(USHORT PortAddr, ULONG NumPorts, USHORT *Buffer);

void VICFN ReadPortLFIFO(USHORT PortAddr, ULONG NumPorts, ULONG *Buffer);

void VICFN WritePortLFIFO(USHORT PortAddr, ULONG NumPorts, ULONG *Buffer);

USHORT VICFN GetLPTNumber();

void VICFN SetLPTNumber(USHORT nNewValue);

USHORT VICFN GetLPTNumPorts();

USHORT VICFN GetLPTBasePort();

UCHAR VICFN AddNewLPT(USHORT PortBaseAddress);

BOOL VICFN GetPin(USHORT nPin);

void VICFN SetPin(USHORT nPin, BOOL bNewValue);

BOOL VICFN GetLPTAckwl();

BOOL VICFN GetLPTBusy();

BOOL VICFN GetLPTPaperEnd();

BOOL VICFN GetLPTSlct();

BOOL VICFN GetLPTError();

void VICFN LPTInit();

void VICFN LPTSlctIn();

void VICFN LPTStrobe();

void VICFN LPTAutofd(BOOL Flag);

void VICFN GetHDDInfo(UCHAR IdeNumber, UCHAR Master, pHDDInfo Info);

ULONG VICFN MapPhysToLinear(ULONG PhAddr, ULONG PhSize);

void VICFN UnmapMemory(ULONG PhAddr, ULONG PhSize);

UCHAR VICFN GetMem(ULONG MappedAddr, ULONG Offset);

void VICFN SetMem(ULONG MappedAddr, ULONG Offset, UCHAR nNewValue);

USHORT VICFN GetMemW(ULONG MappedAddr, ULONG Offset);

void VICFN SetMemW(ULONG MappedAddr, ULONG Offset, USHORT nNewValue);

ULONG VICFN GetMemL(ULONG MappedAddr, ULONG Offset);

void VICFN SetMemL(ULONG MappedAddr, ULONG Offset, ULONG nNewValue);

void VICFN SetLPTReadMode();

void VICFN SetLPTWriteMode();

void VICFN LaunchWeb();

void VICFN LaunchMail();

int VICFN EvaluationDaysLeft();

Expand Down
18 changes: 16 additions & 2 deletions fancontrol/approot.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,28 @@ HWND g_dialogWnd = NULL;
HANDLE g_workerThread = NULL;

void ShowError(DWORD ec, const char *description);

void ShowMessage(const char *title, const char *description);

void ShowHelp();

DWORD InstallService(bool quiet);

DWORD UninstallService(bool quiet);
VOID WINAPI Handler(DWORD fdwControl);
VOID WINAPI ServiceMain(DWORD aArgc, LPTSTR* aArgv);

VOID WINAPI
Handler(DWORD
fdwControl);
VOID WINAPI
ServiceMain(DWORD
aArgc,
LPTSTR *aArgv
);

void StartWorkerThread();

void StopWorkerThread();

void WorkerThread(void *dummy);

void debug(const char *msg);
Loading

0 comments on commit 631739a

Please sign in to comment.