From 7aff1e4cb053394db57c2814d5fe1e6493e0cc75 Mon Sep 17 00:00:00 2001 From: watcherhd Date: Sat, 26 Nov 2011 14:19:43 +0000 Subject: Project folders rename part 2 git-svn-id: http://miranda-plugins.googlecode.com/svn/trunk@214 e753b5eb-9565-29b2-b5c5-2cc6f99dfbcb --- fddnotify/fdd.c | 81 --------------------------------------------------------- 1 file changed, 81 deletions(-) delete mode 100644 fddnotify/fdd.c (limited to 'fddnotify/fdd.c') diff --git a/fddnotify/fdd.c b/fddnotify/fdd.c deleted file mode 100644 index 3d91b38..0000000 --- a/fddnotify/fdd.c +++ /dev/null @@ -1,81 +0,0 @@ -/* - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -*/ - -#define WIN32_LEAN_AND_MEAN - -#include -#include -#include "porttalk_IOCTL.h" - - -// Globals -extern BOOL bWindowsNT; -HANDLE hFddDev=INVALID_HANDLE_VALUE; - - -void outportb(UINT portid, BYTE value) -{ - __asm mov edx,portid - __asm mov al,value - __asm out dx,al -} - -BOOL OpenFddDevice(void) -{ - if (!bWindowsNT) - return TRUE; - - if((hFddDev = CreateFile("\\\\.\\PortTalk", GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE) - return FALSE; - - return TRUE; -} - -BOOL ToggleFddLight(BYTE drive, BYTE status) -{ - DWORD BytesReturned; - unsigned char Buffer[3]; - unsigned short *pBuffer; - BYTE value = status<<(drive|4)|drive|12; - - if (!bWindowsNT) { - outportb(0x3F2, value); - return TRUE; - } - - if (hFddDev == INVALID_HANDLE_VALUE) - return FALSE; - - pBuffer = (unsigned short *)&Buffer[0]; - *pBuffer = 0x3F2; - Buffer[2] = (unsigned char)value; - - if (!DeviceIoControl(hFddDev, IOCTL_WRITE_PORT_UCHAR, &Buffer, 3, NULL, 0, &BytesReturned, NULL)) - return FALSE; - - return TRUE; -} - -void CloseFddDevice(void) -{ - if (!bWindowsNT) - return; - - if (hFddDev != INVALID_HANDLE_VALUE) - CloseHandle(hFddDev); -} -- cgit v1.2.3