mfplat/sample: Optimize copying to 2d buffer.
[wine.git] / dlls / wnaspi32 / winaspi32.c
blobd8dfd1a2e3f93ce6e56ac24ff8738778d044742b
1 /*
2 * Copyright 1997 Bruce Milner
3 * Copyright 1998 Andreas Mohr
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 #include <assert.h>
21 #include <stdlib.h>
22 #include <stdarg.h>
23 #include <stdio.h>
24 #include <string.h>
26 #include "windef.h"
27 #include "winbase.h"
28 #include "aspi.h"
29 #include "wnaspi32.h"
30 #include "winescsi.h"
31 #include "wine/debug.h"
33 WINE_DEFAULT_DEBUG_CHANNEL(aspi);
36 /*******************************************************************
37 * GetASPI32SupportInfo [WNASPI32.1]
39 * Checks if the ASPI subsystem is initialized correctly.
41 * RETURNS
42 * HIWORD: 0.
43 * HIBYTE of LOWORD: status (SS_COMP or SS_FAILED_INIT)
44 * LOBYTE of LOWORD: # of host adapters.
46 DWORD __cdecl GetASPI32SupportInfo(void)
48 DWORD controllers = ASPI_GetNumControllers();
50 if (!controllers)
51 return SS_NO_ADAPTERS << 8;
52 return (SS_COMP << 8) | controllers ;
55 /***********************************************************************
56 * SendASPI32Command (WNASPI32.2)
58 DWORD __cdecl SendASPI32Command(LPSRB lpSRB)
60 FIXME( "no longer supported, should be ported to DeviceIoControl\n" );
61 return SS_INVALID_SRB;
65 /***********************************************************************
66 * GetASPI32DLLVersion (WNASPI32.4)
68 DWORD __cdecl GetASPI32DLLVersion(void)
70 FIXME("Please add SCSI support for your operating system, returning 0\n");
71 return 0;
74 /***********************************************************************
75 * GetASPI32Buffer (WNASPI32.8)
76 * Supposed to return a DMA capable large SCSI buffer.
77 * Our implementation does not use those at all, all buffer stuff is
78 * done in the kernel SG device layer. So we just heapalloc the buffer.
80 BOOL __cdecl GetASPI32Buffer(PASPI32BUFF pab)
82 pab->AB_BufPointer = HeapAlloc(GetProcessHeap(),
83 pab->AB_ZeroFill?HEAP_ZERO_MEMORY:0,
84 pab->AB_BufLen
86 if (!pab->AB_BufPointer) return FALSE;
87 return TRUE;
90 /***********************************************************************
91 * FreeASPI32Buffer (WNASPI32.14)
93 BOOL __cdecl FreeASPI32Buffer(PASPI32BUFF pab)
95 HeapFree(GetProcessHeap(),0,pab->AB_BufPointer);
96 return TRUE;
99 /***********************************************************************
100 * TranslateASPI32Address (WNASPI32.7)
102 BOOL __cdecl TranslateASPI32Address(LPDWORD pdwPath, LPDWORD pdwDEVNODE)
104 FIXME("(%p, %p), stub !\n", pdwPath, pdwDEVNODE);
105 return TRUE;