Fixed 8-bit WAV format handling (it is unsigned data).
Fixed off-by-one checks for buffer wrap.
Increment ref count for primary buffer in CreateSoundBuffer().
Added DSBPN_OFFSETSTOP support to position notification code.
Lots of minor parameter validation checks.
Stubs for: IDirectSound_initialize(), IDirectSound_Compact(),
and IDirectSound_GetSpeakerConfig().
Fixed freq shifting with 16-bit data problem, fixed 8bit<->16bit
conversion.
Lots of thread locking for DirectSound buffers.
Dealloc primary buffer when dsound is deallocated.

diff --git a/include/dsound.h b/include/dsound.h
index 7fdf129..999ed7d 100644
--- a/include/dsound.h
+++ b/include/dsound.h
@@ -2,6 +2,7 @@
 #define __WINE_DSOUND_H
 
 #include "windows.h"
+#include "winbase.h"
 #include "compobj.h"
 #include "mmsystem.h"
 #include "d3d.h"			//FIXME: Need to break out d3dtypes.h
@@ -161,6 +162,11 @@
 #define DSSPEAKER_STEREO        4
 #define DSSPEAKER_SURROUND      5
 
+#define DSSPEAKER_GEOMETRY_MIN      0x00000005  // 5 degrees
+#define DSSPEAKER_GEOMETRY_NARROW   0x0000000A  // 10 degrees
+#define DSSPEAKER_GEOMETRY_WIDE     0x00000014  // 20 degrees
+#define DSSPEAKER_GEOMETRY_MAX      0x000000B4  // 180 degrees
+
 
 typedef LPVOID* LPLPVOID;
 
@@ -191,7 +197,7 @@
     STDMETHOD( Compact)(THIS ) PURE;
     STDMETHOD( GetSpeakerConfig)(THIS_ LPDWORD ) PURE;
     STDMETHOD( SetSpeakerConfig)(THIS_ DWORD ) PURE;
-    STDMETHOD( Initialize)(THIS_ GUID FAR * ) PURE;
+    STDMETHOD( Initialize)(THIS_ LPGUID ) PURE;
 } *LPDIRECTSOUND_VTABLE;
 
 struct IDirectSound {
@@ -247,16 +253,19 @@
 	DWORD				freq;
 	ULONG				freqAdjust;
 	LONG				volume,pan;
-	ULONG				lVolAdjust,rVolAdjust;
+	LONG				lVolAdjust,rVolAdjust;
 	LPDIRECTSOUND			dsound;
 	DSBUFFERDESC			dsbd;
 	LPDSBPOSITIONNOTIFY		notifies;
 	int				nrofnotifies;
+	CRITICAL_SECTION		lock;
 };
 #undef THIS
 
 #define WINE_NOBUFFER                   0x80000000
 
+#define DSBPN_OFFSETSTOP		-1
+
 #define THIS LPDIRECTSOUNDNOTIFY this
 typedef struct IDirectSoundNotify_VTable {
 	/* IUnknown methods */
@@ -347,7 +356,7 @@
 	DWORD				ref;
 	LPDIRECTSOUNDBUFFER		dsb;
 	DS3DLISTENER			ds3dl;
-	
+	CRITICAL_SECTION		lock;	
 };
 #undef THIS
 
@@ -402,6 +411,7 @@
 	DS3DBUFFER			ds3db;
 	LPBYTE				buffer;
 	DWORD				buflen;
+	CRITICAL_SECTION		lock;
 };
 #undef THIS
 #undef STDMETHOD