18 added + 2 removed + 533 modified, total 553 files
- FIXME: Create unique instnce id. */
- TODO: Implement filtering
- FIXME: 0-sized array not supported */
- FIXME: no support of 0 sized array */
- FIXME: Should we do this on Datagram Sockets too? */
- FIXME: It seems Windows does some funky acceleration
- FIXME: We should notify the Helper DLL of WSH_NOTIFY_CLOSE */
- FIXME: Handle Async Connect */
- FIXME: THIS IS NOT RIGHT!!! HACK HACK HACK! */
- FIXME */
- FIXME: THIS IS NOT RIGHT!!! HACK HACK HACK! */
- FIXME: THIS IS NOT RIGHT!!! HACK HACK HACK! */
- FIXME
- FIXME
- FIXME("(%s,%d,%d,0x%04lx,%p),can't handle non-string guids.\n",xguid,wMaj,wMin,(DWORD)lcid,path);
- FIXME("key %s not found\n",typelibkey);
- FIXME("(%s,%p): stub\n",debugstr_w((LPWSTR)szFile),pptLib);
- FIXME: I'd like to return the highest currently known version value
- FIXME("If you get version error messages, please report them\n");
- FIXME("Version value not known yet. Please investigate it!\n");
- FIXME("(%p)->(%p)\n", iface, pSite);
- FIXME("(%p)->( %p)\n", iface, ppSite);
- FIXME("(%p)->(%s %p %08lx)\n", iface, debugstr_w(pwszUrl), pdwZone, dwFlags);
- FIXME("(%p)->(%s %p %p %08lx)\n", iface, debugstr_w(pwszUrl), pbSecurityId, pcbSecurityId,
- FIXME("(%p)->(%s %08lx %p %08lx %p %08lx %08lx %08lx)\n", iface, debugstr_w(pwszUrl), dwAction,
- FIXME("(%p)->(%s %s %p %p %p %08lx %08lx )\n", iface, debugstr_w(pwszUrl), debugstr_guid(guidKey),
- FIXME("(%p)->(%08lx %s %08lx)\n", iface, dwZone, debugstr_w(pwszPattern),dwFlags);
- FIXME("(%p)->(%08lx %p %08lx)\n", iface, dwZone, ppenumString,dwFlags);
- FIXME("Unknown interface: %s\n", debugstr_guid(riid));
- FIXME("(%p)->(%ld %p) stub\n", iface, dwZone, pZoneAttributes);
- FIXME("(%p)->(%08lx %p) stub\n", iface, dwZone, pZoneAttributes);
- FIXME("(%p)->(%08lx %s %p %p %08x) stub\n", iface, dwZone, debugstr_guid(guidKey),
- FIXME("(%p)->(%08lx %s %p %08lx %08x) stub\n", iface, dwZone, debugstr_guid(guidKey),
- FIXME("(%p)->(%08lx %08lx %p %08lx %08x) stub\n", iface, dwZone, dwAction, pPolicy,
- FIXME("(%p)->(%08lx %08lx %p %08lx %08x) stub\n", iface, dwZone, dwAction, pPolicy,
- FIXME("(%p)->(%08lx %s %s %08lx) stub\n", iface, dwAction, debugstr_w(pwszUrl),
- FIXME("(%p)->(%p %p %08lx) stub\n", iface, pdwEnum, pdwCount, dwFlags);
- FIXME("(%p)->(%08lx %08lx %p) stub\n", iface, dwEnum, dwIndex, pdwZone);
- FIXME("(%p)->(%08lx) stub\n", iface, dwEnum);
- FIXME("(%p)->(%08lx %08lx %08lx) stub\n", iface, dwTemplate, dwZone, dwReserved);
- FIXME("(%p)->(%d),stub!\n",This,dolock);
- FIXME("%s: no class found.\n", debugstr_guid(rclsid));
- FIXME("(%#lx, %p, %#lx): stub\n", dwOption, pBuffer, dwBufferLength);
- FIXME("(%#lx, %p, %#lx, %p): stub\n", dwOption, pBuffer, dwBufferLength, pdwBufferLength);
- TODO:
- FIXME("(%p, %s, %ld): stub\n", pBC, debugstr_w(szURL), dwReserved);
- FIXME: dwFlags are ignored! */
- TODO FIXME - don't merge and always insert freed blocks at the end for debugging purposes...
- TODO FIXME - should we validate params or ASSERT_IRQL?
- TODO FIXME - should we validate params?
- TODO FIXME commented out until we use it
- TODO FIXME - should we ASSERT_IRQL?
- TODO FIXME - should we ASSERT_IRQL?
- FIXME: MEMORY_AREA_SYSTEM case incomplete (or possibly wrong) for NtQueryVirtualMemory()\n");
- FIXME - don't have a clue if this is right, but it's better than nothing */
- FIXME: MEMORY_AREA_KERNEL_STACK case incomplete (or possibly wrong) for NtQueryVirtualMemory()\n");
- FIXME - don't have a clue if this is right, but it's better than nothing */
- TODO */
- TODO */
- FIXME - we shouldn't loop forever! Give up after some time! */
reactos
diff -u -r1.279.2.1 -r1.279.2.2
--- ChangeLog 8 Dec 2004 21:56:46 -0000 1.279.2.1
+++ ChangeLog 30 Dec 2004 04:36:07 -0000 1.279.2.2
@@ -1,3 +1,10 @@
+2004-12-14 Casper S. Hornstrup <chorns@users.sourceforge.net>
+
+ * lib/freetype/rosglue.c: Use native line-endings.
+ * drivers/lib/bzip2/sample2.ref: Ditto.
+ * lib/freetype/builds/mac/ftlib.prj: Ditto.
+ * apps/utils/net/telnet/src/tnmsg.h: Ditto.
+
2004-11-27 WaxDragon <waxdragon@gmail.com>
* bootdata/packages/reactos.dff: Add dnsapi.dll, iphlpapi.dll,
reactos
diff -u -r1.262.2.3 -r1.262.2.4
--- Makefile 13 Dec 2004 16:17:57 -0000 1.262.2.3
+++ Makefile 30 Dec 2004 04:36:07 -0000 1.262.2.4
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.262.2.3 2004/12/13 16:17:57 hyperion Exp $
+# $Id: Makefile,v 1.262.2.4 2004/12/30 04:36:07 hyperion Exp $
#
# Global makefile
#
@@ -6,6 +6,7 @@
PATH_TO_TOP = .
include $(PATH_TO_TOP)/rules.mak
+include $(PATH_TO_TOP)/config
#
# Define to build ReactOS external targets
@@ -99,7 +100,7 @@
# autochk cmd format services setup usetup welcome winlogon msiexec
SYS_APPS = autochk calc cmd explorer expand format regedt32 regsvr32 \
services setup taskmgr userinit usetup welcome vmwinst winlogon \
- regedit winefile
+ regedit winefile notepad reactos
# System services
# rpcss eventlog
@@ -773,6 +774,12 @@
#
# Hardware Abstraction Layers
#
+ifeq ($(MP),1)
+halx86: halx86/mp
+else
+halx86: halx86/up
+endif
+
$(HALS): %: $(IMPLIB)
$(MAKE) -C hal/$*
reactos
diff -u -r1.26 -r1.26.2.1
--- baseaddress.cfg 9 Nov 2004 15:02:34 -0000 1.26
+++ baseaddress.cfg 30 Dec 2004 04:36:08 -0000 1.26.2.1
@@ -1,17 +1,20 @@
-# $Id: baseaddress.cfg,v 1.26 2004/11/09 15:02:34 ion Exp $
+# $Id: baseaddress.cfg,v 1.26.2.1 2004/12/30 04:36:08 hyperion Exp $
#
# Please try to keep this up2date. Please clean up
# after yourself.
# REACTOS
+TARGET_BASE_LIB_DINPUT8 =0x00400000
+TARGET_BASE_LIB_DXDIAGN =0x00400000
TARGET_BASE_LIB_NOTIFYHOOK =0x08000000
TARGET_BASE_LIB_SECURE32 =0x10000000
-TARGET_BASE_LIB_DINPUT =0x50000000
+TARGET_BASE_LIB_DEVENUM =0x35680000
TARGET_BASE_LIB_DSOUND =0x50000000
TARGET_BASE_LIB_GLU32 =0x50000000
TARGET_BASE_LIB_OPENGL32 =0x50000000
TARGET_BASE_LIB_EXT_SLAYER =0x5C7E0000
+TARGET_BASE_LIB_DINPUT =0x5F580000
TARGET_BASE_LIB_CPL_TIMEDATE =0x64DA0000
TARGET_BASE_LIB_CPL_SYSDM =0x64DD0000
TARGET_BASE_LIB_CPL_NCPL =0x64EA0000
@@ -30,6 +33,7 @@
TARGET_BASE_LIB_CARDS =0x701a0000
TARGET_BASE_LIB_WININET =0x70200000
TARGET_BASE_LIB_ACLUI =0x71550000
+TARGET_BASE_LIB_SHDOCVW =0x71700000
TARGET_BASE_LIB_MSWSOCK =0x71a30000
TARGET_BASE_LIB_WSOCK32 =0x71ab0000
TARGET_BASE_LIB_ACLEDIT =0x71b70000
reactos/apps/utils/net/arp
diff -u -r1.1 -r1.1.2.1
--- makefile 21 Nov 2004 22:25:36 -0000 1.1
+++ makefile 30 Dec 2004 04:36:08 -0000 1.1.2.1
@@ -6,6 +6,8 @@
TARGET_NAME = arp
+TARGET_INSTALLDIR = system32
+
TARGET_CFLAGS = -D__USE_W32API
TARGET_SDKLIBS = user32.a snmpapi.a
reactos/apps/utils/net/finger
diff -u -r1.1 -r1.1.2.1
--- makefile 21 Nov 2004 22:26:13 -0000 1.1
+++ makefile 30 Dec 2004 04:36:08 -0000 1.1.2.1
@@ -8,6 +8,8 @@
TARGET_SDKLIBS = ws2_32.a
+TARGET_INSTALLDIR = system32
+
TARGET_CFLAGS = -D__USE_W32_SOCKETS
TARGET_OBJECTS = $(TARGET_NAME).o \
reactos/apps/utils/net/ipconfig
diff -u -r1.1 -r1.1.2.1
--- makefile 21 Nov 2004 22:26:13 -0000 1.1
+++ makefile 30 Dec 2004 04:36:08 -0000 1.1.2.1
@@ -6,6 +6,8 @@
TARGET_NAME = ipconfig
+TARGET_INSTALLDIR = system32
+
TARGET_CFLAGS = -D__USE_W32API
TARGET_SDKLIBS = user32.a iphlpapi.a
reactos/apps/utils/net/netstat
diff -u -r1.1 -r1.1.2.1
--- makefile 21 Nov 2004 22:26:14 -0000 1.1
+++ makefile 30 Dec 2004 04:36:08 -0000 1.1.2.1
@@ -6,6 +6,8 @@
TARGET_NAME = netstat
+TARGET_INSTALLDIR = system32
+
TARGET_CFLAGS = \
-D__USE_W32API \
-D_WIN32_IE=0x600 \
reactos/apps/utils/net/ping
diff -u -r1.10 -r1.10.2.1
--- makefile 21 Nov 2004 22:26:14 -0000 1.10
+++ makefile 30 Dec 2004 04:36:08 -0000 1.10.2.1
@@ -6,6 +6,8 @@
TARGET_NAME = ping
+TARGET_INSTALLDIR = system32
+
TARGET_CFLAGS = -D__USE_W32_SOCKETS
TARGET_SDKLIBS = ws2_32.a
reactos/apps/utils/net/route
diff -N .cvsignore
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ .cvsignore 30 Dec 2004 04:36:09 -0000 1.1.4.1
@@ -0,0 +1,17 @@
+*.sys
+*.exe
+*.dll
+*.cpl
+*.a
+*.o
+*.d
+*.coff
+*.dsp
+*.dsw
+*.aps
+*.ncb
+*.opt
+*.sym
+*.plg
+*.bak
+*.map
reactos/apps/utils/net/route
diff -u -r1.1.2.1 -r1.1.2.2
--- makefile 13 Dec 2004 16:18:23 -0000 1.1.2.1
+++ makefile 30 Dec 2004 04:36:08 -0000 1.1.2.2
@@ -6,6 +6,8 @@
TARGET_NAME = route
+TARGET_INSTALLDIR = system32
+
TARGET_SDKLIBS = ws2_32.a iphlpapi.a ntdll.a
TARGET_OBJECTS = $(TARGET_NAME).o
reactos/apps/utils/net/telnet
diff -u -r1.6 -r1.6.2.1
--- Makefile 21 Nov 2004 22:24:55 -0000 1.6
+++ Makefile 30 Dec 2004 04:36:09 -0000 1.6.2.1
@@ -6,6 +6,8 @@
TARGET_NAME = telnet
+TARGET_INSTALLDIR = system32
+
TARGET_SDKLIBS = ws2_32.a
TARGET_CPPFLAGS = -D__REACTOS__ -D__USE_W32API -Wall
reactos/apps/utils/net/telnet/src
diff -u -r1.1 -r1.1.2.1
--- tnmsg.h 21 Nov 2004 22:24:56 -0000 1.1
+++ tnmsg.h 30 Dec 2004 04:36:09 -0000 1.1.2.1
@@ -1,108 +1,108 @@
-//{{NO_DEPENDENCIES}}
-// Microsoft Developer Studio generated include file.
-// Used by Tnmsg.rc
-//
-#define MSG_COPYRIGHT 0x01
-#define MSG_COPYRIGHT_1 0x02
-#define MSG_USAGE 0x03
-#define MSG_USAGE_1 0x04
-#define MSG_HELP 0x05
-#define MSG_HELP_1 0x06
-#define MSG_INVCMD 0x07
-#define MSG_ERROR 0x08
-#define MSG_INFO 0x09
-#define MSG_WARNING 0x0a
-#define MSG_TRYING 0x0b
-#define MSG_CONNECTED 0x0c
-#define MSG_TERMBYREM 0x0d
-#define MSG_KEYMAP 0x0e
-#define MSG_ERRKEYMAP 0x0f
-#define MSG_DUMPFILE 0x10
-#define MSG_CONFIG 0x11
-#define MSG_NOINI 0x12
-#define MSG_BADVAL 0x13
-#define MSG_NOSPAWN 0x14
-#define MSG_RESOLVING 0x15
-#define MSG_NOSERVICE 0x16
-#define MSG_SIZEALIAS 0x17
-#define MSG_ERRPIPE 0x18
-#define MSG_BADUSAGE 0x19
-#define MSG_ALREADYCONNECTED 0x1a
-
-#define MSG_KEYNOVAL 1001
-#define MSG_KEYBADVAL 1002
-#define MSG_KEYBADSTRUCT 1003
-#define MSG_KEYBADCHARS 1004
-#define MSG_KEYUNEXPLINE 1005
-#define MSG_KEYUNEXPEOF 1006
-#define MSG_KEYUNEXPTOK 1007
-#define MSG_KEYUNEXPTOKIN 1008
-#define MSG_KEYUNEXP 1009
-#define MSG_KEYNOGLOBAL 1010
-#define MSG_KEYNOCONFIG 1011
-#define MSG_KEYUSECONFIG 1012
-#define MSG_KEYNOSWKEY 1013
-#define MSG_KEYCANNOTDEF 1014
-#define MSG_KEYDUPSWKEY 1015
-#define MSG_KEYUNKNOWNMAP 1016
-#define MSG_KEYNOCHARMAPS 1017
-#define MSG_KEYNOKEYMAPS 1018
-#define MSG_KEYNUMMAPS 1019
-#define MSG_KEYBADMAP 1020
-#define MSG_KEYMAPSWITCHED 1021
-
-#define MSG_WSAEINTR 0x2714
-#define MSG_WSAEBADF 0x2719
-#define MSG_WSAEACCESS 0x271D
-#define MSG_WSAEDEFAULT 0x271E
-#define MSG_WSAEINVAL 0x2726
-#define MSG_WSAEMFILE 0x2728
-#define MSG_WSAEWOULDBLOCK 0x2733
-#define MSG_WSAEINPROGRESS 0x2734
-#define MSG_WSAEALREADY 0x2735
-#define MSG_WSAENOTSOCK 0x2736
-#define MSG_WSAEDESTADDRREQ 0x2737
-#define MSG_WSAEMSGSIZE 0x2738
-#define MSG_WSAEPROTOTYPE 0x2739
-#define MSG_WSAENOPROTOOPT 0x273A
-#define MSG_WSAEPROTONOTSUPPORT 0x273B
-#define MSG_WSAESOCKNOTSUPPORT 0x273C
-#define MSG_WSAEOPNOTSUPP 0x273D
-#define MSG_WSAEPFNOTSUPPORT 0x273E
-#define MSG_WSAEAFNOTSUPPORT 0x273F
-#define MSG_WSAEADDRINUSE 0x2740
-#define MSG_WSAEADDRNOTAVAIL 0x2741
-#define MSG_WSAENETDOWN 0x2742
-#define MSG_WSAENETUNREACH 0x2743
-#define MSG_WSAENETRESET 0x2744
-#define MSG_WSAECONNABORTED 0x2745
-#define MSG_WSAECONNRESET 0x2746
-#define MSG_WSAENOBUFS 0x2747
-#define MSG_WSAEISCONN 0x2748
-#define MSG_WSAENOTCONN 0x2749
-#define MSG_WSAESHUTDOWN 0x274A
-#define MSG_WSAETOOMANYREFS 0x274B
-#define MSG_WSAETIMEDOUT 0x274C
-#define MSG_WSAECONNREFUSED 0x274D
-#define MSG_WSAELOOP 0x274E
-#define MSG_WSAENAMETOOLONG 0x274F
-#define MSG_WSAEHOSTDOWN 0x2750
-#define MSG_WSAEHOSTUNREACH 0x2751
-#define MSG_WSAESYSNOTREADY 0x276B
-#define MSG_WSAVERNOTSUPPORTED 0x276C
-#define MSG_WSANOTINITIALISED 0x276D
-#define MSG_WSAHOST_NOT_FOUND 0x2AF9
-#define MSG_WSATRY_AGAIN 0x2AFA
-#define MSG_WSANO_RECOVERY 0x2AFB
-#define MSG_WSANO_DATA 0x2AFC
-
-// Next default values for new objects
-//
-#ifdef APSTUDIO_INVOKED
-#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE 101
-#define _APS_NEXT_COMMAND_VALUE 40001
-#define _APS_NEXT_CONTROL_VALUE 1000
-#define _APS_NEXT_SYMED_VALUE 101
-#endif
-#endif
+//{{NO_DEPENDENCIES}}
+// Microsoft Developer Studio generated include file.
+// Used by Tnmsg.rc
+//
+#define MSG_COPYRIGHT 0x01
+#define MSG_COPYRIGHT_1 0x02
+#define MSG_USAGE 0x03
+#define MSG_USAGE_1 0x04
+#define MSG_HELP 0x05
+#define MSG_HELP_1 0x06
+#define MSG_INVCMD 0x07
+#define MSG_ERROR 0x08
+#define MSG_INFO 0x09
+#define MSG_WARNING 0x0a
+#define MSG_TRYING 0x0b
+#define MSG_CONNECTED 0x0c
+#define MSG_TERMBYREM 0x0d
+#define MSG_KEYMAP 0x0e
+#define MSG_ERRKEYMAP 0x0f
+#define MSG_DUMPFILE 0x10
+#define MSG_CONFIG 0x11
+#define MSG_NOINI 0x12
+#define MSG_BADVAL 0x13
+#define MSG_NOSPAWN 0x14
+#define MSG_RESOLVING 0x15
+#define MSG_NOSERVICE 0x16
+#define MSG_SIZEALIAS 0x17
+#define MSG_ERRPIPE 0x18
+#define MSG_BADUSAGE 0x19
+#define MSG_ALREADYCONNECTED 0x1a
+
+#define MSG_KEYNOVAL 1001
+#define MSG_KEYBADVAL 1002
+#define MSG_KEYBADSTRUCT 1003
+#define MSG_KEYBADCHARS 1004
+#define MSG_KEYUNEXPLINE 1005
+#define MSG_KEYUNEXPEOF 1006
+#define MSG_KEYUNEXPTOK 1007
+#define MSG_KEYUNEXPTOKIN 1008
+#define MSG_KEYUNEXP 1009
+#define MSG_KEYNOGLOBAL 1010
+#define MSG_KEYNOCONFIG 1011
+#define MSG_KEYUSECONFIG 1012
+#define MSG_KEYNOSWKEY 1013
+#define MSG_KEYCANNOTDEF 1014
+#define MSG_KEYDUPSWKEY 1015
+#define MSG_KEYUNKNOWNMAP 1016
+#define MSG_KEYNOCHARMAPS 1017
+#define MSG_KEYNOKEYMAPS 1018
+#define MSG_KEYNUMMAPS 1019
+#define MSG_KEYBADMAP 1020
+#define MSG_KEYMAPSWITCHED 1021
+
+#define MSG_WSAEINTR 0x2714
+#define MSG_WSAEBADF 0x2719
+#define MSG_WSAEACCESS 0x271D
+#define MSG_WSAEDEFAULT 0x271E
+#define MSG_WSAEINVAL 0x2726
+#define MSG_WSAEMFILE 0x2728
+#define MSG_WSAEWOULDBLOCK 0x2733
+#define MSG_WSAEINPROGRESS 0x2734
+#define MSG_WSAEALREADY 0x2735
+#define MSG_WSAENOTSOCK 0x2736
+#define MSG_WSAEDESTADDRREQ 0x2737
+#define MSG_WSAEMSGSIZE 0x2738
+#define MSG_WSAEPROTOTYPE 0x2739
+#define MSG_WSAENOPROTOOPT 0x273A
+#define MSG_WSAEPROTONOTSUPPORT 0x273B
+#define MSG_WSAESOCKNOTSUPPORT 0x273C
+#define MSG_WSAEOPNOTSUPP 0x273D
+#define MSG_WSAEPFNOTSUPPORT 0x273E
+#define MSG_WSAEAFNOTSUPPORT 0x273F
+#define MSG_WSAEADDRINUSE 0x2740
+#define MSG_WSAEADDRNOTAVAIL 0x2741
+#define MSG_WSAENETDOWN 0x2742
+#define MSG_WSAENETUNREACH 0x2743
+#define MSG_WSAENETRESET 0x2744
+#define MSG_WSAECONNABORTED 0x2745
+#define MSG_WSAECONNRESET 0x2746
+#define MSG_WSAENOBUFS 0x2747
+#define MSG_WSAEISCONN 0x2748
+#define MSG_WSAENOTCONN 0x2749
+#define MSG_WSAESHUTDOWN 0x274A
+#define MSG_WSAETOOMANYREFS 0x274B
+#define MSG_WSAETIMEDOUT 0x274C
+#define MSG_WSAECONNREFUSED 0x274D
+#define MSG_WSAELOOP 0x274E
+#define MSG_WSAENAMETOOLONG 0x274F
+#define MSG_WSAEHOSTDOWN 0x2750
+#define MSG_WSAEHOSTUNREACH 0x2751
+#define MSG_WSAESYSNOTREADY 0x276B
+#define MSG_WSAVERNOTSUPPORTED 0x276C
+#define MSG_WSANOTINITIALISED 0x276D
+#define MSG_WSAHOST_NOT_FOUND 0x2AF9
+#define MSG_WSATRY_AGAIN 0x2AFA
+#define MSG_WSANO_RECOVERY 0x2AFB
+#define MSG_WSANO_DATA 0x2AFC
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE 101
+#define _APS_NEXT_COMMAND_VALUE 40001
+#define _APS_NEXT_CONTROL_VALUE 1000
+#define _APS_NEXT_SYMED_VALUE 101
+#endif
+#endif
reactos/apps/utils/net/whois
diff -u -r1.1 -r1.1.2.1
--- makefile 21 Nov 2004 22:27:01 -0000 1.1
+++ makefile 30 Dec 2004 04:36:09 -0000 1.1.2.1
@@ -6,6 +6,8 @@
TARGET_NAME = whois
+TARGET_INSTALLDIR = system32
+
TARGET_SDKLIBS = ws2_32.a
TARGET_OBJECTS = $(TARGET_NAME).o
reactos/apps/utils/pnpdump
diff -u -r1.7 -r1.7.14.1
--- pnpdump.c 21 Jun 2004 12:12:01 -0000 1.7
+++ pnpdump.c 30 Dec 2004 04:36:09 -0000 1.7.14.1
@@ -290,7 +290,7 @@
"Identifier",
NULL,
&dwType,
- szBuffer,
+ (LPBYTE)szBuffer,
&dwSize);
if (lError != ERROR_SUCCESS)
{
@@ -547,7 +547,7 @@
void PrintDeviceData (PCM_PNP_BIOS_DEVICE_NODE DeviceNode)
{
- unsigned char PnpId[8];
+ char PnpId[8];
unsigned char *Ptr;
unsigned int TagSize;
unsigned int TagType;
@@ -706,7 +706,7 @@
}
/* Allocate buffer */
- dwSize = 1024;
+ dwSize = 2048;
lpBuffer = malloc(dwSize);
if (lpBuffer == NULL)
{
@@ -715,19 +715,28 @@
return 0;
}
- lError = RegQueryValueEx(hPnpKey,
- "Configuration Data",
- NULL,
- &dwType,
- (LPSTR)lpBuffer,
- &dwSize);
- if (lError != ERROR_SUCCESS)
+ do
{
+ lError = RegQueryValueEx(hPnpKey,
+ "Configuration Data",
+ NULL,
+ &dwType,
+ (LPBYTE)lpBuffer,
+ &dwSize);
if (lError == ERROR_MORE_DATA)
- {
- printf("Need to resize buffer to %lu\n", dwSize);
- }
-
+ {
+ lpBuffer = realloc(lpBuffer, dwSize);
+ if (lpBuffer == NULL)
+ {
+ printf("Error: realloc() of %u bytes failed\n", (unsigned) dwSize);
+ RegCloseKey(hPnpKey);
+ return 0;
+ }
+ }
+ }
+ while (lError == ERROR_MORE_DATA);
+ if (lError != ERROR_SUCCESS)
+ {
printf("Failed to read 'Configuration Data' value\n");
free(lpBuffer);
RegCloseKey(hPnpKey);
@@ -753,13 +762,13 @@
// printf("ResourceSize: %lu\n", dwResourceSize);
lpPnpInst = (PCM_PNP_BIOS_INSTALLATION_CHECK)
- ((DWORD)(&lpBuffer->PartialResourceList.PartialDescriptors[0]) +
+ ((ULONG_PTR)(&lpBuffer->PartialResourceList.PartialDescriptors[0]) +
sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR));
// printf("lpPnpInst %p\n", lpPnpInst);
printf("Signature '%.4s'\n", lpPnpInst->Signature);
- if (strncmp(lpPnpInst->Signature, "$PnP", 4))
+ if (strncmp((PCHAR)lpPnpInst->Signature, "$PnP", 4))
{
printf("Error: Invalid PnP signature\n");
free(lpBuffer);
reactos/apps/utils/sc
diff -u -r1.2 -r1.2.28.1
--- makefile 14 Nov 2003 17:13:22 -0000 1.2
+++ makefile 30 Dec 2004 04:36:09 -0000 1.2.28.1
@@ -9,6 +9,8 @@
TARGET_APPTYPE = console
+TARGET_INSTALLDIR = system32
+
TARGET_NAME = sc
TARGET_CFLAGS = -DDBG -Werror -Wall
reactos/apps/utils/shutdown
diff -u -r1.2 -r1.2.6.1
--- Makefile 16 Sep 2004 12:46:43 -0000 1.2
+++ Makefile 30 Dec 2004 04:36:09 -0000 1.2.6.1
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.2 2004/09/16 12:46:43 gvg Exp $
+# $Id: Makefile,v 1.2.6.1 2004/12/30 04:36:09 hyperion Exp $
PATH_TO_TOP = ../../..
@@ -8,6 +8,8 @@
TARGET_APPTYPE = console
+TARGET_INSTALLDIR = system32
+
TARGET_NAME = shutdown
TARGET_SDKLIBS = kernel32.a user32.a
reactos/bootdata
diff -u -r1.9 -r1.9.2.1
--- hivecls.inf 23 Oct 2004 13:10:57 -0000 1.9
+++ hivecls.inf 30 Dec 2004 04:36:09 -0000 1.9.2.1
@@ -64,6 +64,10 @@
HKCR,"CLSID\{1F4DE370-D627-11D1-BA4F-00A0C91EEDBA}\InProcServer32","ThreadingModel",0x00000000,"Apartment"
HKCR,"CLSID\{1F4DE370-D627-11D1-BA4F-00A0C91EEDBA}\ShellFolder","Attributes",0x00010001,0x20180000
+HKCR,"CLSID\{4657278A-411B-11d2-839A-00C04FD918D0}","",0x00000000,"Shell Drag and Drop helper"
+HKCR,"CLSID\{4657278A-411B-11d2-839A-00C04FD918D0}\InProcServer32","",0x00020000,"%SystemRoot%\system32\shell32.dll"
+HKCR,"CLSID\{4657278A-411B-11d2-839A-00C04FD918D0}\InProcServer32","ThreadingModel",0x00000000,"Apartment"
+
HKCR,"CLSID\{645FF040-5081-101B-9F08-00AA002F954E}","",0x00000000,"Recycle Bin"
HKCR,"CLSID\{645FF040-5081-101B-9F08-00AA002F954E}","LocalizedString",0x00020000,"@%SystemRoot%\system32\shell32.dll,-8964"
HKCR,"CLSID\{645FF040-5081-101B-9F08-00AA002F954E}","InfoTip",0x00020000,"@%SystemRoot%\system32\shell32.dll,-22915"
@@ -98,6 +102,12 @@
HKCR,"CLSID\{A907657F-6FDF-11D0-8EFB-00C04FD912B2}\InProcServer32","",0x00000000,"netcfgx.dll"
HKCR,"CLSID\{A907657F-6FDF-11D0-8EFB-00C04FD912B2}\InProcServer32","ThreadingModel",0x00000000,"Both"
+; For dxdiagn.dll
+HKCR,"CLSID\{A65B8071-3BFE-4213-9A5B-491DA4461CA7}","",0x00000000,"DxDiagProvider Class"
+HKCR,"CLSID\{A65B8071-3BFE-4213-9A5B-491DA4461CA7}\InProcServer32","",0x00000000,"%SystemRoot%\system32\dxdiagn.dll"
+HKCR,"CLSID\{A65B8071-3BFE-4213-9A5B-491DA4461CA7}\InProcServer32","ThreadingModel",0x00000000,"Apartment"
+HKCR,"CLSID\{A65B8071-3BFE-4213-9A5B-491DA4461CA7}\ProgID","",0x00000000,"DxDiag.DxDiagProvider.1"
+HKCR,"CLSID\{A65B8071-3BFE-4213-9A5B-491DA4461CA7}\VersionIndependentProgID","",0x00000000,"DxDiag.DxDiagProvider"
HKCR,"Interface",,0x00000012
reactos/bootdata
diff -u -r1.46.2.1 -r1.46.2.2
--- hivesft.inf 8 Dec 2004 21:56:47 -0000 1.46.2.1
+++ hivesft.inf 30 Dec 2004 04:36:09 -0000 1.46.2.2
@@ -10,6 +10,7 @@
; Uninstall Application list
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall",,0x00000010
+HKLM,"SOFTWARE\Microsoft\Rpc",,0x00000012
; Version Information
HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion","CurrentVersion",0x00020000,"4.0"
@@ -47,6 +48,123 @@
; Time zone settings
HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones",,0x00000012
+HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones","IndexMapping",0x00010000,\
+ "1009", "4",\
+ "80a", "30",\
+ "440a", "30",\
+ "480a", "30",\
+ "4c0a", "30",\
+ "409", "35",\
+ "c0c", "35",\
+ "240a", "45",\
+ "280a", "45",\
+ "300a", "45",\
+ "200a", "55",\
+ "340a", "55",\
+ "3c0a", "55",\
+ "400a", "55",\
+ "500a", "55",\
+ "416", "65",\
+ "2c0a", "70",\
+ "380a", "70",\
+ "422", "85",\
+ "438", "85",\
+ "441", "85",\
+ "809", "85",\
+ "816", "85",\
+ "1001", "85",\
+ "1401", "85",\
+ "1404", "85",\
+ "1809", "85",\
+ "2009", "85",\
+ "2401", "85",\
+ "2409", "85",\
+ "2801", "85",\
+ "2809", "85",\
+ "3001", "85",\
+ "3409", "85",\
+ "4001", "85",\
+ "40f", "85",\
+ "41c", "85",\
+ "43e", "85",\
+ "83e", "85",\
+ "100a", "85",\
+ "140a", "85",\
+ "140c", "85",\
+ "180a", "85",\
+ "180c", "85",\
+ "1c01", "85",\
+ "1c0a", "85",\
+ "2c01", "85",\
+ "2c09", "85",\
+ "3c01", "85",\
+ "405", "95",\
+ "424", "95",\
+ "41b", "95",\
+ "81a", "95",\
+ "c1a", "95",\
+ "402", "100",\
+ "415", "100",\
+ "1801", "100",\
+ "41a", "100",\
+ "42f", "100",\
+ "403", "105",\
+ "406", "105",\
+ "410", "105",\
+ "427", "105",\
+ "813", "105",\
+ "827", "105",\
+ "40a", "105",\
+ "40c", "105",\
+ "42d", "105",\
+ "80c", "105",\
+ "c0a", "105",\
+ "407", "110",\
+ "413", "110",\
+ "414", "110",\
+ "807", "110",\
+ "810", "110",\
+ "814", "110",\
+ "1007", "110",\
+ "1407", "110",\
+ "41d", "110",\
+ "c07", "110",\
+ "100c", "110",\
+ "418", "115",\
+ "40e", "115",\
+ "c01", "120",\
+ "425", "125",\
+ "426", "125",\
+ "40b", "125",\
+ "81d", "125",\
+ "408", "130",\
+ "423", "130",\
+ "41f", "130",\
+ "40d", "135",\
+ "436", "140",\
+ "3009", "140",\
+ "1c09", "140",\
+ "419", "145",\
+ "401", "150",\
+ "801", "150",\
+ "3401", "150",\
+ "429", "160",\
+ "2001", "165",\
+ "3801", "165",\
+ "420", "185",\
+ "439", "190",\
+ "421", "205",\
+ "41e", "205",\
+ "42a", "205",\
+ "804", "210",\
+ "c04", "210",\
+ "1004", "215",\
+ "404", "220",\
+ "412", "230",\
+ "812", "230",\
+ "411", "235",\
+ "c09", "255",\
+ "1409", "290"
HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Dateline Standard Time","Display",0x00000000,"(GMT-12:00) Eniwetok, Kwajalein"
HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Dateline Standard Time","Dlt",0x00000000,"Dateline Daylight Time"
reactos/bootdata
diff -u -r1.74.2.1 -r1.74.2.2
--- hivesys.inf 13 Dec 2004 09:38:45 -0000 1.74.2.1
+++ hivesys.inf 30 Dec 2004 04:36:09 -0000 1.74.2.2
@@ -359,6 +359,13 @@
HKLM,"SYSTEM\CurrentControlSet\Services\hpt3xxPCI","Type",0x00010001,0x00000001
HKLM,"SYSTEM\CurrentControlSet\Services\hpt3xxPCI","Tag",0x00010001,0x00000090
+; ACPI driver
+HKLM,"SYSTEM\CurrentControlSet\Services\ACPI","ErrorControl",0x00010001,0x00000001
+HKLM,"SYSTEM\CurrentControlSet\Services\ACPI","Group",0x00000000,"Boot Bus Extender"
+HKLM,"SYSTEM\CurrentControlSet\Services\ACPI","ImagePath",0x00020000,"system32\drivers\acpi.sys"
+HKLM,"SYSTEM\CurrentControlSet\Services\ACPI","Start",0x00010001,0x00000000
+HKLM,"SYSTEM\CurrentControlSet\Services\ACPI","Type",0x00010001,0x00000001
+
; Beep device driver
HKLM,"SYSTEM\CurrentControlSet\Services\Beep","ErrorControl",0x00010001,0x00000000
HKLM,"SYSTEM\CurrentControlSet\Services\Beep","Group",0x00000000,"Base"
reactos/bootdata/packages
diff -u -r1.51.2.1 -r1.51.2.2
--- reactos.dff 8 Dec 2004 21:56:47 -0000 1.51.2.1
+++ reactos.dff 30 Dec 2004 04:36:10 -0000 1.51.2.2
@@ -68,9 +68,20 @@
lib\comctl32\comctl32.dll 1
lib\comdlg32\comdlg32.dll 1
lib\crtdll\crtdll.dll 1
+lib\devenum\devenum.dll 1
lib\dinput\dinput.dll 1
lib\dinput8\dinput8.dll 1
-lib\dsound\dsound.dll 1
+lib\dsound\dsound.dll 1
+lib\dxdiagn\dxdiagn.dll 1
+lib\expat\expat.dll 1
+lib\dinput\dinput.dll 1
+lib\dinput8\dinput8.dll 1
+lib\dsound\dsound.dll 1
+lib\dxdiagn\dxdiagn.dll 1
+lib\expat\expat.dll 1
+lib\dinput8\dinput8.dll 1
+lib\dsound\dsound.dll 1
+lib\dxdiagn\dxdiagn.dll 1
lib\expat\expat.dll 1
lib\fmifs\fmifs.dll 1
lib\freetype\freetype.dll 1
@@ -102,6 +113,7 @@
lib\ntdll\ntdll.dll 1
lib\ole32\ole32.dll 1
lib\oleaut32\oleaut32.dll 1
+lib\olepro32\olepro32.dll 1
lib\psapi\psapi.dll 1
lib\richedit\riched32.dll 1
lib\rpcrt4\rpcrt4.dll 1
@@ -140,6 +152,7 @@
subsys\system\explorer\explorer-cfg-template.xml 4
subsys\system\explorer\notifyhook\notifyhook.dll 1
subsys\system\format\format.exe 1
+subsys\system\notepad\notepad.exe 1
subsys\system\regedit\regedit.exe 4
subsys\system\regedt32\regedt32.exe 1
subsys\system\regsvr32\regsvr32.exe 1
reactos/doc
diff -u -r1.20.2.2 -r1.20.2.3
--- README.WINE 13 Dec 2004 09:38:45 -0000 1.20.2.2
+++ README.WINE 30 Dec 2004 04:36:10 -0000 1.20.2.3
@@ -53,7 +53,12 @@
reactos/lib/ole32 # Synced to Wine-20041201
reactos/lib/oleaut32 # Synced to Wine-20041201
reactos/lib/oledlg # Synced to Wine-20041201
-reactos/lib/oldpro32 # Out of sync
+reactos/lib/oldpro32 # Synced to Wine-20041201
+reactos/lib/richedit # Synced to Wine-20041201
+reactos/lib/rpcrt4 # Synced to Wine-20041201
+reactos/lib/oleaut32 # Synced to Wine-20041201
+reactos/lib/oledlg # Synced to Wine-20041201
+reactos/lib/oldpro32 # Synced to Wine-20041201
reactos/lib/richedit # Synced to Wine-20041201
reactos/lib/rpcrt4 # Synced to Wine-20041201
reactos/lib/setupapi # Out of sync
reactos/drivers/bus/acpi
diff -u -r1.5 -r1.5.34.1
--- .cvsignore 29 Jul 2003 00:27:40 -0000 1.5
+++ .cvsignore 30 Dec 2004 04:36:10 -0000 1.5.34.1
@@ -1,8 +1,9 @@
-acpi.coff
-objects
+*.a
*.d
*.o
*.sym
*.sys
*.map
*.tmp
+acpi.coff
+objects
reactos/drivers/bus/acpi/ospm
diff -u -r1.4 -r1.4.28.1
--- acpienum.c 14 Nov 2003 17:13:23 -0000 1.4
+++ acpienum.c 30 Dec 2004 04:36:10 -0000 1.4.28.1
@@ -1,4 +1,4 @@
-/* $Id: acpienum.c,v 1.4 2003/11/14 17:13:23 weiden Exp $
+/* $Id: acpienum.c,v 1.4.28.1 2004/12/30 04:36:10 hyperion Exp $
*
* PROJECT: ReactOS ACPI bus driver
* FILE: acpi/ospm/acpienum.c
@@ -14,216 +14,175 @@
#include <debug.h>
-void
+#ifndef NDEBUG
+static void
bm_print1 (
- BM_NODE *node,
- u32 flags)
+ BM_NODE *node,
+ u32 flags)
{
- ACPI_BUFFER buffer;
- BM_DEVICE *device = NULL;
- char *type_string = NULL;
-
- if (!node) {
- return;
- }
-
- device = &(node->device);
-
- if (flags & BM_PRINT_PRESENT) {
- if (!BM_DEVICE_PRESENT(device)) {
- return;
- }
- }
-
- buffer.length = 256;
- buffer.pointer = acpi_os_callocate(buffer.length);
- if (!buffer.pointer) {
- return;
- }
-
- acpi_get_name(device->acpi_handle, ACPI_FULL_PATHNAME, &buffer);
-
- switch(device->id.type) {
- case BM_TYPE_SYSTEM:
- type_string = "System";
- break;
- case BM_TYPE_SCOPE:
- type_string = "Scope";
- break;
- case BM_TYPE_PROCESSOR:
- type_string = "Processor";
- break;
- case BM_TYPE_THERMAL_ZONE:
- type_string = "ThermalZone";
- break;
- case BM_TYPE_POWER_RESOURCE:
- type_string = "PowerResource";
- break;
- case BM_TYPE_FIXED_BUTTON:
- type_string = "Button";
- break;
- case BM_TYPE_DEVICE:
- type_string = "Device";
- break;
- default:
- type_string = "Unknown";
- break;
- }
-
- if (!(flags & BM_PRINT_GROUP)) {
- DbgPrint("+------------------------------------------------------------\n");
- }
-
- DbgPrint("%s[0x%02x] hid[%s] %s\n", type_string, device->handle, device->id.hid, buffer.pointer);
- DbgPrint(" acpi_handle[0x%08x] flags[0x%02x] status[0x%02x]\n", device->acpi_handle, device->flags, device->status);
-
- if (flags & BM_PRINT_IDENTIFICATION) {
- DbgPrint(" identification: uid[%s] adr[0x%08x]\n", device->id.uid, device->id.adr);
- }
-
- if (flags & BM_PRINT_LINKAGE) {
- DbgPrint(" linkage: this[%p] parent[%p] next[%p]\n", node, node->parent, node->next);
- DbgPrint(" scope.head[%p] scope.tail[%p]\n", node->scope.head, node->scope.tail);
- }
-
- if (flags & BM_PRINT_POWER) {
- DbgPrint(" power: state[D%d] flags[0x%08X]\n", device->power.state, device->power.flags);
- DbgPrint(" S0[0x%02x] S1[0x%02x] S2[0x%02x]\n", device->power.dx_supported[0], device->power.dx_supported[1], device->power.dx_supported[2]);
- DbgPrint(" S3[0x%02x] S4[0x%02x] S5[0x%02x]\n", device->power.dx_supported[3], device->power.dx_supported[4], device->power.dx_supported[5]);
- }
-
- if (!(flags & BM_PRINT_GROUP)) {
- DbgPrint("+------------------------------------------------------------\n");
- }
-
- acpi_os_free(buffer.pointer);
-
- return;
-}
+ ACPI_BUFFER buffer;
+ BM_DEVICE *device = NULL;
+ char *type_string = NULL;
+
+ if (!node)
+ {
+ return;
+ }
+ device = &(node->device);
-NTSTATUS
-ACPIEnumerateRootBusses(
- PFDO_DEVICE_EXTENSION DeviceExtension)
-{
- BM_HANDLE_LIST HandleList;
- PACPI_DEVICE AcpiDevice;
- ACPI_STATUS AcpiStatus;
- BM_DEVICE_ID Criteria;
- KIRQL OldIrql;
- ULONG i;
-
- BM_NODE *Node;
- ULONG j;
+ if (flags & BM_PRINT_PRESENT)
+ {
+ if (!BM_DEVICE_PRESENT(device))
+ {
+ return;
+ }
+ }
- DPRINT("Called\n");
+ buffer.length = 256;
+ buffer.pointer = acpi_os_callocate(buffer.length);
+ if (!buffer.pointer)
+ {
+ return;
+ }
- RtlZeroMemory(&Criteria, sizeof(BM_DEVICE_ID));
- RtlMoveMemory(&Criteria.hid, PCI_ROOT_HID_STRING, sizeof(PCI_ROOT_HID_STRING));
+ acpi_get_name(device->acpi_handle, ACPI_FULL_PATHNAME, &buffer);
- AcpiStatus = bm_search(BM_HANDLE_ROOT, &Criteria, &HandleList);
+ switch(device->id.type)
+ {
+ case BM_TYPE_SYSTEM:
+ type_string = "System";
+ break;
+
+ case BM_TYPE_SCOPE:
+ type_string = "Scope";
+ break;
+
+ case BM_TYPE_PROCESSOR:
+ type_string = "Processor";
+ break;
+
+ case BM_TYPE_THERMAL_ZONE:
+ type_string = "ThermalZone";
+ break;
+
+ case BM_TYPE_POWER_RESOURCE:
+ type_string = "PowerResource";
+ break;
+
+ case BM_TYPE_FIXED_BUTTON:
+ type_string = "Button";
+ break;
+
+ case BM_TYPE_DEVICE:
+ type_string = "Device";
+ break;
+
+ default:
+ type_string = "Unknown";
+ break;
+ }
- if (ACPI_SUCCESS(AcpiStatus)) {
- DPRINT("Got %d devices\n", HandleList.count);
+ if (!(flags & BM_PRINT_GROUP))
+ {
+ DbgPrint("+------------------------------------------------------------\n");
+ }
- for (i = 0; i < HandleList.count; i++) {
- AcpiStatus = bm_get_node(HandleList.handles[i], 0, &Node);
- if (ACPI_SUCCESS(AcpiStatus)) {
- DPRINT("Got BM node information: (Node 0x%X)\n", Node);
- bm_print1(Node, BM_PRINT_ALL - BM_PRINT_PRESENT);
-#if 1
- for (j=0; j < 4*1000;j++)
- KeStallExecutionProcessor(1000);
-#endif
- } else {
- DPRINT("Could not get BM node\n");
- }
+ DbgPrint("%s[0x%02x] hid[%s] %s\n", type_string, device->handle, device->id.hid, buffer.pointer);
+ DbgPrint(" acpi_handle[0x%08x] flags[0x%02x] status[0x%02x]\n", device->acpi_handle, device->flags, device->status);
- AcpiDevice = (PACPI_DEVICE)ExAllocatePool(
- NonPagedPool, sizeof(ACPI_DEVICE));
- if (!AcpiDevice) {
- return STATUS_INSUFFICIENT_RESOURCES;
- }
+ if (flags & BM_PRINT_IDENTIFICATION)
+ {
+ DbgPrint(" identification: uid[%s] adr[0x%08x]\n", device->id.uid, device->id.adr);
+ }
- RtlZeroMemory(AcpiDevice, sizeof(ACPI_DEVICE));
+ if (flags & BM_PRINT_LINKAGE)
+ {
+ DbgPrint(" linkage: this[%p] parent[%p] next[%p]\n", node, node->parent, node->next);
+ DbgPrint(" scope.head[%p] scope.tail[%p]\n", node->scope.head, node->scope.tail);
+ }
- AcpiDevice->Pdo = NULL;
- AcpiDevice->BmHandle = HandleList.handles[i];
+ if (flags & BM_PRINT_POWER)
+ {
+ DbgPrint(" power: state[D%d] flags[0x%08X]\n", device->power.state, device->power.flags);
+ DbgPrint(" S0[0x%02x] S1[0x%02x] S2[0x%02x]\n", device->power.dx_supported[0], device->power.dx_supported[1], device->power.dx_supported[2]);
+ DbgPrint(" S3[0x%02x] S4[0x%02x] S5[0x%02x]\n", device->power.dx_supported[3], device->power.dx_supported[4], device->power.dx_supported[5]);
+ }
- KeAcquireSpinLock(&DeviceExtension->DeviceListLock, &OldIrql);
- InsertHeadList(&DeviceExtension->DeviceListHead,
- &AcpiDevice->DeviceListEntry);
- DeviceExtension->DeviceListCount++;
- KeReleaseSpinLock(&DeviceExtension->DeviceListLock, OldIrql);
- }
- } else {
- DPRINT("Got no devices (Status 0x%X)\n", AcpiStatus);
+ if (!(flags & BM_PRINT_GROUP))
+ {
+ DbgPrint("+------------------------------------------------------------\n");
}
- for (j=0; j < 4*10*1000;j++)
- KeStallExecutionProcessor(1000);
- return STATUS_SUCCESS;
+ acpi_os_free(buffer.pointer);
+
+ return;
}
+#endif
NTSTATUS
-ACPIEnumerateNamespace(
- PFDO_DEVICE_EXTENSION DeviceExtension)
+ACPIEnumerateDevices(PFDO_DEVICE_EXTENSION DeviceExtension)
{
BM_HANDLE_LIST HandleList;
PACPI_DEVICE AcpiDevice;
ACPI_STATUS AcpiStatus;
- BM_DEVICE_ID Criteria;
+ BM_DEVICE_ID Criteria;
BM_NODE *Node;
KIRQL OldIrql;
ULONG i;
DPRINT("Called\n");
- RtlZeroMemory(&Criteria, sizeof(BM_DEVICE_ID));
-
- DbgPrint("Listing ACPI namespace\n");
+ RtlZeroMemory(&Criteria, sizeof(BM_DEVICE_ID));
Criteria.type = BM_TYPE_ALL;
AcpiStatus = bm_search(BM_HANDLE_ROOT, &Criteria, &HandleList);
- if (ACPI_SUCCESS(AcpiStatus)) {
+ if (ACPI_SUCCESS(AcpiStatus))
+ {
DPRINT("Got %d devices\n", HandleList.count);
- for (i = 0; i < HandleList.count; i++) {
+ for (i = 0; i < HandleList.count; i++)
+ {
AcpiStatus = bm_get_node(HandleList.handles[i], 0, &Node);
- if (ACPI_SUCCESS(AcpiStatus)) {
+ if (ACPI_SUCCESS(AcpiStatus))
+ {
DPRINT("Got BM node information: (Node 0x%X)\n", Node);
-#if 0
- {
- ULONG j;
+ if ((Node->device.flags & BM_FLAGS_IDENTIFIABLE) &&
+ (Node->device.id.hid[0] != 0))
+ {
+#ifndef NDEBUG
bm_print1(Node, BM_PRINT_ALL - BM_PRINT_PRESENT);
- for (j=0; j < 4*1000;j++)
- KeStallExecutionProcessor(1000);
- }
#endif
- } else {
- DPRINT("Could not get BM node\n");
- }
- AcpiDevice = (PACPI_DEVICE)ExAllocatePool(
- NonPagedPool, sizeof(ACPI_DEVICE));
- if (!AcpiDevice) {
- return STATUS_INSUFFICIENT_RESOURCES;
+ AcpiDevice = (PACPI_DEVICE)ExAllocatePool(NonPagedPool,
+ sizeof(ACPI_DEVICE));
+ if (AcpiDevice == NULL)
+ {
+ return STATUS_INSUFFICIENT_RESOURCES;
+ }
+
+ RtlZeroMemory(AcpiDevice, sizeof(ACPI_DEVICE));
+
+ AcpiDevice->Pdo = NULL;
+ AcpiDevice->BmHandle = HandleList.handles[i];
+
+ KeAcquireSpinLock(&DeviceExtension->DeviceListLock, &OldIrql);
+ InsertHeadList(&DeviceExtension->DeviceListHead,
+ &AcpiDevice->DeviceListEntry);
+ DeviceExtension->DeviceListCount++;
+ KeReleaseSpinLock(&DeviceExtension->DeviceListLock, OldIrql);
+ }
+ }
+ else
+ {
+ DPRINT("Could not get BM node\n");
}
-
- RtlZeroMemory(AcpiDevice, sizeof(ACPI_DEVICE));
-
- AcpiDevice->Pdo = NULL;
- AcpiDevice->BmHandle = HandleList.handles[i];
-
- KeAcquireSpinLock(&DeviceExtension->DeviceListLock, &OldIrql);
- InsertHeadList(&DeviceExtension->DeviceListHead,
- &AcpiDevice->DeviceListEntry);
- DeviceExtension->DeviceListCount++;
- KeReleaseSpinLock(&DeviceExtension->DeviceListLock, OldIrql);
}
- } else {
+ }
+ else
+ {
DPRINT("Got no devices (Status 0x%X)\n", AcpiStatus);
}
reactos/drivers/bus/acpi/ospm
diff -u -r1.5 -r1.5.36.1
--- acpisys.c 5 May 2002 14:57:44 -0000 1.5
+++ acpisys.c 30 Dec 2004 04:36:10 -0000 1.5.36.1
@@ -1,4 +1,4 @@
-/* $Id: acpisys.c,v 1.5 2002/05/05 14:57:44 chorns Exp $
+/* $Id: acpisys.c,v 1.5.36.1 2004/12/30 04:36:10 hyperion Exp $
*
* PROJECT: ReactOS ACPI bus driver
* FILE: acpi/ospm/acpisys.c
@@ -83,7 +83,7 @@
if (DeviceExtension->IsFDO) {
Status = FdoPnpControl(DeviceObject, Irp);
} else {
- Status = FdoPnpControl(DeviceObject, Irp);
+ Status = PdoPnpControl(DeviceObject, Irp);
}
return Status;
@@ -125,9 +125,15 @@
DPRINT("Called\n");
- Status = IoCreateDevice(DriverObject, sizeof(FDO_DEVICE_EXTENSION),
- NULL, FILE_DEVICE_ACPI, FILE_DEVICE_SECURE_OPEN, TRUE, &Fdo);
- if (!NT_SUCCESS(Status)) {
+ Status = IoCreateDevice(DriverObject,
+ sizeof(FDO_DEVICE_EXTENSION),
+ NULL,
+ FILE_DEVICE_ACPI,
+ FILE_DEVICE_SECURE_OPEN,
+ TRUE,
+ &Fdo);
+ if (!NT_SUCCESS(Status))
+ {
DPRINT("IoCreateDevice() failed with status 0x%X\n", Status);
return Status;
}
@@ -135,6 +141,7 @@
DeviceExtension = (PFDO_DEVICE_EXTENSION)Fdo->DeviceExtension;
DeviceExtension->Pdo = PhysicalDeviceObject;
+ DeviceExtension->Common.IsFDO = TRUE;
DeviceExtension->Common.Ldo =
IoAttachDeviceToDeviceStack(Fdo, PhysicalDeviceObject);
reactos/drivers/bus/acpi/ospm
diff -u -r1.1 -r1.1.36.1
--- bn.c 5 May 2001 19:15:44 -0000 1.1
+++ bn.c 30 Dec 2004 04:36:10 -0000 1.1.36.1
@@ -1,7 +1,7 @@
/*****************************************************************************
*
* Module Name: bn.c
- * $Revision: 1.1 $
+ * $Revision: 1.1.36.1 $
*
*****************************************************************************/
@@ -360,6 +360,9 @@
*/
MEMCPY(criteria.hid, BN_HID_LID_SWITCH, sizeof(BN_HID_LID_SWITCH));
status = bm_register_driver(&criteria, &driver);
+
+ if (status == AE_NOT_FOUND)
+ status = AE_OK;
return_ACPI_STATUS(status);
}
reactos/drivers/bus/acpi/ospm
diff -u -r1.3 -r1.3.28.1
--- fdo.c 14 Nov 2003 17:13:23 -0000 1.3
+++ fdo.c 30 Dec 2004 04:36:10 -0000 1.3.28.1
@@ -1,4 +1,4 @@
-/* $Id: fdo.c,v 1.3 2003/11/14 17:13:23 weiden Exp $
+/* $Id: fdo.c,v 1.3.28.1 2004/12/30 04:36:10 hyperion Exp $
*
* PROJECT: ReactOS ACPI bus driver
* FILE: acpi/ospm/fdo.c
@@ -14,11 +14,106 @@
#define NDEBUG
#include <debug.h>
+FADT_DESCRIPTOR_REV2 acpi_fadt;
+
/*** PRIVATE *****************************************************************/
-FADT_DESCRIPTOR_REV2 acpi_fadt;
-NTSTATUS
+BOOLEAN
+AcpiCreateUnicodeString(
+ PUNICODE_STRING Destination,
+ PWSTR Source,
+ POOL_TYPE PoolType)
+{
+ ULONG Length;
+
+ if (!Source)
+ {
+ RtlInitUnicodeString(Destination, NULL);
+ return TRUE;
+ }
+
+ Length = (wcslen(Source) + 1) * sizeof(WCHAR);
+
+ Destination->Buffer = ExAllocatePool(PoolType, Length);
+ if (Destination->Buffer == NULL)
+ {
+ return FALSE;
+ }
+
+ RtlCopyMemory(Destination->Buffer, Source, Length);
+
+ Destination->MaximumLength = Length;
+
+ Destination->Length = Length - sizeof(WCHAR);
+
+ return TRUE;
+}
+
+BOOLEAN
+AcpiCreateDeviceIDString(PUNICODE_STRING DeviceID,
+ BM_NODE *Node)
+{
+ WCHAR Buffer[256];
+
+ swprintf(Buffer,
+ L"ACPI\\%S",
+ Node->device.id.hid);
+
+ if (!AcpiCreateUnicodeString(DeviceID, Buffer, PagedPool))
+ {
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+
+BOOLEAN
+AcpiCreateHardwareIDsString(PUNICODE_STRING HardwareIDs,
+ BM_NODE *Node)
+{
+ WCHAR Buffer[256];
+ ULONG Length;
+ ULONG Index;
+
+ Index = 0;
+ Index += swprintf(&Buffer[Index],
+ L"ACPI\\%S",
+ Node->device.id.hid);
+ Index++;
+
+ Index += swprintf(&Buffer[Index],
+ L"*%S",
+ Node->device.id.hid);
+ Index++;
+ Buffer[Index] = UNICODE_NULL;
+
+ Length = (Index + 1) * sizeof(WCHAR);
+ HardwareIDs->Buffer = ExAllocatePool(PagedPool, Length);
+ if (HardwareIDs->Buffer == NULL)
+ {
+ return FALSE;
+ }
+
+ HardwareIDs->Length = Length - sizeof(WCHAR);
+ HardwareIDs->MaximumLength = Length;
+ RtlCopyMemory(HardwareIDs->Buffer, Buffer, Length);
+
+ return TRUE;
+}
+
+
+BOOLEAN
+AcpiCreateInstanceIDString(PUNICODE_STRING InstanceID,
+ BM_NODE *Node)
+{
+ /* FIXME: Create unique instnce id. */
+ return AcpiCreateUnicodeString(InstanceID, L"0000", PagedPool);
+}
+
+
+static NTSTATUS
FdoQueryBusRelations(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp,
@@ -50,7 +145,8 @@
i = 0;
CurrentEntry = DeviceExtension->DeviceListHead.Flink;
- while (CurrentEntry != &DeviceExtension->DeviceListHead) {
+ while (CurrentEntry != &DeviceExtension->DeviceListHead)
+ {
Device = CONTAINING_RECORD(CurrentEntry, ACPI_DEVICE, DeviceListEntry);
/* FIXME: For ACPI namespace devices on the motherboard create filter DOs
@@ -59,63 +155,75 @@
/* FIXME: For other devices in ACPI namespace, but not on motherboard,
create PDOs */
- if (!Device->Pdo) {
+ if (!Device->Pdo)
+ {
/* Create a physical device object for the
device as it does not already have one */
- Status = IoCreateDevice(DeviceObject->DriverObject, 0,
- NULL, FILE_DEVICE_CONTROLLER, 0, FALSE, &Device->Pdo);
- if (!NT_SUCCESS(Status)) {
+ Status = IoCreateDevice(DeviceObject->DriverObject,
+ sizeof(PDO_DEVICE_EXTENSION),
+ NULL,
+ FILE_DEVICE_CONTROLLER,
+ FILE_AUTOGENERATED_DEVICE_NAME,
+ FALSE,
+ &Device->Pdo);
+ if (!NT_SUCCESS(Status))
+ {
DPRINT("IoCreateDevice() failed with status 0x%X\n", Status);
/* FIXME: Cleanup all new PDOs created in this call */
ExFreePool(Relations);
return Status;
}
- PdoDeviceExtension = ExAllocatePool(
- NonPagedPool,
- sizeof(PDO_DEVICE_EXTENSION));
- if (!PdoDeviceExtension) {
- /* FIXME: Cleanup all new PDOs created in this call */
- ExFreePool(Relations);
- }
-
- RtlZeroMemory(
- PdoDeviceExtension,
- sizeof(PDO_DEVICE_EXTENSION));
+ PdoDeviceExtension = (PPDO_DEVICE_EXTENSION)Device->Pdo->DeviceExtension;
- Device->Pdo->DeviceExtension = PdoDeviceExtension;
+ RtlZeroMemory(PdoDeviceExtension, sizeof(PDO_DEVICE_EXTENSION));
Device->Pdo->Flags |= DO_BUS_ENUMERATED_DEVICE;
+ Device->Pdo->Flags &= ~DO_DEVICE_INITIALIZING;
+
+ //Device->Pdo->Flags |= DO_POWER_PAGABLE;
+
PdoDeviceExtension->Common.DeviceObject = Device->Pdo;
PdoDeviceExtension->Common.DevicePowerState = PowerDeviceD0;
- PdoDeviceExtension->Common.Ldo = IoAttachDeviceToDeviceStack(
- DeviceObject,
- Device->Pdo);
+// PdoDeviceExtension->Common.Ldo = IoAttachDeviceToDeviceStack(DeviceObject,
+// Device->Pdo);
+ RtlInitUnicodeString(&PdoDeviceExtension->DeviceID, NULL);
+ RtlInitUnicodeString(&PdoDeviceExtension->InstanceID, NULL);
RtlInitUnicodeString(&PdoDeviceExtension->HardwareIDs, NULL);
- RtlInitUnicodeString(&PdoDeviceExtension->CompatibleIDs, NULL);
AcpiStatus = bm_get_node(Device->BmHandle, 0, &Node);
- if (ACPI_SUCCESS(AcpiStatus)) {
- if (Node->device.flags & BM_FLAGS_HAS_A_HID) {
- RtlInitAnsiString(&AnsiString, Node->device.id.hid);
- Status = RtlAnsiStringToUnicodeString(
- &PdoDeviceExtension->HardwareIDs,
- &AnsiString,
- TRUE);
- assert(NT_SUCCESS(Status));
+ if (ACPI_SUCCESS(AcpiStatus))
+ {
+ /* Add Device ID string */
+ if (!AcpiCreateDeviceIDString(&PdoDeviceExtension->DeviceID,
+ Node))
+ {
+ ASSERT(FALSE);
+// ErrorStatus = STATUS_INSUFFICIENT_RESOURCES;
+// ErrorOccurred = TRUE;
+// break;
}
- if (Node->device.flags & BM_FLAGS_HAS_A_CID) {
- RtlInitAnsiString(&AnsiString, Node->device.id.cid);
- Status = RtlAnsiStringToUnicodeString(
- &PdoDeviceExtension->CompatibleIDs,
- &AnsiString,
- TRUE);
- assert(NT_SUCCESS(Status));
+ if (!AcpiCreateInstanceIDString(&PdoDeviceExtension->InstanceID,
+ Node))
+ {
+ ASSERT(FALSE);
+// ErrorStatus = STATUS_INSUFFICIENT_RESOURCES;
+// ErrorOccurred = TRUE;
+// break;
+ }
+
+ if (!AcpiCreateHardwareIDsString(&PdoDeviceExtension->HardwareIDs,
+ Node))
+ {
+ ASSERT(FALSE);
+// ErrorStatus = STATUS_INSUFFICIENT_RESOURCES;
+// ErrorOccurred = TRUE;
+// break;
}
}
}
@@ -137,26 +245,28 @@
}
-VOID ACPIPrintInfo(
- PFDO_DEVICE_EXTENSION DeviceExtension)
+static VOID
+ACPIPrintInfo(
+ PFDO_DEVICE_EXTENSION DeviceExtension)
{
DbgPrint("ACPI: System firmware supports:\n");
- /*
- * Print out basic system information
- */
- DbgPrint("+------------------------------------------------------------\n");
- DbgPrint("| Sx states: %cS0 %cS1 %cS2 %cS3 %cS4 %cS5\n",
- (DeviceExtension->SystemStates[0]?'+':'-'),
- (DeviceExtension->SystemStates[1]?'+':'-'),
- (DeviceExtension->SystemStates[2]?'+':'-'),
- (DeviceExtension->SystemStates[3]?'+':'-'),
- (DeviceExtension->SystemStates[4]?'+':'-'),
- (DeviceExtension->SystemStates[5]?'+':'-'));
- DbgPrint("+------------------------------------------------------------\n");
+ /*
+ * Print out basic system information
+ */
+ DbgPrint("+------------------------------------------------------------\n");
+ DbgPrint("| Sx states: %cS0 %cS1 %cS2 %cS3 %cS4 %cS5\n",
+ (DeviceExtension->SystemStates[0]?'+':'-'),
+ (DeviceExtension->SystemStates[1]?'+':'-'),
+ (DeviceExtension->SystemStates[2]?'+':'-'),
+ (DeviceExtension->SystemStates[3]?'+':'-'),
+ (DeviceExtension->SystemStates[4]?'+':'-'),
+ (DeviceExtension->SystemStates[5]?'+':'-'));
+ DbgPrint("+------------------------------------------------------------\n");
}
-NTSTATUS
+
+static NTSTATUS
ACPIInitializeInternalDriver(
PFDO_DEVICE_EXTENSION DeviceExtension,
ACPI_DRIVER_FUNCTION Initialize,
@@ -191,7 +301,7 @@
}
-NTSTATUS
+static NTSTATUS
ACPIInitializeInternalDrivers(
PFDO_DEVICE_EXTENSION DeviceExtension)
{
@@ -204,7 +314,7 @@
}
-NTSTATUS
+static NTSTATUS
FdoStartDevice(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
@@ -221,7 +331,7 @@
DeviceExtension = (PFDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
- assert(DeviceExtension->State == dsStopped);
+ ASSERT(DeviceExtension->State == dsStopped);
AcpiStatus = acpi_initialize_subsystem();
if (!ACPI_SUCCESS(AcpiStatus)) {
@@ -233,30 +343,30 @@
if (!ACPI_SUCCESS(AcpiStatus)) {
DPRINT("acpi_find_root_pointer() failed with status 0x%X\n", AcpiStatus);
return STATUS_UNSUCCESSFUL;
- }
+ }
/* From this point on, on error we must call acpi_terminate() */
AcpiStatus = acpi_load_tables(rsdp);
- if (!ACPI_SUCCESS(AcpiStatus)) {
- DPRINT("acpi_load_tables() failed with status 0x%X\n", AcpiStatus);
- acpi_terminate();
- return STATUS_UNSUCCESSFUL;
- }
+ if (!ACPI_SUCCESS(AcpiStatus)) {
+ DPRINT("acpi_load_tables() failed with status 0x%X\n", AcpiStatus);
+ acpi_terminate();
+ return STATUS_UNSUCCESSFUL;
+ }
- Buffer.length = sizeof(SysInfo);
- Buffer.pointer = &SysInfo;
+ Buffer.length = sizeof(SysInfo);
+ Buffer.pointer = &SysInfo;
AcpiStatus = acpi_get_system_info(&Buffer);
- if (!ACPI_SUCCESS(AcpiStatus)) {
- DPRINT("acpi_get_system_info() failed with status 0x%X\n", AcpiStatus);
- acpi_terminate();
- return STATUS_UNSUCCESSFUL;
- }
+ if (!ACPI_SUCCESS(AcpiStatus)) {
+ DPRINT("acpi_get_system_info() failed with status 0x%X\n", AcpiStatus);
+ acpi_terminate();
+ return STATUS_UNSUCCESSFUL;
+ }
- DPRINT("ACPI CA Core Subsystem version 0x%X\n", SysInfo.acpi_ca_version);
+ DPRINT("ACPI CA Core Subsystem version 0x%X\n", SysInfo.acpi_ca_version);
- assert(SysInfo.num_table_types > ACPI_TABLE_FADT);
+ ASSERT(SysInfo.num_table_types > ACPI_TABLE_FADT);
RtlMoveMemory(&acpi_fadt,
&SysInfo.table_info[ACPI_TABLE_FADT],
@@ -272,21 +382,21 @@
DPRINT("ACPI CA Core Subsystem enabled\n");
/*
- * Sx States:
- * ----------
- * Figure out which Sx states are supported
- */
- for (i=0; i<=ACPI_S_STATES_MAX; i++) {
- AcpiStatus = acpi_hw_obtain_sleep_type_register_data(
+ * Sx States:
+ * ----------
+ * Figure out which Sx states are supported
+ */
+ for (i=0; i<=ACPI_S_STATES_MAX; i++) {
+ AcpiStatus = acpi_hw_obtain_sleep_type_register_data(
i,
&TypeA,
&TypeB);
DPRINT("acpi_hw_obtain_sleep_type_register_data (%d) status 0x%X\n",
i, AcpiStatus);
if (ACPI_SUCCESS(AcpiStatus)) {
- DeviceExtension->SystemStates[i] = TRUE;
- }
- }
+ DeviceExtension->SystemStates[i] = TRUE;
+ }
+ }
ACPIPrintInfo(DeviceExtension);
@@ -302,19 +412,17 @@
KeInitializeSpinLock(&DeviceExtension->DeviceListLock);
DeviceExtension->DeviceListCount = 0;
- ACPIEnumerateNamespace(DeviceExtension);
-
- //ACPIEnumerateRootBusses(DeviceExtension);
+ ACPIEnumerateDevices(DeviceExtension);
ACPIInitializeInternalDrivers(DeviceExtension);
DeviceExtension->State = dsStarted;
- return STATUS_SUCCESS;
+ return STATUS_SUCCESS;
}
-NTSTATUS
+static NTSTATUS
FdoSetPower(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp,
reactos/drivers/bus/acpi/ospm
diff -u -r1.8 -r1.8.18.1
--- osl.c 15 May 2004 22:45:50 -0000 1.8
+++ osl.c 30 Dec 2004 04:36:10 -0000 1.8.18.1
@@ -228,11 +228,11 @@
DIrql,
DIrql,
LevelSensitive, /* FIXME: LevelSensitive or Latched? */
- FALSE,
+ TRUE,
Affinity,
FALSE);
if (!NT_SUCCESS(Status)) {
- DPRINT("Could not connect to interrupt %d\n", Vector);
+ DPRINT("Could not connect to interrupt %d\n", Vector);
return AE_ERROR;
}
reactos/drivers/bus/acpi/ospm
diff -u -r1.2 -r1.2.28.1
--- pdo.c 14 Nov 2003 17:13:23 -0000 1.2
+++ pdo.c 30 Dec 2004 04:36:10 -0000 1.2.28.1
@@ -1,4 +1,4 @@
-/* $Id: pdo.c,v 1.2 2003/11/14 17:13:23 weiden Exp $
+/* $Id: pdo.c,v 1.2.28.1 2004/12/30 04:36:10 hyperion Exp $
*
* PROJECT: ReactOS ACPI bus driver
* FILE: acpi/ospm/pdo.c
@@ -16,30 +16,90 @@
/*** PRIVATE *****************************************************************/
-NTSTATUS
+static NTSTATUS
+AcpiDuplicateUnicodeString(
+ PUNICODE_STRING Destination,
+ PUNICODE_STRING Source,
+ POOL_TYPE PoolType)
+{
+ if (Source == NULL)
+ {
+ RtlInitUnicodeString(Destination, NULL);
+ return STATUS_SUCCESS;
+ }
+
+ Destination->Buffer = ExAllocatePool(PoolType, Source->MaximumLength);
+ if (Destination->Buffer == NULL)
+ {
+ return STATUS_INSUFFICIENT_RESOURCES;
+ }
+
+ Destination->MaximumLength = Source->MaximumLength;
+ Destination->Length = Source->Length;
+ RtlCopyMemory(Destination->Buffer, Source->Buffer, Source->MaximumLength);
+
+ return STATUS_SUCCESS;
+}
+
+
+static NTSTATUS
PdoQueryId(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp,
PIO_STACK_LOCATION IrpSp)
{
PPDO_DEVICE_EXTENSION DeviceExtension;
+ UNICODE_STRING String;
NTSTATUS Status;
DPRINT("Called\n");
DeviceExtension = (PPDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
+ RtlInitUnicodeString(&String, NULL);
+
// Irp->IoStatus.Information = 0;
- switch (IrpSp->Parameters.QueryId.IdType) {
+ switch (IrpSp->Parameters.QueryId.IdType)
+ {
case BusQueryDeviceID:
+ DPRINT("BusQueryDeviceID\n");
+ Status = AcpiDuplicateUnicodeString(&String,
+ &DeviceExtension->DeviceID,
+ PagedPool);
+ DPRINT("DeviceID: %S\n", String.Buffer);
+ Irp->IoStatus.Information = (ULONG_PTR)String.Buffer;
break;
case BusQueryHardwareIDs:
+ DPRINT("BusQueryHardwareIDs\n");
+ Status = AcpiDuplicateUnicodeString(&String,
+ &DeviceExtension->HardwareIDs,
+ PagedPool);
+ Irp->IoStatus.Information = (ULONG_PTR)String.Buffer;
+ break;
+
case BusQueryCompatibleIDs:
+ DPRINT("BusQueryCompatibleIDs\n");
+ Status = STATUS_NOT_IMPLEMENTED;
+ break;
+
case BusQueryInstanceID:
+ DPRINT("BusQueryInstanceID\n");
+ Status = AcpiDuplicateUnicodeString(&String,
+ &DeviceExtension->InstanceID,
+ PagedPool);
+ DPRINT("InstanceID: %S\n", String.Buffer);
+ Irp->IoStatus.Information = (ULONG_PTR)String.Buffer;
+ break;
+
case BusQueryDeviceSerialNumber:
+ DPRINT("BusQueryDeviceSerialNumber\n");
+ Status = STATUS_NOT_IMPLEMENTED;
+ break;
+
default:
+ DPRINT("Unknown id type: %lx\n", IrpSp->Parameters.QueryId.IdType);
Status = STATUS_NOT_IMPLEMENTED;
}
@@ -47,7 +107,7 @@
}
-NTSTATUS
+static NTSTATUS
PdoSetPower(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp,
@@ -126,6 +186,9 @@
break;
case IRP_MN_QUERY_ID:
+ Status = PdoQueryId(DeviceObject,
+ Irp,
+ IrpSp);
break;
case IRP_MN_QUERY_PNP_DEVICE_STATE:
reactos/drivers/bus/acpi/ospm/include
diff -u -r1.7 -r1.7.34.1
--- acpisys.h 10 Nov 2002 19:24:01 -0000 1.7
+++ acpisys.h 30 Dec 2004 04:36:10 -0000 1.7.34.1
@@ -11,7 +11,8 @@
typedef ACPI_STATUS (*ACPI_DRIVER_FUNCTION)(VOID);
-typedef enum {
+typedef enum
+{
dsStopped,
dsStarted,
dsPaused,
@@ -34,17 +35,21 @@
PDEVICE_OBJECT Ldo;
} COMMON_DEVICE_EXTENSION, *PCOMMON_DEVICE_EXTENSION;
+
/* Physical Device Object device extension for a child device */
typedef struct _PDO_DEVICE_EXTENSION
{
// Common device data
COMMON_DEVICE_EXTENSION Common;
+ // Device ID
+ UNICODE_STRING DeviceID;
+ // Instance ID
+ UNICODE_STRING InstanceID;
// Hardware IDs
UNICODE_STRING HardwareIDs;
- // Compatible IDs
- UNICODE_STRING CompatibleIDs;
} PDO_DEVICE_EXTENSION, *PPDO_DEVICE_EXTENSION;
+
typedef struct _FDO_DEVICE_EXTENSION
{
// Common device data
@@ -82,11 +87,7 @@
/* acpienum.c */
NTSTATUS
-ACPIEnumerateRootBusses(
- PFDO_DEVICE_EXTENSION DeviceExtension);
-
-NTSTATUS
-ACPIEnumerateNamespace(
+ACPIEnumerateDevices(
PFDO_DEVICE_EXTENSION DeviceExtension);
reactos/drivers/dd/blue
diff -u -r1.48 -r1.48.8.1
--- blue.c 22 Jul 2004 20:40:17 -0000 1.48
+++ blue.c 30 Dec 2004 04:36:10 -0000 1.48.8.1
@@ -1,4 +1,4 @@
-/* $Id: blue.c,v 1.48 2004/07/22 20:40:17 navaraf Exp $
+/* $Id: blue.c,v 1.48.8.1 2004/12/30 04:36:10 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -166,7 +166,7 @@
PDEVICE_EXTENSION DeviceExtension = DeviceObject->DeviceExtension;
NTSTATUS Status;
char *pch = Irp->UserBuffer;
- char *vidmem;
+ PBYTE vidmem;
int i, j, offset;
int cursorx, cursory;
int rows, columns;
@@ -437,7 +437,7 @@
case IOCTL_CONSOLE_FILL_OUTPUT_ATTRIBUTE:
{
POUTPUT_ATTRIBUTE Buf = (POUTPUT_ATTRIBUTE)Irp->AssociatedIrp.SystemBuffer;
- char *vidmem;
+ PBYTE vidmem;
int offset;
DWORD dwCount;
@@ -461,7 +461,7 @@
{
POUTPUT_ATTRIBUTE Buf = (POUTPUT_ATTRIBUTE)Irp->AssociatedIrp.SystemBuffer;
PWORD pAttr = (PWORD)MmGetSystemAddressForMdl(Irp->MdlAddress);
- char *vidmem;
+ PBYTE vidmem;
int offset;
DWORD dwCount;
@@ -485,7 +485,7 @@
{
COORD *pCoord = (COORD *)MmGetSystemAddressForMdl(Irp->MdlAddress);
CHAR *pAttr = (CHAR *)(pCoord + 1);
- char *vidmem;
+ PBYTE vidmem;
int offset;
DWORD dwCount;
@@ -511,7 +511,7 @@
case IOCTL_CONSOLE_FILL_OUTPUT_CHARACTER:
{
POUTPUT_CHARACTER Buf = (POUTPUT_CHARACTER)Irp->AssociatedIrp.SystemBuffer;
- char *vidmem;
+ PBYTE vidmem;
int offset;
DWORD dwCount;
@@ -537,7 +537,7 @@
{
POUTPUT_CHARACTER Buf = (POUTPUT_CHARACTER)Irp->AssociatedIrp.SystemBuffer;
LPSTR pChar = (LPSTR)MmGetSystemAddressForMdl(Irp->MdlAddress);
- char *vidmem;
+ PBYTE vidmem;
int offset;
DWORD dwCount;
@@ -561,7 +561,7 @@
{
COORD *pCoord;
LPSTR pChar;
- char *vidmem;
+ PBYTE vidmem;
int offset;
DWORD dwCount;
@@ -584,11 +584,11 @@
case IOCTL_CONSOLE_DRAW:
{
PCONSOLE_DRAW ConsoleDraw;
- char *Src, *Dest;
+ PBYTE Src, Dest;
UINT SrcDelta, DestDelta, i, Offset;
ConsoleDraw = (PCONSOLE_DRAW) MmGetSystemAddressForMdl(Irp->MdlAddress);
- Src = (char *) (ConsoleDraw + 1);
+ Src = (PBYTE) (ConsoleDraw + 1);
SrcDelta = ConsoleDraw->SizeX * 2;
Dest = DeviceExtension->VideoMemory +
(ConsoleDraw->Y * DeviceExtension->Columns + ConsoleDraw->X) * 2;
reactos/drivers/dd/null
diff -u -r1.19.10.3 -r1.19.10.4
--- makefile 13 Dec 2004 16:17:58 -0000 1.19.10.3
+++ makefile 30 Dec 2004 04:36:10 -0000 1.19.10.4
@@ -1,4 +1,4 @@
-# $Id: makefile,v 1.19.10.3 2004/12/13 16:17:58 hyperion Exp $
+# $Id: makefile,v 1.19.10.4 2004/12/30 04:36:10 hyperion Exp $
PATH_TO_TOP = ../../..
reactos/drivers/fs/cdfs
diff -u -r1.7.28.2 -r1.7.28.3
--- common.c 13 Dec 2004 16:17:58 -0000 1.7.28.2
+++ common.c 30 Dec 2004 04:36:11 -0000 1.7.28.3
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: common.c,v 1.7.28.2 2004/12/13 16:17:58 hyperion Exp $
+/* $Id: common.c,v 1.7.28.3 2004/12/30 04:36:11 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
reactos/drivers/fs/cdfs
diff -u -r1.17 -r1.17.2.1
--- dirctl.c 6 Nov 2004 13:41:58 -0000 1.17
+++ dirctl.c 30 Dec 2004 04:36:11 -0000 1.17.2.1
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: dirctl.c,v 1.17 2004/11/06 13:41:58 ekohl Exp $
+/* $Id: dirctl.c,v 1.17.2.1 2004/12/30 04:36:11 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -570,14 +570,14 @@
PCCB Ccb;
FCB TempFcb;
BOOLEAN First = FALSE;
- PEXTENDED_IO_STACK_LOCATION Stack;
+ PIO_STACK_LOCATION Stack;
PFILE_OBJECT FileObject;
NTSTATUS Status = STATUS_SUCCESS;
DPRINT("CdfsQueryDirectory() called\n");
DeviceExtension = DeviceObject->DeviceExtension;
- Stack = (PEXTENDED_IO_STACK_LOCATION) IoGetCurrentIrpStackLocation(Irp);
+ Stack = IoGetCurrentIrpStackLocation(Irp);
FileObject = Stack->FileObject;
Ccb = (PCCB)FileObject->FsContext2;
reactos/drivers/fs/cdfs
diff -u -r1.19 -r1.19.20.1
--- fsctl.c 16 Mar 2004 08:30:28 -0000 1.19
+++ fsctl.c 30 Dec 2004 04:36:11 -0000 1.19.20.1
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: fsctl.c,v 1.19 2004/03/16 08:30:28 arty Exp $
+/* $Id: fsctl.c,v 1.19.20.1 2004/12/30 04:36:11 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -52,7 +52,7 @@
{
PPVD Pvd;
ULONG i;
- PCHAR pc;
+ PUCHAR pc;
PWCHAR pw;
union
@@ -153,17 +153,17 @@
DPRINT("EscapeSequences: '%.32s'\n", Svd->EscapeSequences);
- if (strncmp(Svd->EscapeSequences, "%/@", 3) == 0)
+ if (strncmp((PCHAR)Svd->EscapeSequences, "%/@", 3) == 0)
{
DPRINT("Joliet extension found (UCS-2 Level 1)\n");
JolietLevel = 1;
}
- else if (strncmp(Svd->EscapeSequences, "%/C", 3) == 0)
+ else if (strncmp((PCHAR)Svd->EscapeSequences, "%/C", 3) == 0)
{
DPRINT("Joliet extension found (UCS-2 Level 2)\n");
JolietLevel = 2;
}
- else if (strncmp(Svd->EscapeSequences, "%/E", 3) == 0)
+ else if (strncmp((PCHAR)Svd->EscapeSequences, "%/E", 3) == 0)
{
DPRINT("Joliet extension found (UCS-2 Level 3)\n");
JolietLevel = 3;
reactos/drivers/fs/fs_rec
diff -u -r1.7 -r1.7.34.1
--- ntfs.c 16 Jan 2003 11:58:15 -0000 1.7
+++ ntfs.c 30 Dec 2004 04:36:11 -0000 1.7.34.1
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: ntfs.c,v 1.7 2003/01/16 11:58:15 ekohl Exp $
+/* $Id: ntfs.c,v 1.7.34.1 2004/12/30 04:36:11 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -79,7 +79,7 @@
}
DPRINT("NTFS-identifier: [%.8s]\n", &Buffer[3]);
- if (strncmp(&Buffer[3], "NTFS ", 8) == 0)
+ if (RtlCompareMemory(&Buffer[3], "NTFS ", 8) == 8)
{
Status = STATUS_SUCCESS;
}
reactos/drivers/fs/ms
diff -u -r1.6 -r1.6.2.1
--- create.c 1 Nov 2004 22:54:23 -0000 1.6
+++ create.c 30 Dec 2004 04:36:11 -0000 1.6.2.1
@@ -1,4 +1,4 @@
-/* $Id: create.c,v 1.6 2004/11/01 22:54:23 ion Exp $
+/* $Id: create.c,v 1.6.2.1 2004/12/30 04:36:11 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -122,7 +122,7 @@
IoStack = IoGetCurrentIrpStackLocation(Irp);
DeviceExtension = DeviceObject->DeviceExtension;
FileObject = IoStack->FileObject;
- Buffer = (PMAILSLOT_CREATE_PARAMETERS)Irp->Tail.Overlay.AuxiliaryBuffer;
+ Buffer = IoStack->Parameters.CreateMailslot.Parameters;
DPRINT("Mailslot name: %wZ\n", &FileObject->FileName);
reactos/drivers/fs/ms
diff -u -r1.4 -r1.4.34.1
--- fsctrl.c 7 Aug 2003 11:47:32 -0000 1.4
+++ fsctrl.c 30 Dec 2004 04:36:11 -0000 1.4.34.1
@@ -1,4 +1,4 @@
-/* $Id: fsctrl.c,v 1.4 2003/08/07 11:47:32 silverblade Exp $
+/* $Id: fsctrl.c,v 1.4.34.1 2004/12/30 04:36:11 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -22,7 +22,7 @@
MsfsFileSystemControl(PDEVICE_OBJECT DeviceObject,
PIRP Irp)
{
- PEXTENDED_IO_STACK_LOCATION IoStack;
+ PIO_STACK_LOCATION IoStack;
PFILE_OBJECT FileObject;
PMSFS_MAILSLOT Mailslot;
PMSFS_FCB Fcb;
@@ -30,7 +30,7 @@
DPRINT1("MsfsFileSystemControl(DeviceObject %p Irp %p)\n", DeviceObject, Irp);
- IoStack = (PEXTENDED_IO_STACK_LOCATION) IoGetCurrentIrpStackLocation(Irp);
+ IoStack = IoGetCurrentIrpStackLocation(Irp);
FileObject = IoStack->FileObject;
Fcb = FileObject->FsContext;
Mailslot = Fcb->Mailslot;
reactos/drivers/fs/np
diff -u -r1.25 -r1.25.2.1
--- create.c 1 Nov 2004 22:54:24 -0000 1.25
+++ create.c 30 Dec 2004 04:36:11 -0000 1.25.2.1
@@ -1,4 +1,4 @@
-/* $Id: create.c,v 1.25 2004/11/01 22:54:24 ion Exp $
+/* $Id: create.c,v 1.25.2.1 2004/12/30 04:36:11 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -67,128 +67,125 @@
NTSTATUS STDCALL
-NpfsCreate(
- PDEVICE_OBJECT DeviceObject,
- PIRP Irp)
+NpfsCreate(PDEVICE_OBJECT DeviceObject,
+ PIRP Irp)
{
- PIO_STACK_LOCATION IoStack;
- PFILE_OBJECT FileObject;
- PNPFS_PIPE Pipe;
- PNPFS_FCB ClientFcb;
- PNPFS_FCB ServerFcb;
- PNPFS_DEVICE_EXTENSION DeviceExt;
- ULONG Disposition;
-
- DPRINT("NpfsCreate(DeviceObject %p Irp %p)\n", DeviceObject, Irp);
-
- DeviceExt = (PNPFS_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
- IoStack = IoGetCurrentIrpStackLocation(Irp);
- FileObject = IoStack->FileObject;
- Disposition = ((IoStack->Parameters.Create.Options >> 24) & 0xff);
- DPRINT("FileObject %p\n", FileObject);
- DPRINT("FileName %wZ\n", &FileObject->FileName);
-
- Irp->IoStatus.Information = 0;
+ PIO_STACK_LOCATION IoStack;
+ PFILE_OBJECT FileObject;
+ PNPFS_PIPE Pipe;
+ PNPFS_FCB ClientFcb;
+ PNPFS_FCB ServerFcb;
+ PNPFS_DEVICE_EXTENSION DeviceExt;
+ ULONG Disposition;
- /*
- * Step 1. Find the pipe we're trying to open.
- */
+ DPRINT("NpfsCreate(DeviceObject %p Irp %p)\n", DeviceObject, Irp);
- KeLockMutex(&DeviceExt->PipeListLock);
- Pipe = NpfsFindPipe(DeviceExt,
- &FileObject->FileName);
- if (Pipe == NULL)
- {
+ DeviceExt = (PNPFS_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
+ IoStack = IoGetCurrentIrpStackLocation(Irp);
+ FileObject = IoStack->FileObject;
+ Disposition = ((IoStack->Parameters.Create.Options >> 24) & 0xff);
+ DPRINT("FileObject %p\n", FileObject);
+ DPRINT("FileName %wZ\n", &FileObject->FileName);
+
+ Irp->IoStatus.Information = 0;
+
+ /*
+ * Step 1. Find the pipe we're trying to open.
+ */
+ KeLockMutex(&DeviceExt->PipeListLock);
+ Pipe = NpfsFindPipe(DeviceExt,
+ &FileObject->FileName);
+ if (Pipe == NULL)
+ {
/* Not found, bail out with error. */
DPRINT("No pipe found!\n");
KeUnlockMutex(&DeviceExt->PipeListLock);
Irp->IoStatus.Status = STATUS_OBJECT_NAME_NOT_FOUND;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return STATUS_OBJECT_NAME_NOT_FOUND;
- }
+ }
- KeUnlockMutex(&DeviceExt->PipeListLock);
+ KeUnlockMutex(&DeviceExt->PipeListLock);
- /*
- * Step 2. Search for listening server FCB.
- */
+ /*
+ * Step 2. Search for listening server FCB.
+ */
+
+ /*
+ * Acquire the lock for FCB lists. From now on no modifications to the
+ * FCB lists are allowed, because it can cause various misconsistencies.
+ */
+ KeLockMutex(&Pipe->FcbListLock);
- /*
- * Acquire the lock for FCB lists. From now on no modifications to the
- * FCB lists are allowed, because it can cause various misconsistencies.
- */
- KeLockMutex(&Pipe->FcbListLock);
-
- ServerFcb = NpfsFindListeningServerInstance(Pipe);
- if (ServerFcb == NULL)
- {
+ ServerFcb = NpfsFindListeningServerInstance(Pipe);
+ if (ServerFcb == NULL)
+ {
/* Not found, bail out with error for FILE_OPEN requests. */
DPRINT("No server fcb found!\n");
if (Disposition == FILE_OPEN)
- {
- KeUnlockMutex(&Pipe->FcbListLock);
- Irp->IoStatus.Status = STATUS_PIPE_BUSY;
- IoCompleteRequest(Irp, IO_NO_INCREMENT);
- return STATUS_PIPE_BUSY;
- }
- }
+ {
+ KeUnlockMutex(&Pipe->FcbListLock);
+ Irp->IoStatus.Status = STATUS_PIPE_BUSY;
+ IoCompleteRequest(Irp, IO_NO_INCREMENT);
+ return STATUS_PIPE_BUSY;
+ }
+ }
- /*
- * Step 3. Create the client FCB.
- */
-
- ClientFcb = ExAllocatePool(NonPagedPool, sizeof(NPFS_FCB));
- if (ClientFcb == NULL)
- {
+ /*
+ * Step 3. Create the client FCB.
+ */
+ ClientFcb = ExAllocatePool(NonPagedPool, sizeof(NPFS_FCB));
+ if (ClientFcb == NULL)
+ {
DPRINT("No memory!\n");
KeUnlockMutex(&Pipe->FcbListLock);
Irp->IoStatus.Status = STATUS_NO_MEMORY;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return STATUS_NO_MEMORY;
- }
-
- ClientFcb->Pipe = Pipe;
- ClientFcb->PipeEnd = FILE_PIPE_CLIENT_END;
- ClientFcb->OtherSide = NULL;
- ClientFcb->PipeState = FILE_PIPE_DISCONNECTED_STATE;
-
- /* Initialize data list. */
- if (Pipe->InboundQuota)
- {
+ }
+
+ ClientFcb->Pipe = Pipe;
+ ClientFcb->PipeEnd = FILE_PIPE_CLIENT_END;
+ ClientFcb->OtherSide = NULL;
+ ClientFcb->PipeState = FILE_PIPE_DISCONNECTED_STATE;
+
+ /* Initialize data list. */
+ if (Pipe->InboundQuota)
+ {
ClientFcb->Data = ExAllocatePool(NonPagedPool, Pipe->InboundQuota);
if (ClientFcb->Data == NULL)
- {
- DPRINT("No memory!\n");
- ExFreePool(ClientFcb);
- KeUnlockMutex(&Pipe->FcbListLock);
- Irp->IoStatus.Status = STATUS_NO_MEMORY;
- IoCompleteRequest(Irp, IO_NO_INCREMENT);
- return STATUS_NO_MEMORY;
- }
- }
- else
- {
+ {
+ DPRINT("No memory!\n");
+ ExFreePool(ClientFcb);
+ KeUnlockMutex(&Pipe->FcbListLock);
+ Irp->IoStatus.Status = STATUS_NO_MEMORY;
+ IoCompleteRequest(Irp, IO_NO_INCREMENT);
+ return STATUS_NO_MEMORY;
+ }
+ }
+ else
+ {
ClientFcb->Data = NULL;
- }
-
- ClientFcb->ReadPtr = ClientFcb->Data;
- ClientFcb->WritePtr = ClientFcb->Data;
- ClientFcb->ReadDataAvailable = 0;
- ClientFcb->WriteQuotaAvailable = Pipe->InboundQuota;
- ClientFcb->MaxDataLength = Pipe->InboundQuota;
- KeInitializeSpinLock(&ClientFcb->DataListLock);
- KeInitializeEvent(&ClientFcb->ConnectEvent, SynchronizationEvent, FALSE);
- KeInitializeEvent(&ClientFcb->Event, SynchronizationEvent, FALSE);
+ }
- /*
- * Step 4. Add the client FCB to a list and connect it if necessary.
- */
+ ClientFcb->ReadPtr = ClientFcb->Data;
+ ClientFcb->WritePtr = ClientFcb->Data;
+ ClientFcb->ReadDataAvailable = 0;
+ ClientFcb->WriteQuotaAvailable = Pipe->InboundQuota;
+ ClientFcb->MaxDataLength = Pipe->InboundQuota;
+ KeInitializeSpinLock(&ClientFcb->DataListLock);
+ KeInitializeEvent(&ClientFcb->ConnectEvent, SynchronizationEvent, FALSE);
+ KeInitializeEvent(&ClientFcb->Event, SynchronizationEvent, FALSE);
+
+ /*
+ * Step 4. Add the client FCB to a list and connect it if necessary.
+ */
- /* Add the client FCB to the pipe FCB list. */
- InsertTailList(&Pipe->ClientFcbListHead, &ClientFcb->FcbListEntry);
+ /* Add the client FCB to the pipe FCB list. */
+ InsertTailList(&Pipe->ClientFcbListHead, &ClientFcb->FcbListEntry);
- if (ServerFcb)
- {
+ if (ServerFcb)
+ {
ClientFcb->OtherSide = ServerFcb;
ServerFcb->OtherSide = ClientFcb;
ClientFcb->PipeState = FILE_PIPE_CONNECTED_STATE;
@@ -197,18 +194,18 @@
/* Wake server thread */
DPRINT("Setting the ConnectEvent for %x\n", ServerFcb);
KeSetEvent(&ServerFcb->ConnectEvent, 0, FALSE);
- }
+ }
- KeUnlockMutex(&Pipe->FcbListLock);
+ KeUnlockMutex(&Pipe->FcbListLock);
- FileObject->FsContext = ClientFcb;
+ FileObject->FsContext = ClientFcb;
- Irp->IoStatus.Status = STATUS_SUCCESS;
- IoCompleteRequest(Irp, IO_NO_INCREMENT);
+ Irp->IoStatus.Status = STATUS_SUCCESS;
+ IoCompleteRequest(Irp, IO_NO_INCREMENT);
- DPRINT("Success!\n");
+ DPRINT("Success!\n");
- return STATUS_SUCCESS;
+ return STATUS_SUCCESS;
}
@@ -221,20 +218,19 @@
PNPFS_DEVICE_EXTENSION DeviceExt;
PNPFS_PIPE Pipe;
PNPFS_FCB Fcb;
- PLIST_ENTRY current_entry;
- PNPFS_PIPE current = NULL;
PNAMED_PIPE_CREATE_PARAMETERS Buffer;
-
+ BOOLEAN NewPipe = FALSE;
+
DPRINT("NpfsCreateNamedPipe(DeviceObject %p Irp %p)\n", DeviceObject, Irp);
-
+
DeviceExt = (PNPFS_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
IoStack = IoGetCurrentIrpStackLocation(Irp);
FileObject = IoStack->FileObject;
DPRINT("FileObject %p\n", FileObject);
DPRINT("Pipe name %wZ\n", &FileObject->FileName);
-
- Buffer = (PNAMED_PIPE_CREATE_PARAMETERS)Irp->Tail.Overlay.AuxiliaryBuffer;
-
+
+ Buffer = IoStack->Parameters.CreatePipe.Parameters;
+
Irp->IoStatus.Information = 0;
Fcb = ExAllocatePool(NonPagedPool, sizeof(NPFS_FCB));
@@ -244,36 +240,20 @@
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return STATUS_NO_MEMORY;
}
-
+
KeLockMutex(&DeviceExt->PipeListLock);
/*
* First search for existing Pipe with the same name.
*/
-
- current_entry = DeviceExt->PipeListHead.Flink;
- while (current_entry != &DeviceExt->PipeListHead)
- {
- current = CONTAINING_RECORD(current_entry,
- NPFS_PIPE,
- PipeListEntry);
-
- if (RtlCompareUnicodeString(&FileObject->FileName, ¤t->PipeName, TRUE) == 0)
- {
- break;
- }
-
- current_entry = current_entry->Flink;
- }
-
- if (current_entry != &DeviceExt->PipeListHead)
+ Pipe = NpfsFindPipe(DeviceExt,
+ &FileObject->FileName);
+ if (Pipe != NULL)
{
/*
* Found Pipe with the same name. Check if we are
* allowed to use it.
*/
-
- Pipe = current;
KeUnlockMutex(&DeviceExt->PipeListLock);
if (Pipe->CurrentInstances >= Pipe->MaximumInstances)
@@ -298,6 +278,7 @@
}
else
{
+ NewPipe = TRUE;
Pipe = ExAllocatePool(NonPagedPool, sizeof(NPFS_PIPE));
if (Pipe == NULL)
{
@@ -307,8 +288,8 @@
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return STATUS_NO_MEMORY;
}
-
- if (RtlCreateUnicodeString(&Pipe->PipeName, FileObject->FileName.Buffer) == 0)
+
+ if (RtlCreateUnicodeString(&Pipe->PipeName, FileObject->FileName.Buffer) == FALSE)
{
KeUnlockMutex(&DeviceExt->PipeListLock);
ExFreePool(Pipe);
@@ -316,9 +297,9 @@
Irp->IoStatus.Status = STATUS_NO_MEMORY;
Irp->IoStatus.Information = 0;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
- return(STATUS_NO_MEMORY);
+ return STATUS_NO_MEMORY;
}
-
+
InitializeListHead(&Pipe->ServerFcbListHead);
InitializeListHead(&Pipe->ClientFcbListHead);
KeInitializeMutex(&Pipe->FcbListLock, 0);
@@ -355,6 +336,7 @@
{
Pipe->InboundQuota = 0;
}
+
if (IoStack->Parameters.Create.Options & (FILE_PIPE_FULL_DUPLEX|FILE_PIPE_OUTBOUND))
{
if (Buffer->OutboundQuota == 0)
@@ -390,7 +372,7 @@
{
ExFreePool(Fcb);
- if (Pipe != current)
+ if (NewPipe)
{
RtlFreeUnicodeString(&Pipe->PipeName);
ExFreePool(Pipe);
@@ -399,7 +381,7 @@
Irp->IoStatus.Status = STATUS_NO_MEMORY;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return STATUS_NO_MEMORY;
- }
+ }
}
else
{
@@ -414,11 +396,11 @@
KeInitializeSpinLock(&Fcb->DataListLock);
Pipe->CurrentInstances++;
-
+
KeLockMutex(&Pipe->FcbListLock);
InsertTailList(&Pipe->ServerFcbListHead, &Fcb->FcbListEntry);
KeUnlockMutex(&Pipe->FcbListLock);
-
+
Fcb->Pipe = Pipe;
Fcb->PipeEnd = FILE_PIPE_SERVER_END;
Fcb->PipeState = FILE_PIPE_LISTENING_STATE;
@@ -427,17 +409,17 @@
KeInitializeEvent(&Fcb->ConnectEvent,
SynchronizationEvent,
FALSE);
-
+
KeInitializeEvent(&Fcb->Event,
SynchronizationEvent,
FALSE);
-
+
FileObject->FsContext = Fcb;
-
+
Irp->IoStatus.Status = STATUS_SUCCESS;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
-
- return(STATUS_SUCCESS);
+
+ return STATUS_SUCCESS;
}
reactos/drivers/fs/np
diff -u -r1.16 -r1.16.2.1
--- fsctrl.c 11 Oct 2004 12:37:04 -0000 1.16
+++ fsctrl.c 30 Dec 2004 04:36:11 -0000 1.16.2.1
@@ -1,4 +1,4 @@
-/* $Id: fsctrl.c,v 1.16 2004/10/11 12:37:04 ekohl Exp $
+/* $Id: fsctrl.c,v 1.16.2.1 2004/12/30 04:36:11 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -110,7 +110,7 @@
DPRINT("NpfsDisconnectPipe()\n");
if (Fcb->PipeState == FILE_PIPE_DISCONNECTED_STATE)
- return(STATUS_SUCCESS);
+ return STATUS_SUCCESS;
if (Fcb->PipeState == FILE_PIPE_CONNECTED_STATE)
{
@@ -124,7 +124,7 @@
Fcb->OtherSide = NULL;
DPRINT("Pipe disconnected\n");
- return(STATUS_SUCCESS);
+ return STATUS_SUCCESS;
}
if (Fcb->PipeState == FILE_PIPE_CLOSING_STATE)
@@ -135,10 +135,10 @@
/* FIXME: remove data queue(s) */
DPRINT("Pipe disconnected\n");
- return(STATUS_SUCCESS);
+ return STATUS_SUCCESS;
}
- return(STATUS_UNSUCCESSFUL);
+ return STATUS_UNSUCCESSFUL;
}
@@ -191,10 +191,6 @@
}
-static NTSTATUS
-NpfsGetState(
- PIRP Irp,
- PIO_STACK_LOCATION IrpSp)
/*
* FUNCTION: Return current state of a pipe
* ARGUMENTS:
@@ -203,6 +199,9 @@
* RETURNS:
* Status of operation
*/
+static NTSTATUS
+NpfsGetState(PIRP Irp,
+ PIO_STACK_LOCATION IrpSp)
{
ULONG OutputBufferLength;
PNPFS_GET_STATE Reply;
@@ -214,10 +213,10 @@
/* Validate parameters */
if (OutputBufferLength >= sizeof(NPFS_GET_STATE))
- {
- Fcb = IrpSp->FileObject->FsContext;
- Reply = (PNPFS_GET_STATE)Irp->AssociatedIrp.SystemBuffer;
- Pipe = Fcb->Pipe;
+ {
+ Fcb = IrpSp->FileObject->FsContext;
+ Reply = (PNPFS_GET_STATE)Irp->AssociatedIrp.SystemBuffer;
+ Pipe = Fcb->Pipe;
if (Pipe->PipeWriteMode == FILE_PIPE_MESSAGE_MODE)
{
@@ -265,10 +264,6 @@
}
-static NTSTATUS
-NpfsSetState(
- PIRP Irp,
- PIO_STACK_LOCATION IrpSp)
/*
* FUNCTION: Set state of a pipe
* ARGUMENTS:
@@ -277,6 +272,9 @@
* RETURNS:
* Status of operation
*/
+static NTSTATUS
+NpfsSetState(PIRP Irp,
+ PIO_STACK_LOCATION IrpSp)
{
ULONG InputBufferLength;
PNPFS_SET_STATE Request;
@@ -339,9 +337,6 @@
}
-static NTSTATUS
-NpfsPeekPipe(PIRP Irp,
- PIO_STACK_LOCATION IoStack)
/*
* FUNCTION: Peek at a pipe (get information about messages)
* ARGUMENTS:
@@ -350,6 +345,9 @@
* RETURNS:
* Status of operation
*/
+static NTSTATUS
+NpfsPeekPipe(PIRP Irp,
+ PIO_STACK_LOCATION IoStack)
{
ULONG OutputBufferLength;
PNPFS_PIPE Pipe;
@@ -365,7 +363,7 @@
if (OutputBufferLength < sizeof(FILE_PIPE_PEEK_BUFFER))
{
DPRINT("Buffer too small\n");
- return(STATUS_INVALID_PARAMETER);
+ return STATUS_INVALID_PARAMETER;
}
Fcb = IoStack->FileObject->FsContext;
@@ -374,7 +372,7 @@
Status = STATUS_NOT_IMPLEMENTED;
- return(Status);
+ return Status;
}
@@ -383,7 +381,7 @@
NpfsFileSystemControl(PDEVICE_OBJECT DeviceObject,
PIRP Irp)
{
- PEXTENDED_IO_STACK_LOCATION IoStack;
+ PIO_STACK_LOCATION IoStack;
PFILE_OBJECT FileObject;
NTSTATUS Status;
PNPFS_DEVICE_EXTENSION DeviceExt;
@@ -393,7 +391,7 @@
DPRINT("NpfsFileSystemContol(DeviceObject %p Irp %p)\n", DeviceObject, Irp);
DeviceExt = (PNPFS_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
- IoStack = (PEXTENDED_IO_STACK_LOCATION) IoGetCurrentIrpStackLocation(Irp);
+ IoStack = IoGetCurrentIrpStackLocation(Irp);
DPRINT("IoStack: %p\n", IoStack);
FileObject = IoStack->FileObject;
DPRINT("FileObject: %p\n", FileObject);
reactos/drivers/fs/ntfs
diff -u -r1.8 -r1.8.16.1
--- dirctl.c 5 Jun 2004 08:28:37 -0000 1.8
+++ dirctl.c 30 Dec 2004 04:36:11 -0000 1.8.16.1
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: dirctl.c,v 1.8 2004/06/05 08:28:37 navaraf Exp $
+/* $Id: dirctl.c,v 1.8.16.1 2004/12/30 04:36:11 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -494,14 +494,14 @@
PCCB Ccb;
// FCB TempFcb;
BOOLEAN First = FALSE;
- PEXTENDED_IO_STACK_LOCATION Stack;
+ PIO_STACK_LOCATION Stack;
PFILE_OBJECT FileObject;
NTSTATUS Status = STATUS_SUCCESS;
DPRINT1("NtfsQueryDirectory() called\n");
DeviceExtension = DeviceObject->DeviceExtension;
- Stack = (PEXTENDED_IO_STACK_LOCATION) IoGetCurrentIrpStackLocation(Irp);
+ Stack = IoGetCurrentIrpStackLocation(Irp);
FileObject = Stack->FileObject;
Ccb = (PCCB)FileObject->FsContext2;
reactos/drivers/fs/ntfs
diff -u -r1.10 -r1.10.16.1
--- fsctl.c 5 Jun 2004 08:28:37 -0000 1.10
+++ fsctl.c 30 Dec 2004 04:36:11 -0000 1.10.16.1
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: fsctl.c,v 1.10 2004/06/05 08:28:37 navaraf Exp $
+/* $Id: fsctl.c,v 1.10.16.1 2004/12/30 04:36:11 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -108,7 +108,7 @@
if (NT_SUCCESS(Status))
{
DPRINT1("NTFS-identifier: [%.8s]\n", BootSector->OemName);
- if (strncmp(BootSector->OemName, "NTFS ", 8) != 0)
+ if (RtlCompareMemory(BootSector->OemName, "NTFS ", 8) != 8)
{
Status = STATUS_UNRECOGNIZED_VOLUME;
}
reactos/drivers/fs/vfat
diff -u -r1.15.6.3 -r1.15.6.4
--- cleanup.c 13 Dec 2004 16:17:58 -0000 1.15.6.3
+++ cleanup.c 30 Dec 2004 04:36:11 -0000 1.15.6.4
@@ -1,4 +1,4 @@
-/* $Id: cleanup.c,v 1.15.6.3 2004/12/13 16:17:58 hyperion Exp $
+/* $Id: cleanup.c,v 1.15.6.4 2004/12/30 04:36:11 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
reactos/drivers/fs/vfat
diff -u -r1.75.2.3 -r1.75.2.4
--- create.c 13 Dec 2004 16:17:58 -0000 1.75.2.3
+++ create.c 30 Dec 2004 04:36:11 -0000 1.75.2.4
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: create.c,v 1.75.2.3 2004/12/13 16:17:58 hyperion Exp $
+/* $Id: create.c,v 1.75.2.4 2004/12/30 04:36:11 hyperion Exp $
*
* PROJECT: ReactOS kernel
* FILE: drivers/fs/vfat/create.c
reactos/drivers/fs/vfat
diff -u -r1.35.2.3 -r1.35.2.4
--- dir.c 13 Dec 2004 16:17:58 -0000 1.35.2.3
+++ dir.c 30 Dec 2004 04:36:12 -0000 1.35.2.4
@@ -1,5 +1,5 @@
/*
- * $Id: dir.c,v 1.35.2.3 2004/12/13 16:17:58 hyperion Exp $
+ * $Id: dir.c,v 1.35.2.4 2004/12/30 04:36:12 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -313,8 +313,8 @@
VFAT_DIRENTRY_CONTEXT DirContext;
WCHAR LongNameBuffer[MAX_PATH];
WCHAR ShortNameBuffer[13];
-
- PEXTENDED_IO_STACK_LOCATION Stack = (PEXTENDED_IO_STACK_LOCATION) IrpContext->Stack;
+
+ PIO_STACK_LOCATION Stack = IrpContext->Stack;
pCcb = (PVFATCCB) IrpContext->FileObject->FsContext2;
pFcb = (PVFATFCB) IrpContext->FileObject->FsContext;
reactos/drivers/fs/vfat
diff -u -r1.17.8.3 -r1.17.8.4
--- direntry.c 13 Dec 2004 16:17:58 -0000 1.17.8.3
+++ direntry.c 30 Dec 2004 04:36:12 -0000 1.17.8.4
@@ -1,4 +1,4 @@
-/* $Id: direntry.c,v 1.17.8.3 2004/12/13 16:17:58 hyperion Exp $
+/* $Id: direntry.c,v 1.17.8.4 2004/12/30 04:36:12 hyperion Exp $
*
*
* FILE: DirEntry.c
reactos/drivers/fs/vfat
diff -u -r1.42.2.3 -r1.42.2.4
--- dirwr.c 13 Dec 2004 16:17:58 -0000 1.42.2.3
+++ dirwr.c 30 Dec 2004 04:36:12 -0000 1.42.2.4
@@ -1,4 +1,4 @@
-/* $Id: dirwr.c,v 1.42.2.3 2004/12/13 16:17:58 hyperion Exp $
+/* $Id: dirwr.c,v 1.42.2.4 2004/12/30 04:36:12 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
reactos/drivers/fs/vfat
diff -u -r1.46.8.3 -r1.46.8.4
--- fat.c 13 Dec 2004 16:17:58 -0000 1.46.8.3
+++ fat.c 30 Dec 2004 04:36:12 -0000 1.46.8.4
@@ -1,5 +1,5 @@
/*
- * $Id: fat.c,v 1.46.8.3 2004/12/13 16:17:58 hyperion Exp $
+ * $Id: fat.c,v 1.46.8.4 2004/12/30 04:36:12 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -606,9 +606,9 @@
if (DeviceExt->AvailableClustersValid)
{
if (OldValue && NewValue == 0)
- InterlockedIncrement(&DeviceExt->AvailableClusters);
+ InterlockedIncrement((PLONG)&DeviceExt->AvailableClusters);
else if (OldValue == 0 && NewValue)
- InterlockedDecrement(&DeviceExt->AvailableClusters);
+ InterlockedDecrement((PLONG)&DeviceExt->AvailableClusters);
}
ExReleaseResourceLite(&DeviceExt->FatResource);
return(Status);
reactos/drivers/fs/vfat
diff -u -r1.42.2.3 -r1.42.2.4
--- fcb.c 13 Dec 2004 16:17:58 -0000 1.42.2.3
+++ fcb.c 30 Dec 2004 04:36:12 -0000 1.42.2.4
@@ -1,4 +1,4 @@
-/* $Id: fcb.c,v 1.42.2.3 2004/12/13 16:17:58 hyperion Exp $
+/* $Id: fcb.c,v 1.42.2.4 2004/12/30 04:36:12 hyperion Exp $
*
*
* FILE: drivers/fs/vfat/fcb.c
reactos/drivers/fs/vfat
diff -u -r1.38.2.3 -r1.38.2.4
--- finfo.c 13 Dec 2004 16:17:59 -0000 1.38.2.3
+++ finfo.c 30 Dec 2004 04:36:12 -0000 1.38.2.4
@@ -1,4 +1,4 @@
-/* $Id: finfo.c,v 1.38.2.3 2004/12/13 16:17:59 hyperion Exp $
+/* $Id: finfo.c,v 1.38.2.4 2004/12/30 04:36:12 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
reactos/drivers/fs/vfat
diff -u -r1.36.2.3 -r1.36.2.4
--- fsctl.c 13 Dec 2004 16:17:59 -0000 1.36.2.3
+++ fsctl.c 30 Dec 2004 04:36:12 -0000 1.36.2.4
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: fsctl.c,v 1.36.2.3 2004/12/13 16:17:59 hyperion Exp $
+/* $Id: fsctl.c,v 1.36.2.4 2004/12/30 04:36:12 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
reactos/drivers/fs/vfat
diff -u -r1.14.2.3 -r1.14.2.4
--- misc.c 13 Dec 2004 16:17:59 -0000 1.14.2.3
+++ misc.c 30 Dec 2004 04:36:12 -0000 1.14.2.4
@@ -1,4 +1,4 @@
-/* $Id: misc.c,v 1.14.2.3 2004/12/13 16:17:59 hyperion Exp $
+/* $Id: misc.c,v 1.14.2.4 2004/12/30 04:36:12 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
reactos/drivers/fs/vfat
diff -u -r1.71.2.3 -r1.71.2.4
--- rw.c 13 Dec 2004 16:17:59 -0000 1.71.2.3
+++ rw.c 30 Dec 2004 04:36:12 -0000 1.71.2.4
@@ -1,5 +1,5 @@
-/* $Id: rw.c,v 1.71.2.3 2004/12/13 16:17:59 hyperion Exp $
+/* $Id: rw.c,v 1.71.2.4 2004/12/30 04:36:12 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
reactos/drivers/fs/vfat
diff -u -r1.8.34.3 -r1.8.34.4
--- shutdown.c 13 Dec 2004 16:17:59 -0000 1.8.34.3
+++ shutdown.c 30 Dec 2004 04:36:16 -0000 1.8.34.4
@@ -1,4 +1,4 @@
-/* $Id: shutdown.c,v 1.8.34.3 2004/12/13 16:17:59 hyperion Exp $
+/* $Id: shutdown.c,v 1.8.34.4 2004/12/30 04:36:16 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
reactos/drivers/fs/vfat
diff -u -r1.69.2.3 -r1.69.2.4
--- vfat.h 13 Dec 2004 16:17:59 -0000 1.69.2.3
+++ vfat.h 30 Dec 2004 04:36:16 -0000 1.69.2.4
@@ -1,4 +1,4 @@
-/* $Id: vfat.h,v 1.69.2.3 2004/12/13 16:17:59 hyperion Exp $ */
+/* $Id: vfat.h,v 1.69.2.4 2004/12/30 04:36:16 hyperion Exp $ */
#include <ddk/ntifs.h>
reactos/drivers/fs/vfat
diff -u -r1.27.2.3 -r1.27.2.4
--- volume.c 13 Dec 2004 16:17:59 -0000 1.27.2.3
+++ volume.c 30 Dec 2004 04:36:16 -0000 1.27.2.4
@@ -1,4 +1,4 @@
-/* $Id: volume.c,v 1.27.2.3 2004/12/13 16:17:59 hyperion Exp $
+/* $Id: volume.c,v 1.27.2.4 2004/12/30 04:36:16 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -382,7 +382,7 @@
NTSTATUS Status = STATUS_SUCCESS;
PVOID SystemBuffer;
ULONG BufferLength;
- PEXTENDED_IO_STACK_LOCATION Stack = (PEXTENDED_IO_STACK_LOCATION) IrpContext->Stack;
+ PIO_STACK_LOCATION Stack = IrpContext->Stack;
/* PRECONDITION */
ASSERT(IrpContext);
reactos/drivers/input/psaux
diff -u -r1.19 -r1.19.22.1
--- psaux.c 10 Feb 2004 16:22:56 -0000 1.19
+++ psaux.c 30 Dec 2004 04:36:16 -0000 1.19.22.1
@@ -156,7 +156,7 @@
ULONG Queue;
Queue = DeviceExtension->ActiveQueue % 2;
- InterlockedIncrement(&DeviceExtension->ActiveQueue);
+ InterlockedIncrement((PLONG)&DeviceExtension->ActiveQueue);
(*(PSERVICE_CALLBACK_ROUTINE)DeviceExtension->ClassInformation.CallBack)(
DeviceExtension->ClassInformation.DeviceObject,
DeviceExtension->MouseInputData[Queue],
reactos/drivers/input/sermouse
diff -u -r1.18 -r1.18.16.1
--- sermouse.c 6 Jun 2004 15:55:03 -0000 1.18
+++ sermouse.c 30 Dec 2004 04:36:16 -0000 1.18.16.1
@@ -376,7 +376,7 @@
ULONG Queue;
Queue = DeviceExtension->ActiveQueue % 2;
- InterlockedIncrement(&DeviceExtension->ActiveQueue);
+ InterlockedIncrement((PLONG)&DeviceExtension->ActiveQueue);
(*(PSERVICE_CALLBACK_ROUTINE)DeviceExtension->ClassInformation.CallBack)(
DeviceExtension->ClassInformation.DeviceObject,
DeviceExtension->MouseInputData[Queue],
reactos/drivers/lib/bzip2
diff -u -r1.6 -r1.6.28.1
--- Makefile 16 Nov 2003 22:37:06 -0000 1.6
+++ Makefile 30 Dec 2004 04:36:16 -0000 1.6.28.1
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.6 2003/11/16 22:37:06 sedwards Exp $
+# $Id: Makefile,v 1.6.28.1 2004/12/30 04:36:16 hyperion Exp $
PATH_TO_TOP = ../../..
@@ -10,7 +10,8 @@
TARGET_CFLAGS = \
-Wall -Winline -Os -fomit-frame-pointer -fno-strength-reduce \
- -DBZ_NO_STDIO -DBZ_DECOMPRESS_ONLY $(BIGFILES) -g -Werror -D__USE_W32API
+ -DBZ_NO_STDIO -DBZ_DECOMPRESS_ONLY $(BIGFILES) -g -Werror -D__USE_W32API \
+ -finline-limit=1000
TARGET_OBJECTS = \
bzlib.o \
reactos/drivers/lib/ip
diff -u -r1.7.2.3 -r1.7.2.4
--- makefile 13 Dec 2004 16:18:00 -0000 1.7.2.3
+++ makefile 30 Dec 2004 04:36:17 -0000 1.7.2.4
@@ -1,4 +1,4 @@
-# $Id: makefile,v 1.7.2.3 2004/12/13 16:18:00 hyperion Exp $
+# $Id: makefile,v 1.7.2.4 2004/12/30 04:36:17 hyperion Exp $
PATH_TO_TOP = ../../..
@@ -40,6 +40,7 @@
network/routines.o \
network/transmit.o \
transport/rawip/rawip.o \
+ transport/tcp/accept.o \
transport/tcp/event.o \
transport/tcp/if.o \
transport/tcp/tcp.o \
reactos/drivers/lib/ip/network
diff -u -r1.3.2.1 -r1.3.2.2
--- interface.c 8 Dec 2004 21:56:49 -0000 1.3.2.1
+++ interface.c 30 Dec 2004 04:36:17 -0000 1.3.2.2
@@ -57,25 +57,11 @@
}
NTSTATUS GetInterfaceSpeed( PIP_INTERFACE Interface, PUINT Speed ) {
- NDIS_STATUS NdisStatus;
PLAN_ADAPTER IF = (PLAN_ADAPTER)Interface->Context;
+
+ *Speed = IF->Speed;
-#ifdef __NTDRIVER__
- /* Get maximum link speed */
- NdisStatus = NDISCall(IF,
- NdisRequestQueryInformation,
- OID_GEN_LINK_SPEED,
- Speed,
- sizeof(UINT));
-#else
- (void)IF;
- NdisStatus = NDIS_STATUS_SUCCESS;
- *Speed = 10000;
-#endif
-
- return
- NdisStatus != NDIS_STATUS_SUCCESS ?
- STATUS_UNSUCCESSFUL : STATUS_SUCCESS;
+ return STATUS_SUCCESS;
}
NTSTATUS GetInterfaceName( PIP_INTERFACE Interface,
reactos/drivers/lib/ip/network
diff -u -r1.5.2.1 -r1.5.2.2
--- ip.c 8 Dec 2004 21:56:49 -0000 1.5.2.1
+++ ip.c 30 Dec 2004 04:36:17 -0000 1.5.2.2
@@ -264,7 +264,6 @@
}
/* Add interface to the global interface list */
- ASSERT(&IF->ListEntry);
TcpipInterlockedInsertTailList(&InterfaceListHead,
&IF->ListEntry,
&InterfaceListLock);
reactos/drivers/lib/ip/transport/datagram
diff -u -r1.5 -r1.5.2.1
--- datagram.c 15 Nov 2004 18:24:57 -0000 1.5
+++ datagram.c 30 Dec 2004 04:36:17 -0000 1.5.2.1
@@ -92,7 +92,7 @@
DataBuffer,
DataSize );
- RTAIPAddress = (PTA_IP_ADDRESS)Current->ReturnInfo;
+ RTAIPAddress = (PTA_IP_ADDRESS)Current->ReturnInfo->RemoteAddress;
RTAIPAddress->TAAddressCount = 1;
RTAIPAddress->Address->AddressType = TDI_ADDRESS_TYPE_IP;
RTAIPAddress->Address->Address->sin_port = SrcPort;
reactos/drivers/lib/ip/transport/tcp
diff -N accept.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ accept.c 30 Dec 2004 04:36:17 -0000 1.1.2.1
@@ -0,0 +1,157 @@
+/*
+ * COPYRIGHT: See COPYING in the top level directory
+ * PROJECT: ReactOS TCP/IP protocol driver
+ * FILE: transport/tcp/tcp.c
+ * PURPOSE: Transmission Control Protocol Listen/Accept code
+ * PROGRAMMERS: Art Yerkes (arty@users.sf.net)
+ * REVISIONS:
+ * arty 12/21/2004 Created
+ */
+
+#include "precomp.h"
+
+NTSTATUS TCPServiceListeningSocket( PCONNECTION_ENDPOINT Listener,
+ PCONNECTION_ENDPOINT Connection,
+ PTDI_REQUEST_KERNEL Request ) {
+ NTSTATUS Status;
+ SOCKADDR_IN OutAddr;
+ OSK_UINT OutAddrLen;
+ PTA_ADDRESS RequestAddressReturn;
+ SOCKADDR_IN AddressConnecting;
+ PTDI_CONNECTION_INFORMATION WhoIsConnecting;
+
+ /* Unpack TDI info -- We need the return connection information
+ * struct to return the address so it can be filtered if needed
+ * by WSAAccept -- The returned address will be passed on to
+ * userland after we complete this irp */
+ WhoIsConnecting = (PTDI_CONNECTION_INFORMATION)
+ Request->ReturnConnectionInformation;
+
+ Status = TCPTranslateError
+ ( OskitTCPAccept( Listener->SocketContext,
+ &Connection->SocketContext,
+ &OutAddr,
+ sizeof(OutAddr),
+ &OutAddrLen,
+ Request->RequestFlags & TDI_QUERY_ACCEPT ? 0 : 1 ) );
+
+ TI_DbgPrint(DEBUG_TCP,("Status %x\n", Status));
+
+ if( NT_SUCCESS(Status) && Status != STATUS_PENDING ) {
+ TI_DbgPrint(DEBUG_TCP,("Copying address to %x (Who %x)\n",
+ RequestAddressReturn, WhoIsConnecting));
+
+ RequestAddressReturn = (PTA_ADDRESS)WhoIsConnecting->RemoteAddress;
+ RequestAddressReturn->AddressLength = OutAddrLen;
+ RequestAddressReturn->AddressType =
+ AddressConnecting.sin_family;
+ TI_DbgPrint(DEBUG_TCP,("Copying address proper: from %x to %x,%x\n",
+ ((PCHAR)&AddressConnecting) +
+ sizeof(AddressConnecting.sin_family),
+ RequestAddressReturn->Address,
+ RequestAddressReturn->AddressLength));
+ RtlCopyMemory( RequestAddressReturn->Address,
+ ((PCHAR)&AddressConnecting) +
+ sizeof(AddressConnecting.sin_family),
+ RequestAddressReturn->AddressLength );
+ TI_DbgPrint(DEBUG_TCP,("Done copying\n"));
+ }
+
+ TI_DbgPrint(DEBUG_TCP,("Status %x\n", Status));
+
+ return Status;
+}
+
+/* This listen is on a socket we keep as internal. That socket has the same
+ * lifetime as the address file */
+NTSTATUS TCPListen( PCONNECTION_ENDPOINT Connection, UINT Backlog ) {
+ NTSTATUS Status = STATUS_SUCCESS;
+ SOCKADDR_IN AddressToBind;
+
+ TI_DbgPrint(DEBUG_TCP,("TCPListen started\n"));
+
+ TI_DbgPrint(DEBUG_TCP,("Connection->SocketContext %x\n",
+ Connection->SocketContext));
+
+ ASSERT(Connection);
+ ASSERT_KM_POINTER(Connection->SocketContext);
+ ASSERT_KM_POINTER(Connection->AddressFile);
+
+ TcpipRecursiveMutexEnter( &TCPLock, TRUE );
+
+ AddressToBind.sin_family = AF_INET;
+ memcpy( &AddressToBind.sin_addr,
+ &Connection->AddressFile->Address.Address.IPv4Address,
+ sizeof(AddressToBind.sin_addr) );
+ AddressToBind.sin_port = Connection->AddressFile->Port;
+
+ TI_DbgPrint(DEBUG_TCP,("AddressToBind - %x:%x\n", AddressToBind.sin_addr, AddressToBind.sin_port));
+
+ OskitTCPBind( Connection->SocketContext,
+ Connection,
+ &AddressToBind,
+ sizeof(AddressToBind) );
+
+ Status = TCPTranslateError( OskitTCPListen( Connection->SocketContext,
+ Backlog ) );
+
+ TcpipRecursiveMutexLeave( &TCPLock );
+
+ TI_DbgPrint(DEBUG_TCP,("TCPListen finished %x\n", Status));
+
+ return Status;
+}
+
+VOID TCPAbortListenForSocket( PCONNECTION_ENDPOINT Listener,
+ PCONNECTION_ENDPOINT Connection ) {
+ PLIST_ENTRY ListEntry;
+ PTDI_BUCKET Bucket;
+
+ TcpipRecursiveMutexEnter( &TCPLock, TRUE );
+
+ for( ListEntry = Listener->ListenRequest.Flink;
+ ListEntry != &Listener->ListenRequest;
+ ListEntry = ListEntry->Flink ) {
+ Bucket = CONTAINING_RECORD(ListEntry, TDI_BUCKET, Entry);
+
+ if( Bucket->Request.Handle.ConnectionContext == Connection ) {
+#ifdef MEMTRACK
+ UntrackFL( __FILE__, __LINE__, Bucket->Request.RequestContext );
+#endif
+ RemoveEntryList( ListEntry );
+ ExFreePool( Bucket );
+ }
+ }
+
+ TcpipRecursiveMutexLeave( &TCPLock );
+}
+
+NTSTATUS TCPAccept
+( PTDI_REQUEST Request,
+ PCONNECTION_ENDPOINT Listener,
+ PCONNECTION_ENDPOINT Connection,
+ PTCP_COMPLETION_ROUTINE Complete,
+ PVOID Context ) {
+ NTSTATUS Status;
+ PTDI_BUCKET Bucket;
+
+ TI_DbgPrint(DEBUG_TCP,("TCPAccept started\n"));
+
+ TcpipRecursiveMutexEnter( &TCPLock, TRUE );
+
+ Status = TCPServiceListeningSocket( Listener, Connection,
+ (PTDI_REQUEST_KERNEL)Request );
+
+ if( Status == STATUS_PENDING ) {
+ Bucket = ExAllocatePool( NonPagedPool, sizeof(*Bucket) );
+ Bucket->AssociatedEndpoint = Connection;
+ Bucket->Request.RequestNotifyObject = Complete;
+ Bucket->Request.RequestContext = Context;
+ InsertHeadList( &Listener->ListenRequest, &Bucket->Entry );
+ }
+
+ TcpipRecursiveMutexLeave( &TCPLock );
+
+ TI_DbgPrint(DEBUG_TCP,("TCPAccept finished %x\n", Status));
+ return Status;
+}
reactos/drivers/lib/ip/transport/tcp
diff -u -r1.7.2.2 -r1.7.2.3
--- event.c 13 Dec 2004 09:38:47 -0000 1.7.2.2
+++ event.c 30 Dec 2004 04:36:17 -0000 1.7.2.3
@@ -18,6 +18,12 @@
OSK_UINT NewState ) {
PCONNECTION_ENDPOINT Connection = WhichConnection;
+ TI_DbgPrint(MID_TRACE,("Flags: %c%c%c%c\n",
+ NewState & SEL_CONNECT ? 'C' : 'c',
+ NewState & SEL_READ ? 'R' : 'r',
+ NewState & SEL_FIN ? 'F' : 'f',
+ NewState & SEL_ACCEPT ? 'A' : 'a'));
+
TI_DbgPrint(DEBUG_TCP,("Called: NewState %x (Conn %x) (Change %x)\n",
NewState, Connection,
Connection ? Connection->State ^ NewState :
@@ -33,6 +39,8 @@
TI_DbgPrint(DEBUG_TCP,("Found socket %x\n", Connection));
}
+ TI_DbgPrint(MID_TRACE,("Connection signalled: %d\n",
+ Connection->Signalled));
if( !Connection->Signalled ) {
Connection->Signalled = TRUE;
Connection->SignalState = NewState;
@@ -105,13 +113,13 @@
void *TCPMalloc( void *ClientData,
OSK_UINT Bytes, OSK_PCHAR File, OSK_UINT Line ) {
void *v = PoolAllocateBuffer( Bytes );
- if( v ) TrackWithTag( FOURCC('f','b','s','d'), v, File, Line );
+ if( v ) TrackWithTag( FOURCC('f','b','s','d'), v, (PCHAR)File, Line );
return v;
}
void TCPFree( void *ClientData,
void *data, OSK_PCHAR File, OSK_UINT Line ) {
- UntrackFL( File, Line, data );
+ UntrackFL( (PCHAR)File, Line, data );
PoolFreeBuffer( data );
}
reactos/drivers/lib/ip/transport/tcp
diff -u -r1.9.2.3 -r1.9.2.4
--- tcp.c 13 Dec 2004 16:18:00 -0000 1.9.2.3
+++ tcp.c 30 Dec 2004 04:36:17 -0000 1.9.2.4
@@ -4,8 +4,10 @@
* FILE: transport/tcp/tcp.c
* PURPOSE: Transmission Control Protocol
* PROGRAMMERS: Casper S. Hornstrup (chorns@users.sourceforge.net)
+ * Art Yerkes (arty@users.sf.net)
* REVISIONS:
- * CSH 01/08-2000 Created
+ * CSH 01/08-2000 Created
+ * arty 12/21/2004 Added accept
*/
#include "precomp.h"
@@ -25,11 +27,11 @@
PTCP_COMPLETION_ROUTINE Complete;
PTDI_BUCKET Bucket;
PLIST_ENTRY Entry;
- BOOLEAN CompletedOne = FALSE;
+ PIRP Irp;
+ PMDL Mdl;
/* Things that can happen when we try the initial connection */
if( ((NewState & SEL_CONNECT) || (NewState & SEL_FIN)) &&
-
!(Connection->State & (SEL_CONNECT | SEL_FIN)) ) {
while( !IsListEmpty( &Connection->ConnectRequest ) ) {
Connection->State |= NewState & (SEL_CONNECT | SEL_FIN);
@@ -45,27 +47,56 @@
}
}
+ if( (NewState & SEL_ACCEPT) ) {
+ /* Handle readable on a listening socket --
+ * TODO: Implement filtering
+ */
+
+ TI_DbgPrint(DEBUG_TCP,("Accepting new connection on %x (Queue: %s)\n",
+ Connection,
+ IsListEmpty(&Connection->ListenRequest) ?
+ "empty" : "nonempty"));
+
+ while( !IsListEmpty( &Connection->ListenRequest ) ) {
+ PIO_STACK_LOCATION IrpSp;
+
+ Entry = RemoveHeadList( &Connection->ListenRequest );
+ Bucket = CONTAINING_RECORD( Entry, TDI_BUCKET, Entry );
+ Complete = Bucket->Request.RequestNotifyObject;
+
+ Irp = Bucket->Request.RequestContext;
+ IrpSp = IoGetCurrentIrpStackLocation( Irp );
+
+ TI_DbgPrint(DEBUG_TCP,("Getting the socket\n"));
+ Status = TCPServiceListeningSocket
+ ( Connection->AddressFile->Listener,
+ Bucket->AssociatedEndpoint,
+ (PTDI_REQUEST_KERNEL)&IrpSp->Parameters );
+
+ TI_DbgPrint(DEBUG_TCP,("Socket: Status: %x\n"));
+
+ if( Status == STATUS_PENDING ) {
+ InsertHeadList( &Connection->ListenRequest, &Bucket->Entry );
+ break;
+ } else
+ Complete( Bucket->Request.RequestContext, Status, 0 );
+ }
+ }
+
/* Things that happen after we're connected */
if( (NewState & SEL_READ) ) {
TI_DbgPrint(DEBUG_TCP,("Readable: irp list %s\n",
IsListEmpty(&Connection->ReceiveRequest) ?
"empty" : "nonempty"));
-
+
while( !IsListEmpty( &Connection->ReceiveRequest ) ) {
- PIRP Irp;
OSK_UINT RecvLen = 0, Received = 0;
OSK_PCHAR RecvBuffer = 0;
- PMDL Mdl;
- NTSTATUS Status;
Entry = RemoveHeadList( &Connection->ReceiveRequest );
Bucket = CONTAINING_RECORD( Entry, TDI_BUCKET, Entry );
Complete = Bucket->Request.RequestNotifyObject;
- TI_DbgPrint(DEBUG_TCP,
- ("Readable, Completing read request %x\n",
- Bucket->Request));
-
Irp = Bucket->Request.RequestContext;
Mdl = Irp->MdlAddress;
@@ -97,23 +128,17 @@
TI_DbgPrint(DEBUG_TCP,("Received %d bytes with status %x\n",
Received, Status));
- TI_DbgPrint(DEBUG_TCP,
- ("Completing Receive Request: %x\n",
- Bucket->Request));
-
Complete( Bucket->Request.RequestContext,
STATUS_SUCCESS, Received );
- CompletedOne = TRUE;
} else if( Status == STATUS_PENDING ) {
- InsertHeadList( &Connection->ReceiveRequest,
- &Bucket->Entry );
+ InsertHeadList
+ ( &Connection->ReceiveRequest, &Bucket->Entry );
break;
} else {
TI_DbgPrint(DEBUG_TCP,
("Completing Receive request: %x %x\n",
Bucket->Request, Status));
Complete( Bucket->Request.RequestContext, Status, 0 );
- CompletedOne = TRUE;
}
}
}
@@ -479,7 +504,23 @@
TcpipRecursiveMutexEnter( &TCPLock, TRUE );
- Status = TCPTranslateError( OskitTCPClose( Connection->SocketContext ) );
+ switch( Flags & (TDI_DISCONNECT_ABORT | TDI_DISCONNECT_RELEASE) ) {
+ case 0:
+ case TDI_DISCONNECT_ABORT:
+ Flags = 0;
+ break;
+
+ case TDI_DISCONNECT_ABORT | TDI_DISCONNECT_RELEASE:
+ Flags = 2;
+ break;
+
+ case TDI_DISCONNECT_RELEASE:
+ Flags = 1;
+ break;
+ }
+
+ Status = TCPTranslateError
+ ( OskitTCPShutdown( Connection->SocketContext, Flags ) );
if( Connection->Signalled )
RemoveEntryList( &Connection->SignalList );
@@ -565,7 +606,7 @@
ULONG ReceiveFlags,
PTCP_COMPLETION_ROUTINE Complete,
PVOID Context ) {
- PCHAR DataBuffer;
+ OSK_PCHAR DataBuffer;
UINT DataLen, Received = 0;
NTSTATUS Status;
PTDI_BUCKET Bucket;
@@ -636,7 +677,8 @@
Connection->SocketContext));
Status = OskitTCPSend( Connection->SocketContext,
- BufferData, PacketSize, (PUINT)DataUsed, 0 );
+ (OSK_PCHAR)BufferData, PacketSize,
+ (PUINT)DataUsed, 0 );
TcpipRecursiveMutexLeave( &TCPLock );
reactos/drivers/lib/ip/transport/udp
diff -u -r1.6.2.1 -r1.6.2.2
--- udp.c 8 Dec 2004 21:56:51 -0000 1.6.2.1
+++ udp.c 30 Dec 2004 04:36:18 -0000 1.6.2.2
@@ -132,6 +132,8 @@
NULL,
Packet->TotalSize + MaxLLHeaderSize );
+ if( !NT_SUCCESS(Status) ) return Status;
+
TI_DbgPrint(MID_TRACE, ("Allocated packet: %x\n", Packet->NdisPacket));
TI_DbgPrint(MID_TRACE, ("Local Addr : %s\n", A2S(LocalAddress)));
TI_DbgPrint(MID_TRACE, ("Remote Addr: %s\n", A2S(RemoteAddress)));
reactos/drivers/lib/oskittcp/include
diff -u -r1.7.2.1 -r1.7.2.2
--- oskittcp.h 8 Dec 2004 21:56:51 -0000 1.7.2.1
+++ oskittcp.h 30 Dec 2004 04:36:18 -0000 1.7.2.2
@@ -133,6 +133,12 @@
extern int OskitTCPBind( void *socket, void *connection,
void *nam, OSK_UINT namelen );
+extern int OskitTCPAccept( void *socket, void **new_socket,
+ void *addr_out,
+ OSK_UINT addr_len,
+ OSK_UINT *out_addr_len,
+ OSK_UINT finish_accept );
+
extern int OskitTCPListen( void *socket, int backlog );
extern int OskitTCPRecv( void *connection,
reactos/drivers/lib/oskittcp/oskittcp
diff -u -r1.16.2.2 -r1.16.2.3
--- interface.c 13 Dec 2004 09:38:48 -0000 1.16.2.2
+++ interface.c 30 Dec 2004 04:36:18 -0000 1.16.2.3
@@ -22,8 +22,8 @@
OSKITTCP_EVENT_HANDLERS OtcpEvent = { 0 };
-//OSK_UINT OskitDebugTraceLevel = OSK_DEBUG_ULTRA;
-OSK_UINT OskitDebugTraceLevel = 0;
+OSK_UINT OskitDebugTraceLevel = OSK_DEBUG_ULTRA;
+//OSK_UINT OskitDebugTraceLevel = 0;
/* SPL */
unsigned cpl;
@@ -119,6 +119,7 @@
if( !error ) {
so->so_connection = context;
so->so_state = SS_NBIO;
+ so->so_error = 0;
*aso = so;
}
return error;
@@ -138,6 +139,8 @@
*OutLen = 0;
+ printf("so->so_state %x\n", ((struct socket *)connection)->so_state);
+
if( Flags & OSK_MSG_OOB ) tcp_flags |= MSG_OOB;
if( Flags & OSK_MSG_DONTWAIT ) tcp_flags |= MSG_DONTWAIT;
if( Flags & OSK_MSG_PEEK ) tcp_flags |= MSG_PEEK;
@@ -281,16 +284,117 @@
}
int OskitTCPAccept( void *socket,
+ void **new_socket,
void *AddrOut,
OSK_UINT AddrLen,
- OSK_UINT *OutAddrLen ) {
- struct mbuf nam;
- int error;
+ OSK_UINT *OutAddrLen,
+ OSK_UINT FinishAccepting ) {
+ struct socket *head = (void *)socket;
+ struct sockaddr *name = (struct sockaddr *)AddrOut;
+ struct socket **newso = (struct socket **)new_socket;
+ struct socket *so = socket;
+ struct sockaddr_in sa;
+ struct mbuf mnam;
+ int namelen = 0, error = 0, s;
+
+ OS_DbgPrint(OSK_MID_TRACE,("OSKITTCP: Doing accept (Finish %d)\n",
+ FinishAccepting));
+
+ *OutAddrLen = AddrLen;
+
+ if (name)
+ /* that's a copyin actually */
+ namelen = *OutAddrLen;
+
+ s = splnet();
+
+ OskitDumpBuffer( so, sizeof(*so) );
+
+#if 0
+ if ((head->so_options & SO_ACCEPTCONN) == 0) {
+ splx(s);
+ OS_DbgPrint(OSK_MID_TRACE,("OSKITTCP: head->so_options = %x, wanted bit %x\n",
+ head->so_options, SO_ACCEPTCONN));
+ error = EINVAL;
+ goto out;
+ }
+#endif
+
+ OS_DbgPrint(OSK_MID_TRACE,("head->so_q = %x, head->so_state = %x\n",
+ head->so_q, head->so_state));
+
+ if ((head->so_state & SS_NBIO) && head->so_q == NULL) {
+ splx(s);
+ error = EWOULDBLOCK;
+ goto out;
+ }
+
+ OS_DbgPrint(OSK_MID_TRACE,("error = %d\n", error));
+ while (head->so_q == NULL && head->so_error == 0) {
+ if (head->so_state & SS_CANTRCVMORE) {
+ head->so_error = ECONNABORTED;
+ break;
+ }
+ OS_DbgPrint(OSK_MID_TRACE,("error = %d\n", error));
+ error = tsleep((caddr_t)&head->so_timeo, PSOCK | PCATCH,
+ "accept", 0);
+ if (error) {
+ splx(s);
+ goto out;
+ }
+ OS_DbgPrint(OSK_MID_TRACE,("error = %d\n", error));
+ }
+ OS_DbgPrint(OSK_MID_TRACE,("error = %d\n", error));
+
+#if 0
+ if (head->so_error) {
+ OS_DbgPrint(OSK_MID_TRACE,("error = %d\n", error));
+ error = head->so_error;
+ head->so_error = 0;
+ splx(s);
+ goto out;
+ }
+ OS_DbgPrint(OSK_MID_TRACE,("error = %d\n", error));
+#endif
- nam.m_data = AddrOut;
- nam.m_len = AddrLen;
+ /*
+ * At this point we know that there is at least one connection
+ * ready to be accepted. Remove it from the queue.
+ */
+ so = head->so_q;
+
+ OS_DbgPrint(OSK_MID_TRACE,("error = %d\n", error));
+ if( FinishAccepting ) {
+ head->so_q = so->so_q;
+ head->so_qlen--;
+
+ *newso = so;
+
+ /*so->so_state &= ~SS_COMP;*/
+ so->so_q = NULL;
- return soaccept( socket, &nam );
+ mnam.m_data = &sa;
+ mnam.m_len = sizeof(sa);
+
+ (void) soaccept(so, &mnam);
+
+ so->so_state = SS_NBIO | SS_ISCONNECTED;
+
+ OskitDumpBuffer( so, sizeof(*so) );
+
+ OS_DbgPrint(OSK_MID_TRACE,("error = %d\n", error));
+ if (name) {
+ /* check sa_len before it is destroyed */
+ memcpy( AddrOut, &sa, AddrLen < sizeof(sa) ? AddrLen : sizeof(sa) );
+ OS_DbgPrint(OSK_MID_TRACE,("error = %d\n", error));
+ *OutAddrLen = namelen; /* copyout actually */
+ }
+ OS_DbgPrint(OSK_MID_TRACE,("error = %d\n", error));
+ splx(s);
+ }
+out:
+ OS_DbgPrint(OSK_MID_TRACE,("OSKITTCP: Returning %d\n", error));
+ return (error);
}
/* The story so far
reactos/drivers/lib/oskittcp/oskittcp
diff -u -r1.3 -r1.3.6.1
--- kern_clock.c 23 Sep 2004 03:02:29 -0000 1.3
+++ kern_clock.c 30 Dec 2004 04:36:18 -0000 1.3.6.1
@@ -85,7 +85,7 @@
/* Exported to machdep.c. */
struct callout *callfree, *callout;
-static struct callout calltodo;
+struct callout calltodo;
long tk_cancc;
long tk_nin;
reactos/drivers/lib/oskittcp/oskittcp
diff -u -r1.7 -r1.7.6.1
--- sleep.c 23 Sep 2004 03:02:29 -0000 1.7
+++ sleep.c 30 Dec 2004 04:36:18 -0000 1.7.6.1
@@ -20,12 +20,17 @@
OSK_UINT flags = 0;
OS_DbgPrint
- (OSK_MID_TRACE,("XXX Bytes to receive: %d\n", so->so_rcv.sb_cc));
+ (OSK_MID_TRACE,("XXX Bytes to receive: %d state %x\n",
+ so->so_rcv.sb_cc, so->so_state));
if( so->so_state & SS_ISCONNECTED ) {
OS_DbgPrint(OSK_MID_TRACE,("Socket connected!\n"));
flags |= SEL_CONNECT;
}
+ if( so->so_q ) {
+ OS_DbgPrint(OSK_MID_TRACE,("Socket accepting q\n"));
+ flags |= SEL_ACCEPT;
+ }
if( so->so_rcv.sb_cc > 0 ) {
OS_DbgPrint(OSK_MID_TRACE,("Socket readable\n"));
flags |= SEL_READ;
reactos/drivers/lib/oskittcp/oskittcp
diff -u -r1.6 -r1.6.2.1
--- uipc_mbuf.c 21 Nov 2004 20:54:52 -0000 1.6
+++ uipc_mbuf.c 30 Dec 2004 04:36:18 -0000 1.6.2.1
@@ -330,7 +330,7 @@
copyhdr = 1;
while (off > 0) {
if (m == 0)
- panic("m_copym");
+ panic("m_copym: %d", off);
if (off < m->m_len)
break;
off -= m->m_len;
reactos/drivers/lib/oskittcp/oskittcp
diff -u -r1.9 -r1.9.6.1
--- uipc_socket.c 23 Sep 2004 06:39:16 -0000 1.9
+++ uipc_socket.c 30 Dec 2004 04:36:18 -0000 1.9.6.1
@@ -608,6 +608,8 @@
}
if ((so->so_state & (SS_ISCONNECTED|SS_ISCONNECTING)) == 0 &&
(so->so_proto->pr_flags & PR_CONNREQUIRED)) {
+ printf("so: %x\n", so);
+ __asm__("int3");
error = ENOTCONN;
goto release;
}
@@ -774,7 +776,7 @@
* Keep sockbuf locked against other readers.
*/
while (flags & MSG_WAITALL && m == 0 && uio->uio_resid > 0 &&
- !sosendallatonce(so) && !nextrecord) {
+ !sosendallatonce(so) && !nextrecord) {
if (so->so_error || so->so_state & SS_CANTRCVMORE)
break;
error = sbwait(&so->so_rcv);
reactos/drivers/net/afd/afd
diff -u -r1.5.2.3 -r1.5.2.4
--- connect.c 13 Dec 2004 16:18:00 -0000 1.5.2.3
+++ connect.c 30 Dec 2004 04:36:18 -0000 1.5.2.4
@@ -1,4 +1,4 @@
-/* $Id: connect.c,v 1.5.2.3 2004/12/13 16:18:00 hyperion Exp $
+/* $Id: connect.c,v 1.5.2.4 2004/12/30 04:36:18 hyperion Exp $
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* FILE: drivers/net/afd/afd/connect.c
@@ -40,12 +40,36 @@
return Status;
}
+NTSTATUS MakeSocketIntoConnection( PAFD_FCB FCB ) {
+ NTSTATUS Status;
+
+ /* Allocate the receive area and start receiving */
+ FCB->Recv.Window =
+ ExAllocatePool( NonPagedPool, FCB->Recv.Size );
+ FCB->Send.Window =
+ ExAllocatePool( NonPagedPool, FCB->Send.Size );
+
+ FCB->State = SOCKET_STATE_CONNECTED;
+
+ if( FCB->Recv.Window ) {
+ Status = TdiReceive( &FCB->ReceiveIrp.InFlightRequest,
+ FCB->Connection.Object,
+ TDI_RECEIVE_NORMAL,
+ FCB->Recv.Window,
+ FCB->Recv.Size,
+ &FCB->ReceiveIrp.Iosb,
+ ReceiveComplete,
+ FCB );
+ }
+
+ return Status;
+}
+
NTSTATUS DDKAPI StreamSocketConnectComplete
( PDEVICE_OBJECT DeviceObject,
PIRP Irp,
PVOID Context ) {
NTSTATUS Status = Irp->IoStatus.Status;
- PIO_STACK_LOCATION IrpSp = IoGetCurrentIrpStackLocation(Irp);
PAFD_FCB FCB = (PAFD_FCB)Context;
PLIST_ENTRY NextIrpEntry;
PIRP NextIrp;
@@ -83,22 +107,7 @@
}
if( NT_SUCCESS(Status) ) {
- /* Allocate the receive area and start receiving */
- FCB->Recv.Window =
- ExAllocatePool( NonPagedPool, FCB->Recv.Size );
- FCB->Send.Window =
- ExAllocatePool( NonPagedPool, FCB->Send.Size );
-
- if( FCB->Recv.Window ) {
- Status = TdiReceive( &FCB->ReceiveIrp.InFlightRequest,
- IrpSp->FileObject,
- TDI_RECEIVE_NORMAL,
- FCB->Recv.Window,
- FCB->Recv.Size,
- &FCB->ReceiveIrp.Iosb,
- ReceiveComplete,
- FCB );
- }
+ Status = MakeSocketIntoConnection( FCB );
if( FCB->Send.Window &&
!IsListEmpty( &FCB->PendingIrpList[FUNCTION_SEND] ) ) {
@@ -184,9 +193,18 @@
case SOCKET_STATE_BOUND:
FCB->RemoteAddress =
TaCopyTransportAddress( &ConnectReq->RemoteAddress );
-
+
+ if( FCB->Flags & AFD_ENDPOINT_CONNECTIONLESS )
+ {
+ Status = STATUS_SUCCESS;
+ break;
+ }
+
Status = WarmSocketForConnection( FCB );
+ if( !NT_SUCCESS(Status) )
+ break;
+
FCB->State = SOCKET_STATE_CONNECTING;
TdiBuildConnectionInfo
@@ -194,9 +212,10 @@
&ConnectReq->RemoteAddress );
if( TargetAddress ) {
- Status = TdiConnect( &FCB->PendingTdiIrp,
+ Status = TdiConnect( &FCB->ConnectIrp.InFlightRequest,
FCB->Connection.Object,
TargetAddress,
+ &FCB->ConnectIrp.Iosb,
StreamSocketConnectComplete,
FCB );
reactos/drivers/net/afd/afd
diff -u -r1.4.8.3 -r1.4.8.4
--- info.c 13 Dec 2004 16:18:00 -0000 1.4.8.3
+++ info.c 30 Dec 2004 04:36:18 -0000 1.4.8.4
@@ -1,4 +1,4 @@
-/* $Id: info.c,v 1.4.8.3 2004/12/13 16:18:00 hyperion Exp $
+/* $Id: info.c,v 1.4.8.4 2004/12/30 04:36:18 hyperion Exp $
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* FILE: drivers/net/afd/afd/info.c
reactos/drivers/net/afd/afd
diff -u -r1.4 -r1.4.6.1
--- listen.c 5 Sep 2004 04:26:29 -0000 1.4
+++ listen.c 30 Dec 2004 04:36:18 -0000 1.4.6.1
@@ -1,4 +1,4 @@
-/* $Id: listen.c,v 1.4 2004/09/05 04:26:29 arty Exp $
+/* $Id: listen.c,v 1.4.6.1 2004/12/30 04:36:18 hyperion Exp $
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* FILE: drivers/net/afd/afd/listen.c
@@ -12,12 +12,54 @@
#include "tdiconn.h"
#include "debug.h"
+VOID SatisfyAccept( PIRP Irp, PFILE_OBJECT NewFileObject,
+ PAFD_TDI_OBJECT_QELT Qelt ) {
+ PAFD_FCB FCB = NewFileObject->FsContext;
+
+ if( !SocketAcquireStateLock( FCB ) ) return;
+
+ /* Transfer the connection to the new socket, launch the opening read */
+ AFD_DbgPrint(MID_TRACE,("Completing a real accept (FCB %x)\n", FCB));
+
+ FCB->State = SOCKET_STATE_CONNECTED;
+ FCB->Connection = Qelt->Object;
+#if 0
+ FCB->RemoteAddress =
+ TaCopyTransportAddress( Qelt->ConnInfo->RemoteAddress );
+#endif
+
+ Irp->IoStatus.Information = 0;
+ Irp->IoStatus.Status = STATUS_SUCCESS;
+ IoCompleteRequest( Irp, IO_NETWORK_INCREMENT );
+
+ MakeSocketIntoConnection( FCB );
+
+ SocketStateUnlock( FCB );
+}
+
+VOID SatisfyPreAccept( PIRP Irp, PAFD_TDI_OBJECT_QELT Qelt ) {
+ PAFD_RECEIVED_ACCEPT_DATA ListenReceive =
+ (PAFD_RECEIVED_ACCEPT_DATA)Irp->AssociatedIrp.SystemBuffer;
+
+ ListenReceive->SequenceNumber = Qelt->Seq;
+ AFD_DbgPrint(MID_TRACE,("Giving SEQ %d to userland\n", Qelt->Seq));
+#if 0
+ TaCopyTransportAddressInPlace( &ListenReceive->Address,
+ Qelt->ConnInfo->RemoteAddress );
+#endif
+
+ Irp->IoStatus.Information = sizeof(*ListenReceive);
+ Irp->IoStatus.Status = STATUS_SUCCESS;
+ IoCompleteRequest( Irp, IO_NETWORK_INCREMENT );
+}
+
NTSTATUS DDKAPI ListenComplete
( PDEVICE_OBJECT DeviceObject,
PIRP Irp,
PVOID Context ) {
NTSTATUS Status = STATUS_UNSUCCESSFUL;
PAFD_FCB FCB = (PAFD_FCB)Context;
+ PAFD_TDI_OBJECT_QELT Qelt;
if( !SocketAcquireStateLock( FCB ) ) return Status;
@@ -31,7 +73,39 @@
AFD_DbgPrint(MID_TRACE,("Completing listen request.\n"));
AFD_DbgPrint(MID_TRACE,("IoStatus was %x\n", FCB->ListenIrp.Iosb.Status));
- AFD_DbgPrint(MID_TRACE,("Doing nothing as yet.\n"));
+
+ Qelt = ExAllocatePool( NonPagedPool, sizeof(*Qelt) );
+ if( !Qelt ) {
+ TdiCloseDevice( FCB->Connection.Handle,
+ FCB->Connection.Object );
+ } else {
+ Qelt->Object = FCB->Connection;
+ Qelt->Seq = FCB->ConnSeq++;
+ InsertTailList( &FCB->PendingConnections, &Qelt->ListEntry );
+ }
+
+ /* Satisfy a pre-accept request if one is available */
+ if( !IsListEmpty( &FCB->PendingIrpList[FUNCTION_PREACCEPT] ) &&
+ !IsListEmpty( &FCB->PendingConnections ) ) {
+ PLIST_ENTRY PendingIrp =
+ RemoveHeadList( &FCB->PendingIrpList[FUNCTION_PREACCEPT] );
+ PLIST_ENTRY PendingConn = FCB->PendingConnections.Flink;
+ SatisfyPreAccept
+ ( CONTAINING_RECORD( PendingIrp, IRP,
+ Tail.Overlay.ListEntry ),
+ CONTAINING_RECORD( PendingConn, AFD_TDI_OBJECT_QELT,
+ ListEntry ) );
+ }
+
+ FCB->NeedsNewListen = TRUE;
+
+ /* Trigger a select return if appropriate */
+ if( !IsListEmpty( &FCB->PendingConnections ) ) {
+ FCB->PollState |= AFD_EVENT_ACCEPT;
+ PollReeval( FCB->DeviceExt, FCB->FileObject );
+ } else {
+ FCB->PollState &= ~AFD_EVENT_ACCEPT;
+ }
SocketStateUnlock( FCB );
@@ -61,17 +135,140 @@
FCB->DelayedAccept = ListenReq->UseDelayedAcceptance;
+ AFD_DbgPrint(MID_TRACE,("ADDRESSFILE: %x\n", FCB->AddressFile.Handle));
+
Status = WarmSocketForConnection( FCB );
FCB->State = SOCKET_STATE_LISTENING;
+ AFD_DbgPrint(MID_TRACE,("Status from warmsocket %x\n", Status));
+
+ TdiBuildNullConnectionInfo
+ ( &FCB->ListenIrp.ConnectionCallInfo,
+ FCB->LocalAddress->Address[0].AddressType );
+ TdiBuildNullConnectionInfo
+ ( &FCB->ListenIrp.ConnectionReturnInfo,
+ FCB->LocalAddress->Address[0].AddressType );
+
Status = TdiListen( &FCB->ListenIrp.InFlightRequest,
FCB->Connection.Object,
- &FCB->ListenIrp.ConnectionInfo,
+ &FCB->ListenIrp.ConnectionCallInfo,
+ &FCB->ListenIrp.ConnectionReturnInfo,
&FCB->ListenIrp.Iosb,
ListenComplete,
FCB );
+ if( NT_SUCCESS(Status) || Status == STATUS_PENDING )
+ Status = STATUS_SUCCESS;
+
AFD_DbgPrint(MID_TRACE,("Returning %x\n", Status));
return UnlockAndMaybeComplete( FCB, Status, Irp, 0, NULL, TRUE );
}
+
+NTSTATUS AfdWaitForListen( PDEVICE_OBJECT DeviceObject, PIRP Irp,
+ PIO_STACK_LOCATION IrpSp ) {
+ NTSTATUS Status = STATUS_SUCCESS;
+ PFILE_OBJECT FileObject = IrpSp->FileObject;
+ PAFD_FCB FCB = FileObject->FsContext;
+
+ AFD_DbgPrint(MID_TRACE,("Called\n"));
+
+ if( !SocketAcquireStateLock( FCB ) ) return LostSocket( Irp, TRUE );
+
+ if( !IsListEmpty( &FCB->PendingConnections ) ) {
+ PLIST_ENTRY PendingConn = FCB->PendingConnections.Flink;
+
+ /* We have a pending connection ... complete this irp right away */
+ SatisfyPreAccept
+ ( Irp,
+ CONTAINING_RECORD
+ ( PendingConn, AFD_TDI_OBJECT_QELT, ListEntry ) );
+
+ AFD_DbgPrint(MID_TRACE,("Completed a wait for accept\n"));
+
+ SocketStateUnlock( FCB );
+ return Status;
+ } else {
+ AFD_DbgPrint(MID_TRACE,("Holding\n"));
+
+ return LeaveIrpUntilLater( FCB, Irp, FUNCTION_PREACCEPT );
+ }
+}
+
+NTSTATUS AfdAccept( PDEVICE_OBJECT DeviceObject, PIRP Irp,
+ PIO_STACK_LOCATION IrpSp ) {
+ NTSTATUS Status = STATUS_SUCCESS;
+ PFILE_OBJECT FileObject = IrpSp->FileObject;
+ PAFD_FCB FCB = FileObject->FsContext;
+ PAFD_ACCEPT_DATA AcceptData = Irp->AssociatedIrp.SystemBuffer;
+ PLIST_ENTRY PendingConn;
+
+ AFD_DbgPrint(MID_TRACE,("Called\n"));
+
+ if( !SocketAcquireStateLock( FCB ) ) return LostSocket( Irp, TRUE );
+
+ if( FCB->NeedsNewListen ) {
+ AFD_DbgPrint(MID_TRACE,("ADDRESSFILE: %x\n", FCB->AddressFile.Handle));
+
+ /* Launch new accept socket */
+ Status = WarmSocketForConnection( FCB );
+
+ if( Status == STATUS_SUCCESS ) {
+ TdiBuildNullConnectionInfo
+ ( &FCB->ListenIrp.ConnectionReturnInfo,
+ FCB->LocalAddress->Address[0].AddressType );
+
+ Status = TdiListen( &FCB->ListenIrp.InFlightRequest,
+ FCB->Connection.Object,
+ &FCB->ListenIrp.ConnectionCallInfo,
+ &FCB->ListenIrp.ConnectionReturnInfo,
+ &FCB->ListenIrp.Iosb,
+ ListenComplete,
+ FCB );
+ }
+ FCB->NeedsNewListen = FALSE;
+ }
+
+ for( PendingConn = FCB->PendingConnections.Flink;
+ PendingConn != &FCB->PendingConnections;
+ PendingConn = PendingConn->Flink ) {
+ PAFD_TDI_OBJECT_QELT PendingConnObj =
+ CONTAINING_RECORD( PendingConn, AFD_TDI_OBJECT_QELT, ListEntry );
+
+ AFD_DbgPrint(MID_TRACE,("Comparing Seq %d to Q %d\n",
+ AcceptData->SequenceNumber,
+ PendingConnObj->Seq));
+
+ if( PendingConnObj->Seq == AcceptData->SequenceNumber ) {
+ PFILE_OBJECT NewFileObject;
+
+ RemoveEntryList( PendingConn );
+
+ Status = ObReferenceObjectByHandle
+ ( (HANDLE)AcceptData->ListenHandle,
+ FILE_ALL_ACCESS,
+ NULL,
+ KernelMode,
+ (PVOID *)&NewFileObject,
+ NULL );
+
+ /* We have a pending connection ... complete this irp right away */
+ SatisfyAccept( Irp, NewFileObject, PendingConnObj );
+
+ ObDereferenceObject( NewFileObject );
+
+ AFD_DbgPrint(MID_TRACE,("Completed a wait for accept\n"));
+
+ ExFreePool( PendingConnObj );
+
+ if( IsListEmpty( &FCB->PendingConnections ) )
+ FCB->PollState &= ~AFD_EVENT_ACCEPT;
+
+ SocketStateUnlock( FCB );
+ return Status;
+ }
+ }
+
+ SocketStateUnlock( FCB );
+ return STATUS_UNSUCCESSFUL;
+}
reactos/drivers/net/afd/afd
diff -u -r1.7 -r1.7.2.1
--- lock.c 17 Nov 2004 05:17:22 -0000 1.7
+++ lock.c 30 Dec 2004 04:36:18 -0000 1.7.2.1
@@ -1,4 +1,4 @@
-/* $Id: lock.c,v 1.7 2004/11/17 05:17:22 arty Exp $
+/* $Id: lock.c,v 1.7.2.1 2004/12/30 04:36:18 hyperion Exp $
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* FILE: drivers/net/afd/afd/lock.c
@@ -142,7 +142,8 @@
UINT i;
for( i = 0; i < HandleCount; i++ ) {
- ObDereferenceObject( (PVOID)HandleArray[i].Handle );
+ if( HandleArray[i].Handle )
+ ObDereferenceObject( (PVOID)HandleArray[i].Handle );
}
ExFreePool( HandleArray );
reactos/drivers/net/afd/afd
diff -u -r1.13.2.3 -r1.13.2.4
--- main.c 13 Dec 2004 16:18:00 -0000 1.13.2.3
+++ main.c 30 Dec 2004 04:36:18 -0000 1.13.2.4
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.13.2.3 2004/12/13 16:18:00 hyperion Exp $
+/* $Id: main.c,v 1.13.2.4 2004/12/30 04:36:18 hyperion Exp $
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* FILE: drivers/net/afd/afd/main.c
@@ -104,7 +104,8 @@
}
InitializeListHead( &FCB->DatagramList );
-
+ InitializeListHead( &FCB->PendingConnections );
+
AFD_DbgPrint(MID_TRACE,("%x: Checking command channel\n", FCB));
if( ConnectInfo ) {
@@ -243,16 +244,24 @@
return UnlockAndMaybeComplete( FCB, STATUS_NO_MEMORY,
Irp, 0, NULL, FALSE );
- Status = TdiBuildNullConnectionInfo
- ( &ConnInfo, FCB->RemoteAddress->Address[0].AddressType );
-
- if( !NT_SUCCESS(Status) || !ConnInfo )
- return UnlockAndMaybeComplete( FCB, STATUS_NO_MEMORY,
- Irp, 0, NULL, TRUE );
+ if (NULL == FCB->RemoteAddress)
+ {
+ ConnInfo = NULL;
+ }
+ else
+ {
+ Status = TdiBuildNullConnectionInfo
+ ( &ConnInfo, FCB->RemoteAddress->Address[0].AddressType );
+
+ if( !NT_SUCCESS(Status) || !ConnInfo )
+ return UnlockAndMaybeComplete( FCB, STATUS_NO_MEMORY,
+ Irp, 0, NULL, TRUE );
+ }
if( DisReq->DisconnectType & AFD_DISCONNECT_SEND )
Flags |= TDI_DISCONNECT_RELEASE;
- if( DisReq->DisconnectType & AFD_DISCONNECT_RECV )
+ if( DisReq->DisconnectType & AFD_DISCONNECT_RECV ||
+ DisReq->DisconnectType & AFD_DISCONNECT_ABORT )
Flags |= TDI_DISCONNECT_ABORT;
Status = TdiDisconnect( FCB->Connection.Object,
@@ -349,12 +358,10 @@
return AfdSetContext( DeviceObject, Irp, IrpSp );
case IOCTL_AFD_WAIT_FOR_LISTEN:
- AFD_DbgPrint(MIN_TRACE, ("IOCTL_AFD_WAIT_FOR_LISTEN\n"));
- break;
+ return AfdWaitForListen( DeviceObject, Irp, IrpSp );
case IOCTL_AFD_ACCEPT:
- AFD_DbgPrint(MIN_TRACE, ("IOCTL_AFD_ACCEPT\n"));
- break;
+ return AfdAccept( DeviceObject, Irp, IrpSp );
case IOCTL_AFD_DISCONNECT:
return AfdDisconnect( DeviceObject, Irp, IrpSp );
reactos/drivers/net/afd/afd
diff -u -r1.12.2.3 -r1.12.2.4
--- read.c 13 Dec 2004 16:18:00 -0000 1.12.2.3
+++ read.c 30 Dec 2004 04:36:18 -0000 1.12.2.4
@@ -1,4 +1,4 @@
-/* $Id: read.c,v 1.12.2.3 2004/12/13 16:18:00 hyperion Exp $
+/* $Id: read.c,v 1.12.2.4 2004/12/30 04:36:18 hyperion Exp $
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* FILE: drivers/net/afd/afd/read.c
@@ -8,12 +8,26 @@
* 20040708 Created
*
* Improve buffering code
+ *
+ * We're keeping data receiving in one of two states:
+ * A) Some data available in the FCB
+ * FCB->Recv.BytesUsed != FCB->Recv.Content
+ * FCB->ReceiveIrp.InFlightRequest == NULL
+ * AFD_EVENT_RECEIVE set in FCB->PollState
+ * B) No data available in the FCB
+ * FCB->Recv.BytesUsed == FCB->Recv.Content (== 0)
+ * FCB->RecieveIrp.InFlightRequest != NULL
+ * AFD_EVENT_RECEIVED not set in FCB->PollState
+ * So basically we either have data available or a TDI receive
+ * in flight.
*/
#include "afd.h"
#include "tdi_proto.h"
#include "tdiconn.h"
#include "debug.h"
+static VOID ProcessClose( PAFD_FCB FCB );
+
NTSTATUS TryToSatisfyRecvRequestFromBuffer( PAFD_FCB FCB,
PAFD_RECV_INFO RecvReq,
PUINT TotalBytesCopied ) {
@@ -22,6 +36,7 @@
FCB->Recv.Content - FCB->Recv.BytesUsed;
*TotalBytesCopied = 0;
PAFD_MAPBUF Map;
+ NTSTATUS Status;
AFD_DbgPrint(MID_TRACE,("Called, BytesAvailable = %d\n",
BytesAvailable));
@@ -62,13 +77,41 @@
}
}
- if( FCB->Recv.BytesUsed == FCB->Recv.Content )
+ /* If there's nothing left in our buffer start a new request */
+ if( FCB->Recv.BytesUsed == FCB->Recv.Content ) {
FCB->Recv.BytesUsed = FCB->Recv.Content = 0;
+ FCB->PollState &= ~AFD_EVENT_RECEIVE;
+
+ if( !FCB->ReceiveIrp.InFlightRequest ) {
+ AFD_DbgPrint(MID_TRACE,("Replenishing buffer\n"));
+
+ SocketCalloutEnter( FCB );
+
+ Status = TdiReceive( &FCB->ReceiveIrp.InFlightRequest,
+ FCB->Connection.Object,
+ TDI_RECEIVE_NORMAL,
+ FCB->Recv.Window,
+ FCB->Recv.Size,
+ &FCB->ReceiveIrp.Iosb,
+ ReceiveComplete,
+ FCB );
+
+ if( Status == STATUS_SUCCESS ) {
+ if( !FCB->ReceiveIrp.Iosb.Information ) {
+ AFD_DbgPrint(MID_TRACE,("Looks like an EOF\n"));
+ ProcessClose( FCB );
+ }
+ FCB->Recv.Content = FCB->ReceiveIrp.Iosb.Information;
+ }
+
+ SocketCalloutLeave( FCB );
+ }
+ }
return STATUS_SUCCESS;
}
-VOID ProcessClose( PAFD_FCB FCB ) {
+static VOID ProcessClose( PAFD_FCB FCB ) {
PLIST_ENTRY NextIrpEntry;
PIRP NextIrp;
@@ -98,7 +141,6 @@
PIRP Irp,
PVOID Context ) {
NTSTATUS Status = Irp->IoStatus.Status;
- PIO_STACK_LOCATION IrpSp = IoGetCurrentIrpStackLocation(Irp);
PAFD_FCB FCB = (PAFD_FCB)Context;
PLIST_ENTRY NextIrpEntry;
PIRP NextIrp;
@@ -164,28 +206,7 @@
}
}
- if( FCB->Recv.Window && !FCB->Recv.Content ) {
- AFD_DbgPrint(MID_TRACE,
- ("Exhausted our buffer. Requesting new: %x\n", FCB));
-
- SocketCalloutEnter( FCB );
-
- Status = TdiReceive( &FCB->ReceiveIrp.InFlightRequest,
- IrpSp->FileObject,
- TDI_RECEIVE_NORMAL,
- FCB->Recv.Window,
- FCB->Recv.Size,
- &FCB->ReceiveIrp.Iosb,
- ReceiveComplete,
- FCB );
-
- if( Status == STATUS_SUCCESS &&
- !FCB->ReceiveIrp.Iosb.Information ) {
- ProcessClose( FCB );
- }
-
- SocketCalloutLeave( FCB );
- } else Status = STATUS_SUCCESS;
+ Status = STATUS_SUCCESS;
} else {
ProcessClose( FCB );
}
@@ -219,6 +240,13 @@
if( !SocketAcquireStateLock( FCB ) ) return LostSocket( Irp, FALSE );
+ if( FCB->Flags & AFD_ENDPOINT_CONNECTIONLESS )
+ {
+ AFD_DbgPrint(MID_TRACE,("Receive on connection-less sockets not implemented\n"));
+ return UnlockAndMaybeComplete( FCB, STATUS_NOT_IMPLEMENTED,
+ Irp, 0, NULL, FALSE );
+ }
+
FCB->EventsFired &= ~AFD_EVENT_RECEIVE;
PollReeval( FCB->DeviceExt, FCB->FileObject );
@@ -231,51 +259,22 @@
NULL, NULL,
TRUE, FALSE );
- /* Launch a new recv request if we have no data */
+ /* Check if we're not closed down yet */
if( !(FCB->PollState & AFD_EVENT_CLOSE ) ) {
AFD_DbgPrint(MID_TRACE,("Not EOF yet\n"));
- if( FCB->Recv.Window && !(FCB->Recv.Content - FCB->Recv.BytesUsed) &&
- !FCB->ReceiveIrp.InFlightRequest ) {
- FCB->Recv.Content = 0;
- FCB->Recv.BytesUsed = 0;
- AFD_DbgPrint(MID_TRACE,("Replenishing buffer\n"));
-
- SocketCalloutEnter( FCB );
-
- Status = TdiReceive( &FCB->ReceiveIrp.InFlightRequest,
- FCB->Connection.Object,
- TDI_RECEIVE_NORMAL,
- FCB->Recv.Window,
- FCB->Recv.Size,
- &FCB->ReceiveIrp.Iosb,
- ReceiveComplete,
- FCB );
-
- if( Status == STATUS_SUCCESS ) {
- if( !FCB->ReceiveIrp.Iosb.Information ) {
- AFD_DbgPrint(MID_TRACE,("Looks like an EOF\n"));
- ProcessClose( FCB );
- }
- FCB->Recv.Content = FCB->ReceiveIrp.Iosb.Information;
- }
-
- SocketCalloutLeave( FCB );
+ if( FCB->ReceiveIrp.InFlightRequest ) {
+ AFD_DbgPrint(MID_TRACE,("We're waiting on a previous irp\n"));
+ Status = STATUS_PENDING;
} else {
- AFD_DbgPrint(MID_TRACE,("There is probably more data here\n"));
- if( FCB->ReceiveIrp.InFlightRequest ) {
- AFD_DbgPrint(MID_TRACE,("We're waiting on a previous irp\n"));
- Status = STATUS_PENDING;
- } else {
- AFD_DbgPrint(MID_TRACE,("The buffer is likely not empty\n"));
- Status = STATUS_SUCCESS;
- }
+ AFD_DbgPrint(MID_TRACE,("The buffer is likely not empty\n"));
+ Status = STATUS_SUCCESS;
}
} else {
AFD_DbgPrint(MID_TRACE,("EOF Happened already\n"));
FCB->Recv.Content = 0;
FCB->Recv.BytesUsed = 0;
- Status = STATUS_SUCCESS;
+ Status = STATUS_END_OF_FILE;
ProcessClose( FCB );
}
reactos/drivers/net/afd/afd
diff -u -r1.7.2.3 -r1.7.2.4
--- select.c 13 Dec 2004 16:18:00 -0000 1.7.2.3
+++ select.c 30 Dec 2004 04:36:18 -0000 1.7.2.4
@@ -1,4 +1,4 @@
-/* $Id: select.c,v 1.7.2.3 2004/12/13 16:18:00 hyperion Exp $
+/* $Id: select.c,v 1.7.2.4 2004/12/30 04:36:18 hyperion Exp $
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* FILE: drivers/net/afd/afd/select.c
@@ -42,12 +42,12 @@
}
VOID SignalSocket( PAFD_ACTIVE_POLL Poll, PAFD_POLL_INFO PollReq,
- NTSTATUS Status, UINT Collected ) {
+ NTSTATUS Status ) {
PIRP Irp = Poll->Irp;
- AFD_DbgPrint(MID_TRACE,("Called (Status %x Events %d)\n",
- Status, Collected));
+ AFD_DbgPrint(MID_TRACE,("Called (Status %x)\n", Status));
Poll->Irp->IoStatus.Status = Status;
- Poll->Irp->IoStatus.Information = Collected;
+ Poll->Irp->IoStatus.Information =
+ FIELD_OFFSET(AFD_POLL_INFO, Handles) + sizeof(AFD_HANDLE) * PollReq->HandleCount;
CopyBackStatus( PollReq->Handles,
PollReq->HandleCount );
UnlockHandles( AFD_HANDLES(PollReq), PollReq->HandleCount );
@@ -77,7 +77,7 @@
ZeroEvents( PollReq->Handles, PollReq->HandleCount );
KeAcquireSpinLock( &DeviceExt->Lock, &OldIrql );
- SignalSocket( Poll, PollReq, STATUS_TIMEOUT, 0 );
+ SignalSocket( Poll, PollReq, STATUS_TIMEOUT );
KeReleaseSpinLock( &DeviceExt->Lock, OldIrql );
AFD_DbgPrint(MID_TRACE,("Timeout\n"));
@@ -91,16 +91,16 @@
PAFD_POLL_INFO PollReq;
KeAcquireSpinLock( &DeviceExt->Lock, &OldIrql );
-
- for( ListEntry = DeviceExt->Polls.Flink;
- ListEntry != &DeviceExt->Polls;
- ListEntry = ListEntry->Flink ) {
+
+ ListEntry = DeviceExt->Polls.Flink;
+ while ( ListEntry != &DeviceExt->Polls ) {
Poll = CONTAINING_RECORD(ListEntry, AFD_ACTIVE_POLL, ListEntry);
+ ListEntry = ListEntry->Flink;
if( Poll->Exclusive ) {
Irp = Poll->Irp;
PollReq = Irp->AssociatedIrp.SystemBuffer;
ZeroEvents( PollReq->Handles, PollReq->HandleCount );
- SignalSocket( Poll, PollReq, STATUS_CANCELLED, 0 );
+ SignalSocket( Poll, PollReq, STATUS_CANCELLED );
}
}
@@ -135,7 +135,7 @@
if( !AFD_HANDLES(PollReq) ) {
Irp->IoStatus.Status = STATUS_NO_MEMORY;
- Irp->IoStatus.Information = -1;
+ Irp->IoStatus.Information = 0;
IoCompleteRequest( Irp, IO_NETWORK_INCREMENT );
return Irp->IoStatus.Status;
}
@@ -186,8 +186,7 @@
if( Signalled ) {
Status = STATUS_SUCCESS;
Irp->IoStatus.Status = Status;
- Irp->IoStatus.Information = Signalled;
- SignalSocket( Poll, PollReq, Status, Signalled );
+ SignalSocket( Poll, PollReq, Status );
} else {
Status = STATUS_PENDING;
IoMarkIrpPending( Irp );
@@ -344,7 +343,7 @@
if( UpdatePollWithFCB( Poll, FileObject ) ) {
ThePollEnt = ThePollEnt->Flink;
AFD_DbgPrint(MID_TRACE,("Signalling socket\n"));
- SignalSocket( Poll, PollReq, STATUS_SUCCESS, 1 );
+ SignalSocket( Poll, PollReq, STATUS_SUCCESS );
} else
ThePollEnt = ThePollEnt->Flink;
}
reactos/drivers/net/afd/afd
diff -u -r1.21.6.1 -r1.21.6.2
--- tdi.c 8 Dec 2004 21:56:51 -0000 1.21.6.1
+++ tdi.c 30 Dec 2004 04:36:19 -0000 1.21.6.2
@@ -272,6 +272,7 @@
PIRP *Irp,
PFILE_OBJECT ConnectionObject,
PTDI_CONNECTION_INFORMATION RemoteAddress,
+ PIO_STATUS_BLOCK Iosb,
PIO_COMPLETION_ROUTINE CompletionRoutine,
PVOID CompletionContext)
/*
@@ -284,7 +285,6 @@
*/
{
PDEVICE_OBJECT DeviceObject;
- IO_STATUS_BLOCK Iosb;
NTSTATUS Status;
AFD_DbgPrint(MAX_TRACE, ("Called\n"));
@@ -297,7 +297,7 @@
DeviceObject, /* Device object */
ConnectionObject, /* File object */
NULL, /* Event */
- &Iosb); /* Status */
+ Iosb); /* Status */
if (!*Irp) {
return STATUS_INSUFFICIENT_RESOURCES;
}
@@ -311,7 +311,7 @@
RemoteAddress, /* Request connection information */
RemoteAddress); /* Return connection information */
- Status = TdiCall(*Irp, DeviceObject, NULL, &Iosb);
+ Status = TdiCall(*Irp, DeviceObject, NULL, Iosb);
return Status;
}
@@ -369,6 +369,7 @@
( PIRP *Irp,
PFILE_OBJECT ConnectionObject,
PTDI_CONNECTION_INFORMATION *RequestConnectionInfo,
+ PTDI_CONNECTION_INFORMATION *ReturnConnectionInfo,
PIO_STATUS_BLOCK Iosb,
PIO_COMPLETION_ROUTINE CompletionRoutine,
PVOID CompletionContext)
@@ -412,7 +413,7 @@
CompletionContext, /* Completion routine context */
0, /* Flags */
*RequestConnectionInfo, /* Request connection information */
- NULL /* ReturnConnectionInfo */); /* Return connection information */
+ *ReturnConnectionInfo); /* Return connection information */
Status = TdiCall(*Irp, DeviceObject, NULL /* Don't wait for completion */, Iosb);
reactos/drivers/net/afd/afd
diff -u -r1.5.2.2 -r1.5.2.3
--- tdiconn.c 13 Dec 2004 16:18:00 -0000 1.5.2.2
+++ tdiconn.c 30 Dec 2004 04:36:19 -0000 1.5.2.3
@@ -1,4 +1,4 @@
-/* $Id: tdiconn.c,v 1.5.2.2 2004/12/13 16:18:00 hyperion Exp $
+/* $Id: tdiconn.c,v 1.5.2.3 2004/12/30 04:36:19 hyperion Exp $
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* FILE: drivers/net/afd/afd/tdiconn.c
reactos/drivers/net/afd/afd
diff -u -r1.12.2.3 -r1.12.2.4
--- write.c 13 Dec 2004 16:18:00 -0000 1.12.2.3
+++ write.c 30 Dec 2004 04:36:19 -0000 1.12.2.4
@@ -1,4 +1,4 @@
-/* $Id: write.c,v 1.12.2.3 2004/12/13 16:18:00 hyperion Exp $
+/* $Id: write.c,v 1.12.2.4 2004/12/30 04:36:19 hyperion Exp $
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* FILE: drivers/net/afd/afd/write.c
@@ -152,6 +152,33 @@
return STATUS_SUCCESS;
}
+NTSTATUS DDKAPI PacketSocketSendComplete
+( PDEVICE_OBJECT DeviceObject,
+ PIRP Irp,
+ PVOID Context ) {
+ PAFD_FCB FCB = (PAFD_FCB)Context;
+
+ AFD_DbgPrint(MID_TRACE,("Called, status %x, %d bytes used\n",
+ Irp->IoStatus.Status,
+ Irp->IoStatus.Information));
+
+ /* It's ok if the FCB already died */
+ if( !SocketAcquireStateLock( FCB ) ) return STATUS_SUCCESS;
+
+ FCB->SendIrp.InFlightRequest = NULL;
+ /* Request is not in flight any longer */
+
+ if( FCB->State == SOCKET_STATE_CLOSED ) {
+ SocketStateUnlock( FCB );
+ DestroySocket( FCB );
+ return STATUS_SUCCESS;
+ }
+
+ SocketStateUnlock( FCB );
+
+ return STATUS_SUCCESS;
+}
+
NTSTATUS STDCALL
AfdConnectedSocketWriteData(PDEVICE_OBJECT DeviceObject, PIRP Irp,
PIO_STACK_LOCATION IrpSp, BOOLEAN Short) {
@@ -168,6 +195,47 @@
FCB->EventsFired &= ~AFD_EVENT_SEND;
+ if( FCB->Flags & AFD_ENDPOINT_CONNECTIONLESS )
+ {
+ PAFD_SEND_INFO_UDP SendReq;
+ PTDI_CONNECTION_INFORMATION TargetAddress;
+
+ /* Check that the socket is bound */
+ if( FCB->State != SOCKET_STATE_BOUND )
+ return UnlockAndMaybeComplete( FCB, STATUS_UNSUCCESSFUL, Irp,
+ 0, NULL, FALSE );
+
+ if( !(SendReq = LockRequest( Irp, IrpSp )) )
+ return UnlockAndMaybeComplete( FCB, STATUS_NO_MEMORY, Irp, 0,
+ NULL, FALSE );
+
+ TdiBuildConnectionInfo( &TargetAddress, FCB->RemoteAddress );
+
+ SocketCalloutEnter( FCB );
+
+ Status = TdiSendDatagram
+ ( &FCB->SendIrp.InFlightRequest,
+ FCB->AddressFile.Object,
+ SendReq->BufferArray[0].buf,
+ SendReq->BufferArray[0].len,
+ TargetAddress,
+ &FCB->SendIrp.Iosb,
+ PacketSocketSendComplete,
+ FCB );
+
+ SocketCalloutLeave( FCB );
+
+ ExFreePool( TargetAddress );
+
+ if( Status == STATUS_PENDING ) Status = STATUS_SUCCESS;
+
+ AFD_DbgPrint(MID_TRACE,("Dismissing request: %x\n", Status));
+
+ return UnlockAndMaybeComplete( FCB, Status, Irp,
+ SendReq->BufferArray[0].len,
+ NULL, TRUE );
+ }
+
if( !(SendReq = LockRequest( Irp, IrpSp )) )
return UnlockAndMaybeComplete
( FCB, STATUS_NO_MEMORY, Irp, TotalBytesCopied, NULL, FALSE );
@@ -273,33 +341,6 @@
}
}
-NTSTATUS DDKAPI PacketSocketSendComplete
-( PDEVICE_OBJECT DeviceObject,
- PIRP Irp,
- PVOID Context ) {
- PAFD_FCB FCB = (PAFD_FCB)Context;
-
- AFD_DbgPrint(MID_TRACE,("Called, status %x, %d bytes used\n",
- Irp->IoStatus.Status,
- Irp->IoStatus.Information));
-
- /* It's ok if the FCB already died */
- if( !SocketAcquireStateLock( FCB ) ) return STATUS_SUCCESS;
-
- FCB->SendIrp.InFlightRequest = NULL;
- /* Request is not in flight any longer */
-
- if( FCB->State == SOCKET_STATE_CLOSED ) {
- SocketStateUnlock( FCB );
- DestroySocket( FCB );
- return STATUS_SUCCESS;
- }
-
- SocketStateUnlock( FCB );
-
- return STATUS_SUCCESS;
-}
-
NTSTATUS STDCALL
AfdPacketSocketWriteData(PDEVICE_OBJECT DeviceObject, PIRP Irp,
PIO_STACK_LOCATION IrpSp) {
reactos/drivers/net/afd/include
diff -u -r1.25.2.3 -r1.25.2.4
--- afd.h 13 Dec 2004 16:18:00 -0000 1.25.2.3
+++ afd.h 30 Dec 2004 04:36:19 -0000 1.25.2.4
@@ -1,4 +1,4 @@
-/* $Id: afd.h,v 1.25.2.3 2004/12/13 16:18:00 hyperion Exp $
+/* $Id: afd.h,v 1.25.2.4 2004/12/30 04:36:19 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -51,8 +51,10 @@
#define FUNCTION_CONNECT 0
#define FUNCTION_RECV 1
#define FUNCTION_SEND 2
-#define FUNCTION_CLOSE 3
-#define MAX_FUNCTIONS 4
+#define FUNCTION_PREACCEPT 3
+#define FUNCTION_ACCEPT 4
+#define FUNCTION_CLOSE 5
+#define MAX_FUNCTIONS 6
#define IN_FLIGHT_REQUESTS 3
@@ -102,10 +104,18 @@
HANDLE Handle;
} AFD_TDI_OBJECT, *PAFD_TDI_OBJECT;
+typedef struct _AFD_TDI_OBJECT_QELT {
+ LIST_ENTRY ListEntry;
+ UINT Seq;
+ PTDI_CONNECTION_INFORMATION ConnInfo;
+ AFD_TDI_OBJECT Object;
+} AFD_TDI_OBJECT_QELT, *PAFD_TDI_OBJECT_QELT;
+
typedef struct _AFD_IN_FLIGHT_REQUEST {
PIRP InFlightRequest;
IO_STATUS_BLOCK Iosb;
- PTDI_CONNECTION_INFORMATION ConnectionInfo;
+ PTDI_CONNECTION_INFORMATION ConnectionCallInfo;
+ PTDI_CONNECTION_INFORMATION ConnectionReturnInfo;
} AFD_IN_FLIGHT_REQUEST, *PAFD_IN_FLIGHT_REQUEST;
typedef struct _AFD_DATA_WINDOW {
@@ -129,11 +139,12 @@
KSPIN_LOCK SpinLock;
PFILE_OBJECT FileObject;
PAFD_DEVICE_EXTENSION DeviceExt;
- BOOLEAN DelayedAccept;
+ BOOLEAN DelayedAccept, NeedsNewListen;
+ UINT ConnSeq;
PTRANSPORT_ADDRESS LocalAddress, RemoteAddress;
PTDI_CONNECTION_INFORMATION AddressFrom;
AFD_TDI_OBJECT AddressFile, Connection;
- AFD_IN_FLIGHT_REQUEST ListenIrp, ReceiveIrp, SendIrp;
+ AFD_IN_FLIGHT_REQUEST ConnectIrp, ListenIrp, ReceiveIrp, SendIrp;
AFD_DATA_WINDOW Send, Recv;
FAST_MUTEX Mutex;
KEVENT StateLockedEvent;
@@ -144,9 +155,9 @@
PVOID Context;
DWORD PollState;
UINT ContextSize;
- PIRP PendingTdiIrp;
LIST_ENTRY PendingIrpList[MAX_FUNCTIONS];
LIST_ENTRY DatagramList;
+ LIST_ENTRY PendingConnections;
} AFD_FCB, *PAFD_FCB;
/* bind.c */
@@ -158,6 +169,7 @@
/* connect.c */
+NTSTATUS MakeSocketIntoConnection( PAFD_FCB FCB );
NTSTATUS WarmSocketForConnection( PAFD_FCB FCB );
NTSTATUS STDCALL
AfdStreamSocketConnect(PDEVICE_OBJECT DeviceObject, PIRP Irp,
@@ -183,10 +195,15 @@
PIO_STACK_LOCATION IrpSp );
/* listen.c */
+NTSTATUS AfdWaitForListen( PDEVICE_OBJECT DeviceObject, PIRP Irp,
+ PIO_STACK_LOCATION IrpSp );
NTSTATUS AfdListenSocket(PDEVICE_OBJECT DeviceObject, PIRP Irp,
PIO_STACK_LOCATION IrpSp);
+NTSTATUS AfdAccept( PDEVICE_OBJECT DeviceObject, PIRP Irp,
+ PIO_STACK_LOCATION IrpSp );
+
/* lock.c */
PAFD_WSABUF LockBuffers( PAFD_WSABUF Buf, UINT Count,
@@ -262,6 +279,7 @@
( PIRP *Irp,
PFILE_OBJECT ConnectionObject,
PTDI_CONNECTION_INFORMATION *RequestConnectionInfo,
+ PTDI_CONNECTION_INFORMATION *ReturnConnectionInfo,
PIO_STATUS_BLOCK Iosb,
PIO_COMPLETION_ROUTINE CompletionRoutine,
PVOID CompletionContext);
reactos/drivers/net/afd/include
diff -u -r1.3.6.2 -r1.3.6.3
--- tdi_proto.h 13 Dec 2004 09:38:49 -0000 1.3.6.2
+++ tdi_proto.h 30 Dec 2004 04:36:19 -0000 1.3.6.3
@@ -4,6 +4,7 @@
NTSTATUS TdiConnect( PIRP *PendingIrp,
PFILE_OBJECT ConnectionObject,
PTDI_CONNECTION_INFORMATION RemoteAddress,
+ PIO_STATUS_BLOCK Iosb,
PIO_COMPLETION_ROUTINE CompletionRoutine,
PVOID CompletionContext );
reactos/drivers/net/afd
diff -u -r1.14.2.3 -r1.14.2.4
--- makefile 13 Dec 2004 16:18:00 -0000 1.14.2.3
+++ makefile 30 Dec 2004 04:36:19 -0000 1.14.2.4
@@ -1,4 +1,4 @@
-# $Id: makefile,v 1.14.2.3 2004/12/13 16:18:00 hyperion Exp $
+# $Id: makefile,v 1.14.2.4 2004/12/30 04:36:19 hyperion Exp $
PATH_TO_TOP = ../../..
reactos/drivers/net/dd/ne2000/ne2000
diff -u -r1.6 -r1.6.8.1
--- 8390.c 24 Jul 2004 04:48:01 -0000 1.6
+++ 8390.c 30 Dec 2004 04:36:19 -0000 1.6.8.1
@@ -641,7 +641,7 @@
VOID NICReadDataAlign(
PNIC_ADAPTER Adapter,
PUSHORT Target,
- ULONG Source,
+ ULONG_PTR Source,
USHORT Length)
/*
* FUNCTION: Copies data from a NIC's RAM into a buffer
@@ -697,7 +697,7 @@
VOID NICWriteDataAlign(
PNIC_ADAPTER Adapter,
- ULONG Target,
+ ULONG_PTR Target,
PUSHORT Source,
USHORT Length)
/*
@@ -790,7 +790,7 @@
VOID NICReadData(
PNIC_ADAPTER Adapter,
PUCHAR Target,
- ULONG Source,
+ ULONG_PTR Source,
USHORT Length)
/*
* FUNCTION: Copies data from a NIC's RAM into a buffer
@@ -831,7 +831,7 @@
VOID NICWriteData(
PNIC_ADAPTER Adapter,
- ULONG Target,
+ ULONG_PTR Target,
PUCHAR Source,
USHORT Length)
/*
@@ -858,7 +858,7 @@
/* Update pointers */
Source = (PUCHAR) ((ULONG_PTR) Source + 1);
- (ULONG_PTR)Target += 1;
+ Target += 1;
Length--;
}
@@ -866,8 +866,8 @@
/* Transfer as many words as we can without exceeding the transfer length */
Tmp = Length & 0xFFFE;
NICWriteDataAlign(Adapter, Target, (PUSHORT)Source, Tmp);
- Source += Tmp;
- (ULONG_PTR)Target += Tmp;
+ Source += Tmp;
+ Target += Tmp;
/* Read one word */
NICReadDataAlign(Adapter, &Tmp, Target, 0x02);
reactos/drivers/net/ndis
diff -u -r1.23 -r1.23.2.1
--- Makefile 23 Nov 2004 18:58:44 -0000 1.23
+++ Makefile 30 Dec 2004 04:36:19 -0000 1.23.2.1
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.23 2004/11/23 18:58:44 navaraf Exp $
+# $Id: Makefile,v 1.23.2.1 2004/12/30 04:36:19 hyperion Exp $
PATH_TO_TOP = ../../..
@@ -8,7 +8,7 @@
TARGET_PCH = include/ndissys.h
-TARGET_CFLAGS = -I./include -D__USE_W32API -Wall -Werror
+TARGET_CFLAGS = -I./include -D__USE_W32API -Wall
TARGET_CFLAGS += -DNDIS_WRAPPER -DNDIS50 -DNDIS50_MINIPORT -DBINARY_COMPATIBLE
reactos/drivers/net/ndis/include
diff -u -r1.8 -r1.8.2.1
--- ndissys.h 23 Nov 2004 18:58:46 -0000 1.8
+++ ndissys.h 30 Dec 2004 04:36:20 -0000 1.8.2.1
@@ -39,6 +39,7 @@
#define EXPORT STDCALL
#endif
+#define NDIS_TAG 0x4e4d4953
#ifdef DBG
@@ -60,27 +61,27 @@
* VOID ReferenceObject(
* PVOID Object)
*/
-#define ReferenceObject(Object) \
-{ \
- DEBUG_REFCHECK(Object); \
+#define ReferenceObject(Object) \
+{ \
+ DEBUG_REFCHECK(Object); \
NDIS_DbgPrint(DEBUG_REFCOUNT, ("Referencing object at (0x%X). RefCount (%d).\n", \
- (Object), (Object)->RefCount)); \
- \
- InterlockedIncrement(&((Object)->RefCount)); \
+ (Object), (Object)->RefCount)); \
+ \
+ InterlockedIncrement((PLONG)&((Object)->RefCount)); \
}
/*
* VOID DereferenceObject(
* PVOID Object)
*/
-#define DereferenceObject(Object) \
-{ \
- DEBUG_REFCHECK(Object); \
+#define DereferenceObject(Object) \
+{ \
+ DEBUG_REFCHECK(Object); \
NDIS_DbgPrint(DEBUG_REFCOUNT, ("Dereferencing object at (0x%X). RefCount (%d).\n", \
- (Object), (Object)->RefCount)); \
- \
- if (InterlockedDecrement(&((Object)->RefCount)) == 0) \
- PoolFreeBuffer(Object); \
+ (Object), (Object)->RefCount)); \
+ \
+ if (InterlockedDecrement((PLONG)&((Object)->RefCount)) == 0) \
+ PoolFreeBuffer(Object); \
}
reactos/drivers/net/ndis/ndis
diff -u -r1.2 -r1.2.2.1
--- efilter.c 23 Nov 2004 18:58:47 -0000 1.2
+++ efilter.c 30 Dec 2004 04:36:20 -0000 1.2.2.1
@@ -83,6 +83,10 @@
* PacketSize = Total size of received packet
*/
{
+ /* Not sure if this is a valid thing to do, but we do arrive here early
+ * in the boot process with Filter NULL. We need to investigate whether
+ * this should be handled or not allowed. */
+ if( !Filter ) return;
MiniIndicateData((PLOGICAL_ADAPTER)Filter->Miniport,
MacReceiveContext,
HeaderBuffer,
reactos/drivers/net/ndis/ndis
diff -u -r1.19.2.1 -r1.19.2.2
--- main.c 8 Dec 2004 21:56:52 -0000 1.19.2.1
+++ main.c 30 Dec 2004 04:36:20 -0000 1.19.2.2
@@ -19,6 +19,7 @@
/* See debug.h for debug/trace constants */
DWORD DebugTraceLevel = MIN_TRACE;
+//DWORD DebugTraceLevel = DEBUG_ULTRA;
#endif /* DBG */
reactos/drivers/net/ndis/ndis
diff -u -r1.43.2.1 -r1.43.2.2
--- miniport.c 8 Dec 2004 21:56:52 -0000 1.43.2.1
+++ miniport.c 30 Dec 2004 04:36:20 -0000 1.43.2.2
@@ -18,6 +18,14 @@
#include <buffer.h>
#endif /* DBG */
+#undef NdisMSendComplete
+VOID
+EXPORT
+NdisMSendComplete(
+ IN NDIS_HANDLE MiniportAdapterHandle,
+ IN PNDIS_PACKET Packet,
+ IN NDIS_STATUS Status);
+
/* Root of the scm database */
#define SERVICES_ROOT L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\"
@@ -819,6 +827,8 @@
*/
(*Adapter->Miniport->Chars.SendPacketsHandler)(
Adapter->NdisMiniportBlock.MiniportAdapterContext, (PPNDIS_PACKET)&WorkItemContext, 1);
+ NdisStatus =
+ NDIS_GET_PACKET_STATUS((PNDIS_PACKET)WorkItemContext);
NDIS_DbgPrint(MAX_TRACE, ("back from miniport's SendPackets handler\n"));
}
@@ -830,12 +840,12 @@
Adapter->NdisMiniportBlock.MiniportAdapterContext, (PNDIS_PACKET)WorkItemContext, 0);
NDIS_DbgPrint(MAX_TRACE, ("back from miniport's Send handler\n"));
-
- if ((NdisStatus != NDIS_STATUS_PENDING) &&
- !(Adapter->NdisMiniportBlock.Flags & NDIS_ATTRIBUTE_DESERIALIZE))
- MiniSendComplete((NDIS_HANDLE)Adapter, (PNDIS_PACKET)WorkItemContext, NdisStatus);
}
-
+ if( NdisStatus != NDIS_STATUS_PENDING ) {
+ NdisMSendComplete
+ ( Adapter, (PNDIS_PACKET)WorkItemContext, NdisStatus );
+ Adapter->MiniportBusy = FALSE;
+ }
break;
case NdisWorkItemSendLoopback:
@@ -1127,7 +1137,7 @@
BugcheckContext->CallbackRecord = ExAllocatePool(NonPagedPool, sizeof(KBUGCHECK_CALLBACK_RECORD));
KeRegisterBugCheckCallback(BugcheckContext->CallbackRecord, NdisIBugcheckCallback,
- BugcheckContext, sizeof(BugcheckContext), "Ndis Miniport");
+ BugcheckContext, sizeof(BugcheckContext), (PUCHAR)"Ndis Miniport");
}
@@ -1246,7 +1256,8 @@
KeInitializeEvent(&Event, NotificationEvent, FALSE);
IoCopyCurrentIrpStackLocationToNext(Irp);
- IoSetCompletionRoutine(Irp, NdisIForwardIrpAndWaitCompletionRoutine, &Event, TRUE, TRUE, TRUE);
+ IoSetCompletionRoutine(Irp, NdisIForwardIrpAndWaitCompletionRoutine, &Event,
+ TRUE, TRUE, TRUE);
Status = IoCallDriver(Adapter->NdisMiniportBlock.NextDeviceObject, Irp);
if (Status == STATUS_PENDING)
{
@@ -1835,8 +1846,6 @@
MiniResetComplete(MiniportAdapterHandle, Status, AddressingReset);
}
-#undef NdisMSendComplete
-
/*
* @implemented
reactos/drivers/net/ndis/ndis
diff -u -r1.22.2.1 -r1.22.2.2
--- protocol.c 8 Dec 2004 21:56:52 -0000 1.22.2.1
+++ protocol.c 30 Dec 2004 04:36:20 -0000 1.22.2.2
@@ -13,6 +13,13 @@
#include "ndissys.h"
#include <buffer.h>
+VOID
+EXPORT
+NdisMSendComplete(
+ IN NDIS_HANDLE MiniportAdapterHandle,
+ IN PNDIS_PACKET Packet,
+ IN NDIS_STATUS Status);
+
#define SERVICES_KEY L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\"
#define LINKAGE_KEY L"\\Linkage"
#define PARAMETERS_KEY L"\\Parameters\\"
@@ -359,11 +366,13 @@
NDIS_DbgPrint(MAX_TRACE, ("Calling miniport's Send handler\n"));
NdisStatus = (*Adapter->Miniport->Chars.SendHandler)(Adapter->NdisMiniportBlock.MiniportAdapterContext, Packet, 0);
NDIS_DbgPrint(MAX_TRACE, ("back from miniport's send handler\n"));
-
+ if( NdisStatus != NDIS_STATUS_PENDING ) {
+ Adapter->MiniportBusy = FALSE;
+ }
KeLowerIrql(RaiseOldIrql);
}
}
-
+
/* XXX why the hell do we do this? */
NDIS_DbgPrint(MAX_TRACE, ("acquiring miniport block lock\n"));
KeAcquireSpinLock(&Adapter->NdisMiniportBlock.Lock, &SpinOldIrql);
@@ -736,7 +745,7 @@
UNICODE_STRING RegistryPath;
WCHAR *RegistryPathStr;
- RegistryPathStr = ExAllocatePool(PagedPool, sizeof(SERVICES_KEY) + ProtocolCharacteristics->Name.Length + sizeof(LINKAGE_KEY));
+ RegistryPathStr = ExAllocatePoolWithTag(PagedPool, sizeof(SERVICES_KEY) + ProtocolCharacteristics->Name.Length + sizeof(LINKAGE_KEY), NDIS_TAG + __LINE__);
if(!RegistryPathStr)
{
NDIS_DbgPrint(MIN_TRACE, ("Insufficient resources.\n"));
@@ -785,7 +794,7 @@
return;
}
- KeyInformation = ExAllocatePool(PagedPool, sizeof(KEY_VALUE_PARTIAL_INFORMATION) + ResultLength);
+ KeyInformation = ExAllocatePoolWithTag(PagedPool, sizeof(KEY_VALUE_PARTIAL_INFORMATION) + ResultLength, NDIS_TAG + __LINE__);
if(!KeyInformation)
{
NDIS_DbgPrint(MIN_TRACE, ("Insufficient resources.\n"));
@@ -833,7 +842,7 @@
PathLength = sizeof(SERVICES_KEY) + /* \Registry\Machine\System\CurrentControlSet\Services\ */
wcslen( DataPtr + 8 ) * sizeof(WCHAR) + /* Adapter1 (extracted from \Device\Adapter1) */
sizeof(PARAMETERS_KEY) + /* \Parameters\ */
- ProtocolCharacteristics->Name.Length; /* Tcpip */
+ ProtocolCharacteristics->Name.Length + sizeof(WCHAR); /* Tcpip */
RegistryPathStr = ExAllocatePool(PagedPool, PathLength);
if(!RegistryPathStr)
@@ -856,7 +865,7 @@
NDIS_DbgPrint(MAX_TRACE, ("Calling protocol's BindAdapter handler with DeviceName %wZ and RegistryPath %wZ\n",
&DeviceName, &RegistryPath));
-
+
/* XXX SD must do something with bind context */
*NdisProtocolHandle = Protocol;
reactos/drivers/net/npf
diff -u -r1.4 -r1.4.16.1
--- openclos.c 11 May 2004 20:52:09 -0000 1.4
+++ openclos.c 30 Dec 2004 04:36:20 -0000 1.4.16.1
@@ -154,7 +154,7 @@
PacketItoa(NamedEventsCounter,(PUCHAR)(Open->ReadEventName.Buffer+21));
- InterlockedIncrement(&NamedEventsCounter);
+ InterlockedIncrement((PLONG)&NamedEventsCounter);
IF_LOUD(DbgPrint("\nCreated the named event for the read; name=%ws, counter=%d\n", Open->ReadEventName.Buffer,NamedEventsCounter-1);)
reactos/drivers/net/npf
diff -u -r1.6 -r1.6.10.1
--- packet.c 3 Jul 2004 17:40:21 -0000 1.6
+++ packet.c 30 Dec 2004 04:36:20 -0000 1.6.10.1
@@ -706,7 +706,7 @@
case BIOCSENDPACKETSNOSYNC:
WriteRes = NPF_BufferedWrite(Irp,
- (PUCHAR)Irp->AssociatedIrp.SystemBuffer,
+ (PCHAR)Irp->AssociatedIrp.SystemBuffer,
IrpSp->Parameters.DeviceIoControl.InputBufferLength,
SyncWrite);
reactos/drivers/net/tcpip/datalink
diff -u -r1.27.2.3 -r1.27.2.4
--- lan.c 13 Dec 2004 16:18:00 -0000 1.27.2.3
+++ lan.c 30 Dec 2004 04:36:20 -0000 1.27.2.4
@@ -16,6 +16,7 @@
UINT TransferDataCalled = 0;
UINT TransferDataCompleteCalled = 0;
UINT LanReceiveWorkerCalled = 0;
+BOOLEAN LanReceiveWorkerBusy = FALSE;
#define NGFP(_Packet) \
{ \
@@ -91,8 +92,8 @@
}
KeReleaseSpinLock( &LanSendCompleteLock, OldIrql );
- TI_DbgPrint(MID_TRACE,("NDIS completed the same send packet twice "
- "(Adapter %x Packet %x)!!\n", Adapter, NdisPacket));
+ DbgPrint("NDIS completed the same send packet twice "
+ "(Adapter %x Packet %x)!!\n", Adapter, NdisPacket);
#ifdef BREAK_ON_DOUBLE_COMPLETE
KeBugCheck(0);
#endif
@@ -279,9 +280,8 @@
ExInterlockedRemoveHeadList( &LanWorkList, &LanWorkLock )) ) {
WorkItem = CONTAINING_RECORD(ListEntry, LAN_WQ_ITEM, ListEntry);
- LanReceiveWorkerCalled++;
- ASSERT(LanReceiveWorkerCalled <= TransferDataCompleteCalled);
-
+ TI_DbgPrint(DEBUG_DATALINK, ("WorkItem: %x\n", WorkItem));
+
Packet = WorkItem->Packet;
Adapter = WorkItem->Adapter;
BytesTransferred = WorkItem->BytesTransferred;
@@ -328,6 +328,40 @@
FreeNdisPacket( Packet );
}
+ TI_DbgPrint(DEBUG_DATALINK, ("Leaving\n"));
+ LanReceiveWorkerBusy = FALSE;
+}
+
+VOID LanSubmitReceiveWork(
+ NDIS_HANDLE BindingContext,
+ PNDIS_PACKET Packet,
+ NDIS_STATUS Status,
+ UINT BytesTransferred) {
+ PLAN_WQ_ITEM WQItem;
+ PLAN_ADAPTER Adapter = (PLAN_ADAPTER)BindingContext;
+ KIRQL OldIrql;
+
+ TcpipAcquireSpinLock( &LanWorkLock, &OldIrql );
+
+ WQItem = ExAllocatePool( NonPagedPool, sizeof(LAN_WQ_ITEM) );
+ if( !WQItem ) {
+ TcpipReleaseSpinLock( &LanWorkLock, OldIrql );
+ return;
+ }
+
+ WQItem->Packet = Packet;
+ WQItem->Adapter = Adapter;
+ WQItem->BytesTransferred = BytesTransferred;
+ InsertTailList( &LanWorkList, &WQItem->ListEntry );
+ if( !LanReceiveWorkerBusy ) {
+ LanReceiveWorkerBusy = TRUE;
+ ExQueueWorkItem( &LanWorkItem, CriticalWorkQueue );
+ TI_DbgPrint(DEBUG_DATALINK,
+ ("Work item inserted %x %x\n", &LanWorkItem, WQItem));
+ } else {
+ DbgPrint("LAN WORKER BUSY %x %x\n", &LanWorkItem, WQItem);
+ }
+ TcpipReleaseSpinLock( &LanWorkLock, OldIrql );
}
VOID STDCALL ProtocolTransferDataComplete(
@@ -347,34 +381,14 @@
* type and pass it to the correct receive handler
*/
{
- BOOLEAN WorkStart;
- PLAN_WQ_ITEM WQItem;
- PLAN_ADAPTER Adapter = (PLAN_ADAPTER)BindingContext;
- KIRQL OldIrql;
-
ASSERT(KeGetCurrentIrql() == DISPATCH_LEVEL);
- if( Status != NDIS_STATUS_SUCCESS ) return;
- TcpipAcquireSpinLock( &LanWorkLock, &OldIrql );
-
TransferDataCompleteCalled++;
-
ASSERT(TransferDataCompleteCalled <= TransferDataCalled);
- WQItem = ExAllocatePool( NonPagedPool, sizeof(LAN_WQ_ITEM) );
- if( !WQItem ) {
- TcpipReleaseSpinLock( &LanWorkLock, OldIrql );
- return;
- }
+ if( Status != NDIS_STATUS_SUCCESS ) return;
- WorkStart = IsListEmpty( &LanWorkList );
- WQItem->Packet = Packet;
- WQItem->Adapter = Adapter;
- WQItem->BytesTransferred = BytesTransferred;
- InsertTailList( &LanWorkList, &WQItem->ListEntry );
- if( WorkStart )
- ExQueueWorkItem( &LanWorkItem, CriticalWorkQueue );
- TcpipReleaseSpinLock( &LanWorkLock, OldIrql );
+ LanSubmitReceiveWork( BindingContext, Packet, Status, BytesTransferred );
}
NDIS_STATUS STDCALL ProtocolReceive(
@@ -610,6 +624,8 @@
* not needed immediately */
GetDataPtr( NdisPacket, 0, &Data, &Size );
+ LanChainCompletion( Adapter, NdisPacket );
+
if (Adapter->State == LAN_STATE_STARTED) {
switch (Adapter->Media) {
case NdisMedium802_3:
@@ -669,10 +685,15 @@
TcpipAcquireSpinLock( &Adapter->Lock, &OldIrql );
TI_DbgPrint(MID_TRACE, ("NdisSend\n"));
NdisSend(&NdisStatus, Adapter->NdisHandle, NdisPacket);
- LanChainCompletion( Adapter, NdisPacket );
- TI_DbgPrint(MID_TRACE, ("NdisSend Done\n"));
+ TI_DbgPrint(MID_TRACE, ("NdisSend %s\n",
+ NdisStatus == NDIS_STATUS_PENDING ?
+ "Pending" : "Complete"));
TcpipReleaseSpinLock( &Adapter->Lock, OldIrql );
+ /* I had a talk with vizzini: these really ought to be here.
+ * we're supposed to see these completed by ndis *only* when
+ * status_pending is returned. Note that this is different from
+ * the situation with IRPs. */
if (NdisStatus != NDIS_STATUS_PENDING)
ProtocolSendComplete((NDIS_HANDLE)Context, NdisPacket, NdisStatus);
} else {
@@ -935,6 +956,16 @@
1 );
}
+ /* Get maximum link speed */
+ NdisStatus = NDISCall(Adapter,
+ NdisRequestQueryInformation,
+ OID_GEN_LINK_SPEED,
+ &IF->Speed,
+ sizeof(UINT));
+
+ if( !NT_SUCCESS(NdisStatus) )
+ IF->Speed = IP_DEFAULT_LINK_SPEED;
+
/* Register interface with IP layer */
IPRegisterInterface(IF);
@@ -944,6 +975,7 @@
OID_GEN_CURRENT_PACKET_FILTER,
&Adapter->PacketFilter,
sizeof(UINT));
+
if (NdisStatus != NDIS_STATUS_SUCCESS) {
TI_DbgPrint(MID_TRACE, ("Could not set packet filter (0x%X).\n", NdisStatus));
IPDestroyInterface(IF);
reactos/drivers/net/tcpip/include
diff -u -r1.18.2.1 -r1.18.2.2
--- ip.h 8 Dec 2004 21:56:52 -0000 1.18.2.1
+++ ip.h 30 Dec 2004 04:36:21 -0000 1.18.2.2
@@ -145,6 +145,7 @@
UINT HeaderSize; /* Size of link level header */
UINT MinFrameSize; /* Minimum frame size in bytes */
UINT MTU; /* Maximum transmission unit */
+ UINT Speed; /* Link speed */
IP_ADDRESS Unicast; /* Unicast address */
IP_ADDRESS PointToPoint; /* Point to point address */
IP_ADDRESS Netmask; /* Netmask */
@@ -180,7 +181,7 @@
/* Timeout timer constants */
#define IP_TICKS_SECOND 2 /* Two ticks per second */
#define IP_TIMEOUT (1000 / IP_TICKS_SECOND) /* Timeout in milliseconds */
-
+#define IP_DEFAULT_LINK_SPEED 10000
extern LIST_ENTRY InterfaceListHead;
extern KSPIN_LOCK InterfaceListLock;
reactos/drivers/net/tcpip/include
diff -u -r1.11.6.2 -r1.11.6.3
--- tcp.h 13 Dec 2004 09:38:49 -0000 1.11.6.2
+++ tcp.h 30 Dec 2004 04:36:21 -0000 1.11.6.3
@@ -87,6 +87,21 @@
extern FAST_MUTEX SleepingThreadsLock;
extern RECURSIVE_MUTEX TCPLock;
+/* accept.c */
+NTSTATUS TCPServiceListeningSocket( PCONNECTION_ENDPOINT Listener,
+ PCONNECTION_ENDPOINT Connection,
+ PTDI_REQUEST_KERNEL Request );
+NTSTATUS TCPListen( PCONNECTION_ENDPOINT Connection, UINT Backlog );
+VOID TCPAbortListenForSocket( PCONNECTION_ENDPOINT Listener,
+ PCONNECTION_ENDPOINT Connection );
+NTSTATUS TCPAccept
+( PTDI_REQUEST Request,
+ PCONNECTION_ENDPOINT Listener,
+ PCONNECTION_ENDPOINT Connection,
+ PTCP_COMPLETION_ROUTINE Complete,
+ PVOID Context );
+
+/* tcp.c */
PCONNECTION_ENDPOINT TCPAllocateConnectionEndpoint( PVOID ClientContext );
VOID TCPFreeConnectionEndpoint( PCONNECTION_ENDPOINT Connection );
@@ -123,12 +138,6 @@
PTCP_COMPLETION_ROUTINE Complete,
PVOID Context);
-NTSTATUS TCPListen(
- PCONNECTION_ENDPOINT Connection,
- UINT Backlog,
- PTCP_COMPLETION_ROUTINE Complete,
- PVOID Context);
-
NTSTATUS TCPReceiveData(
PCONNECTION_ENDPOINT Connection,
PNDIS_BUFFER Buffer,
reactos/drivers/net/tcpip/include
diff -u -r1.14.2.1 -r1.14.2.2
--- titypes.h 8 Dec 2004 21:56:52 -0000 1.14.2.1
+++ titypes.h 30 Dec 2004 04:36:21 -0000 1.14.2.2
@@ -144,28 +144,6 @@
ULONG Flags; /* Protocol specific flags */
} DATAGRAM_SEND_REQUEST, *PDATAGRAM_SEND_REQUEST;
-#if 0
-#define InitializeDatagramSendRequest( \
- _SendRequest, \
- _RemoteAddress, \
- _RemotePort, \
- _Buffer, \
- _BufferSize, \
- _Complete, \
- _Context, \
- _Build, \
- _Flags) { \
- (_SendRequest)->RemoteAddress = (_RemoteAddress); \
- (_SendRequest)->RemotePort = (_RemotePort); \
- (_SendRequest)->Buffer = (_Buffer); \
- (_SendRequest)->BufferSize = (_BufferSize); \
- (_SendRequest)->Complete = (_Complete); \
- (_SendRequest)->Context = (_Context); \
- (_SendRequest)->Build = (_Build); \
- (_SendRequest)->Flags = (_Flags); \
- }
-#endif /* These things bug me... They hide the member names. */
-
/* Transport address file context structure. The FileObject->FsContext2
field holds a pointer to this structure */
typedef struct _ADDRESS_FILE {
@@ -175,6 +153,7 @@
OBJECT_FREE_ROUTINE Free; /* Routine to use to free resources for the object */
USHORT Flags; /* Flags for address file (see below) */
IP_ADDRESS Address; /* Address of this address file */
+ USHORT Family; /* Address family */
USHORT Protocol; /* Protocol number */
USHORT Port; /* Network port (network byte order) */
WORK_QUEUE_ITEM WorkItem; /* Work queue item handle */
@@ -184,8 +163,9 @@
LIST_ENTRY ReceiveQueue; /* List of outstanding receive requests */
LIST_ENTRY TransmitQueue; /* List of outstanding transmit requests */
struct _CONNECTION_ENDPOINT *Connection;
- /* Associated connection or NULL if no
- associated connection exist */
+ /* Associated connection or NULL if no associated connection exist */
+ struct _CONNECTION_ENDPOINT *Listener;
+ /* Associated listener (see transport/tcp/accept.c) */
IP_ADDRESS AddrCache; /* One entry address cache (destination
address of last packet transmitted) */
@@ -302,6 +282,7 @@
typedef struct _TDI_BUCKET {
LIST_ENTRY Entry;
+ struct _CONNECTION_ENDPOINT *AssociatedEndpoint;
TDI_REQUEST Request;
} TDI_BUCKET, *PTDI_BUCKET;
@@ -316,7 +297,7 @@
PVOID SocketContext; /* Context for lower layer */
UINT State; /* Socket state W.R.T. oskit */
-
+
/* Requests */
LIST_ENTRY ConnectRequest; /* Queued connect rqueusts */
LIST_ENTRY ListenRequest; /* Queued listen requests */
reactos/drivers/net/tcpip
diff -u -r1.31.2.3 -r1.31.2.4
--- makefile 13 Dec 2004 16:18:01 -0000 1.31.2.3
+++ makefile 30 Dec 2004 04:36:21 -0000 1.31.2.4
@@ -1,4 +1,4 @@
-# $Id: makefile,v 1.31.2.3 2004/12/13 16:18:01 hyperion Exp $
+# $Id: makefile,v 1.31.2.4 2004/12/30 04:36:21 hyperion Exp $
PATH_TO_TOP = ../../..
@@ -14,7 +14,6 @@
TARGET_CFLAGS = \
-D__USE_W32API \
-D_SEH_NO_NATIVE_NLG \
- -DMEMTRACK \
-DNDIS40 \
-Wall -Werror \
-I./include \
reactos/drivers/net/tcpip/tcpip
diff -u -r1.26.2.2 -r1.26.2.3
--- dispatch.c 13 Dec 2004 09:38:50 -0000 1.26.2.2
+++ dispatch.c 30 Dec 2004 04:36:21 -0000 1.26.2.3
@@ -272,8 +272,8 @@
(PVOID*)&FileObject,
NULL);
if (!NT_SUCCESS(Status)) {
- TI_DbgPrint(MID_TRACE, ("Bad address file object handle (0x%X).\n",
- Parameters->AddressHandle));
+ TI_DbgPrint(MID_TRACE, ("Bad address file object handle (0x%X): %x.\n",
+ Parameters->AddressHandle, Status));
return STATUS_INVALID_PARAMETER;
}
@@ -465,7 +465,7 @@
PTDI_REQUEST_KERNEL Parameters;
PTRANSPORT_CONTEXT TranContext;
PIO_STACK_LOCATION IrpSp;
- NTSTATUS Status;
+ NTSTATUS Status = STATUS_SUCCESS;
TI_DbgPrint(DEBUG_IRP, ("Called.\n"));
@@ -489,9 +489,50 @@
Parameters = (PTDI_REQUEST_KERNEL)&IrpSp->Parameters;
- Status = TCPListen( Connection, 1024 /* BACKLOG */,
- DispDataRequestComplete,
- Irp );
+ TI_DbgPrint(MIN_TRACE, ("Connection->AddressFile: %x\n",
+ Connection->AddressFile ));
+ if( Connection->AddressFile ) {
+ TI_DbgPrint(MIN_TRACE, ("Connection->AddressFile->Listener: %x\n",
+ Connection->AddressFile->Listener));
+ }
+
+ /* Listening will require us to create a listening socket and store it in
+ * the address file. It will be signalled, and attempt to complete an irp
+ * when a new connection arrives. */
+ /* The important thing to note here is that the irp we'll complete belongs
+ * to the socket to be accepted onto, not the listener */
+ if( !Connection->AddressFile->Listener ) {
+ Connection->AddressFile->Listener =
+ TCPAllocateConnectionEndpoint( NULL );
+
+ if( !Connection->AddressFile->Listener )
+ Status = STATUS_NO_MEMORY;
+
+ if( NT_SUCCESS(Status) ) {
+ Connection->AddressFile->Listener->AddressFile =
+ Connection->AddressFile;
+
+ Status = TCPSocket( Connection->AddressFile->Listener,
+ Connection->AddressFile->Family,
+ SOCK_STREAM,
+ Connection->AddressFile->Protocol );
+ }
+
+ if( NT_SUCCESS(Status) )
+ Status = TCPListen( Connection->AddressFile->Listener, 1024 );
+ /* BACKLOG */
+ }
+
+ if( NT_SUCCESS(Status) ) {
+ Status = TCPAccept
+ ( (PTDI_REQUEST)Parameters,
+ Connection->AddressFile->Listener,
+ Connection,
+ DispDataRequestComplete,
+ Irp );
+ }
+
+ TI_DbgPrint(MID_TRACE,("Leaving %x\n", Status));
return Status;
}
@@ -692,11 +733,11 @@
Status = UDPReceiveDatagram(
Request.Handle.AddressHandle,
- DgramInfo->ReceiveDatagramInformation->RemoteAddress,
+ DgramInfo->ReceiveDatagramInformation,
DataBuffer,
DgramInfo->ReceiveLength,
DgramInfo->ReceiveFlags,
- DgramInfo->ReturnDatagramInformation->RemoteAddress,
+ DgramInfo->ReturnDatagramInformation,
&BytesReceived,
(PDATAGRAM_COMPLETION_ROUTINE)DispDataRequestComplete,
Irp);
@@ -1049,7 +1090,7 @@
Count = CopyBufferToBufferChain(
QueryContext->InputMdl,
FIELD_OFFSET(TCP_REQUEST_QUERY_INFORMATION_EX, Context),
- (PUCHAR)&QueryContext->QueryInfo.Context,
+ (PCHAR)&QueryContext->QueryInfo.Context,
CONTEXT_SIZE);
}
reactos/drivers/net/tcpip/tcpip
diff -u -r1.24.2.2 -r1.24.2.3
--- fileobjs.c 13 Dec 2004 09:38:50 -0000 1.24.2.2
+++ fileobjs.c 30 Dec 2004 04:36:21 -0000 1.24.2.3
@@ -249,6 +249,7 @@
/* Locate address entry. If specified address is 0, a random address is chosen */
/* FIXME: IPv4 only */
+ AddrFile->Family = Address->Address[0].AddressType;
IPv4Address = Address->Address[0].Address[0].in_addr;
if (IPv4Address == 0)
Matched = IPGetDefaultAddress(&AddrFile->Address);
@@ -351,6 +352,8 @@
switch (AddrFile->Protocol) {
case IPPROTO_TCP:
TCPFreePort( AddrFile->Port );
+ if( AddrFile->Listener )
+ TCPClose( AddrFile->Listener );
break;
case IPPROTO_UDP:
reactos/drivers/net/tcpip/tcpip
diff -u -r1.9.2.1 -r1.9.2.2
--- info.c 8 Dec 2004 21:56:53 -0000 1.9.2.1
+++ info.c 30 Dec 2004 04:36:21 -0000 1.9.2.2
@@ -19,7 +19,7 @@
if( RememberedCBSize < SizeOut )
return TDI_BUFFER_TOO_SMALL;
else {
- CopyBufferToBufferChain( ClientBuf, 0, (PUCHAR)DataOut, SizeOut );
+ CopyBufferToBufferChain( ClientBuf, 0, (PCHAR)DataOut, SizeOut );
return TDI_SUCCESS;
}
}
@@ -99,7 +99,7 @@
for( Count = 0; Count < EntityCount; Count++ ) {
CopyBufferToBufferChain(Buffer,
Count * sizeof(TDIEntityID),
- (PUCHAR)&EntityList[Count],
+ (PCHAR)&EntityList[Count],
sizeof(TDIEntityID));
}
reactos/drivers/net/tcpip/tcpip
diff -u -r1.42.2.1 -r1.42.2.2
--- main.c 8 Dec 2004 21:56:53 -0000 1.42.2.1
+++ main.c 30 Dec 2004 04:36:21 -0000 1.42.2.2
@@ -9,10 +9,10 @@
*/
#include "precomp.h"
-#define NDEBUG
+//#define NDEBUG
#ifndef NDEBUG
-DWORD DebugTraceLevel = DEBUG_ULTRA;
+DWORD DebugTraceLevel = MAX_TRACE | DEBUG_TCP;
#else
DWORD DebugTraceLevel = 0;
#endif /* NDEBUG */
@@ -480,6 +480,7 @@
case TDI_LISTEN:
Status = DispTdiListen(Irp);
+ Complete = FALSE;
break;
case TDI_CONNECT:
reactos/drivers/net/tcpip/tcpip
diff -u -r1.7.2.1 -r1.7.2.2
--- ninfo.c 8 Dec 2004 21:56:53 -0000 1.7.2.1
+++ ninfo.c 30 Dec 2004 04:36:21 -0000 1.7.2.2
@@ -220,7 +220,7 @@
TI_DbgPrint(MID_TRACE,("Called\n"));
- OskitDumpBuffer( Buffer, BufferSize );
+ OskitDumpBuffer( (OSK_PCHAR)Buffer, BufferSize );
if( InfoClass == INFO_CLASS_PROTOCOL &&
InfoType == INFO_TYPE_PROVIDER &&
reactos/drivers/video/displays/vga/main
diff -u -r1.3.20.3 -r1.3.20.4
--- enable.c 13 Dec 2004 16:18:01 -0000 1.3.20.3
+++ enable.c 30 Dec 2004 04:36:21 -0000 1.3.20.4
@@ -1,9 +1,9 @@
/*
* entry.c
*
- * $Revision: 1.3.20.3 $
+ * $Revision: 1.3.20.4 $
* $Author: hyperion $
- * $Date: 2004/12/13 16:18:01 $
+ * $Date: 2004/12/30 04:36:21 $
*
*/
reactos/drivers/video/displays/vga/objects
diff -u -r1.3.10.2 -r1.3.10.3
--- pointer.c 13 Dec 2004 16:18:01 -0000 1.3.10.2
+++ pointer.c 30 Dec 2004 04:36:21 -0000 1.3.10.3
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: pointer.c,v 1.3.10.2 2004/12/13 16:18:01 hyperion Exp $
+/* $Id: pointer.c,v 1.3.10.3 2004/12/30 04:36:21 hyperion Exp $
*
* PROJECT: ReactOS VGA16 display driver
* FILE: drivers/dd/vga/display/objects/pointer.c
reactos/drivers/video/displays/vga/vgavideo
diff -u -r1.3 -r1.3.10.1
--- vgavideo.c 3 Jul 2004 13:45:42 -0000 1.3
+++ vgavideo.c 30 Dec 2004 04:36:22 -0000 1.3.10.1
@@ -11,7 +11,7 @@
int bit8[640];
int startmasks[8];
int endmasks[8];
-char* vidmem;
+PBYTE vidmem;
static ULONG UnpackPixel[256];
static unsigned char leftMask;
reactos/drivers/video/displays/vga/vgavideo
diff -u -r1.1 -r1.1.24.1
--- vgavideo.h 10 Jan 2004 14:39:20 -0000 1.1
+++ vgavideo.h 30 Dec 2004 04:36:22 -0000 1.1.24.1
@@ -21,7 +21,7 @@
extern UCHAR PreCalcReverseByte[256];
-extern char* vidmem;
+extern PBYTE vidmem;
#define MISC 0x3c2
#define SEQ 0x3c4
reactos/drivers/video/videoprt
diff -u -r1.6 -r1.6.14.1
--- dispatch.c 20 Jun 2004 16:05:47 -0000 1.6
+++ dispatch.c 30 Dec 2004 04:36:22 -0000 1.6.14.1
@@ -18,7 +18,7 @@
* If not, write to the Free Software Foundation,
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
- * $Id: dispatch.c,v 1.6 2004/06/20 16:05:47 navaraf Exp $
+ * $Id: dispatch.c,v 1.6.14.1 2004/12/30 04:36:22 hyperion Exp $
*/
#include "videoprt.h"
@@ -132,7 +132,7 @@
{
Irp->IoStatus.Status = STATUS_SUCCESS;
- InterlockedIncrement(&DeviceExtension->DeviceOpened);
+ InterlockedIncrement((PLONG)&DeviceExtension->DeviceOpened);
/*
* Storing the device extension pointer in a static variable is an
@@ -177,7 +177,7 @@
DeviceExtension = (PVIDEO_PORT_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
if (DeviceExtension->DeviceOpened >= 1 &&
- InterlockedDecrement(&DeviceExtension->DeviceOpened) == 0)
+ InterlockedDecrement((PLONG)&DeviceExtension->DeviceOpened) == 0)
{
ResetDisplayParametersDeviceExtension = DeviceExtension;
HalReleaseDisplayOwnership();
reactos/drivers/video/videoprt
diff -u -r1.4 -r1.4.2.1
--- resource.c 15 Oct 2004 22:48:43 -0000 1.4
+++ resource.c 30 Dec 2004 04:36:22 -0000 1.4.2.1
@@ -18,7 +18,7 @@
* If not, write to the Free Software Foundation,
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
- * $Id: resource.c,v 1.4 2004/10/15 22:48:43 gvg Exp $
+ * $Id: resource.c,v 1.4.2.1 2004/12/30 04:36:22 hyperion Exp $
*/
#include "videoprt.h"
@@ -34,7 +34,7 @@
OUT VP_STATUS *Status)
{
PHYSICAL_ADDRESS TranslatedAddress;
- PVIDEO_PORT_ADDRESS_MAPPING AddressMapping;
+ PVIDEO_PORT_ADDRESS_MAPPING AddressMapping = NULL;
ULONG AddressSpace;
PVOID MappedAddress;
PLIST_ENTRY Entry;
@@ -62,17 +62,32 @@
if (IoAddress.QuadPart == AddressMapping->IoAddress.QuadPart &&
NumberOfUchars <= AddressMapping->NumberOfUchars)
{
- AddressMapping->MappingCount++;
- if (Status)
- *Status = NO_ERROR;
-
- return AddressMapping->MappedAddress;
+ if ((InIoSpace & VIDEO_MEMORY_SPACE_USER_MODE) != 0 &&
+ AddressMapping->MappedUserAddress != NULL)
+ {
+ AddressMapping->UserMappingCount++;
+ if (Status)
+ *Status = NO_ERROR;
+ return AddressMapping->MappedUserAddress;
+ }
+ else if ((InIoSpace & VIDEO_MEMORY_SPACE_USER_MODE) == 0 &&
+ AddressMapping->MappedUserAddress != NULL)
+ {
+ AddressMapping->MappingCount++;
+ if (Status)
+ *Status = NO_ERROR;
+ return AddressMapping->MappedAddress;
+ }
+ break;
}
Entry = Entry->Flink;
}
+ if (Entry == &DeviceExtension->AddressMappingListHead)
+ AddressMapping = NULL;
}
AddressSpace = (ULONG)InIoSpace;
+ AddressSpace &= ~VIDEO_MEMORY_SPACE_USER_MODE;
if (HalTranslateBusAddress(
DeviceExtension->AdapterInterfaceType,
DeviceExtension->SystemIoBusNumber,
@@ -96,45 +111,109 @@
return (PVOID)TranslatedAddress.u.LowPart;
}
- MappedAddress = MmMapIoSpace(
- TranslatedAddress,
- NumberOfUchars,
- MmNonCached);
+ /* user space */
+ if ((InIoSpace & VIDEO_MEMORY_SPACE_USER_MODE) != 0)
+ {
+ OBJECT_ATTRIBUTES ObjAttribs;
+ UNICODE_STRING UnicodeString;
+ HANDLE hMemObj;
+ NTSTATUS NtStatus;
+ SIZE_T Size;
+
+ RtlInitUnicodeString(&UnicodeString, L"\\Device\\PhysicalMemory");
+ InitializeObjectAttributes(&ObjAttribs,
+ &UnicodeString,
+ OBJ_CASE_INSENSITIVE/* | OBJ_KERNEL_HANDLE*/,
+ NULL, NULL);
+ NtStatus = ZwOpenSection(&hMemObj, SECTION_ALL_ACCESS, &ObjAttribs);
+ if (!NT_SUCCESS(NtStatus))
+ {
+ DPRINT("ZwOpenSection() failed! (0x%x)\n", NtStatus);
+ if (Status)
+ *Status = NO_ERROR;
+ return NULL;
+ }
+ Size = NumberOfUchars;
+ MappedAddress = NULL;
+ NtStatus = ZwMapViewOfSection(hMemObj,
+ NtCurrentProcess(),
+ &MappedAddress,
+ 0,
+ NumberOfUchars,
+ (PLARGE_INTEGER)(&TranslatedAddress),
+ &Size,
+ ViewUnmap,
+ 0,
+ PAGE_READWRITE/* | PAGE_WRITECOMBINE*/);
+ if (!NT_SUCCESS(NtStatus))
+ {
+ DPRINT("ZwMapViewOfSection() failed! (0x%x)\n", NtStatus);
+ ZwClose(hMemObj);
+ if (Status)
+ *Status = NO_ERROR;
+ return NULL;
+ }
+ ZwClose(hMemObj);
+ DPRINT("Mapped user address = 0x%08x\n", MappedAddress);
+ }
+ else /* kernel space */
+ {
+ MappedAddress = MmMapIoSpace(
+ TranslatedAddress,
+ NumberOfUchars,
+ MmNonCached);
+ }
- if (MappedAddress)
+ if (MappedAddress != NULL)
{
+ BOOL InsertIntoList = FALSE;
+
if (Status)
{
*Status = NO_ERROR;
}
-
- AddressMapping = ExAllocatePoolWithTag(
- PagedPool,
- sizeof(VIDEO_PORT_ADDRESS_MAPPING),
- TAG_VIDEO_PORT);
-
if (AddressMapping == NULL)
- return MappedAddress;
+ {
+ AddressMapping = ExAllocatePoolWithTag(
+ PagedPool,
+ sizeof(VIDEO_PORT_ADDRESS_MAPPING),
+ TAG_VIDEO_PORT);
+
+ if (AddressMapping == NULL)
+ return MappedAddress;
+
+ InsertIntoList = TRUE;
+ RtlZeroMemory(AddressMapping, sizeof(VIDEO_PORT_ADDRESS_MAPPING));
+ AddressMapping->NumberOfUchars = NumberOfUchars;
+ AddressMapping->IoAddress = IoAddress;
+ AddressMapping->SystemIoBusNumber = DeviceExtension->SystemIoBusNumber;
+ }
- AddressMapping->MappedAddress = MappedAddress;
- AddressMapping->NumberOfUchars = NumberOfUchars;
- AddressMapping->IoAddress = IoAddress;
- AddressMapping->SystemIoBusNumber = DeviceExtension->SystemIoBusNumber;
- AddressMapping->MappingCount = 1;
-
- InsertHeadList(
- &DeviceExtension->AddressMappingListHead,
- &AddressMapping->List);
+ if ((InIoSpace & VIDEO_MEMORY_SPACE_USER_MODE) != 0)
+ {
+ AddressMapping->MappedUserAddress = MappedAddress;
+ AddressMapping->UserMappingCount = 1;
+ }
+ else
+ {
+ AddressMapping->MappedAddress = MappedAddress;
+ AddressMapping->MappingCount = 1;
+ }
+
+ if (InsertIntoList)
+ {
+ InsertHeadList(
+ &DeviceExtension->AddressMappingListHead,
+ &AddressMapping->List);
+ }
return MappedAddress;
}
- else
- {
- if (Status)
- *Status = NO_ERROR;
- return NULL;
- }
+ if (Status)
+ *Status = NO_ERROR;
+
+ return NULL;
}
VOID STDCALL
@@ -152,20 +231,40 @@
Entry,
VIDEO_PORT_ADDRESS_MAPPING,
List);
- if (AddressMapping->MappedAddress == MappedAddress)
+ if (AddressMapping->MappedUserAddress == MappedAddress)
{
- ASSERT(AddressMapping->MappingCount >= 0);
+ ASSERT(AddressMapping->UserMappingCount > 0);
+ AddressMapping->UserMappingCount--;
+ if (AddressMapping->UserMappingCount == 0)
+ {
+ ZwUnmapViewOfSection(NtCurrentProcess(),
+ AddressMapping->MappedUserAddress);
+ AddressMapping->MappedUserAddress = NULL;
+ if (AddressMapping->MappingCount == 0)
+ {
+ RemoveEntryList(Entry);
+ ExFreePool(AddressMapping);
+ }
+ }
+ return;
+ }
+ else if (AddressMapping->MappedAddress == MappedAddress)
+ {
+ ASSERT(AddressMapping->MappingCount > 0);
AddressMapping->MappingCount--;
if (AddressMapping->MappingCount == 0)
{
MmUnmapIoSpace(
AddressMapping->MappedAddress,
AddressMapping->NumberOfUchars);
- RemoveEntryList(Entry);
- ExFreePool(AddressMapping);
-
- return;
+ AddressMapping->MappedAddress = NULL;
+ if (AddressMapping->UserMappingCount == 0)
+ {
+ RemoveEntryList(Entry);
+ ExFreePool(AddressMapping);
+ }
}
+ return;
}
Entry = Entry->Flink;
reactos/drivers/video/videoprt
diff -u -r1.28 -r1.28.2.1
--- videoprt.c 24 Nov 2004 11:12:19 -0000 1.28
+++ videoprt.c 30 Dec 2004 04:36:22 -0000 1.28.2.1
@@ -18,7 +18,7 @@
* If not, write to the Free Software Foundation,
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
- * $Id: videoprt.c,v 1.28 2004/11/24 11:12:19 ekohl Exp $
+ * $Id: videoprt.c,v 1.28.2.1 2004/12/30 04:36:22 hyperion Exp $
*/
#include "videoprt.h"
@@ -104,8 +104,8 @@
((ULONG_PTR)BaseAddress + (ULONG_PTR)ExportDir->AddressOfNames);
for (i = 0; i < ExportDir->NumberOfNames; i++, NamePtr++, OrdinalPtr++)
{
- if (!_strnicmp(FunctionName, (char*)(BaseAddress + *NamePtr),
- strlen(FunctionName)))
+ if (!_strnicmp((PCHAR)FunctionName, (PCHAR)(BaseAddress + *NamePtr),
+ strlen((PCHAR)FunctionName)))
{
return (PVOID)((ULONG_PTR)BaseAddress +
(ULONG_PTR)AddressPtr[*OrdinalPtr]);
@@ -445,7 +445,8 @@
}
if (PhysicalDeviceObject != NULL)
- IoAttachDeviceToDeviceStack(DeviceObject, PhysicalDeviceObject);
+ DeviceExtension->NextDeviceObject = IoAttachDeviceToDeviceStack(
+ DeviceObject, PhysicalDeviceObject);
DPRINT("STATUS_SUCCESS\n");
return STATUS_SUCCESS;
@@ -840,7 +841,7 @@
DPRINT("VideoPortScanRom RomBase %p RomLength 0x%x String %s\n", RomBase, RomLength, String);
- StringLength = strlen(String);
+ StringLength = strlen((PCHAR)String);
Found = FALSE;
SearchLocation = RomBase;
for (SearchLocation = RomBase;
reactos/drivers/video/videoprt
diff -u -r1.11 -r1.11.2.1
--- videoprt.h 23 Oct 2004 23:43:23 -0000 1.11
+++ videoprt.h 30 Dec 2004 04:36:22 -0000 1.11.2.1
@@ -18,7 +18,7 @@
* If not, write to the Free Software Foundation,
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
- * $Id: videoprt.h,v 1.11 2004/10/23 23:43:23 ion Exp $
+ * $Id: videoprt.h,v 1.11.2.1 2004/12/30 04:36:22 hyperion Exp $
*/
#ifndef VIDEOPRT_H
@@ -51,10 +51,12 @@
{
LIST_ENTRY List;
PVOID MappedAddress;
+ PVOID MappedUserAddress;
ULONG NumberOfUchars;
PHYSICAL_ADDRESS IoAddress;
ULONG SystemIoBusNumber;
UINT MappingCount;
+ UINT UserMappingCount;
} VIDEO_PORT_ADDRESS_MAPPING, *PVIDEO_PORT_ADDRESS_MAPPING;
typedef struct _VIDEO_PORT_DRIVER_EXTENSION
@@ -68,6 +70,7 @@
{
PDEVICE_OBJECT PhysicalDeviceObject;
PDEVICE_OBJECT FunctionalDeviceObject;
+ PDEVICE_OBJECT NextDeviceObject;
UNICODE_STRING RegistryPath;
PKINTERRUPT InterruptObject;
KSPIN_LOCK InterruptSpinLock;
reactos/hal/halx86/generic
diff -u -r1.1.2.1 -r1.1.2.2
--- timer.c 13 Dec 2004 16:18:23 -0000 1.1.2.1
+++ timer.c 30 Dec 2004 04:36:22 -0000 1.1.2.2
@@ -20,7 +20,7 @@
* MA 02139, USA.
*
*/
-/* $Id: timer.c,v 1.1.2.1 2004/12/13 16:18:23 hyperion Exp $
+/* $Id: timer.c,v 1.1.2.2 2004/12/30 04:36:22 hyperion Exp $
*
* PROJECT: ReactOS kernel
* FILE: ntoskrnl/hal/x86/udelay.c
@@ -41,8 +41,6 @@
/* GLOBALS ******************************************************************/
-static unsigned int delay_count = 1;
-
#define TMR_CTRL 0x43 /* I/O for control */
#define TMR_CNT0 0x40 /* I/O for counter 0 */
#define TMR_CNT1 0x41 /* I/O for counter 1 */
@@ -232,55 +230,55 @@
WaitFor8254Wraparound();
- delay_count = 1;
+ Pcr->StallScaleFactor = 1;
do
{
- delay_count <<= 1; /* Next delay count to try */
+ Pcr->StallScaleFactor <<= 1; /* Next delay count to try */
WaitFor8254Wraparound();
- __KeStallExecutionProcessor(delay_count); /* Do the delay */
+ __KeStallExecutionProcessor(Pcr->StallScaleFactor); /* Do the delay */
CurCount = Read8254Timer();
}
while (CurCount > LATCH / 2);
- delay_count >>= 1; /* Get bottom value for delay */
+ Pcr->StallScaleFactor >>= 1; /* Get bottom value for delay */
- /* Stage 2: Fine calibration */
- DbgPrint("delay_count: %d", delay_count);
+ /* Stage 2: Fine calibration */
+ DbgPrint("delay_count: %d", Pcr->StallScaleFactor);
- calib_bit = delay_count; /* Which bit are we going to test */
+ calib_bit = Pcr->StallScaleFactor; /* Which bit are we going to test */
for (i = 0; i < PRECISION; i++)
{
- calib_bit >>= 1; /* Next bit to calibrate */
+ calib_bit >>= 1; /* Next bit to calibrate */
if (!calib_bit)
{
- break; /* If we have done all bits, stop */
+ break; /* If we have done all bits, stop */
}
- delay_count |= calib_bit; /* Set the bit in delay_count */
+ Pcr->StallScaleFactor |= calib_bit; /* Set the bit in delay_count */
WaitFor8254Wraparound();
- __KeStallExecutionProcessor(delay_count); /* Do the delay */
+ __KeStallExecutionProcessor(Pcr->StallScaleFactor); /* Do the delay */
CurCount = Read8254Timer();
- if (CurCount <= LATCH / 2) /* If a tick has passed, turn the */
- { /* calibrated bit back off */
- delay_count &= ~calib_bit;
+ if (CurCount <= LATCH / 2) /* If a tick has passed, turn the */
+ { /* calibrated bit back off */
+ Pcr->StallScaleFactor &= ~calib_bit;
}
}
- /* We're finished: Do the finishing touches */
+ /* We're finished: Do the finishing touches */
- delay_count /= (MILLISEC / 2); /* Calculate delay_count for 1ms */
+ Pcr->StallScaleFactor /= (MILLISEC / 2); /* Calculate delay_count for 1ms */
DbgPrint("]\n");
- DbgPrint("delay_count: %d\n", delay_count);
- DbgPrint("CPU speed: %d\n", delay_count / 250);
+ DbgPrint("delay_count: %d\n", Pcr->StallScaleFactor);
+ DbgPrint("CPU speed: %d\n", Pcr->StallScaleFactor / 250);
#if 0
DbgPrint("About to start delay loop test\n");
DbgPrint("Waiting for five minutes...");
reactos/hal/halx86/include
diff -u -r1.1.2.1 -r1.1.2.2
--- apic.h 8 Dec 2004 21:56:56 -0000 1.1.2.1
+++ apic.h 30 Dec 2004 04:36:22 -0000 1.1.2.2
@@ -62,11 +62,11 @@
#define APIC_ICR0_DESTS (0x3 << 18) /* Destination Shorthand */
/* Delivery Modes */
-#define APIC_DM_FIXED (0x0 << 8)
-#define APIC_DM_LOWEST (0x1 << 8)
-#define APIC_DM_SMI (0x2 << 8)
-#define APIC_DM_REMRD (0x3 << 8)
-#define APIC_DM_NMI (0x4 << 8)
+#define APIC_DM_FIXED (0x0 << 8)
+#define APIC_DM_LOWEST (0x1 << 8)
+#define APIC_DM_SMI (0x2 << 8)
+#define APIC_DM_REMRD (0x3 << 8)
+#define APIC_DM_NMI (0x4 << 8)
#define APIC_DM_INIT (0x5 << 8)
#define APIC_DM_STARTUP (0x6 << 8)
#define APIC_DM_EXTINT (0x7 << 8)
@@ -174,7 +174,7 @@
/* Prototypes */
-volatile inline ULONG APICRead(ULONG Offset);
+inline ULONG APICRead(ULONG Offset);
inline VOID APICWrite(ULONG Offset, ULONG Value);
VOID APICSendIPI(ULONG Target, ULONG Mode);
reactos/hal/halx86/include
diff -u -r1.7.2.1 -r1.7.2.2
--- mps.h 8 Dec 2004 21:56:56 -0000 1.7.2.1
+++ mps.h 30 Dec 2004 04:36:23 -0000 1.7.2.2
@@ -280,7 +280,7 @@
/* Prototypes */
VOID HalpInitMPS(VOID);
-volatile ULONG IOAPICRead(ULONG Apic, ULONG Offset);
+ULONG IOAPICRead(ULONG Apic, ULONG Offset);
VOID IOAPICWrite(ULONG Apic, ULONG Offset, ULONG Value);
VOID IOAPICMaskIrq(ULONG Irq);
VOID IOAPICUnmaskIrq(ULONG Irq);
reactos/hal/halx86/mp
diff -u -r1.1.2.1 -r1.1.2.2
--- apic.c 13 Dec 2004 16:18:23 -0000 1.1.2.1
+++ apic.c 30 Dec 2004 04:36:24 -0000 1.1.2.2
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: apic.c,v 1.1.2.1 2004/12/13 16:18:23 hyperion Exp $
+/* $Id: apic.c,v 1.1.2.2 2004/12/30 04:36:24 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -261,7 +261,7 @@
APICCalibrateTimer(BootCPU);
}
-volatile inline ULONG _APICRead(ULONG Offset)
+inline ULONG _APICRead(ULONG Offset)
{
PULONG p;
@@ -297,7 +297,7 @@
#if 0
-volatile inline ULONG APICRead(ULONG Offset)
+inline ULONG APICRead(ULONG Offset)
{
PULONG p;
@@ -305,7 +305,7 @@
return *p;
}
#else
-volatile inline ULONG APICRead(ULONG Offset)
+inline ULONG APICRead(ULONG Offset)
{
PULONG p;
ULONG CPU = (_APICRead(APIC_ID) & APIC_ID_MASK) >> 24;
reactos/hal/halx86/mp
diff -u -r1.1.2.1 -r1.1.2.2
--- processor_mp.c 13 Dec 2004 16:18:24 -0000 1.1.2.1
+++ processor_mp.c 30 Dec 2004 04:36:24 -0000 1.1.2.2
@@ -1,4 +1,4 @@
-/* $Id: processor_mp.c,v 1.1.2.1 2004/12/13 16:18:24 hyperion Exp $
+/* $Id: processor_mp.c,v 1.1.2.2 2004/12/30 04:36:24 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -126,7 +126,7 @@
/* Functions for handling I/O APICs */
-volatile ULONG IOAPICRead(ULONG Apic, ULONG Offset)
+ULONG IOAPICRead(ULONG Apic, ULONG Offset)
{
PULONG Base;
@@ -616,7 +616,7 @@
*/
memset(&entry,0,sizeof(entry));
- entry.delivery_mode = APIC_DM_LOWEST;
+ entry.delivery_mode = (APIC_DM_LOWEST >> 8);
entry.dest_mode = 1; /* logical delivery */
entry.mask = 1; /* disable IRQ */
#if 0
reactos/include/afd
diff -u -r1.11.2.2 -r1.11.2.3
--- shared.h 13 Dec 2004 09:38:50 -0000 1.11.2.2
+++ shared.h 30 Dec 2004 04:36:24 -0000 1.11.2.3
@@ -145,6 +145,7 @@
/* AFD Info Flags */
#define AFD_INFO_BLOCKING_MODE 0x02L
+#define AFD_INFO_SENDS_IN_PROGRESS 0x04L
#define AFD_INFO_RECEIVE_WINDOW_SIZE 0x06L
#define AFD_INFO_SEND_WINDOW_SIZE 0x07L
#define AFD_INFO_GROUP_ID_TYPE 0x10L
@@ -158,6 +159,7 @@
/* AFD Disconnect Flags */
#define AFD_DISCONNECT_SEND 0x01L
#define AFD_DISCONNECT_RECV 0x02L
+#define AFD_DISCONNECT_ABORT 0x04L
/* AFD Event Flags */
#define AFD_EVENT_RECEIVE 0x1L
reactos/include/ddk
diff -u -r1.43.2.2 -r1.43.2.3
--- exfuncs.h 13 Dec 2004 09:38:50 -0000 1.43.2.2
+++ exfuncs.h 30 Dec 2004 04:36:24 -0000 1.43.2.3
@@ -344,8 +344,7 @@
ASSERT_IRQL(DISPATCH_LEVEL); \
(Item)->WorkerRoutine = (Routine); \
(Item)->Parameter = (RoutineContext); \
- (Item)->List.Flink = NULL; \
- (Item)->List.Blink = NULL;
+ (Item)->List.Flink = NULL;
NTSTATUS
STDCALL
reactos/include/ddk
diff -u -r1.46.2.3 -r1.46.2.4
--- iofuncs.h 13 Dec 2004 16:18:01 -0000 1.46.2.3
+++ iofuncs.h 30 Dec 2004 04:36:24 -0000 1.46.2.4
@@ -1,6 +1,6 @@
#ifndef _INCLUDE_DDK_IOFUNCS_H
#define _INCLUDE_DDK_IOFUNCS_H
-/* $Id: iofuncs.h,v 1.46.2.3 2004/12/13 16:18:01 hyperion Exp $ */
+/* $Id: iofuncs.h,v 1.46.2.4 2004/12/30 04:36:24 hyperion Exp $ */
#ifdef __NTOSKRNL__
extern POBJECT_TYPE EXPORTED IoAdapterObjectType;
reactos/include/ddk
diff -u -r1.69.2.3 -r1.69.2.4
--- iotypes.h 13 Dec 2004 16:18:01 -0000 1.69.2.3
+++ iotypes.h 30 Dec 2004 04:36:24 -0000 1.69.2.4
@@ -1,4 +1,4 @@
-/* $Id: iotypes.h,v 1.69.2.3 2004/12/13 16:18:01 hyperion Exp $
+/* $Id: iotypes.h,v 1.69.2.4 2004/12/30 04:36:24 hyperion Exp $
*
*/
@@ -287,15 +287,13 @@
/*
* PURPOSE: IRP stack location
*/
-
-/*
typedef struct _IO_STACK_LOCATION
{
UCHAR MajorFunction;
UCHAR MinorFunction;
UCHAR Flags;
UCHAR Control;
-
+
union
{
struct
@@ -306,57 +304,59 @@
USHORT ShareAccess;
ULONG EaLength;
} Create;
+
+ struct
+ {
+ PIO_SECURITY_CONTEXT SecurityContext;
+ ULONG Options;
+ USHORT Reserved;
+ USHORT ShareAccess;
+ struct _NAMED_PIPE_CREATE_PARAMETERS *Parameters;
+ } CreatePipe;
+
+ struct
+ {
+ PIO_SECURITY_CONTEXT SecurityContext;
+ ULONG Options;
+ USHORT Reserved;
+ USHORT ShareAccess;
+ struct _MAILSLOT_CREATE_PARAMETERS *Parameters;
+ } CreateMailslot;
+
struct
{
ULONG Length;
ULONG Key;
LARGE_INTEGER ByteOffset;
} Read;
+
struct
{
ULONG Length;
ULONG Key;
LARGE_INTEGER ByteOffset;
} Write;
- struct
- {
- ULONG OutputBufferLength;
- ULONG InputBufferLength;
- ULONG IoControlCode;
- PVOID Type3InputBuffer;
- } DeviceIoControl;
- struct
- {
- ULONG OutputBufferLength;
- ULONG InputBufferLength;
- ULONG IoControlCode;
- PVOID Type3InputBuffer;
- } FileSystemControl;
- struct
- {
- struct _VPB* Vpb;
- struct _DEVICE_OBJECT* DeviceObject;
- } MountVolume;
- struct
- {
- struct _VPB* Vpb;
- struct _DEVICE_OBJECT* DeviceObject;
- } VerifyVolume;
+
struct
{
ULONG Length;
+ PUNICODE_STRING FileName;
FILE_INFORMATION_CLASS FileInformationClass;
- } QueryFile;
+ ULONG FileIndex;
+ } QueryDirectory;
+
struct
{
ULONG Length;
- FS_INFORMATION_CLASS FsInformationClass;
- } QueryVolume;
+ ULONG CompletionFilter;
+ } NotifyDirectory;
+
struct
{
ULONG Length;
- FS_INFORMATION_CLASS FsInformationClass;
- } SetVolume;
+ FILE_INFORMATION_CLASS FileInformationClass;
+ } QueryFile;
+
struct
{
ULONG Length;
@@ -373,21 +373,106 @@
HANDLE DeleteHandle;
} u;
} SetFile;
+
struct
{
ULONG Length;
- PUNICODE_STRING FileName;
- FILE_INFORMATION_CLASS FileInformationClass;
- ULONG FileIndex;
- } QueryDirectory;
+ PVOID EaList;
+ ULONG EaListLength;
+ ULONG EaIndex;
+ } QueryEa;
+
+ struct
+ {
+ ULONG Length;
+ } SetEa;
+
+ struct
+ {
+ ULONG Length;
+ FS_INFORMATION_CLASS FsInformationClass;
+ } QueryVolume;
+
+ struct
+ {
+ ULONG Length;
+ FS_INFORMATION_CLASS FsInformationClass;
+ } SetVolume;
+
+ struct
+ {
+ ULONG OutputBufferLength;
+ ULONG InputBufferLength;
+ ULONG FsControlCode;
+ PVOID Type3InputBuffer;
+ } FileSystemControl;
+
+ /* byte range file locking */
+ struct
+ {
+ PLARGE_INTEGER Length;
+ ULONG Key;
+ LARGE_INTEGER ByteOffset;
+ } LockControl;
+
+ struct
+ {
+ ULONG OutputBufferLength;
+ ULONG InputBufferLength;
+ ULONG IoControlCode;
+ PVOID Type3InputBuffer;
+ } DeviceIoControl;
+
+ struct
+ {
+ SECURITY_INFORMATION SecurityInformation;
+ ULONG POINTER_ALIGNMENT Length;
+ } QuerySecurity;
+
+ struct
+ {
+ SECURITY_INFORMATION SecurityInformation;
+ PSECURITY_DESCRIPTOR SecurityDescriptor;
+ } SetSecurity;
+
+ struct
+ {
+ struct _VPB* Vpb;
+ struct _DEVICE_OBJECT* DeviceObject;
+ } MountVolume;
+
+ struct
+ {
+ struct _VPB* Vpb;
+ struct _DEVICE_OBJECT* DeviceObject;
+ } VerifyVolume;
+
+ /* Parameters for IRP_MN_SCSI_CLASS */
+ struct
+ {
+ struct _SCSI_REQUEST_BLOCK *Srb;
+ } Scsi;
+
+ struct
+ {
+ ULONG Length;
+ PSID StartSid;
+ struct _FILE_GET_QUOTA_INFORMATION *SidList;
+ ULONG SidListLength;
+ } QueryQuota;
+
+ struct
+ {
+ ULONG Length;
+ } SetQuota;
- // Parameters for IRP_MN_QUERY_DEVICE_RELATIONS
+ /* Parameters for IRP_MN_QUERY_DEVICE_RELATIONS */
struct
{
DEVICE_RELATION_TYPE Type;
} QueryDeviceRelations;
- // Parameters for IRP_MN_QUERY_INTERFACE
+ /* Parameters for IRP_MN_QUERY_INTERFACE */
struct
{
CONST GUID *InterfaceType;
@@ -397,32 +482,45 @@
PVOID InterfaceSpecificData;
} QueryInterface;
- // Parameters for IRP_MN_QUERY_CAPABILITIES
+ /* Parameters for IRP_MN_QUERY_CAPABILITIES */
struct
{
PDEVICE_CAPABILITIES Capabilities;
} DeviceCapabilities;
- // Parameters for IRP_MN_FILTER_RESOURCE_REQUIREMENTS
+ /* Parameters for IRP_MN_FILTER_RESOURCE_REQUIREMENTS */
struct
{
- PIO_RESOURCE_REQUIREMENTS_LIST IoResourceRequirementList;
- } FilterResourceRequirements;
+ PIO_RESOURCE_REQUIREMENTS_LIST IoResourceRequirementList;
+ } FilterResourceRequirements;
- // Parameters for IRP_MN_QUERY_ID
+ struct
+ {
+ ULONG WhichSpace;
+ PVOID Buffer;
+ ULONG Offset;
+ ULONG POINTER_ALIGNMENT Length;
+ } ReadWriteConfig;
+
+ struct
+ {
+ BOOLEAN Lock;
+ } SetLock;
+
+ /* Parameters for IRP_MN_QUERY_ID */
struct
{
BUS_QUERY_ID_TYPE IdType;
} QueryId;
- // Parameters for IRP_MN_QUERY_DEVICE_TEXT
+ /* Parameters for IRP_MN_QUERY_DEVICE_TEXT */
struct
{
DEVICE_TEXT_TYPE DeviceTextType;
LCID LocaleId;
} QueryDeviceText;
- // Parameters for IRP_MN_DEVICE_USAGE_NOTIFICATION
+ /* Parameters for IRP_MN_DEVICE_USAGE_NOTIFICATION */
struct
{
BOOLEAN InPath;
@@ -430,19 +528,19 @@
DEVICE_USAGE_NOTIFICATION_TYPE Type;
} UsageNotification;
- // Parameters for IRP_MN_WAIT_WAKE
+ /* Parameters for IRP_MN_WAIT_WAKE */
struct
{
SYSTEM_POWER_STATE PowerState;
} WaitWake;
- // Parameter for IRP_MN_POWER_SEQUENCE
+ /* Parameter for IRP_MN_POWER_SEQUENCE */
struct
{
PPOWER_SEQUENCE PowerSequence;
} PowerSequence;
- // Parameters for IRP_MN_SET_POWER and IRP_MN_QUERY_POWER
+ /* Parameters for IRP_MN_SET_POWER and IRP_MN_QUERY_POWER */
struct
{
ULONG SystemContext;
@@ -451,29 +549,23 @@
POWER_ACTION ShutdownType;
} Power;
- // Parameters for IRP_MN_START_DEVICE
+ /* Parameters for IRP_MN_START_DEVICE */
struct
{
PCM_RESOURCE_LIST AllocatedResources;
PCM_RESOURCE_LIST AllocatedResourcesTranslated;
} StartDevice;
-*/
- /* Parameters for IRP_MN_SCSI_CLASS */
-/* struct
- {
- struct _SCSI_REQUEST_BLOCK *Srb;
- } Scsi;
- //byte range file locking
- struct
+ struct
{
- PLARGE_INTEGER Length;
- ULONG Key;
- LARGE_INTEGER ByteOffset;
- } LockControl;
-*/
+ ULONG_PTR ProviderId;
+ PVOID DataPath;
+ ULONG BufferSize;
+ PVOID Buffer;
+ } WMI;
+
/* Paramters for other calls */
-/* struct
+ struct
{
PVOID Argument1;
PVOID Argument2;
@@ -481,245 +573,15 @@
PVOID Argument4;
} Others;
} Parameters;
-
+
struct _DEVICE_OBJECT* DeviceObject;
struct _FILE_OBJECT* FileObject;
PIO_COMPLETION_ROUTINE CompletionRoutine;
- PVOID CompletionContext;
-
-} IO_STACK_LOCATION, *PIO_STACK_LOCATION;*/
+ PVOID Context;
-typedef struct _IO_STACK_LOCATION {
- UCHAR MajorFunction;
- UCHAR MinorFunction;
- UCHAR Flags;
- UCHAR Control;
- union {
- struct {
- PIO_SECURITY_CONTEXT SecurityContext;
- ULONG Options;
- USHORT POINTER_ALIGNMENT FileAttributes;
- USHORT ShareAccess;
- ULONG POINTER_ALIGNMENT EaLength;
- } Create;
- struct {
- ULONG Length;
- ULONG POINTER_ALIGNMENT Key;
- LARGE_INTEGER ByteOffset;
- } Read;
- struct {
- ULONG Length;
- ULONG POINTER_ALIGNMENT Key;
- LARGE_INTEGER ByteOffset;
- } Write;
- struct {
- ULONG Length;
- FILE_INFORMATION_CLASS POINTER_ALIGNMENT FileInformationClass;
- } QueryFile;
- struct {
- ULONG Length;
- FILE_INFORMATION_CLASS POINTER_ALIGNMENT FileInformationClass;
- struct _FILE_OBJECT* FileObject;
- union {
- struct {
- BOOLEAN ReplaceIfExists;
- BOOLEAN AdvanceOnly;
- };
- ULONG ClusterCount;
- HANDLE DeleteHandle;
- };
- } SetFile;
- struct {
- ULONG Length;
- FS_INFORMATION_CLASS POINTER_ALIGNMENT FsInformationClass;
- } QueryVolume;
- struct {
- ULONG OutputBufferLength;
- ULONG POINTER_ALIGNMENT InputBufferLength;
- ULONG POINTER_ALIGNMENT IoControlCode;
- PVOID Type3InputBuffer;
- } DeviceIoControl;
- struct {
- SECURITY_INFORMATION SecurityInformation;
- ULONG POINTER_ALIGNMENT Length;
- } QuerySecurity;
- struct {
- SECURITY_INFORMATION SecurityInformation;
- PSECURITY_DESCRIPTOR SecurityDescriptor;
- } SetSecurity;
- struct {
- struct _VPB* Vpb;
- struct _DEVICE_OBJECT* DeviceObject;
- } MountVolume;
- struct {
- struct _VPB* Vpb;
- struct _DEVICE_OBJECT* DeviceObject;
- } VerifyVolume;
- struct {
- struct _SCSI_REQUEST_BLOCK *Srb;
- } Scsi;
- struct {
- DEVICE_RELATION_TYPE Type;
- } QueryDeviceRelations;
- struct {
- CONST GUID *InterfaceType;
- USHORT Size;
- USHORT Version;
- PINTERFACE Interface;
- PVOID InterfaceSpecificData;
- } QueryInterface;
- struct {
- PDEVICE_CAPABILITIES Capabilities;
- } DeviceCapabilities;
- struct {
- PIO_RESOURCE_REQUIREMENTS_LIST IoResourceRequirementList;
- } FilterResourceRequirements;
- struct {
- ULONG WhichSpace;
- PVOID Buffer;
- ULONG Offset;
- ULONG POINTER_ALIGNMENT Length;
- } ReadWriteConfig;
- struct {
- BOOLEAN Lock;
- } SetLock;
- struct {
- BUS_QUERY_ID_TYPE IdType;
- } QueryId;
- struct {
- DEVICE_TEXT_TYPE DeviceTextType;
- LCID POINTER_ALIGNMENT LocaleId;
- } QueryDeviceText;
- struct {
- BOOLEAN InPath;
- BOOLEAN Reserved[3];
- DEVICE_USAGE_NOTIFICATION_TYPE POINTER_ALIGNMENT Type;
- } UsageNotification;
- struct {
- SYSTEM_POWER_STATE PowerState;
- } WaitWake;
- struct {
- PPOWER_SEQUENCE PowerSequence;
- } PowerSequence;
- struct {
- ULONG SystemContext;
- POWER_STATE_TYPE POINTER_ALIGNMENT Type;
- POWER_STATE POINTER_ALIGNMENT State;
- POWER_ACTION POINTER_ALIGNMENT ShutdownType;
- } Power;
- struct {
- PCM_RESOURCE_LIST AllocatedResources;
- PCM_RESOURCE_LIST AllocatedResourcesTranslated;
- } StartDevice;
- struct {
- ULONG_PTR ProviderId;
- PVOID DataPath;
- ULONG BufferSize;
- PVOID Buffer;
- } WMI;
- struct {
- PVOID Argument1;
- PVOID Argument2;
- PVOID Argument3;
- PVOID Argument4;
- } Others;
- } Parameters;
- struct _DEVICE_OBJECT* DeviceObject;
- struct _FILE_OBJECT* FileObject;
- PIO_COMPLETION_ROUTINE CompletionRoutine;
- PVOID Context;
} IO_STACK_LOCATION, *PIO_STACK_LOCATION;
-// AG: The commented lines in this structure are due to PMAILSLOT_CREATE_PARAMETERS
-// and PNAMED_PIPE_CREATE_PARAMETERS and PFILE_GET_QUOTA_INFORMATION not being
-// defined.
-
-typedef struct _EXTENDED_IO_STACK_LOCATION {
-
- /* Included for padding */
- UCHAR MajorFunction;
- UCHAR MinorFunction;
- UCHAR Flags;
- UCHAR Control;
-
- union {
-
-// struct {
-// PIO_SECURITY_CONTEXT SecurityContext;
-// ULONG Options;
-// USHORT Reserved;
-// USHORT ShareAccess;
-// PMAILSLOT_CREATE_PARAMETERS Parameters;
-// } CreateMailslot;
-
-// struct {
-// PIO_SECURITY_CONTEXT SecurityContext;
-// ULONG Options;
-// USHORT Reserved;
-// USHORT ShareAccess;
-// PNAMED_PIPE_CREATE_PARAMETERS Parameters;
-// } CreatePipe;
-
- struct {
- ULONG OutputBufferLength;
- ULONG InputBufferLength;
- ULONG FsControlCode;
- PVOID Type3InputBuffer;
- } FileSystemControl;
-
- struct {
- PLARGE_INTEGER Length;
- ULONG Key;
- LARGE_INTEGER ByteOffset;
- } LockControl;
-
- struct {
- ULONG Length;
- ULONG CompletionFilter;
- } NotifyDirectory;
-
- struct {
- ULONG Length;
- PUNICODE_STRING FileName;
- FILE_INFORMATION_CLASS FileInformationClass;
- ULONG FileIndex;
- } QueryDirectory;
-
- struct {
- ULONG Length;
- PVOID EaList;
- ULONG EaListLength;
- ULONG EaIndex;
- } QueryEa;
-
-// struct {
-// ULONG Length;
-// PSID StartSid;
-// PFILE_GET_QUOTA_INFORMATION SidList;
-// ULONG SidListLength;
-// } QueryQuota;
-
- struct {
- ULONG Length;
- } SetEa;
-
- struct {
- ULONG Length;
- } SetQuota;
-
- struct {
- ULONG Length;
- FS_INFORMATION_CLASS FsInformationClass;
- } SetVolume;
-
- } Parameters;
- struct _DEVICE_OBJECT* DeviceObject;
- struct _FILE_OBJECT* FileObject;
- PIO_COMPLETION_ROUTINE CompletionRoutine;
- PVOID Context;
-
-} EXTENDED_IO_STACK_LOCATION, *PEXTENDED_IO_STACK_LOCATION;
typedef struct _IO_STATUS_BLOCK
{
@@ -1242,24 +1104,27 @@
#endif // (_WIN32_WINNT >= 0x0400)
-typedef struct _NAMED_PIPE_CREATE_PARAMETERS {
- ULONG NamedPipeType;
- ULONG ReadMode;
- ULONG CompletionMode;
- ULONG MaximumInstances;
- ULONG InboundQuota;
- ULONG OutboundQuota;
- LARGE_INTEGER DefaultTimeout;
- BOOLEAN TimeoutSpecified;
+typedef struct _NAMED_PIPE_CREATE_PARAMETERS
+{
+ ULONG NamedPipeType;
+ ULONG ReadMode;
+ ULONG CompletionMode;
+ ULONG MaximumInstances;
+ ULONG InboundQuota;
+ ULONG OutboundQuota;
+ LARGE_INTEGER DefaultTimeout;
+ BOOLEAN TimeoutSpecified;
} NAMED_PIPE_CREATE_PARAMETERS, *PNAMED_PIPE_CREATE_PARAMETERS;
-typedef struct _MAILSLOT_CREATE_PARAMETERS {
- ULONG MailslotQuota;
- ULONG MaximumMessageSize;
- LARGE_INTEGER ReadTimeout;
- BOOLEAN TimeoutSpecified;
+typedef struct _MAILSLOT_CREATE_PARAMETERS
+{
+ ULONG MailslotQuota;
+ ULONG MaximumMessageSize;
+ LARGE_INTEGER ReadTimeout;
+ BOOLEAN TimeoutSpecified;
} MAILSLOT_CREATE_PARAMETERS, *PMAILSLOT_CREATE_PARAMETERS;
+
/* error logging */
typedef struct _IO_ERROR_LOG_PACKET
@@ -1307,7 +1172,7 @@
typedef struct _SCATTER_GATHER_LIST {
ULONG NumberOfElements;
ULONG_PTR Reserved;
- SCATTER_GATHER_ELEMENT Elements[];
+ SCATTER_GATHER_ELEMENT Elements[1];
} SCATTER_GATHER_LIST, *PSCATTER_GATHER_LIST;
typedef VOID (*PPUT_DMA_ADAPTER)(
reactos/include/ddk
diff -u -r1.48.2.1 -r1.48.2.2
--- kefuncs.h 8 Dec 2004 21:56:57 -0000 1.48.2.1
+++ kefuncs.h 30 Dec 2004 04:36:24 -0000 1.48.2.2
@@ -358,6 +358,15 @@
LONG STDCALL
KeResetEvent(IN PKEVENT Event);
+VOID STDCALL
+KeRosDumpStackFrames ( PULONG Frame, ULONG FrameCount );
+
+ULONG STDCALL
+KeRosGetStackFrames ( PULONG Frames, ULONG FrameCount );
+
+BOOLEAN STDCALL
+KeRosPrintAddress(PVOID address);
+
LONG STDCALL
KeSetBasePriorityThread(struct _KTHREAD* Thread,
LONG Increment);
reactos/include/ddk
diff -u -r1.20 -r1.20.2.1
--- mmtypes.h 20 Nov 2004 16:46:04 -0000 1.20
+++ mmtypes.h 30 Dec 2004 04:36:24 -0000 1.20.2.1
@@ -1,4 +1,4 @@
-/* $Id: mmtypes.h,v 1.20 2004/11/20 16:46:04 weiden Exp $ */
+/* $Id: mmtypes.h,v 1.20.2.1 2004/12/30 04:36:24 hyperion Exp $ */
#ifndef _INCLUDE_DDK_MMTYPES_H
#define _INCLUDE_DDK_MMTYPES_H
@@ -76,10 +76,10 @@
}FILE_SEGMENT_ELEMENT, *PFILE_SEGMENT_ELEMENT;
typedef struct _READ_LIST {
- struct FILE_OBJECT* FileObject;
+ struct _FILE_OBJECT* FileObject;
ULONG NumberOfEntries;
ULONG IsImage;
- FILE_SEGMENT_ELEMENT List[];
+ FILE_SEGMENT_ELEMENT List[1];
} READ_LIST, *PREAD_LIST;
#define MmSmallSystem (0)
reactos/include/ddk
diff -u -r1.16 -r1.16.6.1
--- setypes.h 19 Jul 2004 06:08:21 -0000 1.16
+++ setypes.h 30 Dec 2004 04:36:24 -0000 1.16.6.1
@@ -1,4 +1,4 @@
-/* $Id: setypes.h,v 1.16 2004/07/19 06:08:21 ion Exp $
+/* $Id: setypes.h,v 1.16.6.1 2004/12/30 04:36:24 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory for details
* PROJECT: ReactOS kernel
@@ -96,7 +96,7 @@
UCHAR Unused[2]; /* 0x66 */
PVOID ProxyData; /* 0x68 */
PVOID AuditData; /* 0x6c */
- UCHAR VariablePart[0]; /* 0x70 */
+ UCHAR VariablePart[1]; /* 0x70 */
} ACCESS_TOKEN, *PACCESS_TOKEN;
reactos/include
diff -N cvconst.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ cvconst.h 30 Dec 2004 04:36:25 -0000 1.1.4.1
@@ -0,0 +1,432 @@
+/*
+ * File cvconst.h - MS debug information
+ *
+ * Copyright (C) 2004, Eric Pouech
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* information in this file is highly derivated from MSDN DIA information pages */
+
+/* symbols & types enumeration */
+enum SymTagEnum
+{
+ SymTagNull,
+ SymTagExe,
+ SymTagCompiland,
+ SymTagCompilandDetails,
+ SymTagCompilandEnv,
+ SymTagFunction,
+ SymTagBlock,
+ SymTagData,
+ SymTagAnnotation,
+ SymTagLabel,
+ SymTagPublicSymbol,
+ SymTagUDT,
+ SymTagEnum,
+ SymTagFunctionType,
+ SymTagPointerType,
+ SymTagArrayType,
+ SymTagBaseType,
+ SymTagTypedef,
+ SymTagBaseClass,
+ SymTagFriend,
+ SymTagFunctionArgType,
+ SymTagFuncDebugStart,
+ SymTagFuncDebugEnd,
+ SymTagUsingNamespace,
+ SymTagVTableShape,
+ SymTagVTable,
+ SymTagCustom,
+ SymTagThunk,
+ SymTagCustomType,
+ SymTagManagedType,
+ SymTagDimension,
+ SymTagMax
+};
+
+enum BasicType
+{
+ btNoType = 0,
+ btVoid = 1,
+ btChar = 2,
+ btWChar = 3,
+ btInt = 6,
+ btUInt = 7,
+ btFloat = 8,
+ btBCD = 9,
+ btBool = 10,
+ btLong = 13,
+ btULong = 14,
+ btCurrency = 25,
+ btDate = 26,
+ btVariant = 27,
+ btComplex = 28,
+ btBit = 29,
+ btBSTR = 30,
+ btHresult = 31,
+};
+
+/* kind of UDT */
+enum UdtKind
+{
+ UdtStruct,
+ UdtClass,
+ UdtUnion
+};
+
+/* where a SymTagData is */
+enum LocationType
+{
+ LocIsNull,
+ LocIsStatic,
+ LocIsTLS,
+ LocIsRegRel,
+ LocIsThisRel,
+ LocIsEnregistered,
+ LocIsBitField,
+ LocIsSlot,
+ LocIsIlRel,
+ LocInMetaData,
+ LocIsConstant
+};
+
+/* kind of SymTagData */
+enum DataKind
+{
+ DataIsUnknown,
+ DataIsLocal,
+ DataIsStaticLocal,
+ DataIsParam,
+ DataIsObjectPtr,
+ DataIsFileStatic,
+ DataIsGlobal,
+ DataIsMember,
+ DataIsStaticMember,
+ DataIsConstant
+};
+
+/* values for registers (on different CPUs) */
+enum CV_HREG_e
+{
+ /* those values are common to all supported CPUs (and CPU independant) */
+ CV_ALLREG_ERR = 30000,
+ CV_ALLREG_TEB = 30001,
+ CV_ALLREG_TIMER = 30002,
+ CV_ALLREG_EFAD1 = 30003,
+ CV_ALLREG_EFAD2 = 30004,
+ CV_ALLREG_EFAD3 = 30005,
+ CV_ALLREG_VFRAME = 30006,
+ CV_ALLREG_HANDLE = 30007,
+ CV_ALLREG_PARAMS = 30008,
+ CV_ALLREG_LOCALS = 30009,
+
+ /* Intel x86 CPU */
+ CV_REG_NONE = 0,
+ CV_REG_AL = 1,
+ CV_REG_CL = 2,
+ CV_REG_DL = 3,
+ CV_REG_BL = 4,
+ CV_REG_AH = 5,
+ CV_REG_CH = 6,
+ CV_REG_DH = 7,
+ CV_REG_BH = 8,
+ CV_REG_AX = 9,
+ CV_REG_CX = 10,
+ CV_REG_DX = 11,
+ CV_REG_BX = 12,
+ CV_REG_SP = 13,
+ CV_REG_BP = 14,
+ CV_REG_SI = 15,
+ CV_REG_DI = 16,
+ CV_REG_EAX = 17,
+ CV_REG_ECX = 18,
+ CV_REG_EDX = 19,
+ CV_REG_EBX = 20,
+ CV_REG_ESP = 21,
+ CV_REG_EBP = 22,
+ CV_REG_ESI = 23,
+ CV_REG_EDI = 24,
+ CV_REG_ES = 25,
+ CV_REG_CS = 26,
+ CV_REG_SS = 27,
+ CV_REG_DS = 28,
+ CV_REG_FS = 29,
+ CV_REG_GS = 30,
+ CV_REG_IP = 31,
+ CV_REG_FLAGS = 32,
+ CV_REG_EIP = 33,
+ CV_REG_EFLAGS = 34,
+
+ /* <pcode> */
+ CV_REG_TEMP = 40,
+ CV_REG_TEMPH = 41,
+ CV_REG_QUOTE = 42,
+ CV_REG_PCDR3 = 43, /* this includes PCDR4 to PCDR7 */
+ CV_REG_CR0 = 80, /* this includes CR1 to CR4 */
+ CV_REG_DR0 = 90, /* this includes DR1 to DR7 */
+ /* </pcode> */
+
+ CV_REG_GDTR = 110,
+ CV_REG_GDTL = 111,
+ CV_REG_IDTR = 112,
+ CV_REG_IDTL = 113,
+ CV_REG_LDTR = 114,
+ CV_REG_TR = 115,
+
+ CV_REG_PSEUDO1 = 116, /* this includes Pseudo02 to Pseuso09 */
+ CV_REG_ST0 = 128, /* this includes ST1 to ST7 */
+ CV_REG_CTRL = 136,
+ CV_REG_STAT = 137,
+ CV_REG_TAG = 138,
+ CV_REG_FPIP = 139,
+ CV_REG_FPCS = 140,
+ CV_REG_FPDO = 141,
+ CV_REG_FPDS = 142,
+ CV_REG_ISEM = 143,
+ CV_REG_FPEIP = 144,
+ CV_REG_FPEDO = 145,
+ CV_REG_MM0 = 146, /* this includes MM1 to MM7 */
+ CV_REG_XMM0 = 154, /* this includes XMM1 to XMM7 */
+ CV_REG_XMM00 = 162,
+ CV_REG_XMM0L = 194, /* this includes XMM1L to XMM7L */
+ CV_REG_XMM0H = 202, /* this includes XMM1H to XMM7H */
+ CV_REG_MXCSR = 211,
+ CV_REG_EDXEAX = 212,
+ CV_REG_EMM0L = 220,
+ CV_REG_EMM0H = 228,
+ CV_REG_MM00 = 236,
+ CV_REG_MM01 = 237,
+ CV_REG_MM10 = 238,
+ CV_REG_MM11 = 239,
+ CV_REG_MM20 = 240,
+ CV_REG_MM21 = 241,
+ CV_REG_MM30 = 242,
+ CV_REG_MM31 = 243,
+ CV_REG_MM40 = 244,
+ CV_REG_MM41 = 245,
+ CV_REG_MM50 = 246,
+ CV_REG_MM51 = 247,
+ CV_REG_MM60 = 248,
+ CV_REG_MM61 = 249,
+ CV_REG_MM70 = 250,
+ CV_REG_MM71 = 251,
+
+ /* Motorola 68K CPU */
+ CV_R68_D0 = 0, /* this includes D1 to D7 too */
+ CV_R68_A0 = 8, /* this includes A1 to A7 too */
+ CV_R68_CCR = 16,
+ CV_R68_SR = 17,
+ CV_R68_USP = 18,
+ CV_R68_MSP = 19,
+ CV_R68_SFC = 20,
+ CV_R68_DFC = 21,
+ CV_R68_CACR = 22,
+ CV_R68_VBR = 23,
+ CV_R68_CAAR = 24,
+ CV_R68_ISP = 25,
+ CV_R68_PC = 26,
+ CV_R68_FPCR = 28,
+ CV_R68_FPSR = 29,
+ CV_R68_FPIAR = 30,
+ CV_R68_FP0 = 32, /* this includes FP1 to FP7 */
+ CV_R68_MMUSR030 = 41,
+ CV_R68_MMUSR = 42,
+ CV_R68_URP = 43,
+ CV_R68_DTT0 = 44,
+ CV_R68_DTT1 = 45,
+ CV_R68_ITT0 = 46,
+ CV_R68_ITT1 = 47,
+ CV_R68_PSR = 51,
+ CV_R68_PCSR = 52,
+ CV_R68_VAL = 53,
+ CV_R68_CRP = 54,
+ CV_R68_SRP = 55,
+ CV_R68_DRP = 56,
+ CV_R68_TC = 57,
+ CV_R68_AC = 58,
+ CV_R68_SCC = 59,
+ CV_R68_CAL = 60,
+ CV_R68_TT0 = 61,
+ CV_R68_TT1 = 62,
+ CV_R68_BAD0 = 64, /* this includes BAD1 to BAD7 */
+ CV_R68_BAC0 = 72, /* this includes BAC1 to BAC7 */
+
+ /* MIPS 4000 CPU */
+ CV_M4_NOREG = CV_REG_NONE,
+ CV_M4_IntZERO = 10,
+ CV_M4_IntAT = 11,
+ CV_M4_IntV0 = 12,
+ CV_M4_IntV1 = 13,
+ CV_M4_IntA0 = 14, /* this includes IntA1 to IntA3 */
+ CV_M4_IntT0 = 18, /* this includes IntT1 to IntT7 */
+ CV_M4_IntS0 = 26, /* this includes IntS1 to IntS7 */
+ CV_M4_IntT8 = 34,
+ CV_M4_IntT9 = 35,
+ CV_M4_IntKT0 = 36,
+ CV_M4_IntKT1 = 37,
+ CV_M4_IntGP = 38,
+ CV_M4_IntSP = 39,
+ CV_M4_IntS8 = 40,
+ CV_M4_IntRA = 41,
+ CV_M4_IntLO = 42,
+ CV_M4_IntHI = 43,
+ CV_M4_Fir = 50,
+ CV_M4_Psr = 51,
+ CV_M4_FltF0 = 60, /* this includes FltF1 to Flt31 */
+ CV_M4_FltFsr = 92,
+
+ /* Alpha AXP CPU */
+ CV_ALPHA_NOREG = CV_REG_NONE,
+ CV_ALPHA_FltF0 = 10, /* this includes FltF1 to FltF31 */
+ CV_ALPHA_IntV0 = 42,
+ CV_ALPHA_IntT0 = 43, /* this includes T1 to T7 */
+ CV_ALPHA_IntS0 = 51, /* this includes S1 to S5 */
+ CV_ALPHA_IntFP = 57,
+ CV_ALPHA_IntA0 = 58, /* this includes A1 to A5 */
+ CV_ALPHA_IntT8 = 64,
+ CV_ALPHA_IntT9 = 65,
+ CV_ALPHA_IntT10 = 66,
+ CV_ALPHA_IntT11 = 67,
+ CV_ALPHA_IntRA = 68,
+ CV_ALPHA_IntT12 = 69,
+ CV_ALPHA_IntAT = 70,
+ CV_ALPHA_IntGP = 71,
+ CV_ALPHA_IntSP = 72,
+ CV_ALPHA_IntZERO = 73,
+ CV_ALPHA_Fpcr = 74,
+ CV_ALPHA_Fir = 75,
+ CV_ALPHA_Psr = 76,
+ CV_ALPHA_FltFsr = 77,
+ CV_ALPHA_SoftFpcr = 78,
+
+ /* Motorola & IBM PowerPC CPU */
+ CV_PPC_GPR0 = 1, /* this includes GPR1 to GPR31 */
+ CV_PPC_CR = 33,
+ CV_PPC_CR0 = 34, /* this includes CR1 to CR7 */
+ CV_PPC_FPR0 = 42, /* this includes FPR1 to FPR31 */
+
+ CV_PPC_FPSCR = 74,
+ CV_PPC_MSR = 75,
+ CV_PPC_SR0 = 76, /* this includes SR1 to SR15 */
+ /* some PPC registers missing */
+
+ /* Hitachi SH3 CPU */
+ CV_SH3_NOREG = CV_REG_NONE,
+ CV_SH3_IntR0 = 10, /* this include R1 to R13 */
+ CV_SH3_IntFp = 24,
+ CV_SH3_IntSp = 25,
+ CV_SH3_Gbr = 38,
+ CV_SH3_Pr = 39,
+ CV_SH3_Mach = 40,
+ CV_SH3_Macl = 41,
+ CV_SH3_Pc = 50,
+ CV_SH3_Sr = 51,
+ CV_SH3_BarA = 60,
+ CV_SH3_BasrA = 61,
+ CV_SH3_BamrA = 62,
+ CV_SH3_BbrA = 63,
+ CV_SH3_BarB = 64,
+ CV_SH3_BasrB = 65,
+ CV_SH3_BamrB = 66,
+ CV_SH3_BbrB = 67,
+ CV_SH3_BdrB = 68,
+ CV_SH3_BdmrB = 69,
+ CV_SH3_Brcr = 70,
+ CV_SH_Fpscr = 75,
+ CV_SH_Fpul = 76,
+ CV_SH_FpR0 = 80, /* this includes FpR1 to FpR15 */
+ CV_SH_XFpR0 = 96, /* this includes XFpR1 to XXFpR15 */
+
+ /* ARM CPU */
+ CV_ARM_NOREG = CV_REG_NONE,
+ CV_ARM_R0 = 10, /* this includes R1 to R12 */
+ CV_ARM_SP = 23,
+ CV_ARM_LR = 24,
+ CV_ARM_PC = 25,
+ CV_ARM_CPSR = 26,
+
+ /* Intel IA64 CPU */
+ CV_IA64_NOREG = CV_REG_NONE,
+ CV_IA64_Br0 = 512, /* this includes Br1 to Br7 */
+ CV_IA64_P0 = 704, /* this includes P1 to P63 */
+ CV_IA64_Preds = 768,
+ CV_IA64_IntH0 = 832, /* this includes H1 to H15 */
+ CV_IA64_Ip = 1016,
+ CV_IA64_Umask = 1017,
+ CV_IA64_Cfm = 1018,
+ CV_IA64_Psr = 1019,
+ CV_IA64_Nats = 1020,
+ CV_IA64_Nats2 = 1021,
+ CV_IA64_Nats3 = 1022,
+ CV_IA64_IntR0 = 1024, /* this includes R1 to R127 */
+ CV_IA64_FltF0 = 2048, /* this includes FltF1 to FltF127 */
+ /* some IA64 registers missing */
+
+ /* TriCore CPU */
+ CV_TRI_NOREG = CV_REG_NONE,
+ CV_TRI_D0 = 10, /* includes D1 to D15 */
+ CV_TRI_A0 = 26, /* includes A1 to A15 */
+ CV_TRI_E0 = 42,
+ CV_TRI_E2 = 43,
+ CV_TRI_E4 = 44,
+ CV_TRI_E6 = 45,
+ CV_TRI_E8 = 46,
+ CV_TRI_E10 = 47,
+ CV_TRI_E12 = 48,
+ CV_TRI_E14 = 49,
+ CV_TRI_EA0 = 50,
+ CV_TRI_EA2 = 51,
+ CV_TRI_EA4 = 52,
+ CV_TRI_EA6 = 53,
+ CV_TRI_EA8 = 54,
+ CV_TRI_EA10 = 55,
+ CV_TRI_EA12 = 56,
+ CV_TRI_EA14 = 57,
+ /* some TriCode registers missing */
+
+ /* AM33 (and the likes) CPU */
+ CV_AM33_NOREG = CV_REG_NONE,
+ CV_AM33_E0 = 10, /* this includes E1 to E7 */
+ CV_AM33_A0 = 20, /* this includes A1 to A3 */
+ CV_AM33_D0 = 30, /* this includes D1 to D3 */
+ CV_AM33_FS0 = 40, /* this includes FS1 to FS31 */
+
+ /* Mitsubishi M32R CPU */
+ CV_M32R_NOREG = CV_REG_NONE,
+ CV_M32R_R0 = 10, /* this includes R1 to R11 */
+ CV_M32R_R12 = 22,
+ CV_M32R_R13 = 23,
+ CV_M32R_R14 = 24,
+ CV_M32R_R15 = 25,
+ CV_M32R_PSW = 26,
+ CV_M32R_CBR = 27,
+ CV_M32R_SPI = 28,
+ CV_M32R_SPU = 29,
+ CV_M32R_SPO = 30,
+ CV_M32R_BPC = 31,
+ CV_M32R_ACHI = 32,
+ CV_M32R_ACLO = 33,
+ CV_M32R_PC = 34,
+} CV_HREG_e;
+
+typedef enum
+{
+ THUNK_ORDINAL_NOTYPE,
+ THUNK_ORDINAL_ADJUSTOR,
+ THUNK_ORDINAL_VCALL,
+ THUNK_ORDINAL_PCODE,
+ THUNK_ORDINAL_LOAD
+} THUNK_ORDINAL;
reactos/include
diff -N dbghelp.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ dbghelp.h 30 Dec 2004 04:36:25 -0000 1.1.4.1
@@ -0,0 +1,878 @@
+/*
+ * Declarations for DBGHELP
+ *
+ * Copyright (C) 2003 Eric Pouech
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef __WINE_DBGHELP_H
+#define __WINE_DBGHELP_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* defined(__cplusplus) */
+
+typedef struct _LOADED_IMAGE
+{
+ LPSTR ModuleName;
+ HANDLE hFile;
+ PUCHAR MappedAddress;
+ PIMAGE_NT_HEADERS FileHeader;
+ PIMAGE_SECTION_HEADER LastRvaSection;
+ ULONG NumberOfSections;
+ PIMAGE_SECTION_HEADER Sections;
+ ULONG Characteristics;
+ BOOLEAN fSystemImage;
+ BOOLEAN fDOSImage;
+ LIST_ENTRY Links;
+ ULONG SizeOfImage;
+} LOADED_IMAGE, *PLOADED_IMAGE;
+
+/*************************
+ * IMAGEHLP equiv *
+ *************************/
+
+typedef enum
+{
+ AddrMode1616,
+ AddrMode1632,
+ AddrModeReal,
+ AddrModeFlat
+} ADDRESS_MODE;
+
+typedef struct _tagADDRESS
+{
+ DWORD Offset;
+ WORD Segment;
+ ADDRESS_MODE Mode;
+} ADDRESS, *LPADDRESS;
+
+#define SYMF_OMAP_GENERATED 0x00000001
+#define SYMF_OMAP_MODIFIED 0x00000002
+#define SYMF_USER_GENERATED 0x00000004
+#define SYMF_REGISTER 0x00000008
+#define SYMF_REGREL 0x00000010
+#define SYMF_FRAMEREL 0x00000020
+#define SYMF_PARAMETER 0x00000040
+#define SYMF_LOCAL 0x00000080
+#define SYMF_CONSTANT 0x00000100
+#define SYMF_EXPORT 0x00000200
+#define SYMF_FORWARDER 0x00000400
+#define SYMF_FUNCTION 0x00000800
+#define SYMF_VIRTUAL 0x00001000
+#define SYMF_THUNK 0x00002000
+#define SYMF_TLSREL 0x00004000
+
+typedef enum
+{
+ SymNone = 0,
+ SymCoff,
+ SymCv,
+ SymPdb,
+ SymExport,
+ SymDeferred,
+ SymSym,
+ SymDia,
+ NumSymTypes
+} SYM_TYPE;
+
+typedef struct _IMAGEHLP_SYMBOL
+{
+ DWORD SizeOfStruct;
+ DWORD Address;
+ DWORD Size;
+ DWORD Flags;
+ DWORD MaxNameLength;
+ CHAR Name[1];
+} IMAGEHLP_SYMBOL, *PIMAGEHLP_SYMBOL;
+
+typedef struct _IMAGEHLP_MODULE
+{
+ DWORD SizeOfStruct;
+ DWORD BaseOfImage;
+ DWORD ImageSize;
+ DWORD TimeDateStamp;
+ DWORD CheckSum;
+ DWORD NumSyms;
+ SYM_TYPE SymType;
+ CHAR ModuleName[32];
+ CHAR ImageName[256];
+ CHAR LoadedImageName[256];
+} IMAGEHLP_MODULE, *PIMAGEHLP_MODULE;
+
+typedef struct _IMAGEHLP_MODULEW {
+ DWORD SizeOfStruct;
+ DWORD BaseOfImage;
+ DWORD ImageSize;
+ DWORD TimeDateStamp;
+ DWORD CheckSum;
+ DWORD NumSyms;
+ SYM_TYPE SymType;
+ WCHAR ModuleName[32];
+ WCHAR ImageName[256];
+ WCHAR LoadedImageName[256];
+} IMAGEHLP_MODULEW, *PIMAGEHLP_MODULEW;
+
+typedef struct _IMAGEHLP_LINE
+{
+ DWORD SizeOfStruct;
+ PVOID Key;
+ DWORD LineNumber;
+ PCHAR FileName;
+ DWORD Address;
+} IMAGEHLP_LINE, *PIMAGEHLP_LINE;
+
+typedef struct _SOURCEFILE
+{
+ DWORD ModBase;
+ PCHAR FileName;
+} SOURCEFILE, *PSOURCEFILE;
+
+#define CBA_DEFERRED_SYMBOL_LOAD_START 0x00000001
+#define CBA_DEFERRED_SYMBOL_LOAD_COMPLETE 0x00000002
+#define CBA_DEFERRED_SYMBOL_LOAD_FAILURE 0x00000003
+#define CBA_SYMBOLS_UNLOADED 0x00000004
+#define CBA_DUPLICATE_SYMBOL 0x00000005
+#define CBA_READ_MEMORY 0x00000006
+#define CBA_DEFERRED_SYMBOL_LOAD_CANCEL 0x00000007
+#define CBA_SET_OPTIONS 0x00000008
+#define CBA_EVENT 0x00000010
+#define CBA_DEBUG_INFO 0x10000000
+
+typedef struct _IMAGEHLP_CBA_READ_MEMORY
+{
+ DWORD64 addr;
+ PVOID buf;
+ DWORD bytes;
+ DWORD *bytesread;
+} IMAGEHLP_CBA_READ_MEMORY, *PIMAGEHLP_CBA_READ_MEMORY;
+
+enum {
+ sevInfo = 0,
+ sevProblem,
+ sevAttn,
+ sevFatal,
+ sevMax
+};
+
+typedef struct _IMAGEHLP_CBA_EVENT
+{
+ DWORD severity;
+ DWORD code;
+ PCHAR desc;
+ PVOID object;
+} IMAGEHLP_CBA_EVENT, *PIMAGEHLP_CBA_EVENT;
+
+typedef struct _IMAGEHLP_DEFERRED_SYMBOL_LOAD
+{
+ DWORD SizeOfStruct;
+ DWORD64 BaseOfImage;
+ DWORD CheckSum;
+ DWORD TimeDateStamp;
+ CHAR FileName[MAX_PATH];
+ BOOLEAN Reparse;
+} IMAGEHLP_DEFERRED_SYMBOL_LOAD, *PIMAGEHLP_DEFERRED_SYMBOL_LOAD;
+
+typedef struct _IMAGEHLP_DUPLICATE_SYMBOL
+{
+ DWORD SizeOfStruct;
+ DWORD NumberOfDups;
+ PIMAGEHLP_SYMBOL Symbol;
+ DWORD SelectedSymbol;
+} IMAGEHLP_DUPLICATE_SYMBOL, *PIMAGEHLP_DUPLICATE_SYMBOL;
+
+#define SYMOPT_CASE_INSENSITIVE 0x00000001
+#define SYMOPT_UNDNAME 0x00000002
+#define SYMOPT_DEFERRED_LOADS 0x00000004
+#define SYMOPT_NO_CPP 0x00000008
+#define SYMOPT_LOAD_LINES 0x00000010
+#define SYMOPT_OMAP_FIND_NEAREST 0x00000020
+#define SYMOPT_LOAD_ANYTHING 0x00000040
+#define SYMOPT_IGNORE_CVREC 0x00000080
+#define SYMOPT_NO_UNQUALIFIED_LOADS 0x00000100
+#define SYMOPT_FAIL_CRITICAL_ERRORS 0x00000200
+#define SYMOPT_EXACT_SYMBOLS 0x00000400
+#define SYMOPT_WILD_UNDERSCORE 0x00000800
+#define SYMOPT_USE_DEFAULTS 0x00001000
+#define SYMOPT_INCLUDE_32BIT_MODULES 0x00002000
+#define SYMOPT_PUBLICS_ONLY 0x00004000
+#define SYMOPT_NO_PUBLICS 0x00008000
+#define SYMOPT_AUTO_PUBLICS 0x00010000
+#define SYMOPT_NO_IMAGE_SEARCH 0x00020000
+#define SYMOPT_SECURE 0x00040000
+#define SYMOPT_NO_PROMPTS 0x00080000
+
+#define SYMOPT_DEBUG 0x80000000
+
+typedef struct _IMAGEHLP_STACK_FRAME
+{
+ ULONG64 InstructionOffset;
+ ULONG64 ReturnOffset;
+ ULONG64 FrameOffset;
+ ULONG64 StackOffset;
+ ULONG64 BackingStoreOffset;
+ ULONG64 FuncTableEntry;
+ ULONG64 Params[4];
+ ULONG64 Reserved[5];
+ BOOL Virtual;
+ ULONG Reserved2;
+} IMAGEHLP_STACK_FRAME, *PIMAGEHLP_STACK_FRAME;
+
+typedef VOID IMAGEHLP_CONTEXT, *PIMAGEHLP_CONTEXT;
+
+#define DBHHEADER_DEBUGDIRS 0x1
+typedef struct _DBGHELP_MODLOAD_DATA
+{
+ DWORD ssize;
+ DWORD ssig;
+ PVOID data;
+ DWORD size;
+ DWORD flags;
+} MODLOAD_DATA, *PMODLOAD_DATA;
+
+/*************************
+ * MiniDUMP *
+ *************************/
+
+/* DebugHelp */
+
+#define MINIDUMP_SIGNATURE 0x4D444D50 /* 'PMDM' */
+#define MINIDUMP_VERSION (42899)
+
+typedef DWORD RVA;
+typedef ULONG64 RVA64;
+
+typedef enum _MINIDUMP_TYPE
+{
+ MiniDumpNormal = 0x0000,
+ MiniDumpWithDataSegs = 0x0001,
+ MiniDumpWithFullMemory = 0x0002,
+ MiniDumpWithHandleData = 0x0004,
+ MiniDumpFilterMemory = 0x0008,
+ MiniDumpScanMemory = 0x0010
+} MINIDUMP_TYPE;
+
+typedef enum _MINIDUMP_CALLBACK_TYPE
+{
+ ModuleCallback,
+ ThreadCallback,
+ ThreadExCallback,
+ IncludeThreadCallback,
+ IncludeModuleCallback,
+} MINIDUMP_CALLBACK_TYPE;
+
+typedef struct _MINIDUMP_THREAD_CALLBACK
+{
+ ULONG ThreadId;
+ HANDLE ThreadHandle;
+ CONTEXT Context;
+ ULONG SizeOfContext;
+ ULONGLONG StackBase;
+ ULONG64 StackEnd;
+} MINIDUMP_THREAD_CALLBACK, *PMINIDUMP_THREAD_CALLBACK;
+
+typedef struct _MINIDUMP_THREAD_EX_CALLBACK
+{
+ ULONG ThreadId;
+ HANDLE ThreadHandle;
+ CONTEXT Context;
+ ULONG SizeOfContext;
+ ULONGLONG StackBase;
+ ULONGLONG StackEnd;
+ ULONGLONG BackingStoreBase;
+ ULONGLONG BackingStoreEnd;
+} MINIDUMP_THREAD_EX_CALLBACK, *PMINIDUMP_THREAD_EX_CALLBACK;
+
+typedef struct _MINIDUMP_INCLUDE_THREAD_CALLBACK
+{
+ ULONG ThreadId;
+} MINIDUMP_INCLUDE_THREAD_CALLBACK, *PMINIDUMP_INCLUDE_THREAD_CALLBACK;
+
+typedef enum _THREAD_WRITE_FLAGS
+{
+ ThreadWriteThread = 0x0001,
+ ThreadWriteStack = 0x0002,
+ ThreadWriteContext = 0x0004,
+ ThreadWriteBackingStore = 0x0008,
+ ThreadWriteInstructionWindow = 0x0010
+} THREAD_WRITE_FLAGS;
+
+typedef struct _MINIDUMP_MODULE_CALLBACK
+{
+ PWCHAR FullPath;
+ ULONGLONG BaseOfImage;
+ ULONG SizeOfImage;
+ ULONG CheckSum;
+ ULONG TimeDateStamp;
+ VS_FIXEDFILEINFO VersionInfo;
+ PVOID CvRecord;
+ ULONG SizeOfCvRecord;
+ PVOID MiscRecord;
+ ULONG SizeOfMiscRecord;
+} MINIDUMP_MODULE_CALLBACK, *PMINIDUMP_MODULE_CALLBACK;
+
+typedef struct _MINIDUMP_INCLUDE_MODULE_CALLBACK
+{
+ ULONG64 BaseOfImage;
+} MINIDUMP_INCLUDE_MODULE_CALLBACK, *PMINIDUMP_INCLUDE_MODULE_CALLBACK;
+
+typedef enum _MODULE_WRITE_FLAGS
+{
+ ModuleWriteModule = 0x0001,
+ ModuleWriteDataSeg = 0x0002,
+ ModuleWriteMiscRecord = 0x0004,
+ ModuleWriteCvRecord = 0x0008,
+ ModuleReferencedByMemory = 0x0010
+} MODULE_WRITE_FLAGS;
+
+typedef struct _MINIDUMP_CALLBACK_INPUT
+{
+ ULONG ProcessId;
+ HANDLE ProcessHandle;
+ ULONG CallbackType;
+ union
+ {
+ MINIDUMP_THREAD_CALLBACK Thread;
+ MINIDUMP_THREAD_EX_CALLBACK ThreadEx;
+ MINIDUMP_MODULE_CALLBACK Module;
+ MINIDUMP_INCLUDE_THREAD_CALLBACK IncludeThread;
+ MINIDUMP_INCLUDE_MODULE_CALLBACK IncludeModule;
+ } u;
+} MINIDUMP_CALLBACK_INPUT, *PMINIDUMP_CALLBACK_INPUT;
+
+typedef struct _MINIDUMP_CALLBACK_OUTPUT
+{
+ union
+ {
+ ULONG ModuleWriteFlags;
+ ULONG ThreadWriteFlags;
+ } u;
+} MINIDUMP_CALLBACK_OUTPUT, *PMINIDUMP_CALLBACK_OUTPUT;
+
+typedef BOOL (WINAPI* MINIDUMP_CALLBACK_ROUTINE)(PVOID CallbackParam,
+ const PMINIDUMP_CALLBACK_INPUT CallbackInput,
+ PMINIDUMP_CALLBACK_OUTPUT CallbackOutput);
+
+typedef struct _MINIDUMP_CALLBACK_INFORMATION
+{
+ MINIDUMP_CALLBACK_ROUTINE CallbackRoutine;
+ void* CallbackParam;
+} MINIDUMP_CALLBACK_INFORMATION, *PMINIDUMP_CALLBACK_INFORMATION;
+
+typedef struct _MINIDUMP_LOCATION_DESCRIPTOR
+{
+ ULONG DataSize;
+ RVA Rva;
+} MINIDUMP_LOCATION_DESCRIPTOR;
+
+typedef struct _MINIDUMP_DIRECTORY
+{
+ ULONG StreamType;
+ MINIDUMP_LOCATION_DESCRIPTOR Location;
+} MINIDUMP_DIRECTORY, *PMINIDUMP_DIRECTORY;
+
+typedef struct _MINIDUMP_EXCEPTION
+{
+ ULONG ExceptionCode;
+ ULONG ExceptionFlags;
+ ULONGLONG ExceptionRecord;
+ ULONGLONG ExceptionAddress;
+ ULONG NumberParameters;
+ ULONG __unusedAlignment;
+ ULONGLONG ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS];
+} MINIDUMP_EXCEPTION, *PMINIDUMP_EXCEPTION;
+
+typedef struct _MINIDUMP_EXCEPTION_INFORMATION
+{
+ DWORD ThreadId;
+ PEXCEPTION_POINTERS ExceptionPointers;
+ BOOL ClientPointers;
+} MINIDUMP_EXCEPTION_INFORMATION, *PMINIDUMP_EXCEPTION_INFORMATION;
+
+typedef struct MINIDUMP_EXCEPTION_STREAM
+{
+ ULONG ThreadId;
+ ULONG __alignment;
+ MINIDUMP_EXCEPTION ExceptionRecord;
+ MINIDUMP_LOCATION_DESCRIPTOR ThreadContext;
+} MINIDUMP_EXCEPTION_STREAM, *PMINIDUMP_EXCEPTION_STREAM;
+
+typedef struct _MINIDUMP_HEADER
+{
+ DWORD Signature;
+ DWORD Version;
+ DWORD NumberOfStreams;
+ RVA StreamDirectoryRva;
+ DWORD CheckSum;
+ union
+ {
+ DWORD Reserved;
+ DWORD TimeDateStamp;
+ } u;
+ ULONGLONG Flags;
+} MINIDUMP_HEADER, *PMINIDUMP_HEADER;
+
+typedef struct _MINIDUMP_MEMORY_DESCRIPTOR
+{
+ ULONGLONG StartOfMemoryRange;
+ MINIDUMP_LOCATION_DESCRIPTOR Memory;
+} MINIDUMP_MEMORY_DESCRIPTOR, *PMINIDUMP_MEMORY_DESCRIPTOR;
+
+typedef struct _MINIDUMP_MODULE
+{
+ ULONGLONG BaseOfImage;
+ ULONG SizeOfImage;
+ ULONG CheckSum;
+ ULONG TimeDateStamp;
+ RVA ModuleNameRva;
+ VS_FIXEDFILEINFO VersionInfo;
+ MINIDUMP_LOCATION_DESCRIPTOR CvRecord;
+ MINIDUMP_LOCATION_DESCRIPTOR MiscRecord;
+ ULONGLONG Reserved0;
+ ULONGLONG Reserved1;
+} MINIDUMP_MODULE, *PMINIDUMP_MODULE;
+
+typedef struct _MINIDUMP_MODULE_LIST
+{
+ ULONG NumberOfModules;
+ MINIDUMP_MODULE Modules[1]; /* FIXME: 0-sized array not supported */
+} MINIDUMP_MODULE_LIST, *PMINIDUMP_MODULE_LIST;
+
+typedef struct _MINIDUMP_USER_STREAM
+{
+ ULONG Type;
+ ULONG BufferSize;
+ void* Buffer;
+} MINIDUMP_USER_STREAM, *PMINIDUMP_USER_STREAM;
+
+typedef struct _MINIDUMP_USER_STREAM_INFORMATION
+{
+ ULONG UserStreamCount;
+ PMINIDUMP_USER_STREAM UserStreamArray;
+} MINIDUMP_USER_STREAM_INFORMATION, *PMINIDUMP_USER_STREAM_INFORMATION;
+
+typedef enum _MINIDUMP_STREAM_TYPE
+{
+ UnusedStream = 0,
+ ReservedStream0 = 1,
+ ReservedStream1 = 2,
+ ThreadListStream = 3,
+ ModuleListStream = 4,
+ MemoryListStream = 5,
+ ExceptionStream = 6,
+ SystemInfoStream = 7,
+ ThreadExListStream = 8,
+ Memory64ListStream = 9,
+ CommentStreamA = 10,
+ CommentStreamW = 11,
+ HandleDataStream = 12,
+ FunctionTableStream = 13,
+
+ LastReservedStream = 0xffff
+} MINIDUMP_STREAM_TYPE;
+
+typedef struct _MINIDUMP_SYSTEM_INFO
+{
+ USHORT ProcessorArchitecture;
+ USHORT ProcessorLevel;
+ USHORT ProcessorRevision;
+ USHORT Reserved0;
+
+ ULONG MajorVersion;
+ ULONG MinorVersion;
+ ULONG BuildNumber;
+ ULONG PlatformId;
+
+ RVA CSDVersionRva;
+ ULONG Reserved1;
+ union _CPU_INFORMATION
+ {
+ struct
+ {
+ ULONG VendorId[3];
+ ULONG VersionInformation;
+ ULONG FeatureInformation;
+ ULONG AMDExtendedCpuFeatures;
+ } X86CpuInfo;
+ struct
+ {
+ ULONGLONG ProcessorFeatures[2];
+ } OtherCpuInfo;
+ } Cpu;
+
+} MINIDUMP_SYSTEM_INFO, *PMINIDUMP_SYSTEM_INFO;
+
+typedef struct _MINIDUMP_THREAD
+{
+ ULONG ThreadId;
+ ULONG SuspendCount;
+ ULONG PriorityClass;
+ ULONG Priority;
+ ULONGLONG Teb;
+ MINIDUMP_MEMORY_DESCRIPTOR Stack;
+ MINIDUMP_LOCATION_DESCRIPTOR ThreadContext;
+} MINIDUMP_THREAD, *PMINIDUMP_THREAD;
+
+typedef struct _MINIDUMP_THREAD_LIST
+{
+ ULONG NumberOfThreads;
+ MINIDUMP_THREAD Threads[1]; /* FIXME: no support of 0 sized array */
+} MINIDUMP_THREAD_LIST, *PMINIDUMP_THREAD_LIST;
+
+BOOL WINAPI MiniDumpWriteDump(HANDLE,DWORD,HANDLE,MINIDUMP_TYPE,const PMINIDUMP_EXCEPTION_INFORMATION,
+ const PMINIDUMP_USER_STREAM_INFORMATION,const PMINIDUMP_CALLBACK_INFORMATION);
+BOOL WINAPI MiniDumpReadDumpStream(PVOID,ULONG,PMINIDUMP_DIRECTORY*,PVOID*,ULONG*);
+
+
+/*************************
+ * MODULE handling *
+ *************************/
+typedef BOOL (CALLBACK *PENUMLOADED_MODULES_CALLBACK)(PSTR ModuleName, DWORD ModuleBase,
+ ULONG ModuleSize, PVOID UserContext);
+BOOL WINAPI EnumerateLoadedModules(HANDLE hProcess,
+ PENUMLOADED_MODULES_CALLBACK EnumLoadedModulesCallback,
+ PVOID UserContext);
+typedef BOOL (CALLBACK *PSYM_ENUMMODULES_CALLBACK)(PSTR ModuleName, DWORD BaseOfDll,
+ PVOID UserContext);
+BOOL WINAPI SymEnumerateModules(HANDLE hProcess,
+ PSYM_ENUMMODULES_CALLBACK EnumModulesCallback,
+ PVOID UserContext);
+BOOL WINAPI SymGetModuleInfo(HANDLE hProcess, DWORD dwAddr,
+ PIMAGEHLP_MODULE ModuleInfo);
+BOOL WINAPI SymGetModuleInfoW(HANDLE hProcess, DWORD dwAddr,
+ PIMAGEHLP_MODULEW ModuleInfo);
+DWORD WINAPI SymGetModuleBase(HANDLE hProcess, DWORD dwAddr);
+DWORD WINAPI SymLoadModule(HANDLE hProcess, HANDLE hFile, PSTR ImageName,
+ PSTR ModuleName, DWORD BaseOfDll, DWORD SizeOfDll);
+DWORD64 WINAPI SymLoadModuleEx(HANDLE hProcess, HANDLE hFile, PSTR ImageName,
+ PSTR ModuleName, DWORD64 BaseOfDll, DWORD DllSize,
+ PMODLOAD_DATA Data, DWORD Flags);
+BOOL WINAPI SymUnloadModule(HANDLE hProcess, DWORD BaseOfDll);
+
+/*************************
+ * Symbol Handling *
+ *************************/
+
+#define IMAGEHLP_SYMBOL_INFO_VALUEPRESENT 1
+#define IMAGEHLP_SYMBOL_INFO_REGISTER SYMF_REGISTER /* 0x08 */
+#define IMAGEHLP_SYMBOL_INFO_REGRELATIVE SYMF_REGREL /* 0x10 */
+#define IMAGEHLP_SYMBOL_INFO_FRAMERELATIVE SYMF_FRAMEREL /* 0x20 */
+#define IMAGEHLP_SYMBOL_INFO_PARAMETER SYMF_PARAMETER /* 0x40 */
+#define IMAGEHLP_SYMBOL_INFO_LOCAL SYMF_LOCAL /* 0x80 */
+#define IMAGEHLP_SYMBOL_INFO_CONSTANT SYMF_CONSTANT /* 0x100 */
+#define IMAGEHLP_SYMBOL_FUNCTION SYMF_FUNCTION /* 0x800 */
+
+#define SYMFLAG_VALUEPRESENT 0x00000001
+#define SYMFLAG_REGISTER 0x00000008
+#define SYMFLAG_REGREL 0x00000010
+#define SYMFLAG_FRAMEREL 0x00000020
+#define SYMFLAG_PARAMETER 0x00000040
+#define SYMFLAG_LOCAL 0x00000080
+#define SYMFLAG_CONSTANT 0x00000100
+#define SYMFLAG_EXPORT 0x00000200
+#define SYMFLAG_FORWARDER 0x00000400
+#define SYMFLAG_FUNCTION 0x00000800
+#define SYMFLAG_VIRTUAL 0x00001000
+#define SYMFLAG_THUNK 0x00002000
+#define SYMFLAG_TLSREL 0x00004000
+
+typedef struct _SYMBOL_INFO
+{
+ ULONG SizeOfStruct;
+ ULONG TypeIndex;
+ ULONG64 Reserved[2];
+ ULONG info; /* sdk states info, while MSDN says it's Index... */
+ ULONG Size;
+ ULONG64 ModBase;
+ ULONG Flags;
+ ULONG64 Value;
+ ULONG64 Address;
+ ULONG Register;
+ ULONG Scope;
+ ULONG Tag;
+ ULONG NameLen;
+ ULONG MaxNameLen;
+ CHAR Name[1];
+} SYMBOL_INFO, *PSYMBOL_INFO;
+
+typedef enum _IMAGEHLP_SYMBOL_TYPE_INFO
+{
+ TI_GET_SYMTAG,
+ TI_GET_SYMNAME,
+ TI_GET_LENGTH,
+ TI_GET_TYPE,
+ TI_GET_TYPEID,
+ TI_GET_BASETYPE,
+ TI_GET_ARRAYINDEXTYPEID,
+ TI_FINDCHILDREN,
+ TI_GET_DATAKIND,
+ TI_GET_ADDRESSOFFSET,
+ TI_GET_OFFSET,
+ TI_GET_VALUE,
+ TI_GET_COUNT,
+ TI_GET_CHILDRENCOUNT,
+ TI_GET_BITPOSITION,
+ TI_GET_VIRTUALBASECLASS,
+ TI_GET_VIRTUALTABLESHAPEID,
+ TI_GET_VIRTUALBASEPOINTEROFFSET,
+ TI_GET_CLASSPARENTID,
+ TI_GET_NESTED,
+ TI_GET_SYMINDEX,
+ TI_GET_LEXICALPARENT,
+ TI_GET_ADDRESS,
+ TI_GET_THISADJUST,
+ TI_GET_UDTKIND,
+ TI_IS_EQUIV_TO,
+ TI_GET_CALLING_CONVENTION,
+} IMAGEHLP_SYMBOL_TYPE_INFO;
+
+typedef struct _TI_FINDCHILDREN_PARAMS
+{
+ ULONG Count;
+ ULONG Start;
+ ULONG ChildId[1];
+} TI_FINDCHILDREN_PARAMS;
+
+#define UNDNAME_COMPLETE (0x0000)
+#define UNDNAME_NO_LEADING_UNDERSCORES (0x0001)
+#define UNDNAME_NO_MS_KEYWORDS (0x0002)
+#define UNDNAME_NO_FUNCTION_RETURNS (0x0004)
+#define UNDNAME_NO_ALLOCATION_MODEL (0x0008)
+#define UNDNAME_NO_ALLOCATION_LANGUAGE (0x0010)
+#define UNDNAME_NO_MS_THISTYPE (0x0020)
+#define UNDNAME_NO_CV_THISTYPE (0x0040)
+#define UNDNAME_NO_THISTYPE (0x0060)
+#define UNDNAME_NO_ACCESS_SPECIFIERS (0x0080)
+#define UNDNAME_NO_THROW_SIGNATURES (0x0100)
+#define UNDNAME_NO_MEMBER_TYPE (0x0200)
+#define UNDNAME_NO_RETURN_UDT_MODEL (0x0400)
+#define UNDNAME_32_BIT_DECODE (0x0800)
+#define UNDNAME_NAME_ONLY (0x1000)
+#define UNDNAME_NO_ARGUMENTS (0x2000)
+#define UNDNAME_NO_SPECIAL_SYMS (0x4000)
+
+BOOL WINAPI SymGetTypeInfo(HANDLE hProcess, DWORD64 ModBase, ULONG TypeId,
+ IMAGEHLP_SYMBOL_TYPE_INFO GetType, PVOID);
+typedef BOOL (CALLBACK *PSYM_ENUMERATESYMBOLS_CALLBACK)(PSYMBOL_INFO pSymInfo,
+ ULONG SymbolSize, PVOID UserContext);
+BOOL WINAPI SymEnumTypes(HANDLE hProcess, ULONG64 BaseOfDll,
+ PSYM_ENUMERATESYMBOLS_CALLBACK EnumSymbolsCallback,
+ PVOID UserContext);
+BOOL WINAPI SymFromAddr(HANDLE hProcess, DWORD64 addr, DWORD64* displacement,
+ SYMBOL_INFO* sym_info);
+BOOL WINAPI SymFromName(HANDLE hProcess, LPSTR Name, PSYMBOL_INFO Symbol);
+BOOL WINAPI SymGetSymFromAddr(HANDLE,DWORD,PDWORD,PIMAGEHLP_SYMBOL);
+BOOL WINAPI SymGetSymFromName(HANDLE,PSTR,PIMAGEHLP_SYMBOL);
+BOOL WINAPI SymGetTypeFromName(HANDLE hProcess, ULONG64 BaseOfDll, LPSTR Name,
+ PSYMBOL_INFO Symbol);
+BOOL WINAPI SymGetSymNext(HANDLE,PIMAGEHLP_SYMBOL);
+BOOL WINAPI SymGetSymPrev(HANDLE,PIMAGEHLP_SYMBOL);
+BOOL WINAPI SymEnumSymbols(HANDLE hProcess, ULONG64 BaseOfDll, PCSTR Mask,
+ PSYM_ENUMERATESYMBOLS_CALLBACK EnumSymbolsCallback,
+ PVOID UserContext);
+typedef BOOL (CALLBACK *PSYM_ENUMSYMBOLS_CALLBACK)(PSTR SymbolName, DWORD SymbolAddress,
+ ULONG SymbolSize, PVOID UserContext);
+BOOL WINAPI SymEnumerateSymbols(HANDLE hProcess, DWORD BaseOfDll,
+ PSYM_ENUMSYMBOLS_CALLBACK EnumSymbolsCallback,
+ PVOID UserContext);
+typedef BOOL (CALLBACK *PSYMBOL_REGISTERED_CALLBACK)(HANDLE hProcess, ULONG ActionCode,
+ PVOID CallbackData, PVOID UserContext);
+BOOL WINAPI SymRegisterCallback(HANDLE hProcess,
+ PSYMBOL_REGISTERED_CALLBACK CallbackFunction,
+ PVOID UserContext);
+BOOL WINAPI SymUnDName(PIMAGEHLP_SYMBOL,PSTR,DWORD);
+DWORD WINAPI UnDecorateSymbolName(LPCSTR DecoratedName, LPSTR UnDecoratedName,
+ DWORD UndecoratedLength, DWORD Flags);
+
+/*************************
+ * Source Files *
+ *************************/
+typedef BOOL (CALLBACK *PSYM_ENUMSOURCFILES_CALLBACK)(PSOURCEFILE pSourceFile,
+ PVOID UserContext);
+
+BOOL WINAPI SymEnumSourceFiles(HANDLE hProcess, ULONG64 ModBase, LPSTR Mask,
+ PSYM_ENUMSOURCFILES_CALLBACK cbSrcFiles,
+ PVOID UserContext);
+BOOL WINAPI SymGetLineFromAddr(HANDLE hProcess, DWORD dwAddr,
+ PDWORD pdwDisplacement, PIMAGEHLP_LINE Line);
+BOOL WINAPI SymGetLinePrev(HANDLE hProcess, PIMAGEHLP_LINE Line);
+BOOL WINAPI SymGetLineNext(HANDLE hProcess, PIMAGEHLP_LINE Line);
+
+/*************************
+ * File & image handling *
+ *************************/
+BOOL WINAPI SymInitialize(HANDLE hProcess, PSTR UserSearchPath, BOOL fInvadeProcess);
+BOOL WINAPI SymCleanup(HANDLE hProcess);
+
+HANDLE WINAPI FindDebugInfoFile(PSTR FileName, PSTR SymbolPath, PSTR DebugFilePath);
+typedef BOOL (CALLBACK *PFIND_DEBUG_FILE_CALLBACK)(HANDLE FileHandle, PSTR FileName,
+ PVOID CallerData);
+HANDLE WINAPI FindDebugInfoFileEx(PSTR FileName, PSTR SymbolPath, PSTR DebugFilePath,
+ PFIND_DEBUG_FILE_CALLBACK Callback, PVOID CallerData);
+typedef BOOL (CALLBACK *PFINDFILEINPATHCALLBACK)(PSTR filename, PVOID context);
+
+BOOL WINAPI SymFindFileInPath(HANDLE hProcess, LPSTR searchPath, LPSTR FileName,
+ PVOID id, DWORD two, DWORD three, DWORD flags,
+ LPSTR FilePath, PFINDFILEINPATHCALLBACK callback,
+ PVOID context);
+HANDLE WINAPI FindExecutableImage(PSTR FileName, PSTR SymbolPath, PSTR ImageFilePath);
+typedef BOOL (CALLBACK *PFIND_EXE_FILE_CALLBACK)(HANDLE FileHandle, PSTR FileName,
+ PVOID CallerData);
+HANDLE WINAPI FindExecutableImageEx(PSTR FileName, PSTR SymbolPath, PSTR ImageFilePath,
+ PFIND_EXE_FILE_CALLBACK Callback, PVOID CallerData);
+PIMAGE_NT_HEADERS WINAPI ImageNtHeader(PVOID Base);
+
+PVOID WINAPI ImageDirectoryEntryToDataEx(PVOID Base, BOOLEAN MappedAsImage,
+ USHORT DirectoryEntry, PULONG Size,
+ PIMAGE_SECTION_HEADER *FoundHeader);
+PVOID WINAPI ImageDirectoryEntryToData(PVOID Base, BOOLEAN MappedAsImage,
+ USHORT DirectoryEntry, PULONG Size);
+PIMAGE_SECTION_HEADER WINAPI ImageRvaToSection(PIMAGE_NT_HEADERS NtHeaders,
+ PVOID Base, ULONG Rva);
+PVOID WINAPI ImageRvaToVa(PIMAGE_NT_HEADERS NtHeaders, PVOID Base,
+ ULONG Rva, OUT PIMAGE_SECTION_HEADER *LastRvaSection);
+BOOL WINAPI SymGetSearchPath(HANDLE,PSTR,DWORD);
+BOOL WINAPI SymSetSearchPath(HANDLE,PSTR);
+DWORD WINAPI GetTimestampForLoadedLibrary(HMODULE);
+BOOL WINAPI MakeSureDirectoryPathExists(PCSTR);
+BOOL WINAPI SearchTreeForFile(PSTR,PSTR,PSTR);
+typedef BOOL (CALLBACK *PENUMDIRTREE_CALLBACK)(LPCSTR path, PVOID user);
+BOOL WINAPI EnumDirTree(HANDLE hProcess, PCSTR root, PCSTR file,
+ LPSTR buffer, PENUMDIRTREE_CALLBACK cb, void* user);
+BOOL WINAPI SymMatchFileName(LPSTR file, LPSTR match, LPSTR* filestop, LPSTR* matchstop);
+
+/*************************
+ * Context management *
+ *************************/
+BOOL WINAPI SymSetContext(HANDLE hProcess, PIMAGEHLP_STACK_FRAME StackFrame,
+ PIMAGEHLP_CONTEXT Context);
+
+
+/*************************
+ * Stack management *
+ *************************/
+
+typedef struct _KDHELP
+{
+ DWORD Thread;
+ DWORD ThCallbackStack;
+ DWORD NextCallback;
+ DWORD FramePointer;
+ DWORD KiCallUserMode;
+ DWORD KeUserCallbackDispatcher;
+ DWORD SystemRangeStart;
+} KDHELP, *PKDHELP;
+
+typedef struct _STACKFRAME
+{
+ ADDRESS AddrPC;
+ ADDRESS AddrReturn;
+ ADDRESS AddrFrame;
+ ADDRESS AddrStack;
+ PVOID FuncTableEntry;
+ DWORD Params[4];
+ BOOL Far;
+ BOOL Virtual;
+ DWORD Reserved[3];
+ KDHELP KdHelp;
+} STACKFRAME, *LPSTACKFRAME;
+
+typedef BOOL (CALLBACK *PREAD_PROCESS_MEMORY_ROUTINE)
+ (HANDLE hProcess, LPCVOID lpBaseAddress, PVOID lpBuffer,
+ DWORD nSize, PDWORD lpNumberOfBytesRead);
+
+typedef PVOID (CALLBACK *PFUNCTION_TABLE_ACCESS_ROUTINE)
+ (HANDLE hProcess, DWORD AddrBase);
+
+typedef DWORD (CALLBACK *PGET_MODULE_BASE_ROUTINE)
+ (HANDLE hProcess, DWORD ReturnAddress);
+
+typedef DWORD (CALLBACK *PTRANSLATE_ADDRESS_ROUTINE)
+ (HANDLE hProcess, HANDLE hThread, LPADDRESS lpaddr);
+
+BOOL WINAPI StackWalk(DWORD MachineType, HANDLE hProcess, HANDLE hThread,
+ LPSTACKFRAME StackFrame, PVOID ContextRecord,
+ PREAD_PROCESS_MEMORY_ROUTINE ReadMemoryRoutine,
+ PFUNCTION_TABLE_ACCESS_ROUTINE FunctionTableAccessRoutine,
+ PGET_MODULE_BASE_ROUTINE GetModuleBaseRoutine,
+ PTRANSLATE_ADDRESS_ROUTINE TranslateAddress);
+
+PVOID WINAPI SymFunctionTableAccess(HANDLE hProcess, DWORD AddrBase);
+
+/*************************
+ * Version, global stuff *
+ *************************/
+
+typedef struct API_VERSION
+{
+ USHORT MajorVersion;
+ USHORT MinorVersion;
+ USHORT Revision;
+ USHORT Reserved;
+} API_VERSION, *LPAPI_VERSION;
+
+LPAPI_VERSION WINAPI ImagehlpApiVersion(void);
+LPAPI_VERSION WINAPI ImagehlpApiVersionEx(LPAPI_VERSION AppVersion);
+
+typedef struct _IMAGE_DEBUG_INFORMATION
+{
+ LIST_ENTRY List;
+ DWORD ReservedSize;
+ PVOID ReservedMappedBase;
+ USHORT ReservedMachine;
+ USHORT ReservedCharacteristics;
+ DWORD ReservedCheckSum;
+ DWORD ImageBase;
+ DWORD SizeOfImage;
+ DWORD ReservedNumberOfSections;
+ PIMAGE_SECTION_HEADER ReservedSections;
+ DWORD ReservedExportedNamesSize;
+ PSTR ReservedExportedNames;
+ DWORD ReservedNumberOfFunctionTableEntries;
+ PIMAGE_FUNCTION_ENTRY ReservedFunctionTableEntries;
+ DWORD ReservedLowestFunctionStartingAddress;
+ DWORD ReservedHighestFunctionEndingAddress;
+ DWORD ReservedNumberOfFpoTableEntries;
+ PFPO_DATA ReservedFpoTableEntries;
+ DWORD SizeOfCoffSymbols;
+ PIMAGE_COFF_SYMBOLS_HEADER CoffSymbols;
+ DWORD ReservedSizeOfCodeViewSymbols;
+ PVOID ReservedCodeViewSymbols;
+ PSTR ImageFilePath;
+ PSTR ImageFileName;
+ PSTR ReservedDebugFilePath;
+ DWORD ReservedTimeDateStamp;
+ BOOL ReservedRomImage;
+ PIMAGE_DEBUG_DIRECTORY ReservedDebugDirectory;
+ DWORD ReservedNumberOfDebugDirectories;
+ DWORD ReservedOriginalFunctionTableBaseAddress;
+ DWORD Reserved[ 2 ];
+} IMAGE_DEBUG_INFORMATION, *PIMAGE_DEBUG_INFORMATION;
+
+
+PIMAGE_DEBUG_INFORMATION WINAPI MapDebugInformation(HANDLE FileHandle, PSTR FileName,
+ PSTR SymbolPath, DWORD ImageBase);
+
+BOOL WINAPI UnmapDebugInformation(PIMAGE_DEBUG_INFORMATION DebugInfo);
+
+DWORD WINAPI SymGetOptions(void);
+DWORD WINAPI SymSetOptions(DWORD);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif /* defined(__cplusplus) */
+
+#endif /* __WINE_DBGHELP_H */
reactos/include
diff -N dsconf.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ dsconf.h 30 Dec 2004 04:36:25 -0000 1.1.2.1
@@ -0,0 +1,167 @@
+/*
+ * Copyright (C) 2003 Robert Reif
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef __WINE_DSCONF_H
+#define __WINE_DSCONF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* defined(__cplusplus) */
+
+/*****************************************************************************
+ * Predeclare the interfaces
+ */
+DEFINE_GUID(CLSID_DirectSoundPrivate, 0x11ab3ec0,0x25ec,0x11d1,0xa4,0xd8,0x00,0xc0,0x4f,0xc2,0x8a,0xca);
+
+DEFINE_GUID(DSPROPSETID_DirectSoundDevice, 0x84624f82,0x25ec,0x11d1,0xa4,0xd8,0x00,0xc0,0x4f,0xc2,0x8a,0xca);
+
+typedef enum
+{
+ DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A = 1,
+ DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1 = 2,
+ DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1 = 3,
+ DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W = 4,
+ DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A = 5,
+ DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W = 6,
+ DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A = 7,
+ DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W = 8,
+} DSPROPERTY_DIRECTSOUNDDEVICE;
+
+#ifdef UNICODE
+#define DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W
+#define DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W
+#define DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W
+#else
+#define DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A
+#define DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A
+#define DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A
+#endif
+
+typedef enum
+{
+ DIRECTSOUNDDEVICE_TYPE_EMULATED,
+ DIRECTSOUNDDEVICE_TYPE_VXD,
+ DIRECTSOUNDDEVICE_TYPE_WDM
+} DIRECTSOUNDDEVICE_TYPE;
+
+typedef enum
+{
+ DIRECTSOUNDDEVICE_DATAFLOW_RENDER,
+ DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE
+} DIRECTSOUNDDEVICE_DATAFLOW;
+
+typedef struct _DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A_DATA
+{
+ LPSTR DeviceName;
+ DIRECTSOUNDDEVICE_DATAFLOW DataFlow;
+ GUID DeviceId;
+} DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A_DATA, *PDSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A_DATA;
+
+typedef struct _DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W_DATA
+{
+ LPWSTR DeviceName;
+ DIRECTSOUNDDEVICE_DATAFLOW DataFlow;
+ GUID DeviceId;
+} DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W_DATA, *PDSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W_DATA;
+
+#ifdef UNICODE
+#define DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_DATA DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W_DATA
+#define PDSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_DATA PDSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W_DATA
+#else
+#define DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_DATA DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A_DATA
+#define PDSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_DATA PDSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A_DATA
+#endif
+
+typedef struct _DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1_DATA
+{
+ GUID DeviceId;
+ CHAR DescriptionA[0x100];
+ WCHAR DescriptionW[0x100];
+ CHAR ModuleA[MAX_PATH];
+ WCHAR ModuleW[MAX_PATH];
+ DIRECTSOUNDDEVICE_TYPE Type;
+ DIRECTSOUNDDEVICE_DATAFLOW DataFlow;
+ ULONG WaveDeviceId;
+ ULONG Devnode;
+} DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1_DATA, *PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1_DATA;
+
+typedef struct _DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A_DATA
+{
+ DIRECTSOUNDDEVICE_TYPE Type;
+ DIRECTSOUNDDEVICE_DATAFLOW DataFlow;
+ GUID DeviceId;
+ LPSTR Description;
+ LPSTR Module;
+ LPSTR Interface;
+ ULONG WaveDeviceId;
+} DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A_DATA, *PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A_DATA;
+
+typedef struct _DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA
+{
+ DIRECTSOUNDDEVICE_TYPE Type;
+ DIRECTSOUNDDEVICE_DATAFLOW DataFlow;
+ GUID DeviceId;
+ LPWSTR Description;
+ LPWSTR Module;
+ LPWSTR Interface;
+ ULONG WaveDeviceId;
+} DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA, *PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA;
+
+#ifdef UNICODE
+#define DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_DATA DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA
+#define PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_DATA PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA
+#else
+#define DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_DATA DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A_DATA
+#define PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_DATA PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A_DATA
+#endif
+
+typedef BOOL (CALLBACK *LPFNDIRECTSOUNDDEVICEENUMERATECALLBACK1)(PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1_DATA, LPVOID);
+typedef BOOL (CALLBACK *LPFNDIRECTSOUNDDEVICEENUMERATECALLBACKA)(PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A_DATA, LPVOID);
+typedef BOOL (CALLBACK *LPFNDIRECTSOUNDDEVICEENUMERATECALLBACKW)(PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA, LPVOID);
+
+typedef struct _DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1_DATA
+{
+ LPFNDIRECTSOUNDDEVICEENUMERATECALLBACK1 Callback;
+ LPVOID Context;
+} DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1_DATA, *PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1_DATA;
+
+typedef struct _DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A_DATA
+{
+ LPFNDIRECTSOUNDDEVICEENUMERATECALLBACKA Callback;
+ LPVOID Context;
+} DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A_DATA, *PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A_DATA;
+
+typedef struct _DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W_DATA
+{
+ LPFNDIRECTSOUNDDEVICEENUMERATECALLBACKW Callback;
+ LPVOID Context;
+} DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W_DATA, *PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W_DATA;
+
+#ifdef UNICODE
+#define DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_DATA DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W_DATA
+#define PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_DATA PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W_DATA
+#else
+#define DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_DATA DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A_DATA
+#define PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_DATA PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A_DATA
+#endif
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif /* defined(__cplusplus) */
+
+#endif /* __WINE_DSCONF_H */
reactos/include
diff -N dsdriver.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ dsdriver.h 30 Dec 2004 04:36:25 -0000 1.1.2.1
@@ -0,0 +1,365 @@
+/*
+ * DirectSound driver
+ * (DirectX 5 version)
+ *
+ * Copyright (C) 2000 Ove Kaaven
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef __WINE_DSDRIVER_H
+#define __WINE_DSDRIVER_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*****************************************************************************
+ * Predeclare the interfaces
+ */
+DEFINE_GUID(IID_IDsDriver, 0x8C4233C0l, 0xB4CC, 0x11CE, 0x92, 0x94, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00);
+typedef struct IDsDriver *PIDSDRIVER;
+
+DEFINE_GUID(IID_IDsDriverBuffer, 0x8C4233C1l, 0xB4CC, 0x11CE, 0x92, 0x94, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00);
+typedef struct IDsDriverBuffer *PIDSDRIVERBUFFER;
+
+DEFINE_GUID(IID_IDsDriverPropertySet, 0x0F6F2E8E0, 0xD842, 0x11D0, 0x8F, 0x75, 0x00, 0xC0, 0x4F, 0xC2, 0x8A, 0xCA);
+typedef struct IDsDriverPropertySet *PIDSDRIVERPROPERTYSET;
+
+DEFINE_GUID(IID_IDsDriverNotify, 0x00363EF44, 0x3B57, 0x11D3, 0xAC, 0x79, 0x00, 0x10, 0x5A, 0x01, 0x7f, 0xe1);
+typedef struct IDsDriverNotify *PIDSDRIVERNOTIFY;
+
+DEFINE_GUID(IID_IDsCaptureDriver, 0x03DD10C47, 0x74FB, 0x11D3, 0x90, 0x49, 0xCB, 0xB4, 0xB3, 0x2E, 0xAA, 0x08);
+typedef struct IDsCaptureDriver *PIDSCDRIVER;
+
+DEFINE_GUID(IID_IDsCaptureDriverBuffer, 0x03DD10C48, 0x74FB, 0x11D3, 0x90, 0x49, 0xCB, 0xB4, 0xB3, 0x2E, 0xAA, 0x08);
+typedef struct IDsCaptureDriverBuffer *PIDSCDRIVERBUFFER;
+
+#define DSDDESC_DOMMSYSTEMOPEN 0x00000001
+#define DSDDESC_DOMMSYSTEMSETFORMAT 0x00000002
+#define DSDDESC_USESYSTEMMEMORY 0x00000004
+#define DSDDESC_DONTNEEDPRIMARYLOCK 0x00000008
+#define DSDDESC_DONTNEEDSECONDARYLOCK 0x00000010
+
+#define DSDHEAP_NOHEAP 0
+#define DSDHEAP_CREATEHEAP 1
+#define DSDHEAP_USEDIRECTDRAWHEAP 2
+#define DSDHEAP_PRIVATEHEAP 3
+
+typedef struct _DSDRIVERDESC
+{
+ DWORD dwFlags;
+ CHAR szDesc[256];
+ CHAR szDrvName[256];
+ DWORD dnDevNode;
+ WORD wVxdId;
+ WORD wReserved;
+ ULONG ulDeviceNum;
+ DWORD dwHeapType;
+ LPVOID pvDirectDrawHeap;
+ DWORD dwMemStartAddress;
+ DWORD dwMemEndAddress;
+ DWORD dwMemAllocExtra;
+ LPVOID pvReserved1;
+ LPVOID pvReserved2;
+} DSDRIVERDESC,*PDSDRIVERDESC;
+
+typedef struct _DSDRIVERCAPS
+{
+ DWORD dwFlags;
+ DWORD dwMinSecondarySampleRate;
+ DWORD dwMaxSecondarySampleRate;
+ DWORD dwPrimaryBuffers;
+ DWORD dwMaxHwMixingAllBuffers;
+ DWORD dwMaxHwMixingStaticBuffers;
+ DWORD dwMaxHwMixingStreamingBuffers;
+ DWORD dwFreeHwMixingAllBuffers;
+ DWORD dwFreeHwMixingStaticBuffers;
+ DWORD dwFreeHwMixingStreamingBuffers;
+ DWORD dwMaxHw3DAllBuffers;
+ DWORD dwMaxHw3DStaticBuffers;
+ DWORD dwMaxHw3DStreamingBuffers;
+ DWORD dwFreeHw3DAllBuffers;
+ DWORD dwFreeHw3DStaticBuffers;
+ DWORD dwFreeHw3DStreamingBuffers;
+ DWORD dwTotalHwMemBytes;
+ DWORD dwFreeHwMemBytes;
+ DWORD dwMaxContigFreeHwMemBytes;
+} DSDRIVERCAPS,*PDSDRIVERCAPS;
+
+typedef struct _DSVOLUMEPAN
+{
+ DWORD dwTotalLeftAmpFactor;
+ DWORD dwTotalRightAmpFactor;
+ LONG lVolume;
+ DWORD dwVolAmpFactor;
+ LONG lPan;
+ DWORD dwPanLeftAmpFactor;
+ DWORD dwPanRightAmpFactor;
+} DSVOLUMEPAN,*PDSVOLUMEPAN;
+
+typedef union _DSPROPERTY
+{
+ struct {
+ GUID Set;
+ ULONG Id;
+ ULONG Flags;
+ ULONG InstanceId;
+ } DUMMYSTRUCTNAME;
+ ULONGLONG Alignment;
+} DSPROPERTY,*PDSPROPERTY;
+
+typedef struct _DSCDRIVERCAPS
+{
+ DWORD dwSize;
+ DWORD dwFlags;
+ DWORD dwFormats;
+ DWORD dwChannels;
+} DSCDRIVERCAPS,*PDSCDRIVERCAPS;
+
+/*****************************************************************************
+ * IDsDriver interface
+ */
+#define INTERFACE IDsDriver
+DECLARE_INTERFACE_(IDsDriver,IUnknown)
+{
+ /*** IUnknown methods ***/
+ STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+ STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+ STDMETHOD_(ULONG,Release)(THIS) PURE;
+ /*** IDsDriver methods ***/
+ STDMETHOD(GetDriverDesc)(THIS_ PDSDRIVERDESC pDsDriverDesc) PURE;
+ STDMETHOD(Open)(THIS) PURE;
+ STDMETHOD(Close)(THIS) PURE;
+ STDMETHOD(GetCaps)(THIS_ PDSDRIVERCAPS pDsDrvCaps) PURE;
+ STDMETHOD(CreateSoundBuffer)(THIS_ LPWAVEFORMATEX pwfx,DWORD dwFlags,DWORD dwCardAddress,LPDWORD pdwcbBufferSize,LPBYTE *ppbBuffer,LPVOID *ppvObj) PURE;
+ STDMETHOD(DuplicateSoundBuffer)(THIS_ PIDSDRIVERBUFFER pIDsDriverBuffer,LPVOID *ppvObj) PURE;
+};
+#undef INTERFACE
+
+#if !defined (__cplusplus) || defined(CINTERFACE)
+ /*** IUnknown methods ***/
+#define IDsDriver_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDsDriver_AddRef(p) (p)->lpVtbl->AddRef(p)
+#define IDsDriver_Release(p) (p)->lpVtbl->Release(p)
+ /*** IDsDriver methods ***/
+#define IDsDriver_GetDriverDesc(p,a) (p)->lpVtbl->GetDriverDesc(p,a)
+#define IDsDriver_Open(p) (p)->lpVtbl->Open(p)
+#define IDsDriver_Close(p) (p)->lpVtbl->Close(p)
+#define IDsDriver_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a)
+#define IDsDriver_CreateSoundBuffer(p,a,b,c,d,e,f) (p)->lpVtbl->CreateSoundBuffer(p,a,b,c,d,e,f)
+#define IDsDriver_DuplicateSoundBuffer(p,a,b) (p)->lpVtbl->DuplicateSoundBuffer(p,a,b)
+#endif
+
+/*****************************************************************************
+ * IDsDriverBuffer interface
+ */
+#define INTERFACE IDsDriverBuffer
+DECLARE_INTERFACE_(IDsDriverBuffer,IUnknown)
+{
+ /*** IUnknown methods ***/
+ STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+ STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+ STDMETHOD_(ULONG,Release)(THIS) PURE;
+ /*** IDsDriverBuffer methods ***/
+ STDMETHOD(Lock)(THIS_ LPVOID *ppvAudio1,LPDWORD pdwLen1,LPVOID *pdwAudio2,LPDWORD pdwLen2,DWORD dwWritePosition,DWORD dwWriteLen,DWORD dwFlags) PURE;
+ STDMETHOD(Unlock)(THIS_ LPVOID pvAudio1,DWORD dwLen1,LPVOID pvAudio2,DWORD dwLen2) PURE;
+ STDMETHOD(SetFormat)(THIS_ LPWAVEFORMATEX pwfxToSet) PURE;
+ STDMETHOD(SetFrequency)(THIS_ DWORD dwFrequency) PURE;
+ STDMETHOD(SetVolumePan)(THIS_ PDSVOLUMEPAN pDsVolumePan) PURE;
+ STDMETHOD(SetPosition)(THIS_ DWORD dwNewPosition) PURE;
+ STDMETHOD(GetPosition)(THIS_ LPDWORD lpdwCurrentPlayCursor,LPDWORD lpdwCurrentWriteCursor) PURE;
+ STDMETHOD(Play)(THIS_ DWORD dwReserved1,DWORD dwReserved2,DWORD dwFlags) PURE;
+ STDMETHOD(Stop)(THIS) PURE;
+};
+#undef INTERFACE
+
+#if !defined (__cplusplus) || defined(CINTERFACE)
+ /*** IUnknown methods ***/
+#define IDsDriverBuffer_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDsDriverBuffer_AddRef(p) (p)->lpVtbl->AddRef(p)
+#define IDsDriverBuffer_Release(p) (p)->lpVtbl->Release(p)
+ /*** IDsDriverBuffer methods ***/
+#define IDsDriverBuffer_Lock(p,a,b,c,d,e,f,g) (p)->lpVtbl->Lock(p,a,b,c,d,e,f,g)
+#define IDsDriverBuffer_Unlock(p,a,b,c,d) (p)->lpVtbl->Unlock(p,a,b,c,d)
+#define IDsDriverBuffer_SetFormat(p,a) (p)->lpVtbl->SetFormat(p,a)
+#define IDsDriverBuffer_SetFrequency(p,a) (p)->lpVtbl->SetFrequency(p,a)
+#define IDsDriverBuffer_SetVolumePan(p,a) (p)->lpVtbl->SetVolumePan(p,a)
+#define IDsDriverBuffer_SetPosition(p,a) (p)->lpVtbl->SetPosition(p,a)
+#define IDsDriverBuffer_GetPosition(p,a,b) (p)->lpVtbl->GetPosition(p,a,b)
+#define IDsDriverBuffer_Play(p,a,b,c) (p)->lpVtbl->Play(p,a,b,c)
+#define IDsDriverBuffer_Stop(p) (p)->lpVtbl->Stop(p)
+#endif
+
+/*****************************************************************************
+ * IDsDriverPropertySet interface
+ */
+#define INTERFACE IDsDriverPropertySet
+DECLARE_INTERFACE_(IDsDriverPropertySet,IUnknown)
+{
+ /*** IUnknown methods ***/
+ STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+ STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+ STDMETHOD_(ULONG,Release)(THIS) PURE;
+ /*** IDsDriverPropertySet methods ***/
+ STDMETHOD(Get)(THIS_ PDSPROPERTY pDsProperty,LPVOID pPropertyParams,ULONG cbPropertyParams,LPVOID pPropertyData,ULONG cbPropertyData,PULONG pcbReturnedData) PURE;
+ STDMETHOD(Set)(THIS_ PDSPROPERTY pDsProperty,LPVOID pPropertyParams,ULONG cbPropertyParams,LPVOID pPropertyData,ULONG cbPropertyData) PURE;
+ STDMETHOD(QuerySupport)(THIS_ REFGUID PropertySetId,ULONG PropertyId,PULONG pSupport) PURE;
+};
+#undef INTERFACE
+
+#if !defined (__cplusplus) || defined(CINTERFACE)
+ /*** IUnknown methods ***/
+#define IDsDriverPropertySet_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDsDriverPropertySet_AddRef(p) (p)->lpVtbl->AddRef(p)
+#define IDsDriverPropertySet_Release(p) (p)->lpVtbl->Release(p)
+ /*** IDsDriverPropertySet methods ***/
+#define IDsDriverPropertySet_Get(p,a,b,c,d,e,f) (p)->lpVtbl->Get(p,a,b,c,d,e,f)
+#define IDsDriverPropertySet_Set(p,a,b,c,d,e) (p)->lpVtbl->Set(p,a,b,c,d,e)
+#define IDsDriverPropertySet_QuerySupport(p,a,b,c) (p)->lpVtbl->QuerySupport(p,a,b,c)
+#endif
+
+/* Defined property sets */
+DEFINE_GUID(DSPROPSETID_DirectSound3DListener, 0x6D047B40, 0x7AF9, 0x11D0, 0x92, 0x94, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0);
+typedef enum
+{
+ DSPROPERTY_DIRECTSOUND3DLISTENER_ALL,
+ DSPROPERTY_DIRECTSOUND3DLISTENER_POSITION,
+ DSPROPERTY_DIRECTSOUND3DLISTENER_VELOCITY,
+ DSPROPERTY_DIRECTSOUND3DLISTENER_ORIENTATION,
+ DSPROPERTY_DIRECTSOUND3DLISTENER_DISTANCEFACTOR,
+ DSPROPERTY_DIRECTSOUND3DLISTENER_ROLLOFFFACTOR,
+ DSPROPERTY_DIRECTSOUND3DLISTENER_DOPPLERFACTOR,
+ DSPROPERTY_DIRECTSOUND3DLISTENER_BATCH,
+ DSPROPERTY_DIRECTSOUND3DLISTENER_ALLOCATION
+} DSPROPERTY_DIRECTSOUND3DLISTENER;
+
+DEFINE_GUID(DSPROPSETID_DirectSound3DBuffer, 0x6D047B41, 0x7AF9, 0x11D0, 0x92, 0x94, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0);
+typedef enum
+{
+ DSPROPERTY_DIRECTSOUND3DBUFFER_ALL,
+ DSPROPERTY_DIRECTSOUND3DBUFFER_POSITION,
+ DSPROPERTY_DIRECTSOUND3DBUFFER_VELOCITY,
+ DSPROPERTY_DIRECTSOUND3DBUFFER_CONEANGLES,
+ DSPROPERTY_DIRECTSOUND3DBUFFER_CONEORIENTATION,
+ DSPROPERTY_DIRECTSOUND3DBUFFER_CONEOUTSIDEVOLUME,
+ DSPROPERTY_DIRECTSOUND3DBUFFER_MINDISTANCE,
+ DSPROPERTY_DIRECTSOUND3DBUFFER_MAXDISTANCE,
+ DSPROPERTY_DIRECTSOUND3DBUFFER_MODE
+} DSPROPERTY_DIRECTSOUND3DBUFFER;
+
+DEFINE_GUID(DSPROPSETID_DirectSoundSpeakerConfig, 0x6D047B42, 0x7AF9, 0x11D0, 0x92, 0x94, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0);
+typedef enum
+{
+ DSPROPERTY_DIRECTSOUNDSPEAKERCONFIG_SPEAKERCONFIG
+} DSPROPERTY_DIRECTSOUNDSPEAKERCONFIG;
+
+/*****************************************************************************
+ * IDsDriverNotify interface
+ */
+#define INTERFACE IDsDriverNotify
+DECLARE_INTERFACE_(IDsDriverNotify,IUnknown)
+{
+ /*** IUnknown methods ***/
+ STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+ STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+ STDMETHOD_(ULONG,Release)(THIS) PURE;
+ /*** IDsDriverNotify methods ***/
+ STDMETHOD(SetNotificationPositions)(THIS_ DWORD dwPositionNotifies,LPCDSBPOSITIONNOTIFY pcPositionNotifies) PURE;
+};
+#undef INTERFACE
+
+#if !defined (__cplusplus) || defined(CINTERFACE)
+ /*** IUnknown methods ***/
+#define IDsDriverNotify_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDsDriverNotify_AddRef(p) (p)->lpVtbl->AddRef(p)
+#define IDsDriverNotify_Release(p) (p)->lpVtbl->Release(p)
+ /*** IDsDriverNotify methods ***/
+#define IDsDriverNotify_SetNotificationPositions(p,a,b) (p)->lpVtbl->SetNotificationPositions(p,a,b)
+#endif
+
+/*****************************************************************************
+ * IDsCaptureDriver interface
+ */
+#define INTERFACE IDsCaptureDriver
+DECLARE_INTERFACE_(IDsCaptureDriver,IUnknown)
+{
+ /*** IUnknown methods ***/
+ STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+ STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+ STDMETHOD_(ULONG,Release)(THIS) PURE;
+ /*** IDsCaptureDriver methods ***/
+ STDMETHOD(GetDriverDesc)(THIS_ PDSDRIVERDESC pDsDriverDesc) PURE;
+ STDMETHOD(Open)(THIS) PURE;
+ STDMETHOD(Close)(THIS) PURE;
+ STDMETHOD(GetCaps)(THIS_ PDSCDRIVERCAPS pDsDrvCaps) PURE;
+ STDMETHOD(CreateCaptureBuffer)(THIS_ LPWAVEFORMATEX pwfx,DWORD dwFlags,DWORD dwCardAddress,LPDWORD pdwcbBufferSize,LPBYTE *ppbBuffer,LPVOID *ppvObj) PURE;
+};
+#undef INTERFACE
+
+#if !defined (__cplusplus) || defined(CINTERFACE)
+ /*** IUnknown methods ***/
+#define IDsCaptureDriver_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDsCaptureDriver_AddRef(p) (p)->lpVtbl->AddRef(p)
+#define IDsCaptureDriver_Release(p) (p)->lpVtbl->Release(p)
+ /*** IDsCaptureDriver methods ***/
+#define IDsCaptureDriver_GetDriverDesc(p,a) (p)->lpVtbl->GetDriverDesc(p,a)
+#define IDsCaptureDriver_Open(p) (p)->lpVtbl->Open(p)
+#define IDsCaptureDriver_Close(p) (p)->lpVtbl->Close(p)
+#define IDsCaptureDriver_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a)
+#define IDsCaptureDriver_CreateCaptureBuffer(p,a,b,c,d,e,f) (p)->lpVtbl->CreateCaptureBuffer(p,a,b,c,d,e,f)
+#endif
+
+/*****************************************************************************
+ * IDsCaptureDriverBuffer interface
+ */
+#define INTERFACE IDsCaptureDriverBuffer
+DECLARE_INTERFACE_(IDsCaptureDriverBuffer,IUnknown)
+{
+ /*** IUnknown methods ***/
+ STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+ STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+ STDMETHOD_(ULONG,Release)(THIS) PURE;
+ /*** IDsCaptureDriverBuffer methods ***/
+ STDMETHOD(Lock)(THIS_ LPVOID *ppvAudio1,LPDWORD pdwLen1,LPVOID *ppvAudio2,LPDWORD pdwLen2,DWORD dwWritePosition,DWORD dwWriteLen,DWORD dwFlags) PURE;
+ STDMETHOD(Unlock)(THIS_ LPVOID pvAudio1,DWORD dwLen1,LPVOID pvAudio2,DWORD dwLen2) PURE;
+ STDMETHOD(SetFormat)(THIS_ LPWAVEFORMATEX pwfxToSet) PURE;
+ STDMETHOD(GetPosition)(THIS_ LPDWORD lpdwCurrentPlayCursor,LPDWORD lpdwCurrentWriteCursor) PURE;
+ STDMETHOD(GetStatus)(THIS_ LPDWORD lpdwStatus) PURE;
+ STDMETHOD(Start)(THIS_ DWORD dwFlags) PURE;
+ STDMETHOD(Stop)(THIS) PURE;
+};
+#undef INTERFACE
+
+#if !defined (__cplusplus) || defined(CINTERFACE)
+ /*** IUnknown methods ***/
+#define IDsCaptureDriverBuffer_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDsCaptureDriverBuffer_AddRef(p) (p)->lpVtbl->AddRef(p)
+#define IDsCaptureDriverBuffer_Release(p) (p)->lpVtbl->Release(p)
+ /*** IDsCaptureDriverBuffer methods ***/
+#define IDsCaptureDriverBuffer_Lock(p,a,b,c,d,e,f,g) (p)->lpVtbl->Lock(p,a,b,c,d,e,f,g)
+#define IDsCaptureDriverBuffer_Unlock(p,a,b,c,d) (p)->lpVtbl->Unlock(p,a,b,c,d)
+#define IDsCaptureDriverBuffer_SetFormat(p,a) (p)->lpVtbl->SetFormat(p,a)
+#define IDsCaptureDriverBuffer_GetPosition(p,a,b) (p)->lpVtbl->GetPosition(p,a,b)
+#define IDsCaptureDriverBuffer_GetStatus(p,a) (p)->lpVtbl->GetStatus(p,a)
+#define IDsCaptureDriverBuffer_Start(p,a) (p)->lpVtbl->Start(p,a)
+#define IDsCaptureDriverBuffer_Stop(p) (p)->lpVtbl->Stop(p)
+#endif
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* __WINE_DSDRIVER_H */
reactos/include
diff -N dsound.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ dsound.h 30 Dec 2004 04:36:25 -0000 1.1.2.1
@@ -0,0 +1,1191 @@
+/*
+ * Copyright (C) the Wine project
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef __WINE_DSOUND_H
+#define __WINE_DSOUND_H
+
+#ifndef DIRECTSOUND_VERSION
+#define DIRECTSOUND_VERSION 0x0900
+#endif
+
+#define COM_NO_WINDOWS_H
+#include <objbase.h>
+#include <float.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* defined(__cplusplus) */
+
+#ifndef DX_SHARED_DEFINES
+
+typedef float D3DVALUE, *LPD3DVALUE;
+
+#ifndef D3DCOLOR_DEFINED
+typedef DWORD D3DCOLOR, *LPD3DCOLOR;
+#define D3DCOLOR_DEFINED
+#endif
+
+#ifndef D3DVECTOR_DEFINED
+typedef struct _D3DVECTOR {
+ float x;
+ float y;
+ float z;
+} D3DVECTOR, *LPD3DVECTOR;
+#define D3DVECTOR_DEFINED
+#endif
+
+#define DX_SHARED_DEFINES
+#endif /* DX_SHARED_DEFINES */
+
+/*****************************************************************************
+ * Predeclare the interfaces
+ */
+DEFINE_GUID(CLSID_DirectSound, 0x47d4d946, 0x62e8, 0x11cf, 0x93, 0xbc, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00);
+DEFINE_GUID(CLSID_DirectSound8, 0x3901cc3f, 0x84b5, 0x4fa4, 0xba, 0x35, 0xaa, 0x81, 0x72, 0xb8, 0xa0, 0x9b);
+DEFINE_GUID(CLSID_DirectSoundCapture, 0xb0210780, 0x89cd, 0x11d0, 0xaf, 0x08, 0x00, 0xa0, 0xc9, 0x25, 0xcd, 0x16);
+DEFINE_GUID(CLSID_DirectSoundCapture8, 0xe4bcac13, 0x7f99, 0x4908, 0x9a, 0x8e, 0x74, 0xe3, 0xbf, 0x24, 0xb6, 0xe1);
+DEFINE_GUID(CLSID_DirectSoundFullDuplex,0xfea4300c, 0x7959, 0x4147, 0xb2, 0x6a, 0x23, 0x77, 0xb9, 0xe7, 0xa9, 0x1d);
+
+DEFINE_GUID(IID_IDirectSound, 0x279AFA83,0x4981,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60);
+typedef struct IDirectSound *LPDIRECTSOUND,**LPLPDIRECTSOUND;
+
+DEFINE_GUID(IID_IDirectSound8, 0xC50A7E93,0xF395,0x4834,0x9E,0xF6,0x7F,0xA9,0x9D,0xE5,0x09,0x66);
+typedef struct IDirectSound8 *LPDIRECTSOUND8,**LPLPDIRECTSOUND8;
+
+DEFINE_GUID(IID_IDirectSoundBuffer, 0x279AFA85,0x4981,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60);
+typedef struct IDirectSoundBuffer *LPDIRECTSOUNDBUFFER,**LPLPDIRECTSOUNDBUFFER;
+
+DEFINE_GUID(IID_IDirectSoundBuffer8, 0x6825A449,0x7524,0x4D82,0x92,0x0F,0x50,0xE3,0x6A,0xB3,0xAB,0x1E);
+typedef struct IDirectSoundBuffer8 *LPDIRECTSOUNDBUFFER8,**LPLPDIRECTSOUNDBUFFER8;
+
+DEFINE_GUID(IID_IDirectSoundNotify, 0xB0210783,0x89cd,0x11d0,0xAF,0x08,0x00,0xA0,0xC9,0x25,0xCD,0x16);
+typedef struct IDirectSoundNotify *LPDIRECTSOUNDNOTIFY,**LPLPDIRECTSOUNDNOTIFY;
+#define IID_IDirectSoundNotify8 IID_IDirectSoundNotify
+
+DEFINE_GUID(IID_IDirectSound3DListener, 0x279AFA84,0x4981,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60);
+typedef struct IDirectSound3DListener *LPDIRECTSOUND3DLISTENER,**LPLPDIRECTSOUND3DLISTENER;
+
+DEFINE_GUID(IID_IDirectSound3DBuffer, 0x279AFA86,0x4981,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60);
+typedef struct IDirectSound3DBuffer *LPDIRECTSOUND3DBUFFER,**LPLPDIRECTSOUND3DBUFFER;
+
+DEFINE_GUID(IID_IDirectSoundCapture, 0xB0210781,0x89CD,0x11D0,0xAF,0x08,0x00,0xA0,0xC9,0x25,0xCD,0x16);
+typedef struct IDirectSoundCapture *LPDIRECTSOUNDCAPTURE,**LPLPDIRECTSOUNDCAPTURE;
+#define IID_IDirectSoundCapture8 IID_IDirectSoundCapture
+typedef struct IDirectSoundCapture *LPDIRECTSOUNDCAPTURE8,**LPLPDIRECTSOUNDCAPTURE8;
+
+DEFINE_GUID(IID_IDirectSoundCaptureBuffer,0xB0210782,0x89CD,0x11D0,0xAF,0x08,0x00,0xA0,0xC9,0x25,0xCD,0x16);
+typedef struct IDirectSoundCaptureBuffer *LPDIRECTSOUNDCAPTUREBUFFER,**LPLPDIRECTSOUNDCAPTUREBUFFER;
+
+DEFINE_GUID(IID_IDirectSoundCaptureBuffer8,0x00990DF4,0x0DBB,0x4872,0x83,0x3E,0x6D,0x30,0x3E,0x80,0xAE,0xB6);
+typedef struct IDirectSoundCaptureBuffer8 *LPDIRECTSOUNDCAPTUREBUFFER8,**LPLPDIRECTSOUNDCAPTUREBUFFER8;
+
+DEFINE_GUID(IID_IDirectSoundFullDuplex, 0xEDCB4C7A,0xDAAB,0x4216,0xA4,0x2E,0x6C,0x50,0x59,0x6D,0xDC,0x1D);
+typedef struct IDirectSoundFullDuplex *LPDIRECTSOUNDFULLDUPLEX,**LPLPDIRECTSOUNDFULLDUPLEX;
+#define IID_IDirectSoundFullDuplex8 IID_IDirectSoundFullDuplex
+
+DEFINE_GUID(DSDEVID_DefaultPlayback, 0xDEF00000,0x9C6D,0x47Ed,0xAA,0xF1,0x4D,0xDA,0x8F,0x2B,0x5C,0x03);
+DEFINE_GUID(DSDEVID_DefaultCapture, 0xDEF00001,0x9C6D,0x47Ed,0xAA,0xF1,0x4D,0xDA,0x8F,0x2B,0x5C,0x03);
+DEFINE_GUID(DSDEVID_DefaultVoicePlayback,0xDEF00002,0x9C6D,0x47Ed,0xAA,0xF1,0x4D,0xDA,0x8F,0x2B,0x5C,0x03);
+DEFINE_GUID(DSDEVID_DefaultVoiceCapture, 0xDEF00003,0x9C6D,0x47ED,0xAA,0xF1,0x4D,0xDA,0x8F,0x2B,0x5C,0x03);
+
+DEFINE_GUID(DSDEVID_WinePlayback, 0x40316A1D,0x605B,0xD611,0x87,0xC6,0x00,0x80,0xAD,0x00,0x02,0xFE);
+
+#define _FACDS 0x878
+#define MAKE_DSHRESULT(code) MAKE_HRESULT(1,_FACDS,code)
+
+#define DS_OK 0
+#define DS_NO_VIRTUALIZATION MAKE_HRESULT(0, _FACDS, 10)
+#define DS_INCOMPLETE MAKE_HRESULT(0, _FACDS, 20)
+#define DSERR_ALLOCATED MAKE_DSHRESULT(10)
+#define DSERR_CONTROLUNAVAIL MAKE_DSHRESULT(30)
+#define DSERR_INVALIDPARAM E_INVALIDARG
+#define DSERR_INVALIDCALL MAKE_DSHRESULT(50)
+#define DSERR_GENERIC E_FAIL
+#define DSERR_PRIOLEVELNEEDED MAKE_DSHRESULT(70)
+#define DSERR_OUTOFMEMORY E_OUTOFMEMORY
+#define DSERR_BADFORMAT MAKE_DSHRESULT(100)
+#define DSERR_UNSUPPORTED E_NOTIMPL
+#define DSERR_NODRIVER MAKE_DSHRESULT(120)
+#define DSERR_ALREADYINITIALIZED MAKE_DSHRESULT(130)
+#define DSERR_NOAGGREGATION CLASS_E_NOAGGREGATION
+#define DSERR_BUFFERLOST MAKE_DSHRESULT(150)
+#define DSERR_OTHERAPPHASPRIO MAKE_DSHRESULT(160)
+#define DSERR_UNINITIALIZED MAKE_DSHRESULT(170)
+#define DSERR_NOINTERFACE E_NOINTERFACE
+#define DSERR_ACCESSDENIED E_ACCESSDENIED
+#define DSERR_BUFFERTOOSMALL MAKE_DSHRESULT(180)
+#define DSERR_DS8_REQUIRED MAKE_DSHRESULT(190)
+#define DSERR_SENDLOOP MAKE_DSHRESULT(200)
+#define DSERR_BADSENDBUFFERGUID MAKE_DSHRESULT(210)
+#define DSERR_FXUNAVAILABLE MAKE_DSHRESULT(220)
+#define DSERR_OBJECTNOTFOUND MAKE_DSHRESULT(4449)
+
+#define DSCAPS_PRIMARYMONO 0x00000001
+#define DSCAPS_PRIMARYSTEREO 0x00000002
+#define DSCAPS_PRIMARY8BIT 0x00000004
+#define DSCAPS_PRIMARY16BIT 0x00000008
+#define DSCAPS_CONTINUOUSRATE 0x00000010
+#define DSCAPS_EMULDRIVER 0x00000020
+#define DSCAPS_CERTIFIED 0x00000040
+#define DSCAPS_SECONDARYMONO 0x00000100
+#define DSCAPS_SECONDARYSTEREO 0x00000200
+#define DSCAPS_SECONDARY8BIT 0x00000400
+#define DSCAPS_SECONDARY16BIT 0x00000800
+
+#define DSSCL_NORMAL 1
+#define DSSCL_PRIORITY 2
+#define DSSCL_EXCLUSIVE 3
+#define DSSCL_WRITEPRIMARY 4
+
+typedef struct _DSCAPS
+{
+ DWORD dwSize;
+ DWORD dwFlags;
+ DWORD dwMinSecondarySampleRate;
+ DWORD dwMaxSecondarySampleRate;
+ DWORD dwPrimaryBuffers;
+ DWORD dwMaxHwMixingAllBuffers;
+ DWORD dwMaxHwMixingStaticBuffers;
+ DWORD dwMaxHwMixingStreamingBuffers;
+ DWORD dwFreeHwMixingAllBuffers;
+ DWORD dwFreeHwMixingStaticBuffers;
+ DWORD dwFreeHwMixingStreamingBuffers;
+ DWORD dwMaxHw3DAllBuffers;
+ DWORD dwMaxHw3DStaticBuffers;
+ DWORD dwMaxHw3DStreamingBuffers;
+ DWORD dwFreeHw3DAllBuffers;
+ DWORD dwFreeHw3DStaticBuffers;
+ DWORD dwFreeHw3DStreamingBuffers;
+ DWORD dwTotalHwMemBytes;
+ DWORD dwFreeHwMemBytes;
+ DWORD dwMaxContigFreeHwMemBytes;
+ DWORD dwUnlockTransferRateHwBuffers;
+ DWORD dwPlayCpuOverheadSwBuffers;
+ DWORD dwReserved1;
+ DWORD dwReserved2;
+} DSCAPS,*LPDSCAPS;
+typedef const DSCAPS *LPCDSCAPS;
+
+#define DSBPLAY_LOOPING 0x00000001
+#define DSBPLAY_LOCHARDWARE 0x00000002
+#define DSBPLAY_LOCSOFTWARE 0x00000004
+#define DSBPLAY_TERMINATEBY_TIME 0x00000008
+#define DSBPLAY_TERMINATEBY_DISTANCE 0x000000010
+#define DSBPLAY_TERMINATEBY_PRIORITY 0x000000020
+
+#define DSBSTATUS_PLAYING 0x00000001
+#define DSBSTATUS_BUFFERLOST 0x00000002
+#define DSBSTATUS_LOOPING 0x00000004
+#define DSBSTATUS_LOCHARDWARE 0x00000008
+#define DSBSTATUS_LOCSOFTWARE 0x00000010
+#define DSBSTATUS_TERMINATED 0x00000020
+
+#define DSBLOCK_FROMWRITECURSOR 0x00000001
+#define DSBLOCK_ENTIREBUFFER 0x00000002
+
+#define DSBCAPS_PRIMARYBUFFER 0x00000001
+#define DSBCAPS_STATIC 0x00000002
+#define DSBCAPS_LOCHARDWARE 0x00000004
+#define DSBCAPS_LOCSOFTWARE 0x00000008
+#define DSBCAPS_CTRL3D 0x00000010
+#define DSBCAPS_CTRLFREQUENCY 0x00000020
+#define DSBCAPS_CTRLPAN 0x00000040
+#define DSBCAPS_CTRLVOLUME 0x00000080
+#define DSBCAPS_CTRLDEFAULT 0x000000E0 /* Pan + volume + frequency. */
+#define DSBCAPS_CTRLPOSITIONNOTIFY 0x00000100
+#define DSBCAPS_CTRLFX 0x00000200
+#define DSBCAPS_CTRLALL 0x000001F0 /* All control capabilities */
+#define DSBCAPS_STICKYFOCUS 0x00004000
+#define DSBCAPS_GLOBALFOCUS 0x00008000
+#define DSBCAPS_GETCURRENTPOSITION2 0x00010000 /* More accurate play cursor under emulation*/
+#define DSBCAPS_MUTE3DATMAXDISTANCE 0x00020000
+#define DSBCAPS_LOCDEFER 0x00040000
+
+#define DSBSIZE_MIN 4
+#define DSBSIZE_MAX 0xFFFFFFF
+#define DSBPAN_LEFT -10000
+#define DSBPAN_CENTER 0
+#define DSBPAN_RIGHT 10000
+#define DSBVOLUME_MAX 0
+#define DSBVOLUME_MIN -10000
+#define DSBFREQUENCY_MIN 100
+#define DSBFREQUENCY_MAX 200000
+#define DSBFREQUENCY_ORIGINAL 0
+
+typedef struct _DSBCAPS
+{
+ DWORD dwSize;
+ DWORD dwFlags;
+ DWORD dwBufferBytes;
+ DWORD dwUnlockTransferRate;
+ DWORD dwPlayCpuOverhead;
+} DSBCAPS,*LPDSBCAPS;
+typedef const DSBCAPS *LPCDSBCAPS;
+
+#define DSSCL_NORMAL 1
+#define DSSCL_PRIORITY 2
+#define DSSCL_EXCLUSIVE 3
+#define DSSCL_WRITEPRIMARY 4
+
+typedef struct _DSEFFECTDESC
+{
+ DWORD dwSize;
+ DWORD dwFlags;
+ GUID guidDSFXClass;
+ DWORD_PTR dwReserved1;
+ DWORD_PTR dwReserved2;
+} DSEFFECTDESC,*LPDSEFFECTDESC;
+typedef const DSEFFECTDESC *LPCDSEFFECTDESC;
+
+#define DSFX_LOCHARDWARE 0x00000001
+#define DSFX_LOCSOFTWARE 0x00000002
+
+enum
+{
+ DSFXR_PRESENT,
+ DSFXR_LOCHARDWARE,
+ DSFXR_LOCSOFTWARE,
+ DSFXR_UNALLOCATED,
+ DSFXR_FAILED,
+ DSFXR_UNKNOWN,
+ DSFXR_SENDLOOP
+};
+
+typedef struct _DSBUFFERDESC1
+{
+ DWORD dwSize;
+ DWORD dwFlags;
+ DWORD dwBufferBytes;
+ DWORD dwReserved;
+ LPWAVEFORMATEX lpwfxFormat;
+} DSBUFFERDESC1,*LPDSBUFFERDESC1;
+typedef const DSBUFFERDESC1 *LPCDSBUFFERDESC1;
+
+typedef struct _DSBUFFERDESC
+{
+ DWORD dwSize;
+ DWORD dwFlags;
+ DWORD dwBufferBytes;
+ DWORD dwReserved;
+ LPWAVEFORMATEX lpwfxFormat;
+ GUID guid3DAlgorithm;
+} DSBUFFERDESC,*LPDSBUFFERDESC;
+typedef const DSBUFFERDESC *LPCDSBUFFERDESC;
+
+typedef struct _DSBPOSITIONNOTIFY
+{
+ DWORD dwOffset;
+ HANDLE hEventNotify;
+} DSBPOSITIONNOTIFY,*LPDSBPOSITIONNOTIFY;
+typedef const DSBPOSITIONNOTIFY *LPCDSBPOSITIONNOTIFY;
+
+#define DSSPEAKER_HEADPHONE 1
+#define DSSPEAKER_MONO 2
+#define DSSPEAKER_QUAD 3
+#define DSSPEAKER_STEREO 4
+#define DSSPEAKER_SURROUND 5
+#define DSSPEAKER_5POINT1 6
+#define DSSPEAKER_7POINT1 7
+
+#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 */
+
+#define DSSPEAKER_COMBINED(c, g) ((DWORD)(((BYTE)(c)) | ((DWORD)((BYTE)(g))) << 16))
+#define DSSPEAKER_CONFIG(a) ((BYTE)(a))
+#define DSSPEAKER_GEOMETRY(a) ((BYTE)(((DWORD)(a) >> 16) & 0x00FF))
+
+#define DS_CERTIFIED 0x00000000
+#define DS_UNCERTIFIED 0x00000001
+
+typedef struct _DSCEFFECTDESC
+{
+ DWORD dwSize;
+ DWORD dwFlags;
+ GUID guidDSCFXClass;
+ GUID guidDSCFXInstance;
+ DWORD dwReserved1;
+ DWORD dwReserved2;
+} DSCEFFECTDESC, *LPDSCEFFECTDESC;
+typedef const DSCEFFECTDESC *LPCDSCEFFECTDESC;
+
+#define DSCFX_LOCHARDWARE 0x00000001
+#define DSCFX_LOCSOFTWARE 0x00000002
+
+#define DSCFXR_LOCHARDWARE 0x00000010
+#define DSCFXR_LOCSOFTWARE 0x00000020
+
+typedef struct _DSCBUFFERDESC1
+{
+ DWORD dwSize;
+ DWORD dwFlags;
+ DWORD dwBufferBytes;
+ DWORD dwReserved;
+ LPWAVEFORMATEX lpwfxFormat;
+} DSCBUFFERDESC1, *LPDSCBUFFERDESC1;
+
+typedef struct _DSCBUFFERDESC
+{
+ DWORD dwSize;
+ DWORD dwFlags;
+ DWORD dwBufferBytes;
+ DWORD dwReserved;
+ LPWAVEFORMATEX lpwfxFormat;
+ DWORD dwFXCount;
+ LPDSCEFFECTDESC lpDSCFXDesc;
+} DSCBUFFERDESC, *LPDSCBUFFERDESC;
+typedef const DSCBUFFERDESC *LPCDSCBUFFERDESC;
+
+typedef struct _DSCCAPS
+{
+ DWORD dwSize;
+ DWORD dwFlags;
+ DWORD dwFormats;
+ DWORD dwChannels;
+} DSCCAPS, *LPDSCCAPS;
+typedef const DSCCAPS *LPCDSCCAPS;
+
+typedef struct _DSCBCAPS
+{
+ DWORD dwSize;
+ DWORD dwFlags;
+ DWORD dwBufferBytes;
+ DWORD dwReserved;
+} DSCBCAPS, *LPDSCBCAPS;
+typedef const DSCBCAPS *LPCDSCBCAPS;
+
+#define DSCCAPS_EMULDRIVER DSCAPS_EMULDRIVER
+#define DSCCAPS_CERTIFIED DSCAPS_CERTIFIED
+#define DSCCAPS_MULTIPLECAPTURE 0x00000001
+
+#define DSCBCAPS_WAVEMAPPED 0x80000000
+#define DSCBCAPS_CTRLFX 0x00000200
+
+#define DSCBLOCK_ENTIREBUFFER 0x00000001
+#define DSCBSTART_LOOPING 0x00000001
+#define DSCBPN_OFFSET_STOP 0xffffffff
+
+#define DSCBSTATUS_CAPTURING 0x00000001
+#define DSCBSTATUS_LOOPING 0x00000002
+
+// this is already in ros include files
+#ifndef __LPCGUID_DEFINED__
+//#define __LPCGUID_DEFINED__
+//typedef const GUID *LPCGUID;
+#endif
+
+typedef LPVOID* LPLPVOID;
+
+typedef BOOL (CALLBACK *LPDSENUMCALLBACKW)(LPGUID,LPCWSTR,LPCWSTR,LPVOID);
+typedef BOOL (CALLBACK *LPDSENUMCALLBACKA)(LPGUID,LPCSTR,LPCSTR,LPVOID);
+
+extern HRESULT WINAPI DirectSoundCreate(LPCGUID lpGUID,LPDIRECTSOUND *ppDS,LPUNKNOWN pUnkOuter);
+extern HRESULT WINAPI DirectSoundEnumerateA(LPDSENUMCALLBACKA, LPVOID);
+extern HRESULT WINAPI DirectSoundEnumerateW(LPDSENUMCALLBACKW, LPVOID);
+
+extern HRESULT WINAPI DirectSoundCaptureCreate(LPCGUID lpGUID, LPDIRECTSOUNDCAPTURE *ppDSC, LPUNKNOWN pUnkOuter);
+extern HRESULT WINAPI DirectSoundCaptureEnumerateA(LPDSENUMCALLBACKA, LPVOID);
+extern HRESULT WINAPI DirectSoundCaptureEnumerateW(LPDSENUMCALLBACKW, LPVOID);
+
+extern HRESULT WINAPI DirectSoundCreate8(LPCGUID lpGUID,LPDIRECTSOUND8 *ppDS8,LPUNKNOWN pUnkOuter);
+extern HRESULT WINAPI DirectSoundCaptureCreate8(LPCGUID lpGUID, LPDIRECTSOUNDCAPTURE *ppDSC8, LPUNKNOWN pUnkOuter);
+extern HRESULT WINAPI DirectSoundFullDuplexCreate(LPCGUID pcGuidCaptureDevice, LPCGUID pcGuidRenderDevice,
+ LPCDSCBUFFERDESC pcDSCBufferDesc, LPCDSBUFFERDESC pcDSBufferDesc, HWND hWnd, DWORD dwLevel,
+ LPDIRECTSOUNDFULLDUPLEX *ppDSFD, LPDIRECTSOUNDCAPTUREBUFFER8 *ppDSCBuffer8, LPDIRECTSOUNDBUFFER8 *ppDSBuffer8, LPUNKNOWN pUnkOuter);
+#define DirectSoundFullDuplexCreate8 DirectSoundFullDuplexCreate
+extern HRESULT WINAPI GetDeviceID(LPCGUID lpGuidSrc, LPGUID lpGuidDest);
+
+
+/*****************************************************************************
+ * IDirectSound interface
+ */
+#define INTERFACE IDirectSound
+DECLARE_INTERFACE_(IDirectSound,IUnknown)
+{
+ /*** IUnknown methods ***/
+ STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+ STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+ STDMETHOD_(ULONG,Release)(THIS) PURE;
+ /*** IDirectSound methods ***/
+ STDMETHOD(CreateSoundBuffer)(THIS_ LPCDSBUFFERDESC lpcDSBufferDesc, LPLPDIRECTSOUNDBUFFER lplpDirectSoundBuffer, IUnknown *pUnkOuter) PURE;
+ STDMETHOD(GetCaps)(THIS_ LPDSCAPS lpDSCaps) PURE;
+ STDMETHOD(DuplicateSoundBuffer)(THIS_ LPDIRECTSOUNDBUFFER lpDsbOriginal, LPLPDIRECTSOUNDBUFFER lplpDsbDuplicate) PURE;
+ STDMETHOD(SetCooperativeLevel)(THIS_ HWND hwnd, DWORD dwLevel) PURE;
+ STDMETHOD(Compact)(THIS) PURE;
+ STDMETHOD(GetSpeakerConfig)(THIS_ LPDWORD lpdwSpeakerConfig) PURE;
+ STDMETHOD(SetSpeakerConfig)(THIS_ DWORD dwSpeakerConfig) PURE;
+ STDMETHOD(Initialize)(THIS_ LPCGUID lpcGuid) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IDirectSound_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirectSound_AddRef(p) (p)->lpVtbl->AddRef(p)
+#define IDirectSound_Release(p) (p)->lpVtbl->Release(p)
+/*** IDirectSound methods ***/
+#define IDirectSound_CreateSoundBuffer(p,a,b,c) (p)->lpVtbl->CreateSoundBuffer(p,a,b,c)
+#define IDirectSound_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a)
+#define IDirectSound_DuplicateSoundBuffer(p,a,b) (p)->lpVtbl->DuplicateSoundBuffer(p,a,b)
+#define IDirectSound_SetCooperativeLevel(p,a,b) (p)->lpVtbl->SetCooperativeLevel(p,a,b)
+#define IDirectSound_Compact(p) (p)->lpVtbl->Compact(p)
+#define IDirectSound_GetSpeakerConfig(p,a) (p)->lpVtbl->GetSpeakerConfig(p,a)
+#define IDirectSound_SetSpeakerConfig(p,a) (p)->lpVtbl->SetSpeakerConfig(p,a)
+#define IDirectSound_Initialize(p,a) (p)->lpVtbl->Initialize(p,a)
+#else
+/*** IUnknown methods ***/
+#define IDirectSound_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
+#define IDirectSound_AddRef(p) (p)->AddRef()
+#define IDirectSound_Release(p) (p)->Release()
+/*** IDirectSound methods ***/
+#define IDirectSound_CreateSoundBuffer(p,a,b,c) (p)->CreateSoundBuffer(a,b,c)
+#define IDirectSound_GetCaps(p,a) (p)->GetCaps(a)
+#define IDirectSound_DuplicateSoundBuffer(p,a,b) (p)->DuplicateSoundBuffer(a,b)
+#define IDirectSound_SetCooperativeLevel(p,a,b) (p)->SetCooperativeLevel(a,b)
+#define IDirectSound_Compact(p) (p)->Compact()
+#define IDirectSound_GetSpeakerConfig(p,a) (p)->GetSpeakerConfig(a)
+#define IDirectSound_SetSpeakerConfig(p,a) (p)->SetSpeakerConfig(a)
+#define IDirectSound_Initialize(p,a) (p)->Initialize(a)
+#endif
+
+
+/*****************************************************************************
+ * IDirectSound8 interface
+ */
+#define INTERFACE IDirectSound8
+DECLARE_INTERFACE_(IDirectSound8,IUnknown)
+{
+ /*** IUnknown methods ***/
+ STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+ STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+ STDMETHOD_(ULONG,Release)(THIS) PURE;
+ /*** IDirectSound8 methods ***/
+ STDMETHOD(CreateSoundBuffer)(THIS_ LPCDSBUFFERDESC lpcDSBufferDesc, LPLPDIRECTSOUNDBUFFER lplpDirectSoundBuffer, IUnknown *pUnkOuter) PURE;
+ STDMETHOD(GetCaps)(THIS_ LPDSCAPS lpDSCaps) PURE;
+ STDMETHOD(DuplicateSoundBuffer)(THIS_ LPDIRECTSOUNDBUFFER lpDsbOriginal, LPLPDIRECTSOUNDBUFFER lplpDsbDuplicate) PURE;
+ STDMETHOD(SetCooperativeLevel)(THIS_ HWND hwnd, DWORD dwLevel) PURE;
+ STDMETHOD(Compact)(THIS) PURE;
+ STDMETHOD(GetSpeakerConfig)(THIS_ LPDWORD lpdwSpeakerConfig) PURE;
+ STDMETHOD(SetSpeakerConfig)(THIS_ DWORD dwSpeakerConfig) PURE;
+ STDMETHOD(Initialize)(THIS_ LPCGUID lpcGuid) PURE;
+ STDMETHOD(VerifyCertification)(THIS_ LPDWORD pdwCertified) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IDirectSound8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirectSound8_AddRef(p) (p)->lpVtbl->AddRef(p)
+#define IDirectSound8_Release(p) (p)->lpVtbl->Release(p)
+/*** IDirectSound methods ***/
+#define IDirectSound8_CreateSoundBuffer(p,a,b,c) (p)->lpVtbl->CreateSoundBuffer(p,a,b,c)
+#define IDirectSound8_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a)
+#define IDirectSound8_DuplicateSoundBuffer(p,a,b) (p)->lpVtbl->DuplicateSoundBuffer(p,a,b)
+#define IDirectSound8_SetCooperativeLevel(p,a,b) (p)->lpVtbl->SetCooperativeLevel(p,a,b)
+#define IDirectSound8_Compact(p) (p)->lpVtbl->Compact(p)
+#define IDirectSound8_GetSpeakerConfig(p,a) (p)->lpVtbl->GetSpeakerConfig(p,a)
+#define IDirectSound8_SetSpeakerConfig(p,a) (p)->lpVtbl->SetSpeakerConfig(p,a)
+#define IDirectSound8_Initialize(p,a) (p)->lpVtbl->Initialize(p,a)
+/*** IDirectSound8 methods ***/
+#define IDirectSound8_VerifyCertification(p,a) (p)->lpVtbl->VerifyCertification(p,a)
+#else
+/*** IUnknown methods ***/
+#define IDirectSound8_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
+#define IDirectSound8_AddRef(p) (p)->AddRef()
+#define IDirectSound8_Release(p) (p)->Release()
+/*** IDirectSound methods ***/
+#define IDirectSound8_CreateSoundBuffer(p,a,b,c) (p)->CreateSoundBuffer(a,b,c)
+#define IDirectSound8_GetCaps(p,a) (p)->GetCaps(a)
+#define IDirectSound8_DuplicateSoundBuffer(p,a,b) (p)->DuplicateSoundBuffer(a,b)
+#define IDirectSound8_SetCooperativeLevel(p,a,b) (p)->SetCooperativeLevel(a,b)
+#define IDirectSound8_Compact(p) (p)->Compact()
+#define IDirectSound8_GetSpeakerConfig(p,a) (p)->GetSpeakerConfig(a)
+#define IDirectSound8_SetSpeakerConfig(p,a) (p)->SetSpeakerConfig(a)
+#define IDirectSound8_Initialize(p,a) (p)->Initialize(a)
+/*** IDirectSound8 methods ***/
+#define IDirectSound8_VerifyCertification(p,a) (p)->VerifyCertification(a)
+#endif
+
+
+/*****************************************************************************
+ * IDirectSoundBuffer interface
+ */
+#define INTERFACE IDirectSoundBuffer
+DECLARE_INTERFACE_(IDirectSoundBuffer,IUnknown)
+{
+ /*** IUnknown methods ***/
+ STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+ STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+ STDMETHOD_(ULONG,Release)(THIS) PURE;
+ /*** IDirectSoundBuffer methods ***/
+ STDMETHOD(GetCaps)(THIS_ LPDSBCAPS lpDSBufferCaps) PURE;
+ STDMETHOD(GetCurrentPosition)(THIS_ LPDWORD lpdwCurrentPlayCursor, LPDWORD lpdwCurrentWriteCursor) PURE;
+ STDMETHOD(GetFormat)(THIS_ LPWAVEFORMATEX lpwfxFormat, DWORD dwSizeAllocated, LPDWORD lpdwSizeWritten) PURE;
+ STDMETHOD(GetVolume)(THIS_ LPLONG lplVolume) PURE;
+ STDMETHOD(GetPan)(THIS_ LPLONG lplpan) PURE;
+ STDMETHOD(GetFrequency)(THIS_ LPDWORD lpdwFrequency) PURE;
+ STDMETHOD(GetStatus)(THIS_ LPDWORD lpdwStatus) PURE;
+ STDMETHOD(Initialize)(THIS_ LPDIRECTSOUND lpDirectSound, LPCDSBUFFERDESC lpcDSBufferDesc) PURE;
+ STDMETHOD(Lock)(THIS_ DWORD dwWriteCursor, DWORD dwWriteBytes, LPVOID lplpvAudioPtr1, LPDWORD lpdwAudioBytes1, LPVOID lplpvAudioPtr2, LPDWORD lpdwAudioBytes2, DWORD dwFlags) PURE;
+ STDMETHOD(Play)(THIS_ DWORD dwReserved1, DWORD dwReserved2, DWORD dwFlags) PURE;
+ STDMETHOD(SetCurrentPosition)(THIS_ DWORD dwNewPosition) PURE;
+ STDMETHOD(SetFormat)(THIS_ LPCWAVEFORMATEX lpcfxFormat) PURE;
+ STDMETHOD(SetVolume)(THIS_ LONG lVolume) PURE;
+ STDMETHOD(SetPan)(THIS_ LONG lPan) PURE;
+ STDMETHOD(SetFrequency)(THIS_ DWORD dwFrequency) PURE;
+ STDMETHOD(Stop)(THIS) PURE;
+ STDMETHOD(Unlock)(THIS_ LPVOID lpvAudioPtr1, DWORD dwAudioBytes1, LPVOID lpvAudioPtr2, DWORD dwAudioPtr2) PURE;
+ STDMETHOD(Restore)(THIS) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IDirectSoundBuffer_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirectSoundBuffer_AddRef(p) (p)->lpVtbl->AddRef(p)
+#define IDirectSoundBuffer_Release(p) (p)->lpVtbl->Release(p)
+/*** IDirectSoundBuffer methods ***/
+#define IDirectSoundBuffer_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a)
+#define IDirectSoundBuffer_GetCurrentPosition(p,a,b) (p)->lpVtbl->GetCurrentPosition(p,a,b)
+#define IDirectSoundBuffer_GetFormat(p,a,b,c) (p)->lpVtbl->GetFormat(p,a,b,c)
+#define IDirectSoundBuffer_GetVolume(p,a) (p)->lpVtbl->GetVolume(p,a)
+#define IDirectSoundBuffer_GetPan(p,a) (p)->lpVtbl->GetPan(p,a)
+#define IDirectSoundBuffer_GetFrequency(p,a) (p)->lpVtbl->GetFrequency(p,a)
+#define IDirectSoundBuffer_GetStatus(p,a) (p)->lpVtbl->GetStatus(p,a)
+#define IDirectSoundBuffer_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b)
+#define IDirectSoundBuffer_Lock(p,a,b,c,d,e,f,g) (p)->lpVtbl->Lock(p,a,b,c,d,e,f,g)
+#define IDirectSoundBuffer_Play(p,a,b,c) (p)->lpVtbl->Play(p,a,b,c)
+#define IDirectSoundBuffer_SetCurrentPosition(p,a) (p)->lpVtbl->SetCurrentPosition(p,a)
+#define IDirectSoundBuffer_SetFormat(p,a) (p)->lpVtbl->SetFormat(p,a)
+#define IDirectSoundBuffer_SetVolume(p,a) (p)->lpVtbl->SetVolume(p,a)
+#define IDirectSoundBuffer_SetPan(p,a) (p)->lpVtbl->SetPan(p,a)
+#define IDirectSoundBuffer_SetFrequency(p,a) (p)->lpVtbl->SetFrequency(p,a)
+#define IDirectSoundBuffer_Stop(p) (p)->lpVtbl->Stop(p)
+#define IDirectSoundBuffer_Unlock(p,a,b,c,d) (p)->lpVtbl->Unlock(p,a,b,c,d)
+#define IDirectSoundBuffer_Restore(p) (p)->lpVtbl->Restore(p)
+#else
+/*** IUnknown methods ***/
+#define IDirectSoundBuffer_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
+#define IDirectSoundBuffer_AddRef(p) (p)->AddRef()
+#define IDirectSoundBuffer_Release(p) (p)->Release()
+/*** IDirectSoundBuffer methods ***/
+#define IDirectSoundBuffer_GetCaps(p,a) (p)->GetCaps(a)
+#define IDirectSoundBuffer_GetCurrentPosition(p,a,b) (p)->GetCurrentPosition(a,b)
+#define IDirectSoundBuffer_GetFormat(p,a,b,c) (p)->GetFormat(a,b,c)
+#define IDirectSoundBuffer_GetVolume(p,a) (p)->GetVolume(a)
+#define IDirectSoundBuffer_GetPan(p,a) (p)->GetPan(a)
+#define IDirectSoundBuffer_GetFrequency(p,a) (p)->GetFrequency(a)
+#define IDirectSoundBuffer_GetStatus(p,a) (p)->GetStatus(a)
+#define IDirectSoundBuffer_Initialize(p,a,b) (p)->Initialize(a,b)
+#define IDirectSoundBuffer_Lock(p,a,b,c,d,e,f,g) (p)->Lock(a,b,c,d,e,f,g)
+#define IDirectSoundBuffer_Play(p,a,b,c) (p)->Play(a,b,c)
+#define IDirectSoundBuffer_SetCurrentPosition(p,a) (p)->SetCurrentPosition(a)
+#define IDirectSoundBuffer_SetFormat(p,a) (p)->SetFormat(a)
+#define IDirectSoundBuffer_SetVolume(p,a) (p)->SetVolume(a)
+#define IDirectSoundBuffer_SetPan(p,a) (p)->SetPan(a)
+#define IDirectSoundBuffer_SetFrequency(p,a) (p)->SetFrequency(a)
+#define IDirectSoundBuffer_Stop(p) (p)->Stop()
+#define IDirectSoundBuffer_Unlock(p,a,b,c,d) (p)->Unlock(a,b,c,d)
+#define IDirectSoundBuffer_Restore(p) (p)->Restore()
+#endif
+
+
+/*****************************************************************************
+ * IDirectSoundBuffer8 interface
+ */
+#define INTERFACE IDirectSoundBuffer8
+DECLARE_INTERFACE_(IDirectSoundBuffer8,IUnknown)
+{
+ /*** IUnknown methods ***/
+ STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+ STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+ STDMETHOD_(ULONG,Release)(THIS) PURE;
+ /*** IDirectSoundBuffer8 methods ***/
+ STDMETHOD(GetCaps)(THIS_ LPDSBCAPS lpDSBufferCaps) PURE;
+ STDMETHOD(GetCurrentPosition)(THIS_ LPDWORD lpdwCurrentPlayCursor, LPDWORD lpdwCurrentWriteCursor) PURE;
+ STDMETHOD(GetFormat)(THIS_ LPWAVEFORMATEX lpwfxFormat, DWORD dwSizeAllocated, LPDWORD lpdwSizeWritten) PURE;
+ STDMETHOD(GetVolume)(THIS_ LPLONG lplVolume) PURE;
+ STDMETHOD(GetPan)(THIS_ LPLONG lplpan) PURE;
+ STDMETHOD(GetFrequency)(THIS_ LPDWORD lpdwFrequency) PURE;
+ STDMETHOD(GetStatus)(THIS_ LPDWORD lpdwStatus) PURE;
+ STDMETHOD(Initialize)(THIS_ LPDIRECTSOUND lpDirectSound, LPCDSBUFFERDESC lpcDSBufferDesc) PURE;
+ STDMETHOD(Lock)(THIS_ DWORD dwWriteCursor, DWORD dwWriteBytes, LPVOID lplpvAudioPtr1, LPDWORD lpdwAudioBytes1, LPVOID lplpvAudioPtr2, LPDWORD lpdwAudioBytes2, DWORD dwFlags) PURE;
+ STDMETHOD(Play)(THIS_ DWORD dwReserved1, DWORD dwReserved2, DWORD dwFlags) PURE;
+ STDMETHOD(SetCurrentPosition)(THIS_ DWORD dwNewPosition) PURE;
+ STDMETHOD(SetFormat)(THIS_ LPCWAVEFORMATEX lpcfxFormat) PURE;
+ STDMETHOD(SetVolume)(THIS_ LONG lVolume) PURE;
+ STDMETHOD(SetPan)(THIS_ LONG lPan) PURE;
+ STDMETHOD(SetFrequency)(THIS_ DWORD dwFrequency) PURE;
+ STDMETHOD(Stop)(THIS) PURE;
+ STDMETHOD(Unlock)(THIS_ LPVOID lpvAudioPtr1, DWORD dwAudioBytes1, LPVOID lpvAudioPtr2, DWORD dwAudioPtr2) PURE;
+ STDMETHOD(Restore)(THIS) PURE;
+ STDMETHOD(SetFX)(THIS_ DWORD dwEffectsCount, LPDSEFFECTDESC pDSFXDesc, LPDWORD pdwResultCodes) PURE;
+ STDMETHOD(AcquireResources)(THIS_ DWORD dwFlags, DWORD dwEffectsCount, LPDWORD pdwResultCodes) PURE;
+ STDMETHOD(GetObjectInPath)(THIS_ REFGUID rguidObject, DWORD dwIndex, REFGUID rguidInterface, LPVOID *ppObject) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IDirectSoundBuffer8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirectSoundBuffer8_AddRef(p) (p)->lpVtbl->AddRef(p)
+#define IDirectSoundBuffer8_Release(p) (p)->lpVtbl->Release(p)
+/*** IDirectSoundBuffer methods ***/
+#define IDirectSoundBuffer8_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a)
+#define IDirectSoundBuffer8_GetCurrentPosition(p,a,b) (p)->lpVtbl->GetCurrentPosition(p,a,b)
+#define IDirectSoundBuffer8_GetFormat(p,a,b,c) (p)->lpVtbl->GetFormat(p,a,b,c)
+#define IDirectSoundBuffer8_GetVolume(p,a) (p)->lpVtbl->GetVolume(p,a)
+#define IDirectSoundBuffer8_GetPan(p,a) (p)->lpVtbl->GetPan(p,a)
+#define IDirectSoundBuffer8_GetFrequency(p,a) (p)->lpVtbl->GetFrequency(p,a)
+#define IDirectSoundBuffer8_GetStatus(p,a) (p)->lpVtbl->GetStatus(p,a)
+#define IDirectSoundBuffer8_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b)
+#define IDirectSoundBuffer8_Lock(p,a,b,c,d,e,f,g) (p)->lpVtbl->Lock(p,a,b,c,d,e,f,g)
+#define IDirectSoundBuffer8_Play(p,a,b,c) (p)->lpVtbl->Play(p,a,b,c)
+#define IDirectSoundBuffer8_SetCurrentPosition(p,a) (p)->lpVtbl->SetCurrentPosition(p,a)
+#define IDirectSoundBuffer8_SetFormat(p,a) (p)->lpVtbl->SetFormat(p,a)
+#define IDirectSoundBuffer8_SetVolume(p,a) (p)->lpVtbl->SetVolume(p,a)
+#define IDirectSoundBuffer8_SetPan(p,a) (p)->lpVtbl->SetPan(p,a)
+#define IDirectSoundBuffer8_SetFrequency(p,a) (p)->lpVtbl->SetFrequency(p,a)
+#define IDirectSoundBuffer8_Stop(p) (p)->lpVtbl->Stop(p)
+#define IDirectSoundBuffer8_Unlock(p,a,b,c,d) (p)->lpVtbl->Unlock(p,a,b,c,d)
+#define IDirectSoundBuffer8_Restore(p) (p)->lpVtbl->Restore(p)
+/*** IDirectSoundBuffer8 methods ***/
+#define IDirectSoundBuffer8_SetFX(p,a,b,c) (p)->lpVtbl->SetFX(p,a,b,c)
+#define IDirectSoundBuffer8_AcquireResources(p,a,b,c) (p)->lpVtbl->AcquireResources(p,a,b,c)
+#define IDirectSoundBuffer8_GetObjectInPath(p,a,b,c,d) (p)->lpVtbl->GetObjectInPath(p,a,b,c,d)
+#else
+/*** IUnknown methods ***/
+#define IDirectSoundBuffer8_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
+#define IDirectSoundBuffer8_AddRef(p) (p)->AddRef()
+#define IDirectSoundBuffer8_Release(p) (p)->Release()
+/*** IDirectSoundBuffer methods ***/
+#define IDirectSoundBuffer8_GetCaps(p,a) (p)->GetCaps(a)
+#define IDirectSoundBuffer8_GetCurrentPosition(p,a,b) (p)->GetCurrentPosition(a,b)
+#define IDirectSoundBuffer8_GetFormat(p,a,b,c) (p)->GetFormat(a,b,c)
+#define IDirectSoundBuffer8_GetVolume(p,a) (p)->GetVolume(a)
+#define IDirectSoundBuffer8_GetPan(p,a) (p)->GetPan(a)
+#define IDirectSoundBuffer8_GetFrequency(p,a) (p)->GetFrequency(a)
+#define IDirectSoundBuffer8_GetStatus(p,a) (p)->GetStatus(a)
+#define IDirectSoundBuffer8_Initialize(p,a,b) (p)->Initialize(a,b)
+#define IDirectSoundBuffer8_Lock(p,a,b,c,d,e,f,g) (p)->Lock(a,b,c,d,e,f,g)
+#define IDirectSoundBuffer8_Play(p,a,b,c) (p)->Play(a,b,c)
+#define IDirectSoundBuffer8_SetCurrentPosition(p,a) (p)->SetCurrentPosition(a)
+#define IDirectSoundBuffer8_SetFormat(p,a) (p)->SetFormat(a)
+#define IDirectSoundBuffer8_SetVolume(p,a) (p)->SetVolume(a)
+#define IDirectSoundBuffer8_SetPan(p,a) (p)->SetPan(a)
+#define IDirectSoundBuffer8_SetFrequency(p,a) (p)->SetFrequency(a)
+#define IDirectSoundBuffer8_Stop(p) (p)->Stop()
+#define IDirectSoundBuffer8_Unlock(p,a,b,c,d) (p)->Unlock(a,b,c,d)
+#define IDirectSoundBuffer8_Restore(p) (p)->Restore()
+/*** IDirectSoundBuffer8 methods ***/
+#define IDirectSoundBuffer8_SetFX(p,a,b,c) (p)->SetFX(a,b,c)
+#define IDirectSoundBuffer8_AcquireResources(p,a,b,c) (p)->AcquireResources(a,b,c)
+#define IDirectSoundBuffer8_GetObjectInPath(p,a,b,c,d) (p)->GetObjectInPath(a,b,c,d)
+#endif
+
+
+/*****************************************************************************
+ * IDirectSoundCapture interface
+ */
+#define INTERFACE IDirectSoundCapture
+DECLARE_INTERFACE_(IDirectSoundCapture,IUnknown)
+{
+ /*** IUnknown methods ***/
+ STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+ STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+ STDMETHOD_(ULONG,Release)(THIS) PURE;
+ /*** IDirectSoundCapture methods ***/
+ STDMETHOD(CreateCaptureBuffer)(THIS_ LPCDSCBUFFERDESC lpcDSCBufferDesc,LPDIRECTSOUNDCAPTUREBUFFER *lplpDSCaptureBuffer, LPUNKNOWN pUnk) PURE;
+ STDMETHOD(GetCaps)(THIS_ LPDSCCAPS lpDSCCaps) PURE;
+ STDMETHOD(Initialize)(THIS_ LPCGUID lpcGUID) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IDirectSoundCapture_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirectSoundCapture_AddRef(p) (p)->lpVtbl->AddRef(p)
+#define IDirectSoundCapture_Release(p) (p)->lpVtbl->Release(p)
+/*** IDirectSoundCapture methods ***/
+#define IDirectSoundCapture_CreateCaptureBuffer(p,a,b,c) (p)->lpVtbl->CreateCaptureBuffer(p,a,b,c)
+#define IDirectSoundCapture_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a)
+#define IDirectSoundCapture_Initialize(p,a) (p)->lpVtbl->Initialize(p,a)
+#else
+/*** IUnknown methods ***/
+#define IDirectSoundCapture_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
+#define IDirectSoundCapture_AddRef(p) (p)->AddRef()
+#define IDirectSoundCapture_Release(p) (p)->Release()
+/*** IDirectSoundCapture methods ***/
+#define IDirectSoundCapture_CreateCaptureBuffer(p,a,b,c) (p)->CreateCaptureBuffer(a,b,c)
+#define IDirectSoundCapture_GetCaps(p,a) (p)->GetCaps(a)
+#define IDirectSoundCapture_Initialize(p,a) (p)->Initialize(a)
+#endif
+
+/*****************************************************************************
+ * IDirectSoundCaptureBuffer interface
+ */
+#define INTERFACE IDirectSoundCaptureBuffer
+DECLARE_INTERFACE_(IDirectSoundCaptureBuffer,IUnknown)
+{
+ /*** IUnknown methods ***/
+ STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+ STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+ STDMETHOD_(ULONG,Release)(THIS) PURE;
+ /*** IDirectSoundCaptureBuffer methods ***/
+ STDMETHOD(GetCaps)(THIS_ LPDSCBCAPS lpDSCBCaps) PURE;
+ STDMETHOD(GetCurrentPosition)(THIS_ LPDWORD lpdwCapturePosition,LPDWORD lpdwReadPosition) PURE;
+ STDMETHOD(GetFormat)(THIS_ LPWAVEFORMATEX lpwfxFormat, DWORD dwSizeAllocated, LPDWORD lpdwSizeWritten) PURE;
+ STDMETHOD(GetStatus)(THIS_ LPDWORD lpdwStatus) PURE;
+ STDMETHOD(Initialize)(THIS_ LPDIRECTSOUNDCAPTURE lpDSC, LPCDSCBUFFERDESC lpcDSCBDesc) PURE;
+ STDMETHOD(Lock)(THIS_ DWORD dwReadCusor, DWORD dwReadBytes, LPVOID *lplpvAudioPtr1, LPDWORD lpdwAudioBytes1, LPVOID *lplpvAudioPtr2, LPDWORD lpdwAudioBytes2, DWORD dwFlags) PURE;
+ STDMETHOD(Start)(THIS_ DWORD dwFlags) PURE;
+ STDMETHOD(Stop)(THIS) PURE;
+ STDMETHOD(Unlock)(THIS_ LPVOID lpvAudioPtr1, DWORD dwAudioBytes1, LPVOID lpvAudioPtr2, DWORD dwAudioBytes2) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IDirectSoundCaptureBuffer_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirectSoundCaptureBuffer_AddRef(p) (p)->lpVtbl->AddRef(p)
+#define IDirectSoundCaptureBuffer_Release(p) (p)->lpVtbl->Release(p)
+/*** IDirectSoundCaptureBuffer methods ***/
+#define IDirectSoundCaptureBuffer_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a)
+#define IDirectSoundCaptureBuffer_GetCurrentPosition(p,a,b) (p)->lpVtbl->GetCurrentPosition(p,a,b)
+#define IDirectSoundCaptureBuffer_GetFormat(p,a,b,c) (p)->lpVtbl->GetFormat(p,a,b,c)
+#define IDirectSoundCaptureBuffer_GetStatus(p,a) (p)->lpVtbl->GetStatus(p,a)
+#define IDirectSoundCaptureBuffer_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b)
+#define IDirectSoundCaptureBuffer_Lock(p,a,b,c,d,e,f,g) (p)->lpVtbl->Lock(p,a,b,c,d,e,f,g)
+#define IDirectSoundCaptureBuffer_Start(p,a) (p)->lpVtbl->Start(p,a)
+#define IDirectSoundCaptureBuffer_Stop(p) (p)->lpVtbl->Stop(p)
+#define IDirectSoundCaptureBuffer_Unlock(p,a,b,c,d) (p)->lpVtbl->Unlock(p,a,b,c,d)
+#else
+/*** IUnknown methods ***/
+#define IDirectSoundCaptureBuffer_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
+#define IDirectSoundCaptureBuffer_AddRef(p) (p)->AddRef()
+#define IDirectSoundCaptureBuffer_Release(p) (p)->Release()
+/*** IDirectSoundCaptureBuffer methods ***/
+#define IDirectSoundCaptureBuffer_GetCaps(p,a) (p)->GetCaps(a)
+#define IDirectSoundCaptureBuffer_GetCurrentPosition(p,a,b) (p)->GetCurrentPosition(a,b)
+#define IDirectSoundCaptureBuffer_GetFormat(p,a,b,c) (p)->GetFormat(a,b,c)
+#define IDirectSoundCaptureBuffer_GetStatus(p,a) (p)->GetStatus(a)
+#define IDirectSoundCaptureBuffer_Initialize(p,a,b) (p)->Initialize(a,b)
+#define IDirectSoundCaptureBuffer_Lock(p,a,b,c,d,e,f,g) (p)->Lock(a,b,c,d,e,f,g)
+#define IDirectSoundCaptureBuffer_Start(p,a) (p)->Start(a)
+#define IDirectSoundCaptureBuffer_Stop(p) (p)->Stop()
+#define IDirectSoundCaptureBuffer_Unlock(p,a,b,c,d) (p)->Unlock(a,b,c,d)
+#endif
+
+/*****************************************************************************
+ * IDirectSoundCaptureBuffer8 interface
+ */
+#define INTERFACE IDirectSoundCaptureBuffer8
+DECLARE_INTERFACE_(IDirectSoundCaptureBuffer8,IDirectSoundCaptureBuffer)
+{
+ /*** IUnknown methods ***/
+ STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+ STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+ STDMETHOD_(ULONG,Release)(THIS) PURE;
+ /*** IDirectSoundCaptureBuffer methods ***/
+ STDMETHOD(GetCaps)(THIS_ LPDSCBCAPS lpDSCBCaps) PURE;
+ STDMETHOD(GetCurrentPosition)(THIS_ LPDWORD lpdwCapturePosition,LPDWORD lpdwReadPosition) PURE;
+ STDMETHOD(GetFormat)(THIS_ LPWAVEFORMATEX lpwfxFormat, DWORD dwSizeAllocated, LPDWORD lpdwSizeWritten) PURE;
+ STDMETHOD(GetStatus)(THIS_ LPDWORD lpdwStatus) PURE;
+ STDMETHOD(Initialize)(THIS_ LPDIRECTSOUNDCAPTURE lpDSC, LPCDSCBUFFERDESC lpcDSCBDesc) PURE;
+ STDMETHOD(Lock)(THIS_ DWORD dwReadCusor, DWORD dwReadBytes, LPVOID *lplpvAudioPtr1, LPDWORD lpdwAudioBytes1, LPVOID *lplpvAudioPtr2, LPDWORD lpdwAudioBytes2, DWORD dwFlags) PURE;
+ STDMETHOD(Start)(THIS_ DWORD dwFlags) PURE;
+ STDMETHOD(Stop)(THIS) PURE;
+ STDMETHOD(Unlock)(THIS_ LPVOID lpvAudioPtr1, DWORD dwAudioBytes1, LPVOID lpvAudioPtr2, DWORD dwAudioBytes2) PURE;
+ /*** IDirectSoundCaptureBuffer8 methods ***/
+ STDMETHOD(GetObjectInPath)(THIS_ REFGUID rguidObject, DWORD dwIndex, REFGUID rguidInterface, LPVOID *ppObject) PURE;
+ STDMETHOD(GetFXStatus)(THIS_ DWORD dwFXCount, LPDWORD pdwFXStatus) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IDirectSoundCaptureBuffer8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirectSoundCaptureBuffer8_AddRef(p) (p)->lpVtbl->AddRef(p)
+#define IDirectSoundCaptureBuffer8_Release(p) (p)->lpVtbl->Release(p)
+/*** IDirectSoundCaptureBuffer methods ***/
+#define IDirectSoundCaptureBuffer8_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a)
+#define IDirectSoundCaptureBuffer8_GetCurrentPosition(p,a,b) (p)->lpVtbl->GetCurrentPosition(p,a,b)
+#define IDirectSoundCaptureBuffer8_GetFormat(p,a,b,c) (p)->lpVtbl->GetFormat(p,a,b,c)
+#define IDirectSoundCaptureBuffer8_GetStatus(p,a) (p)->lpVtbl->GetStatus(p,a)
+#define IDirectSoundCaptureBuffer8_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b)
+#define IDirectSoundCaptureBuffer8_Lock(p,a,b,c,d,e,f,g) (p)->lpVtbl->Lock(p,a,b,c,d,e,f,g)
+#define IDirectSoundCaptureBuffer8_Start(p,a) (p)->lpVtbl->Start(p,a)
+#define IDirectSoundCaptureBuffer8_Stop(p) (p)->lpVtbl->Stop(p)
+#define IDirectSoundCaptureBuffer8_Unlock(p,a,b,c,d) (p)->lpVtbl->Unlock(p,a,b,c,d)
+/*** IDirectSoundCaptureBuffer8 methods ***/
+#define IDirectSoundCaptureBuffer8_GetObjectInPath(p,a,b,c,d) (p)->lpVtbl->GetObjectInPath(p,a,b,c,d)
+#define IDirectSoundCaptureBuffer8_GetFXStatus(p,a,b) (p)->lpVtbl->GetFXStatus(p,a,b)
+#else
+/*** IUnknown methods ***/
+#define IDirectSoundCaptureBuffer8_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
+#define IDirectSoundCaptureBuffer8_AddRef(p) (p)->AddRef()
+#define IDirectSoundCaptureBuffer8_Release(p) (p)->Release()
+/*** IDirectSoundCaptureBuffer methods ***/
+#define IDirectSoundCaptureBuffer8_GetCaps(p,a) (p)->GetCaps(a)
+#define IDirectSoundCaptureBuffer8_GetCurrentPosition(p,a,b) (p)->GetCurrentPosition(a,b)
+#define IDirectSoundCaptureBuffer8_GetFormat(p,a,b,c) (p)->GetFormat(a,b,c)
+#define IDirectSoundCaptureBuffer8_GetStatus(p,a) (p)->GetStatus(a)
+#define IDirectSoundCaptureBuffer8_Initialize(p,a,b) (p)->Initialize(a,b)
+#define IDirectSoundCaptureBuffer8_Lock(p,a,b,c,d,e,f,g) (p)->Lock(a,b,c,d,e,f,g)
+#define IDirectSoundCaptureBuffer8_Start(p,a) (p)->Start(a)
+#define IDirectSoundCaptureBuffer8_Stop(p) (p)->Stop()
+#define IDirectSoundCaptureBuffer8_Unlock(p,a,b,c,d) (p)->Unlock(a,b,c,d)
+/*** IDirectSoundCaptureBuffer8 methods ***/
+#define IDirectSoundCaptureBuffer8_GetObjectInPath(p,a,b,c,d) (p)->GetObjectInPath(a,b,c,d)
+#define IDirectSoundCaptureBuffer8_GetFXStatus(p,a,b) (p)->GetFXStatus(a,b)
+#endif
+
+/*****************************************************************************
+ * IDirectSoundNotify interface
+ */
+#define WINE_NOBUFFER 0x80000000
+
+#define DSBPN_OFFSETSTOP -1
+
+#define INTERFACE IDirectSoundNotify
+DECLARE_INTERFACE_(IDirectSoundNotify,IUnknown)
+{
+ /*** IUnknown methods ***/
+ STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+ STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+ STDMETHOD_(ULONG,Release)(THIS) PURE;
+ /*** IDirectSoundNotify methods ***/
+ STDMETHOD(SetNotificationPositions)(THIS_ DWORD cPositionNotifies, LPCDSBPOSITIONNOTIFY lpcPositionNotifies) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IDirectSoundNotify_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirectSoundNotify_AddRef(p) (p)->lpVtbl->AddRef(p)
+#define IDirectSoundNotify_Release(p) (p)->lpVtbl->Release(p)
+/*** IDirectSoundNotify methods ***/
+#define IDirectSoundNotify_SetNotificationPositions(p,a,b) (p)->lpVtbl->SetNotificationPositions(p,a,b)
+#else
+/*** IUnknown methods ***/
+#define IDirectSoundNotify_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
+#define IDirectSoundNotify_AddRef(p) (p)->AddRef()
+#define IDirectSoundNotify_Release(p) (p)->Release()
+/*** IDirectSoundNotify methods ***/
+#define IDirectSoundNotify_SetNotificationPositions(p,a,b) (p)->SetNotificationPositions(a,b)
+#endif
+
+
+/*****************************************************************************
+ * IDirectSound3DListener interface
+ */
+#define DS3DMODE_NORMAL 0x00000000
+#define DS3DMODE_HEADRELATIVE 0x00000001
+#define DS3DMODE_DISABLE 0x00000002
+
+#define DS3D_IMMEDIATE 0x00000000
+#define DS3D_DEFERRED 0x00000001
+
+#define DS3D_MINDISTANCEFACTOR FLT_MIN
+#define DS3D_MAXDISTANCEFACTOR FLT_MAX
+#define DS3D_DEFAULTDISTANCEFACTOR 1.0f
+
+#define DS3D_MINROLLOFFFACTOR 0.0f
+#define DS3D_MAXROLLOFFFACTOR 10.0f
+#define DS3D_DEFAULTROLLOFFFACTOR 1.0f
+
+#define DS3D_MINDOPPLERFACTOR 0.0f
+#define DS3D_MAXDOPPLERFACTOR 10.0f
+#define DS3D_DEFAULTDOPPLERFACTOR 1.0f
+
+#define DS3D_DEFAULTMINDISTANCE 1.0f
+#define DS3D_DEFAULTMAXDISTANCE 1000000000.0f
+
+#define DS3D_MINCONEANGLE 0
+#define DS3D_MAXCONEANGLE 360
+#define DS3D_DEFAULTCONEANGLE 360
+
+#define DS3D_DEFAULTCONEOUTSIDEVOLUME DSBVOLUME_MAX
+
+typedef struct _DS3DLISTENER {
+ DWORD dwSize;
+ D3DVECTOR vPosition;
+ D3DVECTOR vVelocity;
+ D3DVECTOR vOrientFront;
+ D3DVECTOR vOrientTop;
+ D3DVALUE flDistanceFactor;
+ D3DVALUE flRolloffFactor;
+ D3DVALUE flDopplerFactor;
+} DS3DLISTENER, *LPDS3DLISTENER;
+
+typedef const DS3DLISTENER *LPCDS3DLISTENER;
+
+#define INTERFACE IDirectSound3DListener
+DECLARE_INTERFACE_(IDirectSound3DListener,IUnknown)
+{
+ /*** IUnknown methods ***/
+ STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+ STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+ STDMETHOD_(ULONG,Release)(THIS) PURE;
+ /*** IDirectSound3DListener methods ***/
+ STDMETHOD(GetAllParameters)(THIS_ LPDS3DLISTENER lpListener) PURE;
+ STDMETHOD(GetDistanceFactor)(THIS_ LPD3DVALUE lpflDistanceFactor) PURE;
+ STDMETHOD(GetDopplerFactor)(THIS_ LPD3DVALUE lpflDopplerFactor) PURE;
+ STDMETHOD(GetOrientation)(THIS_ LPD3DVECTOR lpvOrientFront, LPD3DVECTOR lpvOrientTop) PURE;
+ STDMETHOD(GetPosition)(THIS_ LPD3DVECTOR lpvPosition) PURE;
+ STDMETHOD(GetRolloffFactor)(THIS_ LPD3DVALUE lpflRolloffFactor) PURE;
+ STDMETHOD(GetVelocity)(THIS_ LPD3DVECTOR lpvVelocity) PURE;
+ STDMETHOD(SetAllParameters)(THIS_ LPCDS3DLISTENER lpcListener, DWORD dwApply) PURE;
+ STDMETHOD(SetDistanceFactor)(THIS_ D3DVALUE flDistanceFactor, DWORD dwApply) PURE;
+ STDMETHOD(SetDopplerFactor)(THIS_ D3DVALUE flDopplerFactor, DWORD dwApply) PURE;
+ STDMETHOD(SetOrientation)(THIS_ D3DVALUE xFront, D3DVALUE yFront, D3DVALUE zFront, D3DVALUE xTop, D3DVALUE yTop, D3DVALUE zTop, DWORD dwApply) PURE;
+ STDMETHOD(SetPosition)(THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply) PURE;
+ STDMETHOD(SetRolloffFactor)(THIS_ D3DVALUE flRolloffFactor, DWORD dwApply) PURE;
+ STDMETHOD(SetVelocity)(THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply) PURE;
+ STDMETHOD(CommitDeferredSettings)(THIS) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IDirectSound3DListener_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirectSound3DListener_AddRef(p) (p)->lpVtbl->AddRef(p)
+#define IDirectSound3DListener_Release(p) (p)->lpVtbl->Release(p)
+/*** IDirectSound3DListener methods ***/
+#define IDirectSound3DListener_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a)
+#define IDirectSound3DListener_GetDistanceFactor(p,a) (p)->lpVtbl->GetDistanceFactor(p,a)
+#define IDirectSound3DListener_GetDopplerFactor(p,a) (p)->lpVtbl->GetDopplerFactor(p,a)
+#define IDirectSound3DListener_GetOrientation(p,a,b) (p)->lpVtbl->GetOrientation(p,a,b)
+#define IDirectSound3DListener_GetPosition(p,a) (p)->lpVtbl->GetPosition(p,a)
+#define IDirectSound3DListener_GetRolloffFactor(p,a) (p)->lpVtbl->GetRolloffFactor(p,a)
+#define IDirectSound3DListener_GetVelocity(p,a) (p)->lpVtbl->GetVelocity(p,a)
+#define IDirectSound3DListener_SetAllParameters(p,a,b) (p)->lpVtbl->SetAllParameters(p,a,b)
+#define IDirectSound3DListener_SetDistanceFactor(p,a,b) (p)->lpVtbl->SetDistanceFactor(p,a,b)
+#define IDirectSound3DListener_SetDopplerFactor(p,a,b) (p)->lpVtbl->SetDopplerFactor(p,a,b)
+#define IDirectSound3DListener_SetOrientation(p,a,b,c,d,e,f,g) (p)->lpVtbl->SetOrientation(p,a,b,c,d,e,f,g)
+#define IDirectSound3DListener_SetPosition(p,a,b,c,d) (p)->lpVtbl->SetPosition(p,a,b,c,d)
+#define IDirectSound3DListener_SetRolloffFactor(p,a,b) (p)->lpVtbl->SetRolloffFactor(p,a,b)
+#define IDirectSound3DListener_SetVelocity(p,a,b,c,d) (p)->lpVtbl->SetVelocity(p,a,b,c,d)
+#define IDirectSound3DListener_CommitDeferredSettings(p) (p)->lpVtbl->CommitDeferredSettings(p)
+#else
+/*** IUnknown methods ***/
+#define IDirectSound3DListener_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
+#define IDirectSound3DListener_AddRef(p) (p)->AddRef()
+#define IDirectSound3DListener_Release(p) (p)->Release()
+/*** IDirectSound3DListener methods ***/
+#define IDirectSound3DListener_GetAllParameters(p,a) (p)->GetAllParameters(a)
+#define IDirectSound3DListener_GetDistanceFactor(p,a) (p)->GetDistanceFactor(a)
+#define IDirectSound3DListener_GetDopplerFactor(p,a) (p)->GetDopplerFactor(a)
+#define IDirectSound3DListener_GetOrientation(p,a,b) (p)->GetOrientation(a,b)
+#define IDirectSound3DListener_GetPosition(p,a) (p)->GetPosition(a)
[truncated at 1000 lines; 195 more skipped]
reactos/include
diff -N dxdiag.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ dxdiag.h 30 Dec 2004 04:36:25 -0000 1.1.2.1
@@ -0,0 +1,157 @@
+/*
+ * Copyright (C) 2004 Raphael Junqueira
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef __WINE_DXDIAG_H
+#define __WINE_DXDIAG_H
+
+#include <ole2.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* defined(__cplusplus) */
+
+/*****************************************************************************
+ * #defines and error codes
+ */
+#define DXDIAG_DX9_SDK_VERSION 111
+
+#define _FACDXDIAG 0x007
+#define MAKE_DXDIAGHRESULT( code ) MAKE_HRESULT( 1, _FACDXDIAG, code )
+
+/*
+ * DXDiag Errors
+ */
+#define DXDIAG_E_INSUFFICIENT_BUFFER MAKE_DXDIAGHRESULT(0x007A)
+
+
+/*****************************************************************************
+ * DXDiag structures Typedefs
+ */
+typedef struct _DXDIAG_INIT_PARAMS {
+ DWORD dwSize;
+ DWORD dwDxDiagHeaderVersion;
+ BOOL bAllowWHQLChecks;
+ VOID* pReserved;
+} DXDIAG_INIT_PARAMS;
+
+
+/*****************************************************************************
+ * Predeclare the interfaces
+ */
+/* CLSIDs */
+DEFINE_GUID(CLSID_DxDiagProvider, 0xA65B8071, 0x3BFE, 0x4213, 0x9A, 0x5B, 0x49, 0x1D, 0xA4, 0x46, 0x1C, 0xA7);
+
+/* IIDs */
+DEFINE_GUID(IID_IDxDiagProvider, 0x9C6B4CB0, 0x23F8, 0x49CC, 0xA3, 0xED, 0x45, 0xA5, 0x50, 0x00, 0xA6, 0xD2);
+DEFINE_GUID(IID_IDxDiagContainer, 0x7D0F462F, 0x4064, 0x4862, 0xBC, 0x7F, 0x93, 0x3E, 0x50, 0x58, 0xC1, 0x0F);
+
+/* typedef definitions */
+//typedef struct IDxDiagProvider IDxDiagProvider, *LPDXDIAGPROVIDER, *PDXDIAGPROVIDER;
+//typedef struct IDxDiagContainer IDxDiagContainer, *LPDXDIAGCONTAINER, *PDXDIAGCONTAINER;
+typedef struct IDxDiagProvider *LPDXDIAGPROVIDER, *PDXDIAGPROVIDER;
+typedef struct IDxDiagContainer *LPDXDIAGCONTAINER, *PDXDIAGCONTAINER;
+
+/*****************************************************************************
+ * IDxDiagProvider interface
+ */
+#define INTERFACE IDxDiagProvider
+DECLARE_INTERFACE_(IDxDiagProvider,IUnknown)
+{
+ /*** IUnknown methods ***/
+ STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+ STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+ STDMETHOD_(ULONG,Release)(THIS) PURE;
+ /*** IDxDiagProvider methods ***/
+ STDMETHOD(Initialize)(THIS_ DXDIAG_INIT_PARAMS* pParams) PURE;
+ STDMETHOD(GetRootContainer)(THIS_ LPDXDIAGCONTAINER* ppInstance) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IDxDiagProvider_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDxDiagProvider_AddRef(p) (p)->lpVtbl->AddRef(p)
+#define IDxDiagProvider_Release(p) (p)->lpVtbl->Release(p)
+/*** IDxDiagProvider methods ***/
+#define IDxDiagProvider_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b)
+#define IDxDiagProvider_GetRootContainer(p,a) (p)->lpVtbl->GetRootContainer(p,a)
+#else
+/*** IUnknown methods ***/
+#define IDxDiagProvider_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
+#define IDxDiagProvider_AddRef(p) (p)->AddRef()
+#define IDxDiagProvider_Release(p) (p)->Release()
+/*** IDxDiagProvider methods ***/
+#define IDxDiagProvider_Initialize(p,a,b) (p)->Initialize(a,b)
+#define IDxDiagProvider_GetRootContainer(p,a) (p)->GetRootContainer(a)
+#endif
+
+/*****************************************************************************
+ * IDxDiagContainer interface
+ */
+#ifdef __WINESRC__
+#undef GetProp
+#endif
+
+#define INTERFACE IDxDiagContainer
+DECLARE_INTERFACE_(IDxDiagContainer,IUnknown)
+{
+ /*** IUnknown methods ***/
+ STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+ STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+ STDMETHOD_(ULONG,Release)(THIS) PURE;
+ /*** IDxDiagContainer methods ***/
+ STDMETHOD(GetNumberOfChildContainers)(THIS_ DWORD* pdwCount) PURE;
+ STDMETHOD(EnumChildContainerNames)(THIS_ DWORD dwIndex, LPWSTR pwszContainer, DWORD cchContainer) PURE;
+ STDMETHOD(GetChildContainer)(THIS_ LPCWSTR pwszContainer, IDxDiagContainer** ppInstance) PURE;
+ STDMETHOD(GetNumberOfProps)(THIS_ DWORD* pdwCount) PURE;
+ STDMETHOD(EnumPropNames)(THIS_ DWORD dwIndex, LPWSTR pwszPropName, DWORD cchPropName) PURE;
+ STDMETHOD(GetProp)(THIS_ LPCWSTR pwszPropName, VARIANT* pvarProp) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IDxDiagContainer_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDxDiagContainer_AddRef(p) (p)->lpVtbl->AddRef(p)
+#define IDxDiagContainer_Release(p) (p)->lpVtbl->Release(p)
+/*** IDxDiagContainer methods ***/
+#define IDxDiagContainer_GetNumberOfChildContainers(p,a) (p)->lpVtbl->GetNumberOfChildContainers(p,a)
+#define IDxDiagContainer_EnumChildContainerNames(p,a,b,c) (p)->lpVtbl->EnumChildContainerNames(p,a,b,c)
+#define IDxDiagContainer_GetChildContainer(p,a,b) (p)->lpVtbl->GetChildContainer(p,a,b)
+#define IDxDiagContainer_GetNumberOfProps(p,a) (p)->lpVtbl->GetNumberOfProps(p,a)
+#define IDxDiagContainer_EnumProps(p,a,b) (p)->lpVtbl->EnumProps(p,a,b,c)
+#define IDxDiagContainer_GetProp(p,a,b) (p)->lpVtbl->GetProp(p,a,b)
+#else
+/*** IUnknown methods ***/
+#define IDxDiagContainer_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
+#define IDxDiagContainer_AddRef(p) (p)->AddRef()
+#define IDxDiagContainer_Release(p) (p)->Release()
+/*** IDxDiagContainer methods ***/
+#define IDxDiagContainer_GetNumberOfChildContainers(p,a) (p)->GetNumberOfChildContainers(a)
+#define IDxDiagContainer_EnumChildContainerNames(p,a,b,c) (p)->EnumChildContainerNames(a,b,c)
+#define IDxDiagContainer_GetChildContainer(p,a,b) (p)->GetChildContainer(a,b)
+#define IDxDiagContainer_GetNumberOfProps(p,a) (p)->GetNumberOfProps(a)
+#define IDxDiagContainer_EnumProps(p,a,b) (p)->EnumProps(a,b,c)
+#define IDxDiagContainer_GetProp(p,a,b) (p)->GetProp(a,b)
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
reactos/include
diff -N strmif.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ strmif.h 30 Dec 2004 04:36:25 -0000 1.1.2.1
@@ -0,0 +1,7969 @@
+/*** Autogenerated by WIDL 0.1 from strmif.idl - Do not edit ***/
+#include <rpc.h>
+#include <rpcndr.h>
+
+#ifndef __WIDL_STRMIF_H
+#define __WIDL_STRMIF_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <objidl.h>
+#include <oaidl.h>
+#define CDEF_CLASS_DEFAULT 0x0001
+#define CDEF_BYPASS_CLASS_MANAGER 0x0002
+#define CDEF_CLASS_LEGACY 0x0004
+#define CDEF_MERIT_ABOVE_DO_NOT_USE 0x0008
+#ifndef __ICreateDevEnum_FWD_DEFINED__
+#define __ICreateDevEnum_FWD_DEFINED__
+typedef struct ICreateDevEnum ICreateDevEnum;
+#endif
+
+/*****************************************************************************
+ * ICreateDevEnum interface
+ */
+#ifndef __ICreateDevEnum_INTERFACE_DEFINED__
+#define __ICreateDevEnum_INTERFACE_DEFINED__
+
+DEFINE_GUID(IID_ICreateDevEnum, 0x29840822, 0x5b84, 0x11d0, 0xbd,0x3b, 0x00,0xa0,0xc9,0x11,0xce,0x86);
+#if defined(__cplusplus) && !defined(CINTERFACE)
+struct ICreateDevEnum : public IUnknown
+{
+ virtual HRESULT STDMETHODCALLTYPE CreateClassEnumerator(
+ REFCLSID clsidDeviceClass,
+ IEnumMoniker** ppEnumMoniker,
+ DWORD dwFlags) = 0;
+
+};
+#else
+typedef struct ICreateDevEnumVtbl ICreateDevEnumVtbl;
+struct ICreateDevEnum {
+ const ICreateDevEnumVtbl* lpVtbl;
+};
+struct ICreateDevEnumVtbl {
+ BEGIN_INTERFACE
+
+ /*** IUnknown methods ***/
+ HRESULT (STDMETHODCALLTYPE *QueryInterface)(
+ ICreateDevEnum* This,
+ REFIID riid,
+ void** ppvObject);
+
+ ULONG (STDMETHODCALLTYPE *AddRef)(
+ ICreateDevEnum* This);
+
+ ULONG (STDMETHODCALLTYPE *Release)(
+ ICreateDevEnum* This);
+
+ /*** ICreateDevEnum methods ***/
+ HRESULT (STDMETHODCALLTYPE *CreateClassEnumerator)(
+ ICreateDevEnum* This,
+ REFCLSID clsidDeviceClass,
+ IEnumMoniker** ppEnumMoniker,
+ DWORD dwFlags);
+
+ END_INTERFACE
+};
+
+#ifdef COBJMACROS
+/*** IUnknown methods ***/
+#define ICreateDevEnum_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define ICreateDevEnum_AddRef(p) (p)->lpVtbl->AddRef(p)
+#define ICreateDevEnum_Release(p) (p)->lpVtbl->Release(p)
+/*** ICreateDevEnum methods ***/
+#define ICreateDevEnum_CreateClassEnumerator(p,a,b,c) (p)->lpVtbl->CreateClassEnumerator(p,a,b,c)
+#endif
+
+#endif
+
+#define ICreateDevEnum_METHODS \
+ /*** IUnknown methods ***/ \
+ STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; \
+ STDMETHOD_(ULONG,AddRef)(THIS) PURE; \
+ STDMETHOD_(ULONG,Release)(THIS) PURE; \
+ /*** ICreateDevEnum methods ***/ \
+ STDMETHOD_(HRESULT,CreateClassEnumerator)(THIS_ REFCLSID clsidDeviceClass, IEnumMoniker** ppEnumMoniker, DWORD dwFlags) PURE;
+
+HRESULT CALLBACK ICreateDevEnum_CreateClassEnumerator_Proxy(
+ ICreateDevEnum* This,
+ REFCLSID clsidDeviceClass,
+ IEnumMoniker** ppEnumMoniker,
+ DWORD dwFlags);
+void __RPC_STUB ICreateDevEnum_CreateClassEnumerator_Stub(
+ struct IRpcStubBuffer* This,
+ struct IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+
+#endif /* __ICreateDevEnum_INTERFACE_DEFINED__ */
+
+#define CHARS_IN_GUID 39
+#undef GetTimeFormat
+typedef struct _AMMediaType {
+ GUID majortype;
+ GUID subtype;
+ BOOL bFixedSizeSamples;
+ BOOL bTemporalCompression;
+ ULONG lSampleSize;
+ GUID formattype;
+ IUnknown *pUnk;
+ ULONG cbFormat;
+ BYTE *pbFormat;
+} AM_MEDIA_TYPE;
+
+typedef enum _PinDirection {
+ PINDIR_INPUT,
+ PINDIR_OUTPUT
+} PIN_DIRECTION;
+
+#define MAX_PIN_NAME 128
+#define MAX_FILTER_NAME 128
+typedef LONGLONG REFERENCE_TIME;
+
+typedef DOUBLE REFTIME;
+
+typedef DWORD_PTR HSEMAPHORE;
+
+typedef DWORD_PTR HEVENT;
+
+typedef struct _AllocatorProperties {
+ long cBuffers;
+ long cbBuffer;
+ long cbAlign;
+ long cbPrefix;
+} ALLOCATOR_PROPERTIES;
+
+#ifndef __IAMovieSetup_FWD_DEFINED__
+#define __IAMovieSetup_FWD_DEFINED__
+typedef struct IAMovieSetup IAMovieSetup;
+#endif
+
+#ifndef __IEnumFilters_FWD_DEFINED__
+#define __IEnumFilters_FWD_DEFINED__
+typedef struct IEnumFilters IEnumFilters;
+#endif
+
+#ifndef __IEnumMediaTypes_FWD_DEFINED__
+#define __IEnumMediaTypes_FWD_DEFINED__
+typedef struct IEnumMediaTypes IEnumMediaTypes;
+#endif
+
+#ifndef __IEnumPins_FWD_DEFINED__
+#define __IEnumPins_FWD_DEFINED__
+typedef struct IEnumPins IEnumPins;
+#endif
+
+#ifndef __IBaseFilter_FWD_DEFINED__
+#define __IBaseFilter_FWD_DEFINED__
+typedef struct IBaseFilter IBaseFilter;
+#endif
+
+#ifndef __IFilterGraph_FWD_DEFINED__
+#define __IFilterGraph_FWD_DEFINED__
+typedef struct IFilterGraph IFilterGraph;
+#endif
+
+#ifndef __IMediaFilter_FWD_DEFINED__
+#define __IMediaFilter_FWD_DEFINED__
+typedef struct IMediaFilter IMediaFilter;
+#endif
+
+#ifndef __IMediaSample_FWD_DEFINED__
+#define __IMediaSample_FWD_DEFINED__
+typedef struct IMediaSample IMediaSample;
+#endif
+
+#ifndef __IMemAllocator_FWD_DEFINED__
+#define __IMemAllocator_FWD_DEFINED__
+typedef struct IMemAllocator IMemAllocator;
+#endif
+
+#ifndef __IMemAllocatorCallbackTemp_FWD_DEFINED__
+#define __IMemAllocatorCallbackTemp_FWD_DEFINED__
+typedef struct IMemAllocatorCallbackTemp IMemAllocatorCallbackTemp;
+#endif
+
+#ifndef __IMemAllocatorNotifyCallbackTemp_FWD_DEFINED__
+#define __IMemAllocatorNotifyCallbackTemp_FWD_DEFINED__
+typedef struct IMemAllocatorNotifyCallbackTemp IMemAllocatorNotifyCallbackTemp;
+#endif
+
+#ifndef __IMemInputPin_FWD_DEFINED__
+#define __IMemInputPin_FWD_DEFINED__
+typedef struct IMemInputPin IMemInputPin;
+#endif
+
+#ifndef __IPin_FWD_DEFINED__
+#define __IPin_FWD_DEFINED__
+typedef struct IPin IPin;
+#endif
+
+#ifndef __IReferenceClock_FWD_DEFINED__
+#define __IReferenceClock_FWD_DEFINED__
+typedef struct IReferenceClock IReferenceClock;
+#endif
+
+typedef struct _PinInfo {
+ IBaseFilter *pFilter;
+ PIN_DIRECTION dir;
+ WCHAR achName[128];
+} PIN_INFO;
+
+/*****************************************************************************
+ * IPin interface
+ */
+#ifndef __IPin_INTERFACE_DEFINED__
+#define __IPin_INTERFACE_DEFINED__
+
+DEFINE_GUID(IID_IPin, 0x56a86891, 0x0ad4, 0x11ce, 0xb0,0x3a, 0x00,0x20,0xaf,0x0b,0xa7,0x70);
+#if defined(__cplusplus) && !defined(CINTERFACE)
+struct IPin : public IUnknown
+{
+ virtual HRESULT STDMETHODCALLTYPE Connect(
+ IPin* pReceivePin,
+ const AM_MEDIA_TYPE* pmt) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE ReceiveConnection(
+ IPin* pConnector,
+ const AM_MEDIA_TYPE* pmt) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE Disconnect(
+ ) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE ConnectedTo(
+ IPin** pPin) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE ConnectionMediaType(
+ AM_MEDIA_TYPE* pmt) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE QueryPinInfo(
+ PIN_INFO* pInfo) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE QueryDirection(
+ PIN_DIRECTION* pPinDir) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE QueryId(
+ LPWSTR* Id) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE QueryAccept(
+ const AM_MEDIA_TYPE* pmt) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE EnumMediaTypes(
+ IEnumMediaTypes** ppEnum) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE QueryInternalConnections(
+ IPin** apPin,
+ ULONG* nPin) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE EndOfStream(
+ ) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE BeginFlush(
+ ) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE EndFlush(
+ ) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE NewSegment(
+ REFERENCE_TIME tStart,
+ REFERENCE_TIME tStop,
+ double dRate) = 0;
+
+};
+#else
+typedef struct IPinVtbl IPinVtbl;
+struct IPin {
+ const IPinVtbl* lpVtbl;
+};
+struct IPinVtbl {
+ BEGIN_INTERFACE
+
+ /*** IUnknown methods ***/
+ HRESULT (STDMETHODCALLTYPE *QueryInterface)(
+ IPin* This,
+ REFIID riid,
+ void** ppvObject);
+
+ ULONG (STDMETHODCALLTYPE *AddRef)(
+ IPin* This);
+
+ ULONG (STDMETHODCALLTYPE *Release)(
+ IPin* This);
+
+ /*** IPin methods ***/
+ HRESULT (STDMETHODCALLTYPE *Connect)(
+ IPin* This,
+ IPin* pReceivePin,
+ const AM_MEDIA_TYPE* pmt);
+
+ HRESULT (STDMETHODCALLTYPE *ReceiveConnection)(
+ IPin* This,
+ IPin* pConnector,
+ const AM_MEDIA_TYPE* pmt);
+
+ HRESULT (STDMETHODCALLTYPE *Disconnect)(
+ IPin* This);
+
+ HRESULT (STDMETHODCALLTYPE *ConnectedTo)(
+ IPin* This,
+ IPin** pPin);
+
+ HRESULT (STDMETHODCALLTYPE *ConnectionMediaType)(
+ IPin* This,
+ AM_MEDIA_TYPE* pmt);
+
+ HRESULT (STDMETHODCALLTYPE *QueryPinInfo)(
+ IPin* This,
+ PIN_INFO* pInfo);
+
+ HRESULT (STDMETHODCALLTYPE *QueryDirection)(
+ IPin* This,
+ PIN_DIRECTION* pPinDir);
+
+ HRESULT (STDMETHODCALLTYPE *QueryId)(
+ IPin* This,
+ LPWSTR* Id);
+
+ HRESULT (STDMETHODCALLTYPE *QueryAccept)(
+ IPin* This,
+ const AM_MEDIA_TYPE* pmt);
+
+ HRESULT (STDMETHODCALLTYPE *EnumMediaTypes)(
+ IPin* This,
+ IEnumMediaTypes** ppEnum);
+
+ HRESULT (STDMETHODCALLTYPE *QueryInternalConnections)(
+ IPin* This,
+ IPin** apPin,
+ ULONG* nPin);
+
+ HRESULT (STDMETHODCALLTYPE *EndOfStream)(
+ IPin* This);
+
+ HRESULT (STDMETHODCALLTYPE *BeginFlush)(
+ IPin* This);
+
+ HRESULT (STDMETHODCALLTYPE *EndFlush)(
+ IPin* This);
+
+ HRESULT (STDMETHODCALLTYPE *NewSegment)(
+ IPin* This,
+ REFERENCE_TIME tStart,
+ REFERENCE_TIME tStop,
+ double dRate);
+
+ END_INTERFACE
+};
+
+#ifdef COBJMACROS
+/*** IUnknown methods ***/
+#define IPin_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IPin_AddRef(p) (p)->lpVtbl->AddRef(p)
+#define IPin_Release(p) (p)->lpVtbl->Release(p)
+/*** IPin methods ***/
+#define IPin_Connect(p,a,b) (p)->lpVtbl->Connect(p,a,b)
+#define IPin_ReceiveConnection(p,a,b) (p)->lpVtbl->ReceiveConnection(p,a,b)
+#define IPin_Disconnect(p) (p)->lpVtbl->Disconnect(p)
+#define IPin_ConnectedTo(p,a) (p)->lpVtbl->ConnectedTo(p,a)
+#define IPin_ConnectionMediaType(p,a) (p)->lpVtbl->ConnectionMediaType(p,a)
+#define IPin_QueryPinInfo(p,a) (p)->lpVtbl->QueryPinInfo(p,a)
+#define IPin_QueryDirection(p,a) (p)->lpVtbl->QueryDirection(p,a)
+#define IPin_QueryId(p,a) (p)->lpVtbl->QueryId(p,a)
+#define IPin_QueryAccept(p,a) (p)->lpVtbl->QueryAccept(p,a)
+#define IPin_EnumMediaTypes(p,a) (p)->lpVtbl->EnumMediaTypes(p,a)
+#define IPin_QueryInternalConnections(p,a,b) (p)->lpVtbl->QueryInternalConnections(p,a,b)
+#define IPin_EndOfStream(p) (p)->lpVtbl->EndOfStream(p)
+#define IPin_BeginFlush(p) (p)->lpVtbl->BeginFlush(p)
+#define IPin_EndFlush(p) (p)->lpVtbl->EndFlush(p)
+#define IPin_NewSegment(p,a,b,c) (p)->lpVtbl->NewSegment(p,a,b,c)
+#endif
+
+#endif
+
+#define IPin_METHODS \
+ /*** IUnknown methods ***/ \
+ STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; \
+ STDMETHOD_(ULONG,AddRef)(THIS) PURE; \
+ STDMETHOD_(ULONG,Release)(THIS) PURE; \
+ /*** IPin methods ***/ \
+ STDMETHOD_(HRESULT,Connect)(THIS_ IPin* pReceivePin, const AM_MEDIA_TYPE* pmt) PURE; \
+ STDMETHOD_(HRESULT,ReceiveConnection)(THIS_ IPin* pConnector, const AM_MEDIA_TYPE* pmt) PURE; \
+ STDMETHOD_(HRESULT,Disconnect)(THIS) PURE; \
+ STDMETHOD_(HRESULT,ConnectedTo)(THIS_ IPin** pPin) PURE; \
+ STDMETHOD_(HRESULT,ConnectionMediaType)(THIS_ AM_MEDIA_TYPE* pmt) PURE; \
+ STDMETHOD_(HRESULT,QueryPinInfo)(THIS_ PIN_INFO* pInfo) PURE; \
+ STDMETHOD_(HRESULT,QueryDirection)(THIS_ PIN_DIRECTION* pPinDir) PURE; \
+ STDMETHOD_(HRESULT,QueryId)(THIS_ LPWSTR* Id) PURE; \
+ STDMETHOD_(HRESULT,QueryAccept)(THIS_ const AM_MEDIA_TYPE* pmt) PURE; \
+ STDMETHOD_(HRESULT,EnumMediaTypes)(THIS_ IEnumMediaTypes** ppEnum) PURE; \
+ STDMETHOD_(HRESULT,QueryInternalConnections)(THIS_ IPin** apPin, ULONG* nPin) PURE; \
+ STDMETHOD_(HRESULT,EndOfStream)(THIS) PURE; \
+ STDMETHOD_(HRESULT,BeginFlush)(THIS) PURE; \
+ STDMETHOD_(HRESULT,EndFlush)(THIS) PURE; \
+ STDMETHOD_(HRESULT,NewSegment)(THIS_ REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate) PURE;
+
+HRESULT CALLBACK IPin_Connect_Proxy(
+ IPin* This,
+ IPin* pReceivePin,
+ const AM_MEDIA_TYPE* pmt);
+void __RPC_STUB IPin_Connect_Stub(
+ struct IRpcStubBuffer* This,
+ struct IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT CALLBACK IPin_ReceiveConnection_Proxy(
+ IPin* This,
+ IPin* pConnector,
+ const AM_MEDIA_TYPE* pmt);
+void __RPC_STUB IPin_ReceiveConnection_Stub(
+ struct IRpcStubBuffer* This,
+ struct IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT CALLBACK IPin_Disconnect_Proxy(
+ IPin* This);
+void __RPC_STUB IPin_Disconnect_Stub(
+ struct IRpcStubBuffer* This,
+ struct IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT CALLBACK IPin_ConnectedTo_Proxy(
+ IPin* This,
+ IPin** pPin);
+void __RPC_STUB IPin_ConnectedTo_Stub(
+ struct IRpcStubBuffer* This,
+ struct IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT CALLBACK IPin_ConnectionMediaType_Proxy(
+ IPin* This,
+ AM_MEDIA_TYPE* pmt);
+void __RPC_STUB IPin_ConnectionMediaType_Stub(
+ struct IRpcStubBuffer* This,
+ struct IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT CALLBACK IPin_QueryPinInfo_Proxy(
+ IPin* This,
+ PIN_INFO* pInfo);
+void __RPC_STUB IPin_QueryPinInfo_Stub(
+ struct IRpcStubBuffer* This,
+ struct IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT CALLBACK IPin_QueryDirection_Proxy(
+ IPin* This,
+ PIN_DIRECTION* pPinDir);
+void __RPC_STUB IPin_QueryDirection_Stub(
+ struct IRpcStubBuffer* This,
+ struct IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT CALLBACK IPin_QueryId_Proxy(
+ IPin* This,
+ LPWSTR* Id);
+void __RPC_STUB IPin_QueryId_Stub(
+ struct IRpcStubBuffer* This,
+ struct IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT CALLBACK IPin_QueryAccept_Proxy(
+ IPin* This,
+ const AM_MEDIA_TYPE* pmt);
+void __RPC_STUB IPin_QueryAccept_Stub(
+ struct IRpcStubBuffer* This,
+ struct IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT CALLBACK IPin_EnumMediaTypes_Proxy(
+ IPin* This,
+ IEnumMediaTypes** ppEnum);
+void __RPC_STUB IPin_EnumMediaTypes_Stub(
+ struct IRpcStubBuffer* This,
+ struct IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT CALLBACK IPin_QueryInternalConnections_Proxy(
+ IPin* This,
+ IPin** apPin,
+ ULONG* nPin);
+void __RPC_STUB IPin_QueryInternalConnections_Stub(
+ struct IRpcStubBuffer* This,
+ struct IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT CALLBACK IPin_EndOfStream_Proxy(
+ IPin* This);
+void __RPC_STUB IPin_EndOfStream_Stub(
+ struct IRpcStubBuffer* This,
+ struct IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT CALLBACK IPin_BeginFlush_Proxy(
+ IPin* This);
+void __RPC_STUB IPin_BeginFlush_Stub(
+ struct IRpcStubBuffer* This,
+ struct IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT CALLBACK IPin_EndFlush_Proxy(
+ IPin* This);
+void __RPC_STUB IPin_EndFlush_Stub(
+ struct IRpcStubBuffer* This,
+ struct IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT CALLBACK IPin_NewSegment_Proxy(
+ IPin* This,
+ REFERENCE_TIME tStart,
+ REFERENCE_TIME tStop,
+ double dRate);
+void __RPC_STUB IPin_NewSegment_Stub(
+ struct IRpcStubBuffer* This,
+ struct IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+
+#endif /* __IPin_INTERFACE_DEFINED__ */
+
+typedef IPin *PPIN;
+
+/*****************************************************************************
+ * IEnumPins interface
+ */
+#ifndef __IEnumPins_INTERFACE_DEFINED__
+#define __IEnumPins_INTERFACE_DEFINED__
+
+DEFINE_GUID(IID_IEnumPins, 0x56a86892, 0x0ad4, 0x11ce, 0xb0,0x3a, 0x00,0x20,0xaf,0x0b,0xa7,0x70);
+#if defined(__cplusplus) && !defined(CINTERFACE)
+struct IEnumPins : public IUnknown
+{
+ virtual HRESULT STDMETHODCALLTYPE Next(
+ ULONG cPins,
+ IPin** ppPins,
+ ULONG* pcFetched) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE Skip(
+ ULONG cPins) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE Reset(
+ ) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE Clone(
+ IEnumPins** ppEnum) = 0;
+
+};
+#else
+typedef struct IEnumPinsVtbl IEnumPinsVtbl;
+struct IEnumPins {
+ const IEnumPinsVtbl* lpVtbl;
+};
+struct IEnumPinsVtbl {
+ BEGIN_INTERFACE
+
+ /*** IUnknown methods ***/
+ HRESULT (STDMETHODCALLTYPE *QueryInterface)(
+ IEnumPins* This,
+ REFIID riid,
+ void** ppvObject);
+
+ ULONG (STDMETHODCALLTYPE *AddRef)(
+ IEnumPins* This);
+
+ ULONG (STDMETHODCALLTYPE *Release)(
+ IEnumPins* This);
+
+ /*** IEnumPins methods ***/
+ HRESULT (STDMETHODCALLTYPE *Next)(
+ IEnumPins* This,
+ ULONG cPins,
+ IPin** ppPins,
+ ULONG* pcFetched);
+
+ HRESULT (STDMETHODCALLTYPE *Skip)(
+ IEnumPins* This,
+ ULONG cPins);
+
+ HRESULT (STDMETHODCALLTYPE *Reset)(
+ IEnumPins* This);
+
+ HRESULT (STDMETHODCALLTYPE *Clone)(
+ IEnumPins* This,
+ IEnumPins** ppEnum);
+
+ END_INTERFACE
+};
+
+#ifdef COBJMACROS
+/*** IUnknown methods ***/
+#define IEnumPins_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IEnumPins_AddRef(p) (p)->lpVtbl->AddRef(p)
+#define IEnumPins_Release(p) (p)->lpVtbl->Release(p)
+/*** IEnumPins methods ***/
+#define IEnumPins_Next(p,a,b,c) (p)->lpVtbl->Next(p,a,b,c)
+#define IEnumPins_Skip(p,a) (p)->lpVtbl->Skip(p,a)
+#define IEnumPins_Reset(p) (p)->lpVtbl->Reset(p)
+#define IEnumPins_Clone(p,a) (p)->lpVtbl->Clone(p,a)
+#endif
+
+#endif
+
+#define IEnumPins_METHODS \
+ /*** IUnknown methods ***/ \
+ STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; \
+ STDMETHOD_(ULONG,AddRef)(THIS) PURE; \
+ STDMETHOD_(ULONG,Release)(THIS) PURE; \
+ /*** IEnumPins methods ***/ \
+ STDMETHOD_(HRESULT,Next)(THIS_ ULONG cPins, IPin** ppPins, ULONG* pcFetched) PURE; \
+ STDMETHOD_(HRESULT,Skip)(THIS_ ULONG cPins) PURE; \
+ STDMETHOD_(HRESULT,Reset)(THIS) PURE; \
+ STDMETHOD_(HRESULT,Clone)(THIS_ IEnumPins** ppEnum) PURE;
+
+HRESULT CALLBACK IEnumPins_Next_Proxy(
+ IEnumPins* This,
+ ULONG cPins,
+ IPin** ppPins,
+ ULONG* pcFetched);
+void __RPC_STUB IEnumPins_Next_Stub(
+ struct IRpcStubBuffer* This,
+ struct IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT CALLBACK IEnumPins_Skip_Proxy(
+ IEnumPins* This,
+ ULONG cPins);
+void __RPC_STUB IEnumPins_Skip_Stub(
+ struct IRpcStubBuffer* This,
+ struct IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT CALLBACK IEnumPins_Reset_Proxy(
+ IEnumPins* This);
+void __RPC_STUB IEnumPins_Reset_Stub(
+ struct IRpcStubBuffer* This,
+ struct IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT CALLBACK IEnumPins_Clone_Proxy(
+ IEnumPins* This,
+ IEnumPins** ppEnum);
+void __RPC_STUB IEnumPins_Clone_Stub(
+ struct IRpcStubBuffer* This,
+ struct IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+
+#endif /* __IEnumPins_INTERFACE_DEFINED__ */
+
+typedef IEnumPins *PENUMPINS;
+
+/*****************************************************************************
+ * IEnumMediaTypes interface
+ */
+#ifndef __IEnumMediaTypes_INTERFACE_DEFINED__
+#define __IEnumMediaTypes_INTERFACE_DEFINED__
+
+DEFINE_GUID(IID_IEnumMediaTypes, 0x89c31040, 0x846b, 0x11ce, 0x97,0xd3, 0x00,0xaa,0x00,0x55,0x59,0x5a);
+#if defined(__cplusplus) && !defined(CINTERFACE)
+struct IEnumMediaTypes : public IUnknown
+{
+ virtual HRESULT STDMETHODCALLTYPE Next(
+ ULONG cMediaTypes,
+ AM_MEDIA_TYPE** ppMediaTypes,
+ ULONG* pcFetched) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE Skip(
+ ULONG cMediaTypes) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE Reset(
+ ) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE Clone(
+ IEnumMediaTypes** ppEnum) = 0;
+
+};
+#else
+typedef struct IEnumMediaTypesVtbl IEnumMediaTypesVtbl;
+struct IEnumMediaTypes {
+ const IEnumMediaTypesVtbl* lpVtbl;
+};
+struct IEnumMediaTypesVtbl {
+ BEGIN_INTERFACE
+
+ /*** IUnknown methods ***/
+ HRESULT (STDMETHODCALLTYPE *QueryInterface)(
+ IEnumMediaTypes* This,
+ REFIID riid,
+ void** ppvObject);
+
+ ULONG (STDMETHODCALLTYPE *AddRef)(
+ IEnumMediaTypes* This);
+
+ ULONG (STDMETHODCALLTYPE *Release)(
+ IEnumMediaTypes* This);
+
+ /*** IEnumMediaTypes methods ***/
+ HRESULT (STDMETHODCALLTYPE *Next)(
+ IEnumMediaTypes* This,
+ ULONG cMediaTypes,
+ AM_MEDIA_TYPE** ppMediaTypes,
+ ULONG* pcFetched);
+
+ HRESULT (STDMETHODCALLTYPE *Skip)(
+ IEnumMediaTypes* This,
+ ULONG cMediaTypes);
+
+ HRESULT (STDMETHODCALLTYPE *Reset)(
+ IEnumMediaTypes* This);
+
+ HRESULT (STDMETHODCALLTYPE *Clone)(
+ IEnumMediaTypes* This,
+ IEnumMediaTypes** ppEnum);
+
+ END_INTERFACE
+};
+
+#ifdef COBJMACROS
+/*** IUnknown methods ***/
+#define IEnumMediaTypes_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IEnumMediaTypes_AddRef(p) (p)->lpVtbl->AddRef(p)
+#define IEnumMediaTypes_Release(p) (p)->lpVtbl->Release(p)
+/*** IEnumMediaTypes methods ***/
+#define IEnumMediaTypes_Next(p,a,b,c) (p)->lpVtbl->Next(p,a,b,c)
+#define IEnumMediaTypes_Skip(p,a) (p)->lpVtbl->Skip(p,a)
+#define IEnumMediaTypes_Reset(p) (p)->lpVtbl->Reset(p)
+#define IEnumMediaTypes_Clone(p,a) (p)->lpVtbl->Clone(p,a)
+#endif
+
+#endif
+
+#define IEnumMediaTypes_METHODS \
+ /*** IUnknown methods ***/ \
+ STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; \
+ STDMETHOD_(ULONG,AddRef)(THIS) PURE; \
+ STDMETHOD_(ULONG,Release)(THIS) PURE; \
+ /*** IEnumMediaTypes methods ***/ \
+ STDMETHOD_(HRESULT,Next)(THIS_ ULONG cMediaTypes, AM_MEDIA_TYPE** ppMediaTypes, ULONG* pcFetched) PURE; \
+ STDMETHOD_(HRESULT,Skip)(THIS_ ULONG cMediaTypes) PURE; \
+ STDMETHOD_(HRESULT,Reset)(THIS) PURE; \
+ STDMETHOD_(HRESULT,Clone)(THIS_ IEnumMediaTypes** ppEnum) PURE;
+
+HRESULT CALLBACK IEnumMediaTypes_Next_Proxy(
+ IEnumMediaTypes* This,
+ ULONG cMediaTypes,
+ AM_MEDIA_TYPE** ppMediaTypes,
+ ULONG* pcFetched);
+void __RPC_STUB IEnumMediaTypes_Next_Stub(
+ struct IRpcStubBuffer* This,
+ struct IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT CALLBACK IEnumMediaTypes_Skip_Proxy(
+ IEnumMediaTypes* This,
+ ULONG cMediaTypes);
+void __RPC_STUB IEnumMediaTypes_Skip_Stub(
+ struct IRpcStubBuffer* This,
+ struct IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT CALLBACK IEnumMediaTypes_Reset_Proxy(
+ IEnumMediaTypes* This);
+void __RPC_STUB IEnumMediaTypes_Reset_Stub(
+ struct IRpcStubBuffer* This,
+ struct IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT CALLBACK IEnumMediaTypes_Clone_Proxy(
+ IEnumMediaTypes* This,
+ IEnumMediaTypes** ppEnum);
+void __RPC_STUB IEnumMediaTypes_Clone_Stub(
+ struct IRpcStubBuffer* This,
+ struct IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+
+#endif /* __IEnumMediaTypes_INTERFACE_DEFINED__ */
+
+typedef IEnumMediaTypes *PENUMMEDIATYPES;
+
+/*****************************************************************************
+ * IFilterGraph interface
+ */
+#ifndef __IFilterGraph_INTERFACE_DEFINED__
+#define __IFilterGraph_INTERFACE_DEFINED__
+
+DEFINE_GUID(IID_IFilterGraph, 0x56a8689f, 0x0ad4, 0x11ce, 0xb0,0x3a, 0x00,0x20,0xaf,0x0b,0xa7,0x70);
+#if defined(__cplusplus) && !defined(CINTERFACE)
+struct IFilterGraph : public IUnknown
+{
+ virtual HRESULT STDMETHODCALLTYPE AddFilter(
+ IBaseFilter* pFilter,
+ LPCWSTR pName) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE RemoveFilter(
+ IBaseFilter* pFilter) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE EnumFilters(
+ IEnumFilters** ppEnum) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE FindFilterByName(
+ LPCWSTR pName,
+ IBaseFilter** ppFilter) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE ConnectDirect(
+ IPin* ppinOut,
+ IPin* ppinIn,
+ const AM_MEDIA_TYPE* pmt) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE Reconnect(
+ IPin* ppin) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE Disconnect(
+ IPin* ppin) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetDefaultSyncSource(
+ ) = 0;
+
+};
+#else
+typedef struct IFilterGraphVtbl IFilterGraphVtbl;
+struct IFilterGraph {
+ const IFilterGraphVtbl* lpVtbl;
+};
+struct IFilterGraphVtbl {
+ BEGIN_INTERFACE
+
+ /*** IUnknown methods ***/
+ HRESULT (STDMETHODCALLTYPE *QueryInterface)(
+ IFilterGraph* This,
+ REFIID riid,
+ void** ppvObject);
+
+ ULONG (STDMETHODCALLTYPE *AddRef)(
+ IFilterGraph* This);
+
+ ULONG (STDMETHODCALLTYPE *Release)(
+ IFilterGraph* This);
+
+ /*** IFilterGraph methods ***/
+ HRESULT (STDMETHODCALLTYPE *AddFilter)(
+ IFilterGraph* This,
+ IBaseFilter* pFilter,
+ LPCWSTR pName);
+
+ HRESULT (STDMETHODCALLTYPE *RemoveFilter)(
+ IFilterGraph* This,
+ IBaseFilter* pFilter);
+
+ HRESULT (STDMETHODCALLTYPE *EnumFilters)(
+ IFilterGraph* This,
+ IEnumFilters** ppEnum);
+
+ HRESULT (STDMETHODCALLTYPE *FindFilterByName)(
+ IFilterGraph* This,
+ LPCWSTR pName,
+ IBaseFilter** ppFilter);
+
+ HRESULT (STDMETHODCALLTYPE *ConnectDirect)(
+ IFilterGraph* This,
+ IPin* ppinOut,
+ IPin* ppinIn,
+ const AM_MEDIA_TYPE* pmt);
+
+ HRESULT (STDMETHODCALLTYPE *Reconnect)(
+ IFilterGraph* This,
+ IPin* ppin);
+
+ HRESULT (STDMETHODCALLTYPE *Disconnect)(
+ IFilterGraph* This,
+ IPin* ppin);
+
+ HRESULT (STDMETHODCALLTYPE *SetDefaultSyncSource)(
+ IFilterGraph* This);
+
+ END_INTERFACE
+};
+
+#ifdef COBJMACROS
+/*** IUnknown methods ***/
+#define IFilterGraph_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IFilterGraph_AddRef(p) (p)->lpVtbl->AddRef(p)
+#define IFilterGraph_Release(p) (p)->lpVtbl->Release(p)
+/*** IFilterGraph methods ***/
+#define IFilterGraph_AddFilter(p,a,b) (p)->lpVtbl->AddFilter(p,a,b)
+#define IFilterGraph_RemoveFilter(p,a) (p)->lpVtbl->RemoveFilter(p,a)
+#define IFilterGraph_EnumFilters(p,a) (p)->lpVtbl->EnumFilters(p,a)
+#define IFilterGraph_FindFilterByName(p,a,b) (p)->lpVtbl->FindFilterByName(p,a,b)
+#define IFilterGraph_ConnectDirect(p,a,b,c) (p)->lpVtbl->ConnectDirect(p,a,b,c)
+#define IFilterGraph_Reconnect(p,a) (p)->lpVtbl->Reconnect(p,a)
+#define IFilterGraph_Disconnect(p,a) (p)->lpVtbl->Disconnect(p,a)
+#define IFilterGraph_SetDefaultSyncSource(p) (p)->lpVtbl->SetDefaultSyncSource(p)
+#endif
+
+#endif
+
+#define IFilterGraph_METHODS \
+ /*** IUnknown methods ***/ \
+ STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; \
+ STDMETHOD_(ULONG,AddRef)(THIS) PURE; \
+ STDMETHOD_(ULONG,Release)(THIS) PURE; \
+ /*** IFilterGraph methods ***/ \
+ STDMETHOD_(HRESULT,AddFilter)(THIS_ IBaseFilter* pFilter, LPCWSTR pName) PURE; \
+ STDMETHOD_(HRESULT,RemoveFilter)(THIS_ IBaseFilter* pFilter) PURE; \
+ STDMETHOD_(HRESULT,EnumFilters)(THIS_ IEnumFilters** ppEnum) PURE; \
+ STDMETHOD_(HRESULT,FindFilterByName)(THIS_ LPCWSTR pName, IBaseFilter** ppFilter) PURE; \
+ STDMETHOD_(HRESULT,ConnectDirect)(THIS_ IPin* ppinOut, IPin* ppinIn, const AM_MEDIA_TYPE* pmt) PURE; \
+ STDMETHOD_(HRESULT,Reconnect)(THIS_ IPin* ppin) PURE; \
+ STDMETHOD_(HRESULT,Disconnect)(THIS_ IPin* ppin) PURE; \
+ STDMETHOD_(HRESULT,SetDefaultSyncSource)(THIS) PURE;
+
+HRESULT CALLBACK IFilterGraph_AddFilter_Proxy(
+ IFilterGraph* This,
+ IBaseFilter* pFilter,
+ LPCWSTR pName);
+void __RPC_STUB IFilterGraph_AddFilter_Stub(
+ struct IRpcStubBuffer* This,
+ struct IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT CALLBACK IFilterGraph_RemoveFilter_Proxy(
+ IFilterGraph* This,
+ IBaseFilter* pFilter);
+void __RPC_STUB IFilterGraph_RemoveFilter_Stub(
+ struct IRpcStubBuffer* This,
+ struct IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT CALLBACK IFilterGraph_EnumFilters_Proxy(
+ IFilterGraph* This,
+ IEnumFilters** ppEnum);
+void __RPC_STUB IFilterGraph_EnumFilters_Stub(
+ struct IRpcStubBuffer* This,
+ struct IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT CALLBACK IFilterGraph_FindFilterByName_Proxy(
+ IFilterGraph* This,
+ LPCWSTR pName,
+ IBaseFilter** ppFilter);
+void __RPC_STUB IFilterGraph_FindFilterByName_Stub(
+ struct IRpcStubBuffer* This,
+ struct IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT CALLBACK IFilterGraph_ConnectDirect_Proxy(
+ IFilterGraph* This,
+ IPin* ppinOut,
+ IPin* ppinIn,
+ const AM_MEDIA_TYPE* pmt);
+void __RPC_STUB IFilterGraph_ConnectDirect_Stub(
+ struct IRpcStubBuffer* This,
+ struct IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT CALLBACK IFilterGraph_Reconnect_Proxy(
+ IFilterGraph* This,
+ IPin* ppin);
+void __RPC_STUB IFilterGraph_Reconnect_Stub(
+ struct IRpcStubBuffer* This,
+ struct IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT CALLBACK IFilterGraph_Disconnect_Proxy(
+ IFilterGraph* This,
+ IPin* ppin);
+void __RPC_STUB IFilterGraph_Disconnect_Stub(
+ struct IRpcStubBuffer* This,
+ struct IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT CALLBACK IFilterGraph_SetDefaultSyncSource_Proxy(
+ IFilterGraph* This);
+void __RPC_STUB IFilterGraph_SetDefaultSyncSource_Stub(
+ struct IRpcStubBuffer* This,
+ struct IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+
+#endif /* __IFilterGraph_INTERFACE_DEFINED__ */
+
+typedef IFilterGraph *PFILTERGRAPH;
+
+/*****************************************************************************
+ * IEnumFilters interface
+ */
+#ifndef __IEnumFilters_INTERFACE_DEFINED__
+#define __IEnumFilters_INTERFACE_DEFINED__
+
[truncated at 1000 lines; 6973 more skipped]
reactos/include
diff -N uuids.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ uuids.h 30 Dec 2004 04:36:25 -0000 1.1.2.1
@@ -0,0 +1,275 @@
+/*
+ * Copyright (C) 2002 Alexandre Julliard
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef OUR_GUID_ENTRY
+#define OUR_GUID_ENTRY(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
+ DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8);
+#endif
+
+#define MEDIATYPE_NULL GUID_NULL
+#define MEDIASUBTYPE_NULL GUID_NULL
+
+OUR_GUID_ENTRY(MEDIASUBTYPE_None, 0xe436eb8e, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70)
+OUR_GUID_ENTRY(MEDIATYPE_Video, 0x73646976, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
+OUR_GUID_ENTRY(MEDIATYPE_Audio, 0x73647561, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
+OUR_GUID_ENTRY(MEDIATYPE_Text, 0x73747874, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
+OUR_GUID_ENTRY(MEDIATYPE_Midi, 0x7364696d, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
+OUR_GUID_ENTRY(MEDIATYPE_Stream, 0xe436eb83, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70)
+OUR_GUID_ENTRY(MEDIATYPE_Interleaved, 0x73766169, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
+OUR_GUID_ENTRY(MEDIATYPE_File, 0x656c6966, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
+OUR_GUID_ENTRY(MEDIATYPE_ScriptCommand, 0x73636d64, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
+OUR_GUID_ENTRY(MEDIATYPE_AUXLine21Data, 0x670aea80, 0x3a82, 0x11d0, 0xb7, 0x9b, 0x00, 0xaa, 0x00, 0x37, 0x67, 0xa7)
+OUR_GUID_ENTRY(MEDIATYPE_Timecode, 0x0482dee3, 0x7817, 0x11cf, 0x8a, 0x03, 0x00, 0xaa, 0x00, 0x6e, 0xcb, 0x65)
+OUR_GUID_ENTRY(MEDIATYPE_LMRT, 0x74726c6d, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
+OUR_GUID_ENTRY(MEDIATYPE_URL_STREAM, 0x736c7275, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
+OUR_GUID_ENTRY(MEDIASUBTYPE_YVU9, 0x39555659, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
+OUR_GUID_ENTRY(MEDIASUBTYPE_Y411, 0x31313459, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
+OUR_GUID_ENTRY(MEDIASUBTYPE_Y41P, 0x50313459, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
+OUR_GUID_ENTRY(MEDIASUBTYPE_YUY2, 0x32595559, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
+OUR_GUID_ENTRY(MEDIASUBTYPE_YVYU, 0x55595659, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
+OUR_GUID_ENTRY(MEDIASUBTYPE_UYVY, 0x59565955, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
+OUR_GUID_ENTRY(MEDIASUBTYPE_Y211, 0x31313259, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
+OUR_GUID_ENTRY(MEDIASUBTYPE_YV12, 0x32315659, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
+OUR_GUID_ENTRY(MEDIASUBTYPE_CLJR, 0x524a4c43, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
+OUR_GUID_ENTRY(MEDIASUBTYPE_IF09, 0x39304649, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
+OUR_GUID_ENTRY(MEDIASUBTYPE_CPLA, 0x414c5043, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
+OUR_GUID_ENTRY(MEDIASUBTYPE_MJPG, 0x47504a4d, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
+OUR_GUID_ENTRY(MEDIASUBTYPE_TVMJ, 0x4a4d5654, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
+OUR_GUID_ENTRY(MEDIASUBTYPE_WAKE, 0x454b4157, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
+OUR_GUID_ENTRY(MEDIASUBTYPE_CFCC, 0x43434643, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
+OUR_GUID_ENTRY(MEDIASUBTYPE_IJPG, 0x47504a49, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
+OUR_GUID_ENTRY(MEDIASUBTYPE_Plum, 0x6d756c50, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
+OUR_GUID_ENTRY(MEDIASUBTYPE_DVCS, 0x53435644, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
+OUR_GUID_ENTRY(MEDIASUBTYPE_DVSD, 0x44535644, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
+OUR_GUID_ENTRY(MEDIASUBTYPE_MDVF, 0x4656444d, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
+OUR_GUID_ENTRY(MEDIASUBTYPE_RGB1, 0xe436eb78, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70)
+OUR_GUID_ENTRY(MEDIASUBTYPE_RGB4, 0xe436eb79, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70)
+OUR_GUID_ENTRY(MEDIASUBTYPE_RGB8, 0xe436eb7a, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70)
+OUR_GUID_ENTRY(MEDIASUBTYPE_RGB565, 0xe436eb7b, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70)
+OUR_GUID_ENTRY(MEDIASUBTYPE_RGB555, 0xe436eb7c, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70)
+OUR_GUID_ENTRY(MEDIASUBTYPE_RGB24, 0xe436eb7d, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70)
+OUR_GUID_ENTRY(MEDIASUBTYPE_RGB32, 0xe436eb7e, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70)
+OUR_GUID_ENTRY(MEDIASUBTYPE_Overlay, 0xe436eb7f, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70)
+OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG1Packet, 0xe436eb80, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70)
+OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG1Payload, 0xe436eb81, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70)
+OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG1AudioPayload, 0x00000050, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
+OUR_GUID_ENTRY(MEDIATYPE_MPEG1SystemStream, 0xe436eb82, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70)
+OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG1System, 0xe436eb84, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70)
+OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG1VideoCD, 0xe436eb85, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70)
+OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG1Video, 0xe436eb86, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70)
+OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG1Audio, 0xe436eb87, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70)
+OUR_GUID_ENTRY(MEDIASUBTYPE_Avi, 0xe436eb88, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70)
+OUR_GUID_ENTRY(MEDIASUBTYPE_Asf, 0x3db80f90, 0x9412, 0x11d1, 0xad, 0xed, 0x00, 0x00, 0xf8, 0x75, 0x4b, 0x99)
+OUR_GUID_ENTRY(MEDIASUBTYPE_QTMovie, 0xe436eb89, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70)
+OUR_GUID_ENTRY(MEDIASUBTYPE_QTRpza, 0x617a7072, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
+OUR_GUID_ENTRY(MEDIASUBTYPE_QTSmc, 0x20636d73, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
+OUR_GUID_ENTRY(MEDIASUBTYPE_QTRle, 0x20656c72, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
+OUR_GUID_ENTRY(MEDIASUBTYPE_QTJpeg, 0x6765706a, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
+OUR_GUID_ENTRY(MEDIASUBTYPE_PCMAudio_Obsolete, 0xe436eb8a, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70)
+OUR_GUID_ENTRY(MEDIASUBTYPE_PCM, 0x00000001, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
+OUR_GUID_ENTRY(MEDIASUBTYPE_WAVE, 0xe436eb8b, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70)
+OUR_GUID_ENTRY(MEDIASUBTYPE_AU, 0xe436eb8c, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70)
+OUR_GUID_ENTRY(MEDIASUBTYPE_AIFF, 0xe436eb8d, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70)
+OUR_GUID_ENTRY(MEDIASUBTYPE_dvsd, 0x64737664, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
+OUR_GUID_ENTRY(MEDIASUBTYPE_dvhd, 0x64687664, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
+OUR_GUID_ENTRY(MEDIASUBTYPE_dvsl, 0x6c737664, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
+OUR_GUID_ENTRY(MEDIASUBTYPE_Line21_BytePair, 0x6e8d4a22, 0x310c, 0x11d0, 0xb7, 0x9a, 0x00, 0xaa, 0x00, 0x37, 0x67, 0xa7)
+OUR_GUID_ENTRY(MEDIASUBTYPE_Line21_GOPPacket, 0x6e8d4a23, 0x310c, 0x11d0, 0xb7, 0x9a, 0x00, 0xaa, 0x00, 0x37, 0x67, 0xa7)
+OUR_GUID_ENTRY(MEDIASUBTYPE_Line21_VBIRawData, 0x6e8d4a24, 0x310c, 0x11d0, 0xb7, 0x9a, 0x00, 0xaa, 0x00, 0x37, 0x67, 0xa7)
+OUR_GUID_ENTRY(MEDIASUBTYPE_DssVideo, 0xa0af4f81, 0xe163, 0x11d0, 0xba, 0xd9, 0x00, 0x60, 0x97, 0x44, 0x11, 0x1a)
+OUR_GUID_ENTRY(MEDIASUBTYPE_DssAudio, 0xa0af4f82, 0xe163, 0x11d0, 0xba, 0xd9, 0x00, 0x60, 0x97, 0x44, 0x11, 0x1a)
+OUR_GUID_ENTRY(MEDIASUBTYPE_VPVideo, 0x5a9b6a40, 0x1a22, 0x11d1, 0xba, 0xd9, 0x00, 0x60, 0x97, 0x44, 0x11, 0x1a)
+OUR_GUID_ENTRY(MEDIASUBTYPE_VPVBI, 0x5a9b6a41, 0x1a22, 0x11d1, 0xba, 0xd9, 0x00, 0x60, 0x97, 0x44, 0x11, 0x1a)
+OUR_GUID_ENTRY(IID_IAMCutListElement, 0xcde29520, 0x3418, 0x11cf, 0xa5, 0xb0, 0x00, 0x20, 0xaf, 0x05, 0x3d, 0x8f)
+OUR_GUID_ENTRY(IID_IAMFileCutListElement, 0xf0947070, 0x276c, 0x11d0, 0x83, 0x16, 0x00, 0x20, 0xaf, 0x11, 0xc0, 0x10)
+OUR_GUID_ENTRY(IID_IAMVideoCutListElement, 0xcde29522, 0x3418, 0x11cf, 0xa5, 0xb0, 0x00, 0x20, 0xaf, 0x05, 0x3d, 0x8f)
+OUR_GUID_ENTRY(IID_IAMAudioCutListElement, 0xcde29524, 0x3418, 0x11cf, 0xa5, 0xb0, 0x00, 0x20, 0xaf, 0x05, 0x3d, 0x8f)
+OUR_GUID_ENTRY(CLSID_CutListSource, 0xa5ea8d20, 0x253d, 0x11d1, 0xb3, 0xf1, 0x00, 0xaa, 0x00, 0x37, 0x61, 0xc5)
+OUR_GUID_ENTRY(IID_IStandardCutList, 0xa5ea8d29, 0x253d, 0x11d1, 0xb3, 0xf1, 0x00, 0xaa, 0x00, 0x37, 0x61, 0xc5)
+OUR_GUID_ENTRY(IID_IFileClip, 0xa5ea8d2a, 0x253d, 0x11d1, 0xb3, 0xf1, 0x00, 0xaa, 0x00, 0x37, 0x61, 0xc5)
+OUR_GUID_ENTRY(IID_ICutListGraphBuilder, 0xa5ea8d2c, 0x253d, 0x11d1, 0xb3, 0xf1, 0x00, 0xaa, 0x00, 0x37, 0x61, 0xc5)
+OUR_GUID_ENTRY(CLSID_CutListGraphBuilder, 0xa5ea8d2f, 0x253d, 0x11d1, 0xb3, 0xf1, 0x00, 0xaa, 0x00, 0x37, 0x61, 0xc5)
+OUR_GUID_ENTRY(CLSID_SimpleCutList, 0xa5ea8d30, 0x253d, 0x11d1, 0xb3, 0xf1, 0x00, 0xaa, 0x00, 0x37, 0x61, 0xc5)
+OUR_GUID_ENTRY(CLSID_VideoFileClip, 0xa5ea8d31, 0x253d, 0x11d1, 0xb3, 0xf1, 0x00, 0xaa, 0x00, 0x37, 0x61, 0xc5)
+OUR_GUID_ENTRY(CLSID_AudioFileClip, 0xa5ea8d32, 0x253d, 0x11d1, 0xb3, 0xf1, 0x00, 0xaa, 0x00, 0x37, 0x61, 0xc5)
+OUR_GUID_ENTRY(CLSID_CutListCacheMemory, 0xa5ea8d33, 0x253d, 0x11d1, 0xb3, 0xf1, 0x00, 0xaa, 0x00, 0x37, 0x61, 0xc5)
+OUR_GUID_ENTRY(CLSID_CaptureGraphBuilder, 0xbf87b6e0, 0x8c27, 0x11d0, 0xb3, 0xf0, 0x00, 0xaa, 0x00, 0x37, 0x61, 0xc5)
+OUR_GUID_ENTRY(CLSID_CaptureGraphBuilder2, 0xbf87b6e1, 0x8c27, 0x11d0, 0xb3, 0xf0, 0x00, 0xaa, 0x00, 0x37, 0x61, 0xc5)
+OUR_GUID_ENTRY(CLSID_ProtoFilterGraph, 0xe436ebb0, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70)
+OUR_GUID_ENTRY(CLSID_SystemClock, 0xe436ebb1, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70)
+OUR_GUID_ENTRY(CLSID_FilterMapper, 0xe436ebb2, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70)
+OUR_GUID_ENTRY(CLSID_FilterGraph, 0xe436ebb3, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70)
+OUR_GUID_ENTRY(CLSID_FilterGraphNoThread, 0xe436ebb8, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70)
+OUR_GUID_ENTRY(CLSID_MPEG1Doc, 0xe4bbd160, 0x4269, 0x11ce, 0x83, 0x8d, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a)
+OUR_GUID_ENTRY(CLSID_FileSource, 0x701722e0, 0x8ae3, 0x11ce, 0xa8, 0x5c, 0x00, 0xaa, 0x00, 0x2f, 0xea, 0xb5)
+OUR_GUID_ENTRY(CLSID_MPEG1PacketPlayer, 0x26c25940, 0x4ca9, 0x11ce, 0xa8, 0x28, 0x00, 0xaa, 0x00, 0x2f, 0xea, 0xb5)
+OUR_GUID_ENTRY(CLSID_MPEG1Splitter, 0x336475d0, 0x942a, 0x11ce, 0xa8, 0x70, 0x00, 0xaa, 0x00, 0x2f, 0xea, 0xb5)
+OUR_GUID_ENTRY(CLSID_CMpegVideoCodec, 0xfeb50740, 0x7bef, 0x11ce, 0x9b, 0xd9, 0x00, 0x00, 0xe2, 0x02, 0x59, 0x9c)
+OUR_GUID_ENTRY(CLSID_CMpegAudioCodec, 0x4a2286e0, 0x7bef, 0x11ce, 0x9b, 0xd9, 0x00, 0x00, 0xe2, 0x02, 0x59, 0x9c)
+OUR_GUID_ENTRY(CLSID_TextRender, 0xe30629d3, 0x27e5, 0x11ce, 0x87, 0x5d, 0x00, 0x60, 0x8c, 0xb7, 0x80, 0x66)
+OUR_GUID_ENTRY(CLSID_InfTee, 0xf8388a40, 0xd5bb, 0x11d0, 0xbe, 0x5a, 0x00, 0x80, 0xc7, 0x06, 0x56, 0x8e)
+OUR_GUID_ENTRY(CLSID_AviSplitter, 0x1b544c20, 0xfd0b, 0x11ce, 0x8c, 0x63, 0x00, 0xaa, 0x00, 0x44, 0xb5, 0x1e)
+OUR_GUID_ENTRY(CLSID_AviReader, 0x1b544c21, 0xfd0b, 0x11ce, 0x8c, 0x63, 0x00, 0xaa, 0x00, 0x44, 0xb5, 0x1e)
+OUR_GUID_ENTRY(CLSID_VfwCapture, 0x1b544c22, 0xfd0b, 0x11ce, 0x8c, 0x63, 0x00, 0xaa, 0x00, 0x44, 0xb5, 0x1e)
+OUR_GUID_ENTRY(CLSID_CaptureProperties, 0x1b544c22, 0xfd0b, 0x11ce, 0x8c, 0x63, 0x00, 0xaa, 0x00, 0x44, 0xb5, 0x1f)
+OUR_GUID_ENTRY(CLSID_FGControl, 0xe436ebb4, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70)
+OUR_GUID_ENTRY(CLSID_MOVReader, 0x44584800, 0xf8ee, 0x11ce, 0xb2, 0xd4, 0x00, 0xdd, 0x01, 0x10, 0x1b, 0x85)
+OUR_GUID_ENTRY(CLSID_QuickTimeParser, 0xd51bd5a0, 0x7548, 0x11cf, 0xa5, 0x20, 0x00, 0x80, 0xc7, 0x7e, 0xf5, 0x8a)
+OUR_GUID_ENTRY(CLSID_QTDec, 0xfdfe9681, 0x74a3, 0x11d0, 0xaf, 0xa7, 0x00, 0xaa, 0x00, 0xb6, 0x7a, 0x42)
+OUR_GUID_ENTRY(CLSID_AVIDoc, 0xd3588ab0, 0x0781, 0x11ce, 0xb0, 0x3a, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70)
+OUR_GUID_ENTRY(CLSID_AVIDocWriter, 0xd3588ab1, 0x0781, 0x11ce, 0xb0, 0x3a, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70)
+OUR_GUID_ENTRY(CLSID_VideoRenderer, 0x70e102b0, 0x5556, 0x11ce, 0x97, 0xc0, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a)
+OUR_GUID_ENTRY(CLSID_Colour, 0x1643e180, 0x90f5, 0x11ce, 0x97, 0xd5, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a)
+OUR_GUID_ENTRY(CLSID_Dither, 0x1da08500, 0x9edc, 0x11cf, 0xbc, 0x10, 0x00, 0xaa, 0x00, 0xac, 0x74, 0xf6)
+OUR_GUID_ENTRY(CLSID_ModexRenderer, 0x07167665, 0x5011, 0x11cf, 0xbf, 0x33, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a)
+OUR_GUID_ENTRY(CLSID_AudioRender, 0xe30629d1, 0x27e5, 0x11ce, 0x87, 0x5d, 0x00, 0x60, 0x8c, 0xb7, 0x80, 0x66)
+OUR_GUID_ENTRY(CLSID_AudioProperties, 0x05589faf, 0xc356, 0x11ce, 0xbf, 0x01, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a)
+OUR_GUID_ENTRY(CLSID_DSoundRender, 0x79376820, 0x07d0, 0x11cf, 0xa2, 0x4d, 0x00, 0x20, 0xaf, 0xd7, 0x97, 0x67)
+OUR_GUID_ENTRY(CLSID_AudioRecord, 0xe30629d2, 0x27e5, 0x11ce, 0x87, 0x5d, 0x00, 0x60, 0x8c, 0xb7, 0x80, 0x66)
+OUR_GUID_ENTRY(CLSID_AudioInputMixerProperties, 0x2ca8ca52, 0x3c3f, 0x11d2, 0xb7, 0x3d, 0x00, 0xc0, 0x4f, 0xb6, 0xbd, 0x3d)
+OUR_GUID_ENTRY(CLSID_AVIDec, 0xcf49d4e0, 0x1115, 0x11ce, 0xb0, 0x3a, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70)
+OUR_GUID_ENTRY(CLSID_AVIDraw, 0xa888df60, 0x1e90, 0x11cf, 0xac, 0x98, 0x00, 0xaa, 0x00, 0x4c, 0x0f, 0xa9)
+OUR_GUID_ENTRY(CLSID_ACMWrapper, 0x6a08cf80, 0x0e18, 0x11cf, 0xa2, 0x4d, 0x00, 0x20, 0xaf, 0xd7, 0x97, 0x67)
+OUR_GUID_ENTRY(CLSID_AsyncReader, 0xe436ebb5, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70)
+OUR_GUID_ENTRY(CLSID_URLReader, 0xe436ebb6, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70)
+OUR_GUID_ENTRY(CLSID_PersistMonikerPID, 0xe436ebb7, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70)
+OUR_GUID_ENTRY(CLSID_AMovie, 0x5f2759c0, 0x7685, 0x11cf, 0x8b, 0x23, 0x00, 0x80, 0x5f, 0x6c, 0xef, 0x60)
+OUR_GUID_ENTRY(CLSID_AVICo, 0xd76e2820, 0x1563, 0x11cf, 0xac, 0x98, 0x00, 0xaa, 0x00, 0x4c, 0x0f, 0xa9)
+OUR_GUID_ENTRY(CLSID_FileWriter, 0x8596e5f0, 0x0da5, 0x11d0, 0xbd, 0x21, 0x00, 0xa0, 0xc9, 0x11, 0xce, 0x86)
+OUR_GUID_ENTRY(CLSID_AviDest, 0xe2510970, 0xf137, 0x11ce, 0x8b, 0x67, 0x00, 0xaa, 0x00, 0xa3, 0xf1, 0xa6)
+OUR_GUID_ENTRY(CLSID_AsfMux, 0xf560ae42, 0x6cdd, 0x11d1, 0xad, 0xe2, 0x00, 0x00, 0xf8, 0x75, 0x4b, 0x99)
+OUR_GUID_ENTRY(CLSID_AviMuxProptyPage, 0xc647b5c0, 0x157c, 0x11d0, 0xbd, 0x23, 0x00, 0xa0, 0xc9, 0x11, 0xce, 0x86)
+OUR_GUID_ENTRY(CLSID_AviMuxProptyPage1, 0x0a9ae910, 0x85c0, 0x11d0, 0xbd, 0x42, 0x00, 0xa0, 0xc9, 0x11, 0xce, 0x86)
+OUR_GUID_ENTRY(CLSID_AVIMIDIRender, 0x07b65360, 0xc445, 0x11ce, 0xaf, 0xde, 0x00, 0xaa, 0x00, 0x6c, 0x14, 0xf4)
+OUR_GUID_ENTRY(CLSID_DVVideoCodec, 0xb1b77c00, 0xc3e4, 0x11cf, 0xaf, 0x79, 0x00, 0xaa, 0x00, 0xb6, 0x7a, 0x42)
+OUR_GUID_ENTRY(CLSID_DVVideoEnc, 0x13aa3650, 0xbb6f, 0x11d0, 0xaf, 0xb9, 0x00, 0xaa, 0x00, 0xb6, 0x7a, 0x42)
+OUR_GUID_ENTRY(CLSID_DVSplitter, 0x4eb31670, 0x9fc6, 0x11cf, 0xaf, 0x6e, 0x00, 0xaa, 0x00, 0xb6, 0x7a, 0x42)
+OUR_GUID_ENTRY(CLSID_DVMux, 0x129d7e40, 0xc10d, 0x11d0, 0xaf, 0xb9, 0x00, 0xaa, 0x00, 0xb6, 0x7a, 0x42)
+OUR_GUID_ENTRY(CLSID_SeekingPassThru, 0x060af76c, 0x68dd, 0x11d0, 0x8f, 0xc1, 0x00, 0xc0, 0x4f, 0xd9, 0x18, 0x9d)
+OUR_GUID_ENTRY(CLSID_Line21Decoder, 0x6e8d4a20, 0x310c, 0x11d0, 0xb7, 0x9a, 0x00, 0xaa, 0x00, 0x37, 0x67, 0xa7)
+OUR_GUID_ENTRY(CLSID_OverlayMixer, 0xcd8743a1, 0x3736, 0x11d0, 0x9e, 0x69, 0x00, 0xc0, 0x4f, 0xd7, 0xc1, 0x5b)
+OUR_GUID_ENTRY(CLSID_VBISurfaces, 0x814b9800, 0x1c88, 0x11d1, 0xba, 0xd9, 0x00, 0x60, 0x97, 0x44, 0x11, 0x1a)
+OUR_GUID_ENTRY(CLSID_SystemDeviceEnum, 0x62be5d10, 0x60eb, 0x11d0, 0xbd, 0x3b, 0x00, 0xa0, 0xc9, 0x11, 0xce, 0x86)
+OUR_GUID_ENTRY(CLSID_CDeviceMoniker, 0x4315d437, 0x5b8c, 0x11d0, 0xbd, 0x3b, 0x00, 0xa0, 0xc9, 0x11, 0xce, 0x86)
+OUR_GUID_ENTRY(CLSID_VideoInputDeviceCategory, 0x860bb310, 0x5d01, 0x11d0, 0xbd, 0x3b, 0x00, 0xa0, 0xc9, 0x11, 0xce, 0x86)
+OUR_GUID_ENTRY(CLSID_CVidCapClassManager, 0x860bb310, 0x5d01, 0x11d0, 0xbd, 0x3b, 0x00, 0xa0, 0xc9, 0x11, 0xce, 0x86)
+OUR_GUID_ENTRY(CLSID_LegacyAmFilterCategory, 0x083863f1, 0x70de, 0x11d0, 0xbd, 0x40, 0x00, 0xa0, 0xc9, 0x11, 0xce, 0x86)
+OUR_GUID_ENTRY(CLSID_CQzFilterClassManager, 0x083863f1, 0x70de, 0x11d0, 0xbd, 0x40, 0x00, 0xa0, 0xc9, 0x11, 0xce, 0x86)
+OUR_GUID_ENTRY(CLSID_VideoCompressorCategory, 0x33d9a760, 0x90c8, 0x11d0, 0xbd, 0x43, 0x00, 0xa0, 0xc9, 0x11, 0xce, 0x86)
+OUR_GUID_ENTRY(CLSID_CIcmCoClassManager, 0x33d9a760, 0x90c8, 0x11d0, 0xbd, 0x43, 0x00, 0xa0, 0xc9, 0x11, 0xce, 0x86)
+OUR_GUID_ENTRY(CLSID_AudioCompressorCategory, 0x33d9a761, 0x90c8, 0x11d0, 0xbd, 0x43, 0x00, 0xa0, 0xc9, 0x11, 0xce, 0x86)
+OUR_GUID_ENTRY(CLSID_CAcmCoClassManager, 0x33d9a761, 0x90c8, 0x11d0, 0xbd, 0x43, 0x00, 0xa0, 0xc9, 0x11, 0xce, 0x86)
+OUR_GUID_ENTRY(CLSID_AudioInputDeviceCategory, 0x33d9a762, 0x90c8, 0x11d0, 0xbd, 0x43, 0x00, 0xa0, 0xc9, 0x11, 0xce, 0x86)
+OUR_GUID_ENTRY(CLSID_CWaveinClassManager, 0x33d9a762, 0x90c8, 0x11d0, 0xbd, 0x43, 0x00, 0xa0, 0xc9, 0x11, 0xce, 0x86)
+OUR_GUID_ENTRY(CLSID_AudioRendererCategory, 0xe0f158e1, 0xcb04, 0x11d0, 0xbd, 0x4e, 0x00, 0xa0, 0xc9, 0x11, 0xce, 0x86)
+OUR_GUID_ENTRY(CLSID_CWaveOutClassManager, 0xe0f158e1, 0xcb04, 0x11d0, 0xbd, 0x4e, 0x00, 0xa0, 0xc9, 0x11, 0xce, 0x86)
+OUR_GUID_ENTRY(CLSID_MidiRendererCategory, 0x4efe2452, 0x168a, 0x11d1, 0xbc, 0x76, 0x00, 0xc0, 0x4f, 0xb9, 0x45, 0x3b)
+OUR_GUID_ENTRY(CLSID_CMidiOutClassManager, 0x4efe2452, 0x168a, 0x11d1, 0xbc, 0x76, 0x00, 0xc0, 0x4f, 0xb9, 0x45, 0x3b)
+OUR_GUID_ENTRY(CLSID_TransmitCategory, 0xcc7bfb41, 0xf175, 0x11d1, 0xa3, 0x92, 0x00, 0xe0, 0x29, 0x1f, 0x39, 0x59)
+OUR_GUID_ENTRY(CLSID_DeviceControlCategory, 0xcc7bfb46, 0xf175, 0x11d1, 0xa3, 0x92, 0x00, 0xe0, 0x29, 0x1f, 0x39, 0x59)
+OUR_GUID_ENTRY(CLSID_ActiveMovieCategories, 0xda4e3da0, 0xd07d, 0x11d0, 0xbd, 0x50, 0x00, 0xa0, 0xc9, 0x11, 0xce, 0x86)
+OUR_GUID_ENTRY(CLSID_DVDHWDecodersCategory, 0x2721ae20, 0x7e70, 0x11d0, 0xa5, 0xd6, 0x28, 0xdb, 0x04, 0xc1, 0x00, 0x00)
+OUR_GUID_ENTRY(CLSID_FilterMapper2, 0xcda42200, 0xbd88, 0x11d0, 0xbd, 0x4e, 0x00, 0xa0, 0xc9, 0x11, 0xce, 0x86)
+OUR_GUID_ENTRY(CLSID_MemoryAllocator, 0x1e651cc0, 0xb199, 0x11d0, 0x82, 0x12, 0x00, 0xc0, 0x4f, 0xc3, 0x2c, 0x45)
+OUR_GUID_ENTRY(CLSID_MediaPropertyBag, 0xcdbd8d00, 0xc193, 0x11d0, 0xbd, 0x4e, 0x00, 0xa0, 0xc9, 0x11, 0xce, 0x86)
+OUR_GUID_ENTRY(CLSID_DvdGraphBuilder, 0xfcc152b7, 0xf372, 0x11d0, 0x8e, 0x00, 0x00, 0xc0, 0x4f, 0xd7, 0xc0, 0x8b)
+OUR_GUID_ENTRY(CLSID_DVDNavigator, 0x9b8c4620, 0x2c1a, 0x11d0, 0x84, 0x93, 0x00, 0xa0, 0x24, 0x38, 0xad, 0x48)
+OUR_GUID_ENTRY(CLSID_SmartTee, 0xcc58e280, 0x8aa1, 0x11d1, 0xb3, 0xf1, 0x00, 0xaa, 0x00, 0x37, 0x61, 0xc5)
+OUR_GUID_ENTRY(FORMAT_None, 0x0f6417d6, 0xc318, 0x11d0, 0xa4, 0x3f, 0x00, 0xa0, 0xc9, 0x22, 0x31, 0x96)
+OUR_GUID_ENTRY(FORMAT_VideoInfo, 0x05589f80, 0xc356, 0x11ce, 0xbf, 0x01, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a)
+OUR_GUID_ENTRY(FORMAT_VideoInfo2, 0xf72a76a0, 0xeb0a, 0x11d0, 0xac, 0xe4, 0x00, 0x00, 0xc0, 0xcc, 0x16, 0xba)
+OUR_GUID_ENTRY(FORMAT_WaveFormatEx, 0x05589f81, 0xc356, 0x11ce, 0xbf, 0x01, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a)
+OUR_GUID_ENTRY(FORMAT_MPEGVideo, 0x05589f82, 0xc356, 0x11ce, 0xbf, 0x01, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a)
+OUR_GUID_ENTRY(FORMAT_MPEGStreams, 0x05589f83, 0xc356, 0x11ce, 0xbf, 0x01, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a)
+OUR_GUID_ENTRY(FORMAT_DvInfo, 0x05589f84, 0xc356, 0x11ce, 0xbf, 0x01, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a)
+OUR_GUID_ENTRY(CLSID_DirectDrawProperties, 0x944d4c00, 0xdd52, 0x11ce, 0xbf, 0x0e, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a)
+OUR_GUID_ENTRY(CLSID_PerformanceProperties, 0x59ce6880, 0xacf8, 0x11cf, 0xb5, 0x6e, 0x00, 0x80, 0xc7, 0xc4, 0xb6, 0x8a)
+OUR_GUID_ENTRY(CLSID_QualityProperties, 0x418afb70, 0xf8b8, 0x11ce, 0xaa, 0xc6, 0x00, 0x20, 0xaf, 0x0b, 0x99, 0xa3)
+OUR_GUID_ENTRY(IID_IBaseVideoMixer, 0x61ded640, 0xe912, 0x11ce, 0xa0, 0x99, 0x00, 0xaa, 0x00, 0x47, 0x9a, 0x58)
+OUR_GUID_ENTRY(IID_IDirectDrawVideo, 0x36d39eb0, 0xdd75, 0x11ce, 0xbf, 0x0e, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a)
+OUR_GUID_ENTRY(IID_IQualProp, 0x1bd0ecb0, 0xf8e2, 0x11ce, 0xaa, 0xc6, 0x00, 0x20, 0xaf, 0x0b, 0x99, 0xa3)
+OUR_GUID_ENTRY(CLSID_VPObject, 0xce292861, 0xfc88, 0x11d0, 0x9e, 0x69, 0x00, 0xc0, 0x4f, 0xd7, 0xc1, 0x5b)
+OUR_GUID_ENTRY(IID_IVPObject, 0xce292862, 0xfc88, 0x11d0, 0x9e, 0x69, 0x00, 0xc0, 0x4f, 0xd7, 0xc1, 0x5b)
+OUR_GUID_ENTRY(IID_IVPControl, 0x25df12c1, 0x3de0, 0x11d1, 0x9e, 0x69, 0x00, 0xc0, 0x4f, 0xd7, 0xc1, 0x5b)
+OUR_GUID_ENTRY(CLSID_VPVBIObject, 0x814b9801, 0x1c88, 0x11d1, 0xba, 0xd9, 0x00, 0x60, 0x97, 0x44, 0x11, 0x1a)
+OUR_GUID_ENTRY(IID_IVPVBIObject, 0x814b9802, 0x1c88, 0x11d1, 0xba, 0xd9, 0x00, 0x60, 0x97, 0x44, 0x11, 0x1a)
+OUR_GUID_ENTRY(IID_IVPConfig, 0xbc29a660, 0x30e3, 0x11d0, 0x9e, 0x69, 0x00, 0xc0, 0x4f, 0xd7, 0xc1, 0x5b)
+OUR_GUID_ENTRY(IID_IVPNotify, 0xc76794a1, 0xd6c5, 0x11d0, 0x9e, 0x69, 0x00, 0xc0, 0x4f, 0xd7, 0xc1, 0x5b)
+OUR_GUID_ENTRY(IID_IVPNotify2, 0xebf47183, 0x8764, 0x11d1, 0x9e, 0x69, 0x00, 0xc0, 0x4f, 0xd7, 0xc1, 0x5b)
+OUR_GUID_ENTRY(IID_IVPVBIConfig, 0xec529b00, 0x1a1f, 0x11d1, 0xba, 0xd9, 0x00, 0x60, 0x97, 0x44, 0x11, 0x1a)
+OUR_GUID_ENTRY(IID_IVPVBINotify, 0xec529b01, 0x1a1f, 0x11d1, 0xba, 0xd9, 0x00, 0x60, 0x97, 0x44, 0x11, 0x1a)
+OUR_GUID_ENTRY(IID_IMixerPinConfig, 0x593cdde1, 0x0759, 0x11d1, 0x9e, 0x69, 0x00, 0xc0, 0x4f, 0xd7, 0xc1, 0x5b)
+OUR_GUID_ENTRY(IID_IMixerPinConfig2, 0xebf47182, 0x8764, 0x11d1, 0x9e, 0x69, 0x00, 0xc0, 0x4f, 0xd7, 0xc1, 0x5b)
+OUR_GUID_ENTRY(CLSID_ModexProperties, 0x0618aa30, 0x6bc4, 0x11cf, 0xbf, 0x36, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a)
+OUR_GUID_ENTRY(IID_IFullScreenVideo, 0xdd1d7110, 0x7836, 0x11cf, 0xbf, 0x47, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a)
+OUR_GUID_ENTRY(IID_IFullScreenVideoEx, 0x53479470, 0xf1dd, 0x11cf, 0xbc, 0x42, 0x00, 0xaa, 0x00, 0xac, 0x74, 0xf6)
+OUR_GUID_ENTRY(CLSID_DVDecPropertiesPage, 0x101193c0, 0x0bfe, 0x11d0, 0xaf, 0x91, 0x00, 0xaa, 0x00, 0xb6, 0x7a, 0x42)
+OUR_GUID_ENTRY(CLSID_DVEncPropertiesPage, 0x4150f050, 0xbb6f, 0x11d0, 0xaf, 0xb9, 0x00, 0xaa, 0x00, 0xb6, 0x7a, 0x42)
+OUR_GUID_ENTRY(CLSID_DVMuxPropertyPage, 0x4db880e0, 0xc10d, 0x11d0, 0xaf, 0xb9, 0x00, 0xaa, 0x00, 0xb6, 0x7a, 0x42)
+OUR_GUID_ENTRY(IID_IAMDirectSound, 0x546f4260, 0xd53e, 0x11cf, 0xb3, 0xf0, 0x00, 0xaa, 0x00, 0x37, 0x61, 0xc5)
+OUR_GUID_ENTRY(IID_IMpegAudioDecoder, 0xb45dd570, 0x3c77, 0x11d1, 0xab, 0xe1, 0x00, 0xa0, 0xc9, 0x05, 0xf3, 0x75)
+OUR_GUID_ENTRY(IID_IAMLine21Decoder, 0x6e8d4a21, 0x310c, 0x11d0, 0xb7, 0x9a, 0x00, 0xaa, 0x00, 0x37, 0x67, 0xa7)
+OUR_GUID_ENTRY(FORMAT_AnalogVideo, 0x0482dde0, 0x7817, 0x11cf, 0x8a, 0x03, 0x00, 0xaa, 0x00, 0x6e, 0xcb, 0x65)
+OUR_GUID_ENTRY(MEDIATYPE_AnalogVideo, 0x0482dde1, 0x7817, 0x11cf, 0x8a, 0x03, 0x00, 0xaa, 0x00, 0x6e, 0xcb, 0x65)
+OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_NTSC_M, 0x0482dde2, 0x7817, 0x11cf, 0x8a, 0x03, 0x00, 0xaa, 0x00, 0x6e, 0xcb, 0x65)
+OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_PAL_B, 0x0482dde5, 0x7817, 0x11cf, 0x8a, 0x03, 0x00, 0xaa, 0x00, 0x6e, 0xcb, 0x65)
+OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_PAL_D, 0x0482dde6, 0x7817, 0x11cf, 0x8a, 0x03, 0x00, 0xaa, 0x00, 0x6e, 0xcb, 0x65)
+OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_PAL_G, 0x0482dde7, 0x7817, 0x11cf, 0x8a, 0x03, 0x00, 0xaa, 0x00, 0x6e, 0xcb, 0x65)
+OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_PAL_H, 0x0482dde8, 0x7817, 0x11cf, 0x8a, 0x03, 0x00, 0xaa, 0x00, 0x6e, 0xcb, 0x65)
+OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_PAL_I, 0x0482dde9, 0x7817, 0x11cf, 0x8a, 0x03, 0x00, 0xaa, 0x00, 0x6e, 0xcb, 0x65)
+OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_PAL_M, 0x0482ddea, 0x7817, 0x11cf, 0x8a, 0x03, 0x00, 0xaa, 0x00, 0x6e, 0xcb, 0x65)
+OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_PAL_N, 0x0482ddeb, 0x7817, 0x11cf, 0x8a, 0x03, 0x00, 0xaa, 0x00, 0x6e, 0xcb, 0x65)
+OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_SECAM_B, 0x0482ddf0, 0x7817, 0x11cf, 0x8a, 0x03, 0x00, 0xaa, 0x00, 0x6e, 0xcb, 0x65)
+OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_SECAM_D, 0x0482ddf1, 0x7817, 0x11cf, 0x8a, 0x03, 0x00, 0xaa, 0x00, 0x6e, 0xcb, 0x65)
+OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_SECAM_G, 0x0482ddf2, 0x7817, 0x11cf, 0x8a, 0x03, 0x00, 0xaa, 0x00, 0x6e, 0xcb, 0x65)
+OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_SECAM_H, 0x0482ddf3, 0x7817, 0x11cf, 0x8a, 0x03, 0x00, 0xaa, 0x00, 0x6e, 0xcb, 0x65)
+OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_SECAM_K, 0x0482ddf4, 0x7817, 0x11cf, 0x8a, 0x03, 0x00, 0xaa, 0x00, 0x6e, 0xcb, 0x65)
+OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_SECAM_K1, 0x0482ddf5, 0x7817, 0x11cf, 0x8a, 0x03, 0x00, 0xaa, 0x00, 0x6e, 0xcb, 0x65)
+OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_SECAM_L, 0x0482ddf6, 0x7817, 0x11cf, 0x8a, 0x03, 0x00, 0xaa, 0x00, 0x6e, 0xcb, 0x65)
+OUR_GUID_ENTRY(MEDIATYPE_AnalogAudio, 0x0482dee1, 0x7817, 0x11cf, 0x8a, 0x03, 0x00, 0xaa, 0x00, 0x6e, 0xcb, 0x65)
+OUR_GUID_ENTRY(TIME_FORMAT_NONE, 0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00)
+OUR_GUID_ENTRY(TIME_FORMAT_FRAME, 0x7b785570, 0x8c82, 0x11cf, 0xbc, 0x0c, 0x00, 0xaa, 0x00, 0xac, 0x74, 0xf6)
+OUR_GUID_ENTRY(TIME_FORMAT_BYTE, 0x7b785571, 0x8c82, 0x11cf, 0xbc, 0x0c, 0x00, 0xaa, 0x00, 0xac, 0x74, 0xf6)
+OUR_GUID_ENTRY(TIME_FORMAT_SAMPLE, 0x7b785572, 0x8c82, 0x11cf, 0xbc, 0x0c, 0x00, 0xaa, 0x00, 0xac, 0x74, 0xf6)
+OUR_GUID_ENTRY(TIME_FORMAT_FIELD, 0x7b785573, 0x8c82, 0x11cf, 0xbc, 0x0c, 0x00, 0xaa, 0x00, 0xac, 0x74, 0xf6)
+OUR_GUID_ENTRY(TIME_FORMAT_MEDIA_TIME, 0x7b785574, 0x8c82, 0x11cf, 0xbc, 0x0c, 0x00, 0xaa, 0x00, 0xac, 0x74, 0xf6)
+OUR_GUID_ENTRY(AMPROPSETID_Pin, 0x9b00f101, 0x1567, 0x11d1, 0xb3, 0xf1, 0x00, 0xaa, 0x00, 0x37, 0x61, 0xc5)
+OUR_GUID_ENTRY(PIN_CATEGORY_CAPTURE, 0xfb6c4281, 0x0353, 0x11d1, 0x90, 0x5f, 0x00, 0x00, 0xc0, 0xcc, 0x16, 0xba)
+OUR_GUID_ENTRY(PIN_CATEGORY_PREVIEW, 0xfb6c4282, 0x0353, 0x11d1, 0x90, 0x5f, 0x00, 0x00, 0xc0, 0xcc, 0x16, 0xba)
+OUR_GUID_ENTRY(PIN_CATEGORY_ANALOGVIDEOIN, 0xfb6c4283, 0x0353, 0x11d1, 0x90, 0x5f, 0x00, 0x00, 0xc0, 0xcc, 0x16, 0xba)
+OUR_GUID_ENTRY(PIN_CATEGORY_VBI, 0xfb6c4284, 0x0353, 0x11d1, 0x90, 0x5f, 0x00, 0x00, 0xc0, 0xcc, 0x16, 0xba)
+OUR_GUID_ENTRY(PIN_CATEGORY_VIDEOPORT, 0xfb6c4285, 0x0353, 0x11d1, 0x90, 0x5f, 0x00, 0x00, 0xc0, 0xcc, 0x16, 0xba)
+OUR_GUID_ENTRY(PIN_CATEGORY_NABTS, 0xfb6c4286, 0x0353, 0x11d1, 0x90, 0x5f, 0x00, 0x00, 0xc0, 0xcc, 0x16, 0xba)
+OUR_GUID_ENTRY(PIN_CATEGORY_EDS, 0xfb6c4287, 0x0353, 0x11d1, 0x90, 0x5f, 0x00, 0x00, 0xc0, 0xcc, 0x16, 0xba)
+OUR_GUID_ENTRY(PIN_CATEGORY_TELETEXT, 0xfb6c4288, 0x0353, 0x11d1, 0x90, 0x5f, 0x00, 0x00, 0xc0, 0xcc, 0x16, 0xba)
+OUR_GUID_ENTRY(PIN_CATEGORY_CC, 0xfb6c4289, 0x0353, 0x11d1, 0x90, 0x5f, 0x00, 0x00, 0xc0, 0xcc, 0x16, 0xba)
+OUR_GUID_ENTRY(PIN_CATEGORY_STILL, 0xfb6c428a, 0x0353, 0x11d1, 0x90, 0x5f, 0x00, 0x00, 0xc0, 0xcc, 0x16, 0xba)
+OUR_GUID_ENTRY(PIN_CATEGORY_TIMECODE, 0xfb6c428b, 0x0353, 0x11d1, 0x90, 0x5f, 0x00, 0x00, 0xc0, 0xcc, 0x16, 0xba)
+OUR_GUID_ENTRY(PIN_CATEGORY_VIDEOPORT_VBI, 0xfb6c428c, 0x0353, 0x11d1, 0x90, 0x5f, 0x00, 0x00, 0xc0, 0xcc, 0x16, 0xba)
+OUR_GUID_ENTRY(LOOK_UPSTREAM_ONLY, 0xac798be0, 0x98e3, 0x11d1, 0xb3, 0xf1, 0x00, 0xaa, 0x00, 0x37, 0x61, 0xc5)
+OUR_GUID_ENTRY(LOOK_DOWNSTREAM_ONLY, 0xac798be1, 0x98e3, 0x11d1, 0xb3, 0xf1, 0x00, 0xaa, 0x00, 0x37, 0x61, 0xc5)
+OUR_GUID_ENTRY(CLSID_TVTunerFilterPropertyPage, 0x266eee41, 0x6c63, 0x11cf, 0x8a, 0x03, 0x00, 0xaa, 0x00, 0x6e, 0xcb, 0x65)
+OUR_GUID_ENTRY(CLSID_CrossbarFilterPropertyPage, 0x71f96461, 0x78f3, 0x11d0, 0xa1, 0x8c, 0x00, 0xa0, 0xc9, 0x11, 0x89, 0x56)
+OUR_GUID_ENTRY(CLSID_TVAudioFilterPropertyPage, 0x71f96463, 0x78f3, 0x11d0, 0xa1, 0x8c, 0x00, 0xa0, 0xc9, 0x11, 0x89, 0x56)
+OUR_GUID_ENTRY(CLSID_VideoProcAmpPropertyPage, 0x71f96464, 0x78f3, 0x11d0, 0xa1, 0x8c, 0x00, 0xa0, 0xc9, 0x11, 0x89, 0x56)
+OUR_GUID_ENTRY(CLSID_CameraControlPropertyPage, 0x71f96465, 0x78f3, 0x11d0, 0xa1, 0x8c, 0x00, 0xa0, 0xc9, 0x11, 0x89, 0x56)
+OUR_GUID_ENTRY(CLSID_AnalogVideoDecoderPropertyPage, 0x71f96466, 0x78f3, 0x11d0, 0xa1, 0x8c, 0x00, 0xa0, 0xc9, 0x11, 0x89, 0x56)
+OUR_GUID_ENTRY(CLSID_VideoStreamConfigPropertyPage, 0x71f96467, 0x78f3, 0x11d0, 0xa1, 0x8c, 0x00, 0xa0, 0xc9, 0x11, 0x89, 0x56)
+OUR_GUID_ENTRY(CLSID_HTMLDocument, 0x25336920, 0x03f9, 0x11cf, 0x8f, 0xd0, 0x00, 0xaa, 0x00, 0x68, 0x6f, 0x13)
+
+#undef OUR_GUID_ENTRY
reactos/include
diff -N vfwmsgs.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ vfwmsgs.h 30 Dec 2004 04:36:25 -0000 1.1.2.1
@@ -0,0 +1,140 @@
+/*
+ * Copyright (C) 2002 Alexandre Julliard
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#define VFW_S_NO_MORE_ITEMS ((HRESULT)0x00040103)
+#define VFW_S_DUPLICATE_NAME ((HRESULT)0x0004022D)
+#define VFW_S_STATE_INTERMEDIATE ((HRESULT)0x00040237)
+#define VFW_S_PARTIAL_RENDER ((HRESULT)0x00040242)
+#define VFW_S_SOME_DATA_IGNORED ((HRESULT)0x00040245)
+#define VFW_S_CONNECTIONS_DEFERRED ((HRESULT)0x00040246)
+#define VFW_S_RESOURCE_NOT_NEEDED ((HRESULT)0x00040250)
+#define VFW_S_MEDIA_TYPE_IGNORED ((HRESULT)0x00040254)
+#define VFW_S_VIDEO_NOT_RENDERED ((HRESULT)0x00040257)
+#define VFW_S_AUDIO_NOT_RENDERED ((HRESULT)0x00040258)
+#define VFW_S_RPZA ((HRESULT)0x0004025A)
+#define VFW_S_ESTIMATED ((HRESULT)0x00040260)
+#define VFW_S_RESERVED ((HRESULT)0x00040263)
+#define VFW_S_STREAM_OFF ((HRESULT)0x00040267)
+#define VFW_S_CANT_CUE ((HRESULT)0x00040268)
+#define VFW_S_NO_STOP_TIME ((HRESULT)0x00040270)
+#define VFW_S_NOPREVIEWPIN ((HRESULT)0x0004027E)
+#define VFW_E_INVALIDMEDIATYPE ((HRESULT)0x80040200)
+#define VFW_E_INVALIDSUBTYPE ((HRESULT)0x80040201)
+#define VFW_E_NEED_OWNER ((HRESULT)0x80040202)
+#define VFW_E_ENUM_OUT_OF_SYNC ((HRESULT)0x80040203)
+#define VFW_E_ALREADY_CONNECTED ((HRESULT)0x80040204)
+#define VFW_E_FILTER_ACTIVE ((HRESULT)0x80040205)
+#define VFW_E_NO_TYPES ((HRESULT)0x80040206)
+#define VFW_E_NO_ACCEPTABLE_TYPES ((HRESULT)0x80040207)
+#define VFW_E_INVALID_DIRECTION ((HRESULT)0x80040208)
+#define VFW_E_NOT_CONNECTED ((HRESULT)0x80040209)
+#define VFW_E_NO_ALLOCATOR ((HRESULT)0x8004020A)
+#define VFW_E_RUNTIME_ERROR ((HRESULT)0x8004020B)
+#define VFW_E_BUFFER_NOTSET ((HRESULT)0x8004020C)
+#define VFW_E_BUFFER_OVERFLOW ((HRESULT)0x8004020D)
+#define VFW_E_BADALIGN ((HRESULT)0x8004020E)
+#define VFW_E_ALREADY_COMMITTED ((HRESULT)0x8004020F)
+#define VFW_E_BUFFERS_OUTSTANDING ((HRESULT)0x80040210)
+#define VFW_E_NOT_COMMITTED ((HRESULT)0x80040211)
+#define VFW_E_SIZENOTSET ((HRESULT)0x80040212)
+#define VFW_E_NO_CLOCK ((HRESULT)0x80040213)
+#define VFW_E_NO_SINK ((HRESULT)0x80040214)
+#define VFW_E_NO_INTERFACE ((HRESULT)0x80040215)
+#define VFW_E_NOT_FOUND ((HRESULT)0x80040216)
+#define VFW_E_CANNOT_CONNECT ((HRESULT)0x80040217)
+#define VFW_E_CANNOT_RENDER ((HRESULT)0x80040218)
+#define VFW_E_CHANGING_FORMAT ((HRESULT)0x80040219)
+#define VFW_E_NO_COLOR_KEY_SET ((HRESULT)0x8004021A)
+#define VFW_E_NOT_OVERLAY_CONNECTION ((HRESULT)0x8004021B)
+#define VFW_E_NOT_SAMPLE_CONNECTION ((HRESULT)0x8004021C)
+#define VFW_E_PALETTE_SET ((HRESULT)0x8004021D)
+#define VFW_E_COLOR_KEY_SET ((HRESULT)0x8004021E)
+#define VFW_E_NO_COLOR_KEY_FOUND ((HRESULT)0x8004021F)
+#define VFW_E_NO_PALETTE_AVAILABLE ((HRESULT)0x80040220)
+#define VFW_E_NO_DISPLAY_PALETTE ((HRESULT)0x80040221)
+#define VFW_E_TOO_MANY_COLORS ((HRESULT)0x80040222)
+#define VFW_E_STATE_CHANGED ((HRESULT)0x80040223)
+#define VFW_E_NOT_STOPPED ((HRESULT)0x80040224)
+#define VFW_E_NOT_PAUSED ((HRESULT)0x80040225)
+#define VFW_E_NOT_RUNNING ((HRESULT)0x80040226)
+#define VFW_E_WRONG_STATE ((HRESULT)0x80040227)
+#define VFW_E_START_TIME_AFTER_END ((HRESULT)0x80040228)
+#define VFW_E_INVALID_RECT ((HRESULT)0x80040229)
+#define VFW_E_TYPE_NOT_ACCEPTED ((HRESULT)0x8004022A)
+#define VFW_E_SAMPLE_REJECTED ((HRESULT)0x8004022B)
+#define VFW_E_SAMPLE_REJECTED_EOS ((HRESULT)0x8004022C)
+#define VFW_E_DUPLICATE_NAME ((HRESULT)0x8004022D)
+#define VFW_E_TIMEOUT ((HRESULT)0x8004022E)
+#define VFW_E_INVALID_FILE_FORMAT ((HRESULT)0x8004022F)
+#define VFW_E_ENUM_OUT_OF_RANGE ((HRESULT)0x80040230)
+#define VFW_E_CIRCULAR_GRAPH ((HRESULT)0x80040231)
+#define VFW_E_NOT_ALLOWED_TO_SAVE ((HRESULT)0x80040232)
+#define VFW_E_TIME_ALREADY_PASSED ((HRESULT)0x80040233)
+#define VFW_E_ALREADY_CANCELLED ((HRESULT)0x80040234)
+#define VFW_E_CORRUPT_GRAPH_FILE ((HRESULT)0x80040235)
+#define VFW_E_ADVISE_ALREADY_SET ((HRESULT)0x80040236)
+#define VFW_E_NO_MODEX_AVAILABLE ((HRESULT)0x80040238)
+#define VFW_E_NO_ADVISE_SET ((HRESULT)0x80040239)
+#define VFW_E_NO_FULLSCREEN ((HRESULT)0x8004023A)
+#define VFW_E_IN_FULLSCREEN_MODE ((HRESULT)0x8004023B)
+#define VFW_E_UNKNOWN_FILE_TYPE ((HRESULT)0x80040240)
+#define VFW_E_CANNOT_LOAD_SOURCE_FILTER ((HRESULT)0x80040241)
+#define VFW_E_FILE_TOO_SHORT ((HRESULT)0x80040243)
+#define VFW_E_INVALID_FILE_VERSION ((HRESULT)0x80040244)
+#define VFW_E_INVALID_CLSID ((HRESULT)0x80040247)
+#define VFW_E_INVALID_MEDIA_TYPE ((HRESULT)0x80040248)
+#define VFW_E_SAMPLE_TIME_NOT_SET ((HRESULT)0x80040249)
+#define VFW_E_MEDIA_TIME_NOT_SET ((HRESULT)0x80040251)
+#define VFW_E_NO_TIME_FORMAT_SET ((HRESULT)0x80040252)
+#define VFW_E_MONO_AUDIO_HW ((HRESULT)0x80040253)
+#define VFW_E_NO_DECOMPRESSOR ((HRESULT)0x80040255)
+#define VFW_E_NO_AUDIO_HARDWARE ((HRESULT)0x80040256)
+#define VFW_E_RPZA ((HRESULT)0x80040259)
+#define VFW_E_PROCESSOR_NOT_SUITABLE ((HRESULT)0x8004025B)
+#define VFW_E_UNSUPPORTED_AUDIO ((HRESULT)0x8004025C)
+#define VFW_E_UNSUPPORTED_VIDEO ((HRESULT)0x8004025D)
+#define VFW_E_MPEG_NOT_CONSTRAINED ((HRESULT)0x8004025E)
+#define VFW_E_NOT_IN_GRAPH ((HRESULT)0x8004025F)
+#define VFW_E_NO_TIME_FORMAT ((HRESULT)0x80040261)
+#define VFW_E_READ_ONLY ((HRESULT)0x80040262)
+#define VFW_E_BUFFER_UNDERFLOW ((HRESULT)0x80040264)
+#define VFW_E_UNSUPPORTED_STREAM ((HRESULT)0x80040265)
+#define VFW_E_NO_TRANSPORT ((HRESULT)0x80040266)
+#define VFW_E_BAD_VIDEOCD ((HRESULT)0x80040269)
+#define VFW_E_OUT_OF_VIDEO_MEMORY ((HRESULT)0x80040271)
+#define VFW_E_VP_NEGOTIATION_FAILED ((HRESULT)0x80040272)
+#define VFW_E_DDRAW_CAPS_NOT_SUITABLE ((HRESULT)0x80040273)
+#define VFW_E_NO_VP_HARDWARE ((HRESULT)0x80040274)
+#define VFW_E_NO_CAPTURE_HARDWARE ((HRESULT)0x80040275)
+#define VFW_E_DVD_OPERATION_INHIBITED ((HRESULT)0x80040276)
+#define VFW_E_DVD_INVALIDDOMAIN ((HRESULT)0x80040277)
+#define VFW_E_DVD_NO_BUTTON ((HRESULT)0x80040278)
+#define VFW_E_DVD_GRAPHNOTREADY ((HRESULT)0x80040279)
+#define VFW_E_DVD_RENDERFAIL ((HRESULT)0x8004027A)
+#define VFW_E_DVD_DECNOTENOUGH ((HRESULT)0x8004027B)
+#define VFW_E_DDRAW_VERSION_NOT_SUITABLE ((HRESULT)0x8004027C)
+#define VFW_E_COPYPROT_FAILED ((HRESULT)0x8004027D)
+#define VFW_E_TIME_EXPIRED ((HRESULT)0x8004027F)
+#define VFW_E_BAD_KEY ((HRESULT)0x800403F2)
+
+#ifndef E_PROP_ID_UNSUPPORTED
+#define E_PROP_ID_UNSUPPORTED ((HRESULT)0x80070490)
+#endif
+#ifndef E_PROP_SET_UNSUPPORTED
+#define E_PROP_SET_UNSUPPORTED ((HRESULT)0x80070492)
+#endif
reactos/include
diff -u -r1.1.2.1 -r1.1.2.2
--- dinput.h 8 Dec 2004 21:56:56 -0000 1.1.2.1
+++ dinput.h 30 Dec 2004 04:36:24 -0000 1.1.2.2
@@ -14,32 +14,17 @@
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
*/
-//#ifndef __DINPUT_INCLUDED__
-//#define __DINPUT_INCLUDED__
-
#ifndef __WINE_DINPUT_H
#define __WINE_DINPUT_H
-#ifndef DIJ_RINGZERO
-#include <objbase.h>
-#ifdef _WIN32
-#define COM_NO_WINDOWS_H
#include <objbase.h>
-#endif
-
-#endif /* DIJ_RINGZERO */
#ifndef DIRECTINPUT_VERSION
#define DIRECTINPUT_VERSION 0x0800
#endif
-#ifndef DIRECTINPUT_VERSION
-#define DIRECTINPUT_VERSION DIRECTINPUT_HEADER_VERSION
-#endif
-//#ifndef DIJ_RINGZERO
/* Classes */
DEFINE_GUID(CLSID_DirectInput, 0x25E609E0,0xB259,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
DEFINE_GUID(CLSID_DirectInputDevice, 0x25E609E1,0xB259,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
@@ -47,8 +32,6 @@
DEFINE_GUID(CLSID_DirectInput8, 0x25E609E4,0xB259,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
DEFINE_GUID(CLSID_DirectInputDevice8, 0x25E609E5,0xB259,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
-
-
/* Interfaces */
DEFINE_GUID(IID_IDirectInputA, 0x89521360,0xAA8A,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
DEFINE_GUID(IID_IDirectInputW, 0x89521361,0xAA8A,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
@@ -58,7 +41,6 @@
DEFINE_GUID(IID_IDirectInput7W, 0x9A4CB685,0x236D,0x11D3,0x8E,0x9D,0x00,0xC0,0x4F,0x68,0x44,0xAE);
DEFINE_GUID(IID_IDirectInput8A, 0xBF798030,0x483A,0x4DA2,0xAA,0x99,0x5D,0x64,0xED,0x36,0x97,0x00);
DEFINE_GUID(IID_IDirectInput8W, 0xBF798031,0x483A,0x4DA2,0xAA,0x99,0x5D,0x64,0xED,0x36,0x97,0x00);
-
DEFINE_GUID(IID_IDirectInputDeviceA, 0x5944E680,0xC92E,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
DEFINE_GUID(IID_IDirectInputDeviceW, 0x5944E681,0xC92E,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
DEFINE_GUID(IID_IDirectInputDevice2A, 0x5944E682,0xC92E,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
@@ -69,7 +51,6 @@
DEFINE_GUID(IID_IDirectInputDevice8W, 0x54D41081,0xDC15,0x4833,0xA4,0x1B,0x74,0x8F,0x73,0xA3,0x81,0x79);
DEFINE_GUID(IID_IDirectInputEffect, 0xE7E1F7C0,0x88D2,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
-
/* Predefined object types */
DEFINE_GUID(GUID_XAxis, 0xA36D02E0,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
DEFINE_GUID(GUID_YAxis, 0xA36D02E1,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
@@ -83,7 +64,6 @@
DEFINE_GUID(GUID_POV, 0xA36D02F2,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
DEFINE_GUID(GUID_Unknown,0xA36D02F3,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
-
/* Predefined product GUIDs */
DEFINE_GUID(GUID_SysMouse, 0x6F1D2B60,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
DEFINE_GUID(GUID_SysKeyboard, 0x6F1D2B61,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
@@ -93,7 +73,6 @@
DEFINE_GUID(GUID_SysKeyboardEm, 0x6F1D2B82,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
DEFINE_GUID(GUID_SysKeyboardEm2,0x6F1D2B83,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
-
/* predefined forcefeedback effects */
DEFINE_GUID(GUID_ConstantForce, 0x13541C20,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
DEFINE_GUID(GUID_RampForce, 0x13541C21,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
@@ -108,9 +87,6 @@
DEFINE_GUID(GUID_Friction, 0x13541C2A,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
DEFINE_GUID(GUID_CustomForce, 0x13541C2B,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
-//#endif /* DIJ_RINGZERO */
-
-// ok yes ?
typedef struct IDirectInputA *LPDIRECTINPUTA;
typedef struct IDirectInputW *LPDIRECTINPUTW;
typedef struct IDirectInput2A *LPDIRECTINPUT2A;
@@ -128,97 +104,23 @@
typedef struct IDirectInputDevice8A *LPDIRECTINPUTDEVICE8A;
typedef struct IDirectInputDevice8W *LPDIRECTINPUTDEVICE8W;
typedef struct IDirectInputEffect *LPDIRECTINPUTEFFECT;
-typedef struct SysKeyboardA SysKeyboardA,*LPSYSKEYBOARDA;
-typedef struct SysMouseA SysMouseA,*LPSYSMOUSEA;
-
-#ifdef UNICODE
-#define IID_IDirectInputDevice IID_IDirectInputDeviceW
-#define IDirectInputDevice IDirectInputDeviceW
-#define IDirectInputDeviceVtbl IDirectInputDeviceWVtbl
-#else
-#define IID_IDirectInputDevice IID_IDirectInputDeviceA
-#define IDirectInputDevice IDirectInputDeviceA
-#define IDirectInputDeviceVtbl IDirectInputDeviceAVtbl
-#endif
-
-#ifdef UNICODE
-#define IID_IDirectInput2 IID_IDirectInput2W
-#define IDirectInput2 IDirectInput2W
-#define IDirectInput2Vtbl IDirectInput2WVtbl
-#else
-#define IID_IDirectInput2 IID_IDirectInput2A
-#define IDirectInput2 IDirectInput2A
-#define IDirectInput2Vtbl IDirectInput2AVtbl
-#endif
-
-#ifdef UNICODE
-#define IID_IDirectInput7 IID_IDirectInput7W
-#define IDirectInput7 IDirectInput7W
-#define IDirectInput7Vtbl IDirectInput7WVtbl
-#else
-#define IID_IDirectInput7 IID_IDirectInput7A
-#define IDirectInput7 IDirectInput7A
-#define IDirectInput7Vtbl IDirectInput7AVtbl
-#endif
-
-#ifdef UNICODE
-#define IID_IDirectInputDevice IID_IDirectInputDeviceW
-#define IDirectInputDevice IDirectInputDeviceW
-#define IDirectInputDeviceVtbl IDirectInputDeviceWVtbl
-#else
-#define IID_IDirectInputDevice IID_IDirectInputDeviceA
-#define IDirectInputDevice IDirectInputDeviceA
-#define IDirectInputDeviceVtbl IDirectInputDeviceAVtbl
-#endif
-
-#ifdef UNICODE
-#define IID_IDirectInputDevice2 IID_IDirectInputDevice2W
-#define IDirectInputDevice2 IDirectInputDevice2W
-#define IDirectInputDevice2Vtbl IDirectInputDevice2WVtbl
-#else
-#define IID_IDirectInputDevice2 IID_IDirectInputDevice2A
-#define IDirectInputDevice2 IDirectInputDevice2A
-#define IDirectInputDevice2Vtbl IDirectInputDevice2AVtbl
-#endif
-
-#ifdef UNICODE
-#define IID_IDirectInputDevice7 IID_IDirectInputDevice7W
-#define IDirectInputDevice7 IDirectInputDevice7W
-#define IDirectInputDevice7Vtbl IDirectInputDevice7WVtbl
-#else
-#define IID_IDirectInputDevice7 IID_IDirectInputDevice7A
-#define IDirectInputDevice7 IDirectInputDevice7A
-#define IDirectInputDevice7Vtbl IDirectInputDevice7AVtbl
-#endif
-
-#ifdef UNICODE
-#define IID_IDirectInputDevice8 IID_IDirectInputDevice8W
-#define IDirectInputDevice8 IDirectInputDevice8W
-#define IDirectInputDevice8Vtbl IDirectInputDevice8WVtbl
-#else
-#define IID_IDirectInputDevice8 IID_IDirectInputDevice8A
-#define IDirectInputDevice8 IDirectInputDevice8A
-#define IDirectInputDevice8Vtbl IDirectInputDevice8AVtbl
-#endif
-
-// need to be fix
-// #define IID_IDirectInput WINELIB_NAME_AW(IID_IDirectInput)
-// DECL_WINELIB_TYPE_AW(LPDIRECTINPUT)
-// #define IID_IDirectInput2 WINELIB_NAME_AW(IID_IDirectInput2)
-// DECL_WINELIB_TYPE_AW(LPDIRECTINPUT2)
-// #define IID_IDirectInput7 WINELIB_NAME_AW(IID_IDirectInput7)
-// DECL_WINELIB_TYPE_AW(LPDIRECTINPUT7)
-//#define IID_IDirectInputDevice WINELIB_NAME_AW(IID_IDirectInputDevice)
-//DECL_WINELIB_TYPE_AW(LPDIRECTINPUTDEVICE)
-//#define IID_IDirectInputDevice2 WINELIB_NAME_AW(IID_IDirectInputDevice2)
-//DECL_WINELIB_TYPE_AW(LPDIRECTINPUTDEVICE2)
-
-// #define IID_IDirectInputDevice7 WINELIB_NAME_AW(IID_IDirectInputDevice7)
-// DECL_WINELIB_TYPE_AW(LPDIRECTINPUTDEVICE7)
-
-//#define IID_IDirectInputDevice8 WINELIB_NAME_AW(IID_IDirectInputDevice8)
-//DECL_WINELIB_TYPE_AW(LPDIRECTINPUTDEVICE8)
+typedef struct SysKeyboardA *LPSYSKEYBOARDA;
+typedef struct SysMouseA *LPSYSMOUSEA;
+#define IID_IDirectInput WINELIB_NAME_AW(IID_IDirectInput)
+DECL_WINELIB_TYPE_AW(LPDIRECTINPUT)
+#define IID_IDirectInput2 WINELIB_NAME_AW(IID_IDirectInput2)
+DECL_WINELIB_TYPE_AW(LPDIRECTINPUT2)
+#define IID_IDirectInput7 WINELIB_NAME_AW(IID_IDirectInput7)
+DECL_WINELIB_TYPE_AW(LPDIRECTINPUT7)
+#define IID_IDirectInputDevice WINELIB_NAME_AW(IID_IDirectInputDevice)
+DECL_WINELIB_TYPE_AW(LPDIRECTINPUTDEVICE)
+#define IID_IDirectInputDevice2 WINELIB_NAME_AW(IID_IDirectInputDevice2)
+DECL_WINELIB_TYPE_AW(LPDIRECTINPUTDEVICE2)
+#define IID_IDirectInputDevice7 WINELIB_NAME_AW(IID_IDirectInputDevice7)
+DECL_WINELIB_TYPE_AW(LPDIRECTINPUTDEVICE7)
+#define IID_IDirectInputDevice8 WINELIB_NAME_AW(IID_IDirectInputDevice8)
+DECL_WINELIB_TYPE_AW(LPDIRECTINPUTDEVICE8)
#define DI_OK S_OK
#define DI_NOTATTACHED S_FALSE
@@ -895,7 +797,6 @@
#define DISCL_FOREGROUND 0x00000004
#define DISCL_BACKGROUND 0x00000008
-
#define DIEFT_ALL 0x00000000
#define DIEFT_CONSTANTFORCE 0x00000001
@@ -1363,7 +1264,6 @@
/*****************************************************************************
* IDirectInputEffect interface
*/
-
#define INTERFACE IDirectInputEffect
DECLARE_INTERFACE_(IDirectInputEffect,IUnknown)
{
@@ -2346,4 +2246,3 @@
#endif
#endif /* __WINE_DINPUT_H */
-
reactos/include
diff -u -r1.3 -r1.3.32.1
--- sockets.h 8 Sep 2002 10:22:28 -0000 1.3
+++ sockets.h 30 Dec 2004 04:36:25 -0000 1.3.32.1
@@ -771,12 +771,7 @@
u_long PASCAL htonl (u_long hostlong);
-/* For some reason WSOCK.LIB has htons defined as a 4 byte paramter?! */
-#ifdef _WIN32
-u_short PASCAL htons (u_long hostshort);
-#else
u_short PASCAL htons (u_short hostshort);
-#endif /* _WIN32 */
unsigned long PASCAL inet_addr (const char * cp);
reactos/include
diff -N aclapi.h
--- aclapi.h 24 Jan 2004 08:41:03 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,132 +0,0 @@
-/*
- aclapi.h
-
- This file is part of a free library for the Win32 API.
-
- This library 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.
-
-*/
-#ifndef _ACLAPI_H
-#define _ACLAPI_H
-
-#include <windows.h>
-#include <accctrl.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-typedef VOID (*FN_PROGRESS) (LPWSTR pObjectName,DWORD Status,PPROG_INVOKE_SETTING pInvokeSetting,PVOID Args,BOOL SecuritySet);
-
-VOID STDCALL BuildExplicitAccessWithNameA(PEXPLICIT_ACCESS_A pExplicitAccess,LPSTR pTrusteeName,DWORD AccessPermissions,ACCESS_MODE AccessMode,DWORD Inheritance);
-VOID STDCALL BuildExplicitAccessWithNameW(PEXPLICIT_ACCESS_W pExplicitAccess,LPWSTR pTrusteeName,DWORD AccessPermissions,ACCESS_MODE AccessMode,DWORD Inheritance);
-DWORD STDCALL BuildSecurityDescriptorA(PTRUSTEE_A pOwner,PTRUSTEE_A pGroup,ULONG cCountOfAccessEntries,PEXPLICIT_ACCESS_A pListOfAccessEntries,
- ULONG cCountOfAuditEntries,PEXPLICIT_ACCESS_A pListOfAuditEntries,PSECURITY_DESCRIPTOR pOldSD,PULONG pSizeNewSD,PSECURITY_DESCRIPTOR* pNewSD);
-DWORD STDCALL BuildSecurityDescriptorW(PTRUSTEE_W pOwner,PTRUSTEE_W pGroup,ULONG cCountOfAccessEntries,PEXPLICIT_ACCESS_W pListOfAccessEntries,
- ULONG cCountOfAuditEntries,PEXPLICIT_ACCESS_W pListOfAuditEntries,PSECURITY_DESCRIPTOR pOldSD,PULONG pSizeNewSD,PSECURITY_DESCRIPTOR* pNewSD);
-VOID STDCALL BuildTrusteeWithNameA(PTRUSTEE_A pTrustee,LPSTR pName);
-VOID STDCALL BuildTrusteeWithNameW(PTRUSTEE_W pTrustee,LPWSTR pName);
-VOID STDCALL BuildTrusteeWithObjectsAndNameA(PTRUSTEE_A pTrustee,POBJECTS_AND_NAME_A pObjName,SE_OBJECT_TYPE ObjectType,
- LPSTR ObjectTypeName,LPSTR InheritedObjectTypeName,LPSTR Name);
-VOID STDCALL BuildTrusteeWithObjectsAndNameW(PTRUSTEE_W pTrustee,POBJECTS_AND_NAME_W pObjName,SE_OBJECT_TYPE ObjectType,
- LPWSTR ObjectTypeName,LPWSTR InheritedObjectTypeName,LPWSTR Name);
-VOID STDCALL BuildTrusteeWithObjectsAndSidA(PTRUSTEE_A pTrustee,POBJECTS_AND_SID pObjSid,GUID* pObjectGuid,GUID* pInheritedObjectGuid,PSID pSid);
-VOID STDCALL BuildTrusteeWithObjectsAndSidW(PTRUSTEE_W pTrustee,POBJECTS_AND_SID pObjSid,GUID* pObjectGuid,GUID* pInheritedObjectGuid,PSID pSid);
-VOID STDCALL BuildTrusteeWithSidA(PTRUSTEE_A pTrustee,PSID pSid);
-VOID STDCALL BuildTrusteeWithSidW(PTRUSTEE_W pTrustee,PSID pSid);
-DWORD STDCALL GetAuditedPermissionsFromAclA(PACL pacl,PTRUSTEE_A pTrustee,PACCESS_MASK pSuccessfulAuditedRights,PACCESS_MASK pFailedAuditRights);
-DWORD STDCALL GetAuditedPermissionsFromAclW(PACL pacl,PTRUSTEE_W pTrustee,PACCESS_MASK pSuccessfulAuditedRights,PACCESS_MASK pFailedAuditRights);
-DWORD STDCALL GetEffectiveRightsFromAclA(PACL pacl,PTRUSTEE_A pTrustee,PACCESS_MASK pAccessRights);
-DWORD STDCALL GetEffectiveRightsFromAclW(PACL pacl,PTRUSTEE_W pTrustee,PACCESS_MASK pAccessRights);
-DWORD STDCALL GetExplicitEntriesFromAclA(PACL pacl,PULONG pcCountOfExplicitEntries,PEXPLICIT_ACCESS_A* pListOfExplicitEntries);
-DWORD STDCALL GetExplicitEntriesFromAclW(PACL pacl,PULONG pcCountOfExplicitEntries,PEXPLICIT_ACCESS_W* pListOfExplicitEntries);
-DWORD STDCALL GetNamedSecurityInfoA(LPSTR pObjectName,SE_OBJECT_TYPE ObjectType,SECURITY_INFORMATION SecurityInfo,
- PSID* ppsidOwner,PSID* ppsidGroup,PACL* ppDacl,PACL* ppSacl,PSECURITY_DESCRIPTOR* ppSecurityDescriptor);
-DWORD STDCALL GetNamedSecurityInfoW(LPWSTR pObjectName,SE_OBJECT_TYPE ObjectType,SECURITY_INFORMATION SecurityInfo,
- PSID* ppsidOwner,PSID* ppsidGroup,PACL* ppDacl,PACL* ppSacl,PSECURITY_DESCRIPTOR* ppSecurityDescriptor);
-DWORD STDCALL GetSecurityInfo(HANDLE handle,SE_OBJECT_TYPE ObjectType,SECURITY_INFORMATION SecurityInfo,
- PSID* ppsidOwner,PSID* ppsidGroup,PACL* ppDacl,PACL* ppSacl,PSECURITY_DESCRIPTOR* ppSecurityDescriptor);
-TRUSTEE_FORM STDCALL GetTrusteeFormA(PTRUSTEE_A pTrustee);
-TRUSTEE_FORM STDCALL GetTrusteeFormW(PTRUSTEE_W pTrustee);
-LPSTR STDCALL GetTrusteeNameA(PTRUSTEE_A pTrustee);
-LPWSTR STDCALL GetTrusteeNameW(PTRUSTEE_W pTrustee);
-TRUSTEE_TYPE STDCALL GetTrusteeTypeA(PTRUSTEE_A pTrustee);
-TRUSTEE_TYPE STDCALL GetTrusteeTypeW(PTRUSTEE_W pTrustee);
-DWORD STDCALL LookupSecurityDescriptorPartsA(PTRUSTEE_A* pOwner,PTRUSTEE_A* pGroup,PULONG cCountOfAccessEntries,PEXPLICIT_ACCESS_A* pListOfAccessEntries,
- PULONG cCountOfAuditEntries,PEXPLICIT_ACCESS_A* pListOfAuditEntries,PSECURITY_DESCRIPTOR pSD);
-DWORD STDCALL LookupSecurityDescriptorPartsW(PTRUSTEE_W* pOwner,PTRUSTEE_W* pGroup,PULONG cCountOfAccessEntries,PEXPLICIT_ACCESS_W* pListOfAccessEntries,
- PULONG cCountOfAuditEntries,PEXPLICIT_ACCESS_W* pListOfAuditEntries,PSECURITY_DESCRIPTOR pSD);
-DWORD STDCALL SetEntriesInAclA(ULONG cCountOfExplicitEntries,PEXPLICIT_ACCESS_A pListOfExplicitEntries,PACL OldAcl,PACL* NewAcl);
-DWORD STDCALL SetEntriesInAclW(ULONG cCountOfExplicitEntries,PEXPLICIT_ACCESS_W pListOfExplicitEntries,PACL OldAcl,PACL* NewAcl);
-DWORD STDCALL SetNamedSecurityInfoA(LPSTR pObjectName,SE_OBJECT_TYPE ObjectType,SECURITY_INFORMATION SecurityInfo,PSID psidOwner,PSID psidGroup,PACL pDacl,PACL pSacl);
-DWORD STDCALL SetNamedSecurityInfoW(LPWSTR pObjectName,SE_OBJECT_TYPE ObjectType,SECURITY_INFORMATION SecurityInfo,PSID psidOwner,PSID psidGroup,PACL pDacl,PACL pSacl);
-DWORD STDCALL SetSecurityInfo(HANDLE handle,SE_OBJECT_TYPE ObjectType,SECURITY_INFORMATION SecurityInfo,PSID psidOwner,PSID psidGroup,PACL pDacl,PACL pSacl);
-DWORD STDCALL GetInheritanceSourceA(LPSTR pObjectName,SE_OBJECT_TYPE ObjectType,SECURITY_INFORMATION SecurityInfo,BOOL Container,GUID ** pObjectClassGuids ,DWORD GuidCount,PACL pAcl,PFN_OBJECT_MGR_FUNCTS pfnArray OPTIONAL,PGENERIC_MAPPING pGenericMapping,PINHERITED_FROMA pInheritArray);
-DWORD STDCALL GetInheritanceSourceW(LPWSTR pObjectName,SE_OBJECT_TYPE ObjectType,SECURITY_INFORMATION SecurityInfo,BOOL Container,GUID ** pObjectClassGuids ,DWORD GuidCount,PACL pAcl,PFN_OBJECT_MGR_FUNCTS pfnArray OPTIONAL,PGENERIC_MAPPING pGenericMapping,PINHERITED_FROMW pInheritArray);
-DWORD STDCALL FreeInheritedFromArray(PINHERITED_FROMW pInheritArray,USHORT AceCnt,PFN_OBJECT_MGR_FUNCTS pfnArray);
-DWORD STDCALL TreeResetNamedSecurityInfoA(LPSTR pObjectName,SE_OBJECT_TYPE ObjectType,SECURITY_INFORMATION SecurityInfo,PSID pOwner,PSID pGroup,PACL pDacl,PACL pSacl,BOOL KeepExplicit,FN_PROGRESS fnProgress,PROG_INVOKE_SETTING ProgressInvokeSetting,PVOID Args);
-DWORD STDCALL TreeResetNamedSecurityInfoW(LPWSTR pObjectName,SE_OBJECT_TYPE ObjectType,SECURITY_INFORMATION SecurityInfo,PSID pOwner,PSID pGroup,PACL pDacl,PACL pSacl,BOOL KeepExplicit,FN_PROGRESS fnProgress,PROG_INVOKE_SETTING ProgressInvokeSetting,PVOID Args);
-VOID STDCALL BuildImpersonateExplicitAccessWithNameA(PEXPLICIT_ACCESS_A pExplicitAccess,LPSTR pTrusteeName,PTRUSTEE_A pTrustee,DWORD AccessPermissions,ACCESS_MODE AccessMode,DWORD Inheritance);
-VOID STDCALL BuildImpersonateExplicitAccessWithNameW(PEXPLICIT_ACCESS_W pExplicitAccess,LPWSTR pTrusteeName,PTRUSTEE_W pTrustee,DWORD AccessPermissions,ACCESS_MODE AccessMode,DWORD Inheritance);
-VOID STDCALL BuildImpersonateTrusteeA(PTRUSTEE_A pTrustee,PTRUSTEE_A pImpersonateTrustee);
-VOID STDCALL BuildImpersonateTrusteeW(PTRUSTEE_W pTrustee,PTRUSTEE_W pImpersonateTrustee);
-MULTIPLE_TRUSTEE_OPERATION STDCALL GetMultipleTrusteeOperationA(PTRUSTEE_A pTrustee);
-MULTIPLE_TRUSTEE_OPERATION STDCALL GetMultipleTrusteeOperationW(PTRUSTEE_W pTrustee);
-PTRUSTEE_A STDCALL GetMultipleTrusteeA(PTRUSTEE_A pTrustee);
-PTRUSTEE_W STDCALL GetMultipleTrusteeW(PTRUSTEE_W pTrustee);
-
-#ifndef _DISABLE_TIDENTS
-#ifdef UNICODE
-#define BuildExplicitAccessWithName BuildExplicitAccessWithNameW
-#define BuildSecurityDescriptor BuildSecurityDescriptorW
-#define BuildTrusteeWithName BuildTrusteeWithNameW
-#define BuildTrusteeWithObjectsAndName BuildTrusteeWithObjectsAndNameW
-#define BuildTrusteeWithObjectsAndSid BuildTrusteeWithObjectsAndSidW
-#define BuildTrusteeWithSid BuildTrusteeWithSidW
-#define GetAuditedPermissionsFromAcl GetAuditedPermissionsFromAclW
-#define GetEffectiveRightsFromAcl GetEffectiveRightsFromAclW
-#define GetExplicitEntriesFromAcl GetExplicitEntriesFromAclW
-#define GetNamedSecurityInfo GetNamedSecurityInfoW
-#define GetTrusteeForm GetTrusteeFormW
-#define GetTrusteeName GetTrusteeNameW
-#define GetTrusteeType GetTrusteeTypeW
-#define LookupSecurityDescriptorParts LookupSecurityDescriptorPartsW
-#define SetEntriesInAcl SetEntriesInAclW
-#define SetNamedSecurityInfo SetNamedSecurityInfoW
-#define GetInheritanceSource GetInheritanceSourceW
-#define TreeResetNamedSecurityInfo TreeResetNamedSecurityInfoW
-#define BuildImpersonateExplicitAccessWithName BuildImpersonateExplicitAccessWithNameW
-#define BuildImpersonateTrustee BuildImpersonateTrusteeW
-#define GetMultipleTrusteeOperation GetMultipleTrusteeOperationW
-#define GetMultipleTrustee GetMultipleTrusteeW
-#else
-#define BuildExplicitAccessWithName BuildExplicitAccessWithNameA
-#define BuildSecurityDescriptor BuildSecurityDescriptorA
-#define BuildTrusteeWithName BuildTrusteeWithNameA
-#define BuildTrusteeWithObjectsAndName BuildTrusteeWithObjectsAndNameA
-#define BuildTrusteeWithObjectsAndSid BuildTrusteeWithObjectsAndSidA
-#define BuildTrusteeWithSid BuildTrusteeWithSidA
-#define GetAuditedPermissionsFromAcl GetAuditedPermissionsFromAclA
-#define GetEffectiveRightsFromAcl GetEffectiveRightsFromAclA
-#define GetExplicitEntriesFromAcl GetExplicitEntriesFromAclA
-#define GetNamedSecurityInfo GetNamedSecurityInfoA
-#define GetTrusteeForm GetTrusteeFormA
-#define GetTrusteeName GetTrusteeNameA
-#define GetTrusteeType GetTrusteeTypeA
-#define LookupSecurityDescriptorParts LookupSecurityDescriptorPartsA
-#define SetEntriesInAcl SetEntriesInAclA
-#define SetNamedSecurityInfo SetNamedSecurityInfoA
-#define GetInheritanceSource GetInheritanceSourceA
-#define TreeResetNamedSecurityInfo TreeResetNamedSecurityInfoA
-#define BuildImpersonateExplicitAccessWithName BuildImpersonateExplicitAccessWithNameA
-#define BuildImpersonateTrustee BuildImpersonateTrusteeA
-#define GetMultipleTrusteeOperation GetMultipleTrusteeOperationA
-#define GetMultipleTrustee GetMultipleTrusteeA
-#endif /* UNICODE */
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-#endif
reactos/include/msvcrt
diff -u -r1.9 -r1.9.32.1
--- ctype.h 25 Aug 2003 01:37:47 -0000 1.9
+++ ctype.h 30 Dec 2004 04:36:26 -0000 1.9.32.1
@@ -18,9 +18,9 @@
* DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Revision: 1.9 $
- * $Author: sedwards $
- * $Date: 2003/08/25 01:37:47 $
+ * $Revision: 1.9.32.1 $
+ * $Author: hyperion $
+ * $Date: 2004/12/30 04:36:26 $
*
*/
@@ -119,10 +119,8 @@
int iswupper(wint_t);
int iswxdigit(wint_t);
-/* wchar_t towlower(wchar_t); */
-/* wchar_t towupper(wchar_t); */
-int towlower(wint_t);
-int towupper(wint_t);
+wchar_t towlower(wchar_t);
+wchar_t towupper(wchar_t);
int isleadbyte(int);
reactos/include/msvcrt
diff -u -r1.6 -r1.6.32.1
--- string.h 25 Aug 2003 01:37:47 -0000 1.6
+++ string.h 30 Dec 2004 04:36:26 -0000 1.6.32.1
@@ -18,9 +18,9 @@
* DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Revision: 1.6 $
- * $Author: sedwards $
- * $Date: 2003/08/25 01:37:47 $
+ * $Revision: 1.6.32.1 $
+ * $Author: hyperion $
+ * $Date: 2004/12/30 04:36:26 $
*
*/
/* Appropriated for Reactos Crtdll by Ariadne */
@@ -39,6 +39,7 @@
#define __need_wchar_t
#define __need_NULL
#include <msvcrt/stddef.h>
+#include <_mingw.h>
#ifdef __cplusplus
extern "C" {
@@ -166,7 +167,11 @@
/* NOTE: There is no _wcscmpi, but this is for compatibility. */
int wcscmpi(const wchar_t* ws1, const wchar_t* ws2);
+#if __MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION == 5
+wchar_t* wcsdup(wchar_t* wsToDuplicate);
+#else
wchar_t* wcsdup(const wchar_t* wsToDuplicate);
+#endif
int wcsicmp(const wchar_t* ws1, const wchar_t* ws2);
int wcsicoll(const wchar_t* ws1, const wchar_t* ws2);
wchar_t* wcslwr(wchar_t* wsToConvert);
reactos/include/ntdll
diff -u -r1.52.2.3 -r1.52.2.4
--- rtl.h 13 Dec 2004 16:18:01 -0000 1.52.2.3
+++ rtl.h 30 Dec 2004 04:36:26 -0000 1.52.2.4
@@ -1,4 +1,4 @@
-/* $Id: rtl.h,v 1.52.2.3 2004/12/13 16:18:01 hyperion Exp $
+/* $Id: rtl.h,v 1.52.2.4 2004/12/30 04:36:26 hyperion Exp $
*
*/
reactos/include/ntos
diff -u -r1.9.2.3 -r1.9.2.4
--- haltypes.h 13 Dec 2004 16:18:01 -0000 1.9.2.3
+++ haltypes.h 30 Dec 2004 04:36:26 -0000 1.9.2.4
@@ -1,4 +1,4 @@
-/* $Id: haltypes.h,v 1.9.2.3 2004/12/13 16:18:01 hyperion Exp $
+/* $Id: haltypes.h,v 1.9.2.4 2004/12/30 04:36:26 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
reactos/include/ntos
diff -u -r1.4 -r1.4.32.1
--- heap.h 14 Nov 2002 18:21:03 -0000 1.4
+++ heap.h 30 Dec 2004 04:36:26 -0000 1.4.32.1
@@ -13,15 +13,15 @@
#define __INCLUDE_HEAP_H
/* HeapAlloc, HeapReAlloc */
-#define HEAP_NO_VALLOC (64)
+#define HEAP_NO_VALLOC (256)
#ifndef __USE_W32API
+#define HEAP_NO_SERIALIZE (1)
+#define HEAP_GROWABLE (2)
#define HEAP_GENERATE_EXCEPTIONS (4)
-#define HEAP_NO_SERIALIZE (1)
-#define HEAP_ZERO_MEMORY (8)
+#define HEAP_ZERO_MEMORY (8)
#define HEAP_REALLOC_IN_PLACE_ONLY (16)
-#define HEAP_GROWABLE (32)
#endif /* !__USE_W32API */
reactos/include/ntos
diff -u -r1.4.32.1 -r1.4.32.2
--- kdbgsyms.h 8 Dec 2004 21:56:57 -0000 1.4.32.1
+++ kdbgsyms.h 30 Dec 2004 04:36:26 -0000 1.4.32.2
@@ -1,34 +1,10 @@
-
#ifndef __KDBGSYMS_H
#define __KDBGSYMS_H
#include <ddk/ntddk.h>
-#define ST_FILENAME 0x00
-#define ST_FUNCTION 0x01
-#define ST_LINENUMBER 0x02
-
-typedef struct _SYMBOL
-{
- struct _SYMBOL *Next;
- /* Address relative to module base address */
- ULONG RelativeAddress;
- ULONG SymbolType;
- ANSI_STRING Name;
- ULONG LineNumber;
-} SYMBOL, *PSYMBOL;
-
-typedef struct _SYMBOL_TABLE
-{
- ULONG SymbolCount;
- PSYMBOL Symbols;
-} SYMBOL_TABLE, *PSYMBOL_TABLE;
-
typedef struct _IMAGE_SYMBOL_INFO
{
- SYMBOL_TABLE FileNameSymbols;
- SYMBOL_TABLE FunctionSymbols;
- SYMBOL_TABLE LineNumberSymbols;
ULONG_PTR ImageBase;
ULONG_PTR ImageSize;
PVOID FileBuffer;
@@ -38,8 +14,5 @@
ULONG SymbolStringsLength;
} IMAGE_SYMBOL_INFO, *PIMAGE_SYMBOL_INFO;
-#define AreSymbolsParsed(si)((si)->FileNameSymbols.Symbols \
- || (si)->FunctionSymbols.Symbols \
- || (si)->LineNumberSymbols.Symbols)
+#endif /* __KDBGSYMS_H */
-#endif
reactos/include/ntos
diff -u -r1.38.2.3 -r1.38.2.4
--- rtl.h 13 Dec 2004 16:18:01 -0000 1.38.2.3
+++ rtl.h 30 Dec 2004 04:36:26 -0000 1.38.2.4
@@ -1,4 +1,4 @@
-/* $Id: rtl.h,v 1.38.2.3 2004/12/13 16:18:01 hyperion Exp $
+/* $Id: rtl.h,v 1.38.2.4 2004/12/30 04:36:26 hyperion Exp $
*
*/
#ifndef __DDK_RTL_H
@@ -960,7 +960,7 @@
NTSTATUS STDCALL
RtlDestroyAtomTable (IN PRTL_ATOM_TABLE AtomTable);
-BOOLEAN STDCALL
+HANDLE STDCALL
RtlDestroyHeap (HANDLE hheap);
NTSTATUS
reactos/include/ntos
diff -u -r1.35.2.4 -r1.35.2.5
--- zw.h 13 Dec 2004 16:18:01 -0000 1.35.2.4
+++ zw.h 30 Dec 2004 04:36:26 -0000 1.35.2.5
@@ -1,5 +1,4 @@
-
-/* $Id: zw.h,v 1.35.2.4 2004/12/13 16:18:01 hyperion Exp $
+/* $Id: zw.h,v 1.35.2.5 2004/12/30 04:36:26 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -830,9 +829,9 @@
IN ULONG ShareAccess,
IN ULONG CreateDisposition,
IN ULONG CreateOptions,
- IN BOOLEAN WriteModeMessage,
- IN BOOLEAN ReadModeMessage,
- IN BOOLEAN NonBlocking,
+ IN ULONG NamedPipeType,
+ IN ULONG ReadMode,
+ IN ULONG CompletionMode,
IN ULONG MaxInstances,
IN ULONG InBufferSize,
IN ULONG OutBufferSize,
@@ -846,9 +845,9 @@
IN ULONG ShareAccess,
IN ULONG CreateDisposition,
IN ULONG CreateOptions,
- IN BOOLEAN WriteModeMessage,
- IN BOOLEAN ReadModeMessage,
- IN BOOLEAN NonBlocking,
+ IN ULONG NamedPipeType,
+ IN ULONG ReadMode,
+ IN ULONG CompletionMode,
IN ULONG MaxInstances,
IN ULONG InBufferSize,
IN ULONG OutBufferSize,
@@ -5838,7 +5837,7 @@
NtDuplicateToken(
IN HANDLE ExistingToken,
IN ACCESS_MASK DesiredAccess,
- IN POBJECT_ATTRIBUTES ObjectAttributes,
+ IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
IN BOOLEAN EffectiveOnly,
IN TOKEN_TYPE TokenType,
OUT PHANDLE NewToken
@@ -5849,8 +5848,8 @@
ZwDuplicateToken(
IN HANDLE ExistingToken,
IN ACCESS_MASK DesiredAccess,
- IN POBJECT_ATTRIBUTES ObjectAttributes,
- IN SECURITY_IMPERSONATION_LEVEL ImpersonationLevel,
+ IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
+ IN BOOLEAN EffectiveOnly,
IN TOKEN_TYPE TokenType,
OUT PHANDLE NewToken
);
reactos/include/reactos
diff -u -r1.26 -r1.26.6.1
--- version.h 26 Aug 2004 21:05:42 -0000 1.26
+++ version.h 30 Dec 2004 04:36:27 -0000 1.26.6.1
@@ -1,4 +1,4 @@
-/* $Id: version.h,v 1.26 2004/08/26 21:05:42 gvg Exp $
+/* $Id: version.h,v 1.26.6.1 2004/12/30 04:36:27 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -18,8 +18,8 @@
#define __VERSION_H
#define KERNEL_VERSION_MAJOR 0
-#define KERNEL_VERSION_MINOR 2
-#define KERNEL_VERSION_PATCH_LEVEL 5
+#define KERNEL_VERSION_MINOR 3
+#define KERNEL_VERSION_PATCH_LEVEL 0
/* KERNEL_VERSION_BUILD_TYPE is L"CVS", L"RC1", L"RC2" or L"RELEASE" */
#define KERNEL_VERSION_BUILD_TYPE L"CVS"
reactos/include/user32
diff -u -r1.8 -r1.8.16.1
--- regcontrol.h 16 May 2004 19:31:06 -0000 1.8
+++ regcontrol.h 30 Dec 2004 04:36:27 -0000 1.8.16.1
@@ -1,4 +1,4 @@
-/* $Id: regcontrol.h,v 1.8 2004/05/16 19:31:06 navaraf Exp $
+/* $Id: regcontrol.h,v 1.8.16.1 2004/12/30 04:36:27 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS User32
reactos/include/win32k
diff -u -r1.26.4.1 -r1.26.4.2
--- gdiobj.h 13 Dec 2004 09:38:52 -0000 1.26.4.1
+++ gdiobj.h 30 Dec 2004 04:36:27 -0000 1.26.4.2
@@ -65,6 +65,8 @@
PETHREAD LockingThread; /* only assigned if a thread is holding the lock! */
ULONG Locks;
#ifdef GDI_DEBUG
+ const char* createdfile;
+ int createdline;
const char* lockfile;
int lockline;
#endif
@@ -77,7 +79,6 @@
DWORD ObjectType;
} GDIMULTILOCK, *PGDIMULTILOCK;
-HGDIOBJ INTERNAL_CALL GDIOBJ_AllocObj(ULONG ObjectType);
BOOL INTERNAL_CALL GDIOBJ_LockMultipleObj(PGDIMULTILOCK pList, INT nObj);
BOOL INTERNAL_CALL GDIOBJ_UnlockMultipleObj(PGDIMULTILOCK pList, INT nObj);
BOOL INTERNAL_CALL GDIOBJ_OwnedByCurrentProcess(HGDIOBJ ObjectHandle);
@@ -92,16 +93,19 @@
#ifdef GDI_DEBUG
/* a couple macros for debugging GDIOBJ locking */
+#define GDIOBJ_AllocObj(ty) GDIOBJ_AllocObjDbg(__FILE__,__LINE__,ty)
#define GDIOBJ_FreeObj(obj,ty) GDIOBJ_FreeObjDbg(__FILE__,__LINE__,obj,ty)
#define GDIOBJ_LockObj(obj,ty) GDIOBJ_LockObjDbg(__FILE__,__LINE__,obj,ty)
#define GDIOBJ_UnlockObj(obj) GDIOBJ_UnlockObjDbg(__FILE__,__LINE__,obj)
+HGDIOBJ INTERNAL_CALL GDIOBJ_AllocObjDbg(const char* file, int line, ULONG ObjectType);
BOOL INTERNAL_CALL GDIOBJ_FreeObjDbg (const char* file, int line, HGDIOBJ hObj, DWORD ObjectType);
PGDIOBJ INTERNAL_CALL GDIOBJ_LockObjDbg (const char* file, int line, HGDIOBJ hObj, DWORD ObjectType);
BOOL INTERNAL_CALL GDIOBJ_UnlockObjDbg (const char* file, int line, HGDIOBJ hObj);
#else /* !GDI_DEBUG */
+HGDIOBJ INTERNAL_CALL GDIOBJ_AllocObj(ULONG ObjectType);
BOOL INTERNAL_CALL GDIOBJ_FreeObj (HGDIOBJ hObj, DWORD ObjectType);
PGDIOBJ INTERNAL_CALL GDIOBJ_LockObj (HGDIOBJ hObj, DWORD ObjectType);
BOOL INTERNAL_CALL GDIOBJ_UnlockObj (HGDIOBJ hObj);
reactos/include/win32k
diff -u -r1.139.2.2 -r1.139.2.3
--- ntuser.h 13 Dec 2004 09:38:52 -0000 1.139.2.2
+++ ntuser.h 30 Dec 2004 04:36:27 -0000 1.139.2.3
@@ -156,14 +156,15 @@
WPARAM wParam,
LPARAM lParam);
-#define NOPARAM_ROUTINE_REGISTER_PRIMITIVE 0xffff0001 /* Private ROS */
-#define NOPARAM_ROUTINE_DESTROY_CARET 0xffff0002
-#define NOPARAM_ROUTINE_UNINIT_MESSAGE_PUMP 0xffff0003
-#define NOPARAM_ROUTINE_INIT_MESSAGE_PUMP 0xffff0004
-#define NOPARAM_ROUTINE_GETMESSAGEEXTRAINFO 0xffff0005
-#define NOPARAM_ROUTINE_ANYPOPUP 0xffff0006
-#define NOPARAM_ROUTINE_CSRSS_INITIALIZED 0xffff0007
-#define NOPARAM_ROUTINE_GDI_QUERY_TABLE 0xffff0008
+#define NOPARAM_ROUTINE_MSQCLEARWAKEMASK 0x3
+#define NOPARAM_ROUTINE_REGISTER_PRIMITIVE 0xffff0001 /* Private ROS */
+#define NOPARAM_ROUTINE_DESTROY_CARET 0xffff0002
+#define NOPARAM_ROUTINE_UNINIT_MESSAGE_PUMP 0xffff0003
+#define NOPARAM_ROUTINE_INIT_MESSAGE_PUMP 0xffff0004
+#define NOPARAM_ROUTINE_GETMESSAGEEXTRAINFO 0xffff0005
+#define NOPARAM_ROUTINE_ANYPOPUP 0xffff0006
+#define NOPARAM_ROUTINE_CSRSS_INITIALIZED 0xffff0007
+#define NOPARAM_ROUTINE_GDI_QUERY_TABLE 0xffff0008
DWORD
STDCALL
NtUserCallNoParam(
@@ -178,11 +179,12 @@
#define ONEPARAM_ROUTINE_GETCARETINFO 0x07
#define ONEPARAM_ROUTINE_SWITCHCARETSHOWING 0x08
#define ONEPARAM_ROUTINE_ENUMCLIPBOARDFORMATS 0x09
-#define ONEPARAM_ROUTINE_GETWINDOWINSTANCE 0x10
#define ONEPARAM_ROUTINE_SETMESSAGEEXTRAINFO 0x0a
#define ONEPARAM_ROUTINE_GETCURSORPOSITION 0x0b
#define ONEPARAM_ROUTINE_ISWINDOWINDESTROY 0x0c
#define ONEPARAM_ROUTINE_ENABLEPROCWNDGHSTING 0x0d
+#define ONEPARAM_ROUTINE_GETWINDOWINSTANCE 0x10
+#define ONEPARAM_ROUTINE_MSQSETWAKEMASK 0x27
DWORD
STDCALL
NtUserCallOneParam(
reactos/include/wine
diff -N urlmon.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ urlmon.h 30 Dec 2004 04:36:28 -0000 1.1.2.1
@@ -0,0 +1,2263 @@
+/*** Autogenerated by WIDL 0.1 from urlmon.idl - Do not edit ***/
+#include <rpc.h>
+#include <rpcndr.h>
+
+#ifndef __WIDL_URLMON_H
+#define __WIDL_URLMON_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <objidl.h>
+#include <oleidl.h>
+#include <servprov.h>
+#ifndef __IBinding_FWD_DEFINED__
+#define __IBinding_FWD_DEFINED__
+typedef struct IBinding IBinding;
+#endif
+
+typedef IBinding *LPBINDING;
+
+/*****************************************************************************
+ * IBinding interface
+ */
+#ifndef __IBinding_INTERFACE_DEFINED__
+#define __IBinding_INTERFACE_DEFINED__
+
+DEFINE_GUID(IID_IBinding, 0x79eac9c0, 0xbaf9, 0x11ce, 0x8c,0x82, 0x00,0xaa,0x00,0x4b,0xa9,0x0b);
+#if defined(__cplusplus) && !defined(CINTERFACE)
+struct IBinding : public IUnknown
+{
+ virtual HRESULT STDMETHODCALLTYPE Abort(
+ ) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE Suspend(
+ ) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE Resume(
+ ) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetPriority(
+ LONG nPriority) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetPriority(
+ LONG* pnPriority) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetBindResult(
+ CLSID* pclsidProtocol,
+ DWORD* pdwResult,
+ LPOLESTR* pszResult,
+ DWORD* pdwReserved) = 0;
+
+};
+#else
+typedef struct IBindingVtbl IBindingVtbl;
+struct IBinding {
+ const IBindingVtbl* lpVtbl;
+};
+struct IBindingVtbl {
+ BEGIN_INTERFACE
+
+ /*** IUnknown methods ***/
+ HRESULT (STDMETHODCALLTYPE *QueryInterface)(
+ IBinding* This,
+ REFIID riid,
+ void** ppvObject);
+
+ ULONG (STDMETHODCALLTYPE *AddRef)(
+ IBinding* This);
+
+ ULONG (STDMETHODCALLTYPE *Release)(
+ IBinding* This);
+
+ /*** IBinding methods ***/
+ HRESULT (STDMETHODCALLTYPE *Abort)(
+ IBinding* This);
+
+ HRESULT (STDMETHODCALLTYPE *Suspend)(
+ IBinding* This);
+
+ HRESULT (STDMETHODCALLTYPE *Resume)(
+ IBinding* This);
+
+ HRESULT (STDMETHODCALLTYPE *SetPriority)(
+ IBinding* This,
+ LONG nPriority);
+
+ HRESULT (STDMETHODCALLTYPE *GetPriority)(
+ IBinding* This,
+ LONG* pnPriority);
+
+ HRESULT (STDMETHODCALLTYPE *GetBindResult)(
+ IBinding* This,
+ CLSID* pclsidProtocol,
+ DWORD* pdwResult,
+ LPOLESTR* pszResult,
+ DWORD* pdwReserved);
+
+ END_INTERFACE
+};
+
+#ifdef COBJMACROS
+/*** IUnknown methods ***/
+#define IBinding_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IBinding_AddRef(p) (p)->lpVtbl->AddRef(p)
+#define IBinding_Release(p) (p)->lpVtbl->Release(p)
+/*** IBinding methods ***/
+#define IBinding_Abort(p) (p)->lpVtbl->Abort(p)
+#define IBinding_Suspend(p) (p)->lpVtbl->Suspend(p)
+#define IBinding_Resume(p) (p)->lpVtbl->Resume(p)
+#define IBinding_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a)
+#define IBinding_GetPriority(p,a) (p)->lpVtbl->GetPriority(p,a)
+#define IBinding_GetBindResult(p,a,b,c,d) (p)->lpVtbl->GetBindResult(p,a,b,c,d)
+#endif
+
+#endif
+
+HRESULT CALLBACK IBinding_Abort_Proxy(
+ IBinding* This);
+void __RPC_STUB IBinding_Abort_Stub(
+ struct IRpcStubBuffer* This,
+ struct IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT CALLBACK IBinding_Suspend_Proxy(
+ IBinding* This);
+void __RPC_STUB IBinding_Suspend_Stub(
+ struct IRpcStubBuffer* This,
+ struct IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT CALLBACK IBinding_Resume_Proxy(
+ IBinding* This);
+void __RPC_STUB IBinding_Resume_Stub(
+ struct IRpcStubBuffer* This,
+ struct IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT CALLBACK IBinding_SetPriority_Proxy(
+ IBinding* This,
+ LONG nPriority);
+void __RPC_STUB IBinding_SetPriority_Stub(
+ struct IRpcStubBuffer* This,
+ struct IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT CALLBACK IBinding_GetPriority_Proxy(
+ IBinding* This,
+ LONG* pnPriority);
+void __RPC_STUB IBinding_GetPriority_Stub(
+ struct IRpcStubBuffer* This,
+ struct IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT CALLBACK IBinding_RemoteGetBindResult_Proxy(
+ IBinding* This,
+ CLSID* pclsidProtocol,
+ DWORD* pdwResult,
+ LPOLESTR* pszResult,
+ DWORD dwReserved);
+void __RPC_STUB IBinding_RemoteGetBindResult_Stub(
+ struct IRpcStubBuffer* This,
+ struct IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT CALLBACK IBinding_GetBindResult_Proxy(
+ IBinding* This,
+ CLSID* pclsidProtocol,
+ DWORD* pdwResult,
+ LPOLESTR* pszResult,
+ DWORD* pdwReserved);
+HRESULT __RPC_STUB IBinding_GetBindResult_Stub(
+ IBinding* This,
+ CLSID* pclsidProtocol,
+ DWORD* pdwResult,
+ LPOLESTR* pszResult,
+ DWORD dwReserved);
+
+#endif /* __IBinding_INTERFACE_DEFINED__ */
+
+#ifndef __IBindStatusCallback_FWD_DEFINED__
+#define __IBindStatusCallback_FWD_DEFINED__
+typedef struct IBindStatusCallback IBindStatusCallback;
+#endif
+
+typedef IBindStatusCallback *LPBINDSTATUSCALLBACK;
+
+typedef enum {
+ BINDF_ASYNCHRONOUS = 0x1,
+ BINDF_ASYNCSTORAGE = 0x2,
+ BINDF_NOPROGRESSIVERENDERING = 0x4,
+ BINDF_OFFLINEOPERATION = 0x8,
+ BINDF_GETNEWESTVERSION = 0x10,
+ BINDF_NOWRITECACHE = 0x20,
+ BINDF_NEEDFILE = 0x40,
+ BINDF_PULLDATA = 0x80,
+ BINDF_IGNORESECURITYPROBLEM = 0x100,
+ BINDF_RESYNCHRONIZE = 0x200,
+ BINDF_HYPERLINK = 0x400,
+ BINDF_NO_UI = 0x800,
+ BINDF_SILENTOPERATION = 0x1000,
+ BINDF_PRAGMA_NO_CACHE = 0x2000,
+ BINDF_GETCLASSOBJECT = 0x4000,
+ BINDF_RESERVED_1 = 0x8000,
+ BINDF_FREE_THREADED = 0x10000,
+ BINDF_DIRECT_READ = 0x20000,
+ BINDF_FORMS_SUBMIT = 0x40000,
+ BINDF_GETFROMCACHE_IF_NET_FAIL = 0x80000,
+ BINDF_FROMURLMON = 0x100000,
+ BINDF_FWD_BACK = 0x200000,
+ BINDF_PREFERDEFAULTHANDLER = 0x400000,
+ BINDF_ENFORCERESTRICTED = 0x800000
+} BINDF;
+
+typedef struct _tagBINDINFO {
+ ULONG cbSize;
+ LPWSTR szExtraInfo;
+ STGMEDIUM stgmedData;
+ DWORD grfBindInfoF;
+ DWORD dwBindVerb;
+ LPWSTR szCustomVerb;
+ DWORD cbStgmedData;
+ DWORD dwOptions;
+ DWORD dwOptionsFlags;
+ DWORD dwCodePage;
+ SECURITY_ATTRIBUTES securityAttributes;
+ IID iid;
+ IUnknown *pUnk;
+ DWORD dwReserved;
+} BINDINFO;
+
+typedef struct _REMSECURITY_ATTRIBUTES {
+ DWORD nLength;
+ DWORD lpSecurityDescriptor;
+ BOOL bInheritHandle;
+} REMSECURITY_ATTRIBUTES, *PREMSECURITY_ATTRIBUTES, *LPREMSECURITY_ATTRIBUTES;
+
+typedef struct _tagRemBINDINFO {
+ ULONG cbSize;
+ LPWSTR szExtraInfo;
+ DWORD grfBindInfoF;
+ DWORD dwBindVerb;
+ LPWSTR szCustomVerb;
+ DWORD cbstgmedData;
+ DWORD dwOptions;
+ DWORD dwOptionsFlags;
+ DWORD dwCodePage;
+ REMSECURITY_ATTRIBUTES securityAttributes;
+ IID iid;
+ IUnknown *pUnk;
+ DWORD dwReserved;
+} RemBINDINFO;
+
+typedef struct tagRemFORMATETC {
+ DWORD cfFormat;
+ DWORD ptd;
+ DWORD dwAspect;
+ LONG lindex;
+ DWORD tymed;
+} RemFORMATETC, *LPREMFORMATETC;
+
+typedef enum {
+ BSCF_FIRSTDATANOTIFICATION = 0x1,
+ BSCF_INTERMEDIATEDATANOTIFICATION = 0x2,
+ BSCF_LASTDATANOTIFICATION = 0x4,
+ BSCF_DATAFULLYAVAILABLE = 0x8,
+ BSCF_AVAILABLEDATASIZEUNKNOWN = 0x10
+} BSCF;
+
+typedef enum BINDSTATUS {
+ BINDSTATUS_FINDINGRESOURCE = 1,
+ BINDSTATUS_CONNECTING,
+ BINDSTATUS_REDIRECTING,
+ BINDSTATUS_BEGINDOWNLOADDATA,
+ BINDSTATUS_DOWNLOADINGDATA,
+ BINDSTATUS_ENDDOWNLOADDATA,
+ BINDSTATUS_BEGINDOWNLOADCOMPONENTS,
+ BINDSTATUS_INSTALLINGCOMPONENTS,
+ BINDSTATUS_ENDDOWNLOADCOMPONENTS,
+ BINDSTATUS_USINGCACHEDCOPY,
+ BINDSTATUS_SENDINGREQUEST,
+ BINDSTATUS_CLASSIDAVAILABLE,
+ BINDSTATUS_MIMETYPEAVAILABLE,
+ BINDSTATUS_CACHEFILENAMEAVAILABLE,
+ BINDSTATUS_BEGINSYNCOPERATION,
+ BINDSTATUS_ENDSYNCOPERATION,
+ BINDSTATUS_BEGINUPLOADDATA,
+ BINDSTATUS_UPLOADINGDATA,
+ BINDSTATUS_ENDUPLOADINGDATA,
+ BINDSTATUS_PROTOCOLCLASSID,
+ BINDSTATUS_ENCODING,
+ BINDSTATUS_VERFIEDMIMETYPEAVAILABLE,
+ BINDSTATUS_CLASSINSTALLLOCATION,
+ BINDSTATUS_DECODING,
+ BINDSTATUS_LOADINGMIMEHANDLER,
+ BINDSTATUS_CONTENTDISPOSITIONATTACH,
+ BINDSTATUS_FILTERREPORTMIMETYPE,
+ BINDSTATUS_CLSIDCANINSTANTIATE,
+ BINDSTATUS_IUNKNOWNAVAILABLE,
+ BINDSTATUS_DIRECTBIND,
+ BINDSTATUS_RAWMIMETYPE,
+ BINDSTATUS_PROXYDETECTING,
+ BINDSTATUS_ACCEPTRANGES,
+ BINDSTATUS_COOKIE_SENT,
+ BINDSTATUS_COMPACT_POLICY_RECEIVED,
+ BINDSTATUS_COOKIE_SUPPRESSED,
+ BINDSTATUS_COOKIE_STATE_UNKNOWN,
+ BINDSTATUS_COOKIE_STATE_ACCEPT,
+ BINDSTATUS_COOKIE_STATE_REJECT,
+ BINDSTATUS_COOKIE_STATE_PROMPT,
+ BINDSTATUS_COOKIE_STATE_LEASH,
+ BINDSTATUS_COOKIE_STATE_DOWNGRADE,
+ BINDSTATUS_POLICY_HREF,
+ BINDSTATUS_P3P_HEADER,
+ BINDSTATUS_SESSION_COOKIE_RECEIVED,
+ BINDSTATUS_PERSISTENT_COOKIE_RECEIVED,
+ BINDSTATUS_SESSION_COOKIES_ALLOWED,
+ BINDSTATUS_CACHECONTROL
+} BINDSTATUS;
+
+/*****************************************************************************
+ * IBindStatusCallback interface
+ */
+#ifndef __IBindStatusCallback_INTERFACE_DEFINED__
+#define __IBindStatusCallback_INTERFACE_DEFINED__
+
+DEFINE_GUID(IID_IBindStatusCallback, 0x79eac9c1, 0xbaf9, 0x11ce, 0x8c,0x82, 0x00,0xaa,0x00,0x4b,0xa9,0x0b);
+#if defined(__cplusplus) && !defined(CINTERFACE)
+struct IBindStatusCallback : public IUnknown
+{
+ virtual HRESULT STDMETHODCALLTYPE OnStartBinding(
+ DWORD dwReserved,
+ IBinding* pib) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetPriority(
+ LONG* pnPriority) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE OnLowResource(
+ DWORD reserved) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE OnProgress(
+ ULONG ulProgress,
+ ULONG ulProgressMax,
+ ULONG ulStatusCode,
+ LPCWSTR szStatusText) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE OnStopBinding(
+ HRESULT hresult,
+ LPCWSTR szError) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetBindInfo(
+ DWORD* grfBINDF,
+ BINDINFO* pbindinfo) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE OnDataAvailable(
+ DWORD grfBSCF,
+ DWORD dwSize,
+ FORMATETC* pformatetc,
+ STGMEDIUM* pstgmed) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE OnObjectAvailable(
+ REFIID riid,
+ IUnknown* punk) = 0;
+
+};
+#else
+typedef struct IBindStatusCallbackVtbl IBindStatusCallbackVtbl;
+struct IBindStatusCallback {
+ const IBindStatusCallbackVtbl* lpVtbl;
+};
+struct IBindStatusCallbackVtbl {
+ BEGIN_INTERFACE
+
+ /*** IUnknown methods ***/
+ HRESULT (STDMETHODCALLTYPE *QueryInterface)(
+ IBindStatusCallback* This,
+ REFIID riid,
+ void** ppvObject);
+
+ ULONG (STDMETHODCALLTYPE *AddRef)(
+ IBindStatusCallback* This);
+
+ ULONG (STDMETHODCALLTYPE *Release)(
+ IBindStatusCallback* This);
+
+ /*** IBindStatusCallback methods ***/
+ HRESULT (STDMETHODCALLTYPE *OnStartBinding)(
+ IBindStatusCallback* This,
+ DWORD dwReserved,
+ IBinding* pib);
+
+ HRESULT (STDMETHODCALLTYPE *GetPriority)(
+ IBindStatusCallback* This,
+ LONG* pnPriority);
+
+ HRESULT (STDMETHODCALLTYPE *OnLowResource)(
+ IBindStatusCallback* This,
+ DWORD reserved);
+
+ HRESULT (STDMETHODCALLTYPE *OnProgress)(
+ IBindStatusCallback* This,
+ ULONG ulProgress,
+ ULONG ulProgressMax,
+ ULONG ulStatusCode,
+ LPCWSTR szStatusText);
+
+ HRESULT (STDMETHODCALLTYPE *OnStopBinding)(
+ IBindStatusCallback* This,
+ HRESULT hresult,
+ LPCWSTR szError);
+
+ HRESULT (STDMETHODCALLTYPE *GetBindInfo)(
+ IBindStatusCallback* This,
+ DWORD* grfBINDF,
+ BINDINFO* pbindinfo);
+
+ HRESULT (STDMETHODCALLTYPE *OnDataAvailable)(
+ IBindStatusCallback* This,
+ DWORD grfBSCF,
+ DWORD dwSize,
+ FORMATETC* pformatetc,
+ STGMEDIUM* pstgmed);
+
+ HRESULT (STDMETHODCALLTYPE *OnObjectAvailable)(
+ IBindStatusCallback* This,
+ REFIID riid,
+ IUnknown* punk);
+
+ END_INTERFACE
+};
+
+#ifdef COBJMACROS
+/*** IUnknown methods ***/
+#define IBindStatusCallback_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IBindStatusCallback_AddRef(p) (p)->lpVtbl->AddRef(p)
+#define IBindStatusCallback_Release(p) (p)->lpVtbl->Release(p)
+/*** IBindStatusCallback methods ***/
+#define IBindStatusCallback_OnStartBinding(p,a,b) (p)->lpVtbl->OnStartBinding(p,a,b)
+#define IBindStatusCallback_GetPriority(p,a) (p)->lpVtbl->GetPriority(p,a)
+#define IBindStatusCallback_OnLowResource(p,a) (p)->lpVtbl->OnLowResource(p,a)
+#define IBindStatusCallback_OnProgress(p,a,b,c,d) (p)->lpVtbl->OnProgress(p,a,b,c,d)
+#define IBindStatusCallback_OnStopBinding(p,a,b) (p)->lpVtbl->OnStopBinding(p,a,b)
+#define IBindStatusCallback_GetBindInfo(p,a,b) (p)->lpVtbl->GetBindInfo(p,a,b)
+#define IBindStatusCallback_OnDataAvailable(p,a,b,c,d) (p)->lpVtbl->OnDataAvailable(p,a,b,c,d)
+#define IBindStatusCallback_OnObjectAvailable(p,a,b) (p)->lpVtbl->OnObjectAvailable(p,a,b)
+#endif
+
+#endif
+
+HRESULT CALLBACK IBindStatusCallback_OnStartBinding_Proxy(
+ IBindStatusCallback* This,
+ DWORD dwReserved,
+ IBinding* pib);
+void __RPC_STUB IBindStatusCallback_OnStartBinding_Stub(
+ struct IRpcStubBuffer* This,
+ struct IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT CALLBACK IBindStatusCallback_GetPriority_Proxy(
+ IBindStatusCallback* This,
+ LONG* pnPriority);
+void __RPC_STUB IBindStatusCallback_GetPriority_Stub(
+ struct IRpcStubBuffer* This,
+ struct IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT CALLBACK IBindStatusCallback_OnLowResource_Proxy(
+ IBindStatusCallback* This,
+ DWORD reserved);
+void __RPC_STUB IBindStatusCallback_OnLowResource_Stub(
+ struct IRpcStubBuffer* This,
+ struct IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT CALLBACK IBindStatusCallback_OnProgress_Proxy(
+ IBindStatusCallback* This,
+ ULONG ulProgress,
+ ULONG ulProgressMax,
+ ULONG ulStatusCode,
+ LPCWSTR szStatusText);
+void __RPC_STUB IBindStatusCallback_OnProgress_Stub(
+ struct IRpcStubBuffer* This,
+ struct IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT CALLBACK IBindStatusCallback_OnStopBinding_Proxy(
+ IBindStatusCallback* This,
+ HRESULT hresult,
+ LPCWSTR szError);
+void __RPC_STUB IBindStatusCallback_OnStopBinding_Stub(
+ struct IRpcStubBuffer* This,
+ struct IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT CALLBACK IBindStatusCallback_RemoteGetBindInfo_Proxy(
+ IBindStatusCallback* This,
+ DWORD* grfBINDF,
+ RemBINDINFO* pbindinfo,
+ RemSTGMEDIUM* pstgmed);
+void __RPC_STUB IBindStatusCallback_RemoteGetBindInfo_Stub(
+ struct IRpcStubBuffer* This,
+ struct IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT CALLBACK IBindStatusCallback_GetBindInfo_Proxy(
+ IBindStatusCallback* This,
+ DWORD* grfBINDF,
+ BINDINFO* pbindinfo);
+HRESULT __RPC_STUB IBindStatusCallback_GetBindInfo_Stub(
+ IBindStatusCallback* This,
+ DWORD* grfBINDF,
+ RemBINDINFO* pbindinfo,
+ RemSTGMEDIUM* pstgmed);
+HRESULT CALLBACK IBindStatusCallback_RemoteOnDataAvailable_Proxy(
+ IBindStatusCallback* This,
+ DWORD grfBSCF,
+ DWORD dwSize,
+ RemFORMATETC* pformatetc,
+ RemSTGMEDIUM* pstgmed);
+void __RPC_STUB IBindStatusCallback_RemoteOnDataAvailable_Stub(
+ struct IRpcStubBuffer* This,
+ struct IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT CALLBACK IBindStatusCallback_OnDataAvailable_Proxy(
+ IBindStatusCallback* This,
+ DWORD grfBSCF,
+ DWORD dwSize,
+ FORMATETC* pformatetc,
+ STGMEDIUM* pstgmed);
+HRESULT __RPC_STUB IBindStatusCallback_OnDataAvailable_Stub(
+ IBindStatusCallback* This,
+ DWORD grfBSCF,
+ DWORD dwSize,
+ RemFORMATETC* pformatetc,
+ RemSTGMEDIUM* pstgmed);
+HRESULT CALLBACK IBindStatusCallback_OnObjectAvailable_Proxy(
+ IBindStatusCallback* This,
+ REFIID riid,
+ IUnknown* punk);
+void __RPC_STUB IBindStatusCallback_OnObjectAvailable_Stub(
+ struct IRpcStubBuffer* This,
+ struct IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+
+#endif /* __IBindStatusCallback_INTERFACE_DEFINED__ */
+
+#define SID_IBindHost IID_IBindHost
+#define SID_SBindHost IID_IBindHost
+#ifndef __IBindHost_FWD_DEFINED__
+#define __IBindHost_FWD_DEFINED__
+typedef struct IBindHost IBindHost;
+#endif
+
+typedef IBindHost *LPBINDHOST;
+
+/*****************************************************************************
+ * IBindHost interface
+ */
+#ifndef __IBindHost_INTERFACE_DEFINED__
+#define __IBindHost_INTERFACE_DEFINED__
+
+DEFINE_GUID(IID_IBindHost, 0xfc4801a1, 0x2ba9, 0x11cf, 0xa2,0x29, 0x00,0xaa,0x00,0x3d,0x73,0x52);
+#if defined(__cplusplus) && !defined(CINTERFACE)
+struct IBindHost : public IUnknown
+{
+ virtual HRESULT STDMETHODCALLTYPE CreateMoniker(
+ LPOLESTR szName,
+ IBindCtx* pBC,
+ IMoniker** ppmk,
+ DWORD dwReserved) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE MonikerBindToStorage(
+ IMoniker* pMk,
+ IBindCtx* pBC,
+ IBindStatusCallback* pBSC,
+ REFIID riid,
+ void** ppvObj) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE MonikerBindToObject(
+ IMoniker* pMk,
+ IBindCtx* pBC,
+ IBindStatusCallback* pBSC,
+ REFIID riid,
+ void** ppvObj) = 0;
+
+};
+#else
+typedef struct IBindHostVtbl IBindHostVtbl;
+struct IBindHost {
+ const IBindHostVtbl* lpVtbl;
+};
+struct IBindHostVtbl {
+ BEGIN_INTERFACE
+
+ /*** IUnknown methods ***/
+ HRESULT (STDMETHODCALLTYPE *QueryInterface)(
+ IBindHost* This,
+ REFIID riid,
+ void** ppvObject);
+
+ ULONG (STDMETHODCALLTYPE *AddRef)(
+ IBindHost* This);
+
+ ULONG (STDMETHODCALLTYPE *Release)(
+ IBindHost* This);
+
+ /*** IBindHost methods ***/
+ HRESULT (STDMETHODCALLTYPE *CreateMoniker)(
+ IBindHost* This,
+ LPOLESTR szName,
+ IBindCtx* pBC,
+ IMoniker** ppmk,
+ DWORD dwReserved);
+
+ HRESULT (STDMETHODCALLTYPE *MonikerBindToStorage)(
+ IBindHost* This,
+ IMoniker* pMk,
+ IBindCtx* pBC,
+ IBindStatusCallback* pBSC,
+ REFIID riid,
+ void** ppvObj);
+
+ HRESULT (STDMETHODCALLTYPE *MonikerBindToObject)(
+ IBindHost* This,
+ IMoniker* pMk,
+ IBindCtx* pBC,
+ IBindStatusCallback* pBSC,
+ REFIID riid,
+ void** ppvObj);
+
+ END_INTERFACE
+};
+
+#ifdef COBJMACROS
+/*** IUnknown methods ***/
+#define IBindHost_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IBindHost_AddRef(p) (p)->lpVtbl->AddRef(p)
+#define IBindHost_Release(p) (p)->lpVtbl->Release(p)
+/*** IBindHost methods ***/
+#define IBindHost_CreateMoniker(p,a,b,c,d) (p)->lpVtbl->CreateMoniker(p,a,b,c,d)
+#define IBindHost_MonikerBindToStorage(p,a,b,c,d,e) (p)->lpVtbl->MonikerBindToStorage(p,a,b,c,d,e)
+#define IBindHost_MonikerBindToObject(p,a,b,c,d,e) (p)->lpVtbl->MonikerBindToObject(p,a,b,c,d,e)
+#endif
+
+#endif
+
+HRESULT CALLBACK IBindHost_CreateMoniker_Proxy(
+ IBindHost* This,
+ LPOLESTR szName,
+ IBindCtx* pBC,
+ IMoniker** ppmk,
+ DWORD dwReserved);
+void __RPC_STUB IBindHost_CreateMoniker_Stub(
+ struct IRpcStubBuffer* This,
+ struct IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT CALLBACK IBindHost_RemoteMonikerBindToStorage_Proxy(
+ IBindHost* This,
+ IMoniker* pMk,
+ IBindCtx* pBC,
+ IBindStatusCallback* pBSC,
+ REFIID riid,
+ IUnknown** ppvObj);
+void __RPC_STUB IBindHost_RemoteMonikerBindToStorage_Stub(
+ struct IRpcStubBuffer* This,
+ struct IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT CALLBACK IBindHost_MonikerBindToStorage_Proxy(
+ IBindHost* This,
+ IMoniker* pMk,
+ IBindCtx* pBC,
+ IBindStatusCallback* pBSC,
+ REFIID riid,
+ void** ppvObj);
+HRESULT __RPC_STUB IBindHost_MonikerBindToStorage_Stub(
+ IBindHost* This,
+ IMoniker* pMk,
+ IBindCtx* pBC,
+ IBindStatusCallback* pBSC,
+ REFIID riid,
+ IUnknown** ppvObj);
+HRESULT CALLBACK IBindHost_RemoteMonikerBindToObject_Proxy(
+ IBindHost* This,
+ IMoniker* pMk,
+ IBindCtx* pBC,
+ IBindStatusCallback* pBSC,
+ REFIID riid,
+ IUnknown** ppvObj);
+void __RPC_STUB IBindHost_RemoteMonikerBindToObject_Stub(
+ struct IRpcStubBuffer* This,
+ struct IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT CALLBACK IBindHost_MonikerBindToObject_Proxy(
+ IBindHost* This,
+ IMoniker* pMk,
+ IBindCtx* pBC,
+ IBindStatusCallback* pBSC,
+ REFIID riid,
+ void** ppvObj);
+HRESULT __RPC_STUB IBindHost_MonikerBindToObject_Stub(
+ IBindHost* This,
+ IMoniker* pMk,
+ IBindCtx* pBC,
+ IBindStatusCallback* pBSC,
+ REFIID riid,
+ IUnknown** ppvObj);
+
+#endif /* __IBindHost_INTERFACE_DEFINED__ */
+
+#ifndef __IWinInetInfo_FWD_DEFINED__
+#define __IWinInetInfo_FWD_DEFINED__
+typedef struct IWinInetInfo IWinInetInfo;
+#endif
+
+typedef IWinInetInfo *LPWININETINFO;
+
+/*****************************************************************************
+ * IWinInetInfo interface
+ */
+#ifndef __IWinInetInfo_INTERFACE_DEFINED__
+#define __IWinInetInfo_INTERFACE_DEFINED__
+
+DEFINE_GUID(IID_IWinInetInfo, 0x79eac9d6, 0xbafa, 0x11ce, 0x8c,0x82, 0x00,0xaa,0x00,0x4b,0xa9,0x0b);
+#if defined(__cplusplus) && !defined(CINTERFACE)
+struct IWinInetInfo : public IUnknown
+{
+ virtual HRESULT STDMETHODCALLTYPE QueryOption(
+ DWORD dwOption,
+ LPVOID pBuffer,
+ DWORD* pcbBuf) = 0;
+
+};
+#else
+typedef struct IWinInetInfoVtbl IWinInetInfoVtbl;
+struct IWinInetInfo {
+ const IWinInetInfoVtbl* lpVtbl;
+};
+struct IWinInetInfoVtbl {
+ BEGIN_INTERFACE
+
+ /*** IUnknown methods ***/
+ HRESULT (STDMETHODCALLTYPE *QueryInterface)(
+ IWinInetInfo* This,
+ REFIID riid,
+ void** ppvObject);
+
+ ULONG (STDMETHODCALLTYPE *AddRef)(
+ IWinInetInfo* This);
+
+ ULONG (STDMETHODCALLTYPE *Release)(
+ IWinInetInfo* This);
+
+ /*** IWinInetInfo methods ***/
+ HRESULT (STDMETHODCALLTYPE *QueryOption)(
+ IWinInetInfo* This,
+ DWORD dwOption,
+ LPVOID pBuffer,
+ DWORD* pcbBuf);
+
+ END_INTERFACE
+};
+
+#ifdef COBJMACROS
+/*** IUnknown methods ***/
+#define IWinInetInfo_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IWinInetInfo_AddRef(p) (p)->lpVtbl->AddRef(p)
+#define IWinInetInfo_Release(p) (p)->lpVtbl->Release(p)
+/*** IWinInetInfo methods ***/
+#define IWinInetInfo_QueryOption(p,a,b,c) (p)->lpVtbl->QueryOption(p,a,b,c)
+#endif
+
+#endif
+
+HRESULT CALLBACK IWinInetInfo_RemoteQueryOption_Proxy(
+ IWinInetInfo* This,
+ DWORD dwOption,
+ BYTE* pBuffer,
+ DWORD* pcbBuf);
+void __RPC_STUB IWinInetInfo_RemoteQueryOption_Stub(
+ struct IRpcStubBuffer* This,
+ struct IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT CALLBACK IWinInetInfo_QueryOption_Proxy(
+ IWinInetInfo* This,
+ DWORD dwOption,
+ LPVOID pBuffer,
+ DWORD* pcbBuf);
+HRESULT __RPC_STUB IWinInetInfo_QueryOption_Stub(
+ IWinInetInfo* This,
+ DWORD dwOption,
+ BYTE* pBuffer,
+ DWORD* pcbBuf);
+
+#endif /* __IWinInetInfo_INTERFACE_DEFINED__ */
+
+#ifndef __IWinInetHttpInfo_FWD_DEFINED__
+#define __IWinInetHttpInfo_FWD_DEFINED__
+typedef struct IWinInetHttpInfo IWinInetHttpInfo;
+#endif
+
+typedef IWinInetHttpInfo *LPWININETHTTPINFO;
+
+/*****************************************************************************
+ * IWinInetHttpInfo interface
+ */
+#ifndef __IWinInetHttpInfo_INTERFACE_DEFINED__
+#define __IWinInetHttpInfo_INTERFACE_DEFINED__
+
+DEFINE_GUID(IID_IWinInetHttpInfo, 0x79eac9d8, 0xbafa, 0x11ce, 0x8c,0x82, 0x00,0xaa,0x00,0x4b,0xa9,0x0b);
+#if defined(__cplusplus) && !defined(CINTERFACE)
+struct IWinInetHttpInfo : public IWinInetInfo
+{
+ virtual HRESULT STDMETHODCALLTYPE QueryInfo(
+ DWORD dwOption,
+ LPVOID pBuffer,
+ DWORD* pcbBuf,
+ DWORD* pdwFlags,
+ DWORD* pdwReserved) = 0;
+
+};
+#else
+typedef struct IWinInetHttpInfoVtbl IWinInetHttpInfoVtbl;
+struct IWinInetHttpInfo {
+ const IWinInetHttpInfoVtbl* lpVtbl;
+};
+struct IWinInetHttpInfoVtbl {
+ BEGIN_INTERFACE
+
+ /*** IUnknown methods ***/
+ HRESULT (STDMETHODCALLTYPE *QueryInterface)(
+ IWinInetHttpInfo* This,
+ REFIID riid,
+ void** ppvObject);
+
+ ULONG (STDMETHODCALLTYPE *AddRef)(
+ IWinInetHttpInfo* This);
+
+ ULONG (STDMETHODCALLTYPE *Release)(
+ IWinInetHttpInfo* This);
+
+ /*** IWinInetInfo methods ***/
+ HRESULT (STDMETHODCALLTYPE *QueryOption)(
+ IWinInetHttpInfo* This,
+ DWORD dwOption,
+ LPVOID pBuffer,
+ DWORD* pcbBuf);
+
+ /*** IWinInetHttpInfo methods ***/
+ HRESULT (STDMETHODCALLTYPE *QueryInfo)(
+ IWinInetHttpInfo* This,
+ DWORD dwOption,
+ LPVOID pBuffer,
+ DWORD* pcbBuf,
+ DWORD* pdwFlags,
+ DWORD* pdwReserved);
+
+ END_INTERFACE
+};
+
+#ifdef COBJMACROS
+/*** IUnknown methods ***/
+#define IWinInetHttpInfo_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IWinInetHttpInfo_AddRef(p) (p)->lpVtbl->AddRef(p)
+#define IWinInetHttpInfo_Release(p) (p)->lpVtbl->Release(p)
+/*** IWinInetInfo methods ***/
+#define IWinInetHttpInfo_QueryOption(p,a,b,c) (p)->lpVtbl->QueryOption(p,a,b,c)
+/*** IWinInetHttpInfo methods ***/
+#define IWinInetHttpInfo_QueryInfo(p,a,b,c,d,e) (p)->lpVtbl->QueryInfo(p,a,b,c,d,e)
+#endif
+
+#endif
+
+HRESULT CALLBACK IWinInetHttpInfo_RemoteQueryInfo_Proxy(
+ IWinInetHttpInfo* This,
+ DWORD dwOption,
+ BYTE* pBuffer,
+ DWORD* pcbBuf,
+ DWORD* pdwFlags,
+ DWORD* pdwReserved);
+void __RPC_STUB IWinInetHttpInfo_RemoteQueryInfo_Stub(
+ struct IRpcStubBuffer* This,
+ struct IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT CALLBACK IWinInetHttpInfo_QueryInfo_Proxy(
+ IWinInetHttpInfo* This,
+ DWORD dwOption,
+ LPVOID pBuffer,
+ DWORD* pcbBuf,
+ DWORD* pdwFlags,
+ DWORD* pdwReserved);
+HRESULT __RPC_STUB IWinInetHttpInfo_QueryInfo_Stub(
+ IWinInetHttpInfo* This,
+ DWORD dwOption,
+ BYTE* pBuffer,
+ DWORD* pcbBuf,
+ DWORD* pdwFlags,
+ DWORD* pdwReserved);
+
+#endif /* __IWinInetHttpInfo_INTERFACE_DEFINED__ */
+
+#ifndef __IPersistMoniker_FWD_DEFINED__
+#define __IPersistMoniker_FWD_DEFINED__
+typedef struct IPersistMoniker IPersistMoniker;
+#endif
+
+typedef IPersistMoniker *LPPERSISTMONIKER;
+
+/*****************************************************************************
+ * IPersistMoniker interface
+ */
+#ifndef __IPersistMoniker_INTERFACE_DEFINED__
+#define __IPersistMoniker_INTERFACE_DEFINED__
+
+DEFINE_GUID(IID_IPersistMoniker, 0x79eac9c9, 0xbaf9, 0x11ce, 0x8c,0x82, 0x00,0xaa,0x00,0x4b,0xa9,0x0b);
+#if defined(__cplusplus) && !defined(CINTERFACE)
+struct IPersistMoniker : public IUnknown
+{
+ virtual HRESULT STDMETHODCALLTYPE GetClassID(
+ CLSID* pClassID) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE IsDirty(
+ ) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE Load(
+ BOOL fFullyAvailable,
+ IMoniker* pimkName,
+ LPBC pibc,
+ DWORD grfMode) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE Save(
+ IMoniker* pimkName,
+ LPBC pbc,
+ BOOL fRemember) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SaveCompleted(
+ IMoniker* pimkName,
+ LPBC pibc) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetCurMoniker(
+ IMoniker** ppimkName) = 0;
+
+};
+#else
+typedef struct IPersistMonikerVtbl IPersistMonikerVtbl;
+struct IPersistMoniker {
+ const IPersistMonikerVtbl* lpVtbl;
+};
+struct IPersistMonikerVtbl {
+ BEGIN_INTERFACE
+
+ /*** IUnknown methods ***/
+ HRESULT (STDMETHODCALLTYPE *QueryInterface)(
+ IPersistMoniker* This,
+ REFIID riid,
+ void** ppvObject);
+
+ ULONG (STDMETHODCALLTYPE *AddRef)(
+ IPersistMoniker* This);
+
+ ULONG (STDMETHODCALLTYPE *Release)(
+ IPersistMoniker* This);
+
+ /*** IPersistMoniker methods ***/
+ HRESULT (STDMETHODCALLTYPE *GetClassID)(
+ IPersistMoniker* This,
+ CLSID* pClassID);
+
+ HRESULT (STDMETHODCALLTYPE *IsDirty)(
+ IPersistMoniker* This);
+
+ HRESULT (STDMETHODCALLTYPE *Load)(
+ IPersistMoniker* This,
+ BOOL fFullyAvailable,
+ IMoniker* pimkName,
+ LPBC pibc,
+ DWORD grfMode);
+
+ HRESULT (STDMETHODCALLTYPE *Save)(
+ IPersistMoniker* This,
+ IMoniker* pimkName,
+ LPBC pbc,
+ BOOL fRemember);
+
+ HRESULT (STDMETHODCALLTYPE *SaveCompleted)(
+ IPersistMoniker* This,
+ IMoniker* pimkName,
+ LPBC pibc);
+
+ HRESULT (STDMETHODCALLTYPE *GetCurMoniker)(
+ IPersistMoniker* This,
+ IMoniker** ppimkName);
[truncated at 1000 lines; 1267 more skipped]
reactos/include/wine
diff -u -r1.1 -r1.1.18.1
--- msacmdrv.h 10 Mar 2004 15:22:44 -0000 1.1
+++ msacmdrv.h 30 Dec 2004 04:36:27 -0000 1.1.18.1
@@ -23,7 +23,7 @@
#include <stdarg.h>
-#include "windef.h"
+#include <windef.h>
#include "winbase.h"
#include "mmsystem.h"
#include "mmreg.h"
reactos/lib/adns/src
diff -u -r1.3 -r1.3.6.1
--- transmit.c 4 Sep 2004 10:51:20 -0000 1.3
+++ transmit.c 30 Dec 2004 04:36:29 -0000 1.3.6.1
@@ -99,7 +99,8 @@
if (!(flags & adns_qf_quoteok_query)) return adns_s_querydomaininvalid;
if (ctype_digit(p[0])) {
if (ctype_digit(p[1]) && ctype_digit(p[2])) {
- c= (*p++ - '0')*100 + (*p++ - '0')*10 + (*p++ - '0');
+ c= (p[0] - '0')*100 + (p[1] - '0')*10 + (p[2] - '0');
+ p += 3;
if (c >= 256) return adns_s_querydomaininvalid;
} else {
return adns_s_querydomaininvalid;
reactos/lib/advapi32
diff -u -r1.6 -r1.6.8.1
--- .cvsignore 15 Aug 2004 17:03:14 -0000 1.6
+++ .cvsignore 30 Dec 2004 04:36:29 -0000 1.6.8.1
@@ -8,3 +8,4 @@
*.tmp
*.o
*.gch
+*.d
\ No newline at end of file
reactos/lib/advapi32
diff -u -r1.25.2.2 -r1.25.2.3
--- advapi32.def 13 Dec 2004 16:18:02 -0000 1.25.2.2
+++ advapi32.def 30 Dec 2004 04:36:29 -0000 1.25.2.3
@@ -1,4 +1,4 @@
-; $Id: advapi32.def,v 1.25.2.2 2004/12/13 16:18:02 hyperion Exp $
+; $Id: advapi32.def,v 1.25.2.3 2004/12/30 04:36:29 hyperion Exp $
;
; advapi32.def
;
@@ -35,8 +35,8 @@
;BuildExplicitAccessWithNameW@20
;BuildImpersonateExplicitAccessWithNameA@24
;BuildImpersonateExplicitAccessWithNameW@24
-;BuildImpersonateTrusteeA@8
-;BuildImpersonateTrusteeW@8
+BuildImpersonateTrusteeA@8
+BuildImpersonateTrusteeW@8
;BuildSecurityDescriptorA@36
;BuildSecurityDescriptorW@36
BuildTrusteeWithNameA@8
@@ -122,6 +122,7 @@
EqualPrefixSid@8
EqualSid@8
FindFirstFreeAce@8
+FreeInheritedFromArray@12
FreeSid@4
GetAce@12
GetAclInformation@16
@@ -143,12 +144,14 @@
;GetExplicitEntriesFromAclW@12
GetFileSecurityA@20
GetFileSecurityW@20
+GetInheritanceSourceA@40
+GetInheritanceSourceW@40
GetKernelObjectSecurity@20
GetLengthSid@4
-;GetMultipleTrusteeA@4
-;GetMultipleTrusteeOperationA@4
-;GetMultipleTrusteeOperationW@4
-;GetMultipleTrusteeW@4
+GetMultipleTrusteeA@4
+GetMultipleTrusteeOperationA@4
+GetMultipleTrusteeOperationW@4
+GetMultipleTrusteeW@4
GetNamedSecurityInfoA@32
GetNamedSecurityInfoW@32
GetNumberOfEventLogRecords@8
@@ -172,10 +175,12 @@
GetSidSubAuthority@8
GetSidSubAuthorityCount@4
GetTokenInformation@20
-;GetTrusteeNameA@4
-;GetTrusteeNameW@4
-;GetTrusteeTypeA@4
-;GetTrusteeTypeW@4
+GetTrusteeFormA@4
+GetTrusteeFormW@4
+GetTrusteeNameA@4
+GetTrusteeNameW@4
+GetTrusteeTypeA@4
+GetTrusteeTypeW@4
GetUserNameA@8
GetUserNameW@8
;GrantAccessRightsA@16
@@ -376,7 +381,7 @@
SetSecurityDescriptorGroup@12
SetSecurityDescriptorOwner@12
SetSecurityDescriptorSacl@16
-;SetSecurityInfo@28
+SetSecurityInfo@28
SetServiceBits@16
SetServiceObjectSecurity@12
SetServiceStatus@8
reactos/lib/advapi32
diff -u -r1.42.8.2 -r1.42.8.3
--- makefile 13 Dec 2004 16:18:02 -0000 1.42.8.2
+++ makefile 30 Dec 2004 04:36:29 -0000 1.42.8.3
@@ -1,4 +1,4 @@
-# $Id: makefile,v 1.42.8.2 2004/12/13 16:18:02 hyperion Exp $
+# $Id: makefile,v 1.42.8.3 2004/12/30 04:36:29 hyperion Exp $
PATH_TO_TOP = ../..
@@ -8,8 +8,11 @@
TARGET_PCH = advapi32.h
-TARGET_CFLAGS = -Wall -Werror -fno-builtin -D__USE_W32API
-# TARGET_CFLAGS += -DUNICODE
+TARGET_CFLAGS = -Wall -Werror -fno-builtin \
+ -D__USE_W32API \
+ -D_WIN32_IE=0x0500 \
+ -D_WIN32_WINNT=0x501 \
+ -DWINVER=0x600 \
TARGET_LFLAGS = -nostartfiles -nostdlib
reactos/lib/advapi32/crypt
diff -u -r1.2.2.1 -r1.2.2.2
--- crypt.c 13 Dec 2004 16:18:25 -0000 1.2.2.1
+++ crypt.c 30 Dec 2004 04:36:29 -0000 1.2.2.2
@@ -325,7 +325,7 @@
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
goto error;
}
- r = RegQueryValueExA(key, "Name", NULL, NULL, provname, &len);
+ r = RegQueryValueExA(key, "Name", NULL, NULL, (LPBYTE)provname, &len);
if (r != ERROR_SUCCESS)
{
DPRINT("error %ld reading 'Name' from registry\n", r );
@@ -381,7 +381,7 @@
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
goto error;
}
- r = RegQueryValueExA(key, "Image Path", NULL, NULL, temp, &len);
+ r = RegQueryValueExA(key, "Image Path", NULL, NULL, (LPBYTE)temp, &len);
if (r != ERROR_SUCCESS)
{
DPRINT("error %ld reading 'Image Path' from registry\n", r );
@@ -1124,7 +1124,7 @@
*pdwProvType += (*(--ch) - '0') * 100;
CRYPT_Free(keyname);
- result = RegQueryValueExA(hSubkey, "TypeName", NULL, &dwType, pszTypeName, pcbTypeName);
+ result = RegQueryValueExA(hSubkey, "TypeName", NULL, &dwType, (LPBYTE)pszTypeName, pcbTypeName);
if (result)
CRYPT_ReturnLastError(result);
@@ -1281,7 +1281,7 @@
}
CRYPT_Free(keyname);
- result = RegQueryValueExA(hKey, "Name", NULL, NULL, pszProvName, pcbProvName);
+ result = RegQueryValueExA(hKey, "Name", NULL, NULL, (LPBYTE)pszProvName, pcbProvName);
if (result)
{
if (result != ERROR_MORE_DATA)
@@ -1760,7 +1760,7 @@
}
CRYPT_Free(keyname);
- if (RegSetValueExA(hTypeKey, "Name", 0, REG_SZ, pszProvName, strlen(pszProvName) + 1))
+ if (RegSetValueExA(hTypeKey, "Name", 0, REG_SZ, (LPBYTE)pszProvName, strlen(pszProvName) + 1))
{
RegCloseKey(hTypeKey);
RegCloseKey(hProvKey);
reactos/lib/advapi32/crypt
diff -u -r1.2.2.1 -r1.2.2.2
--- crypt_lmhash.c 13 Dec 2004 16:18:25 -0000 1.2.2.1
+++ crypt_lmhash.c 30 Dec 2004 04:36:29 -0000 1.2.2.2
@@ -27,18 +27,18 @@
static const unsigned char CRYPT_LMhash_Magic[8] =
{ 'K', 'G', 'S', '!', '@', '#', '$', '%' };
-static void CRYPT_LMhash(unsigned char *dst, const unsigned char *pwd, const int len)
+static void CRYPT_LMhash(LPSTR dst, LPCSTR pwd, const int len)
{
int i, max = 14;
- unsigned char tmp_pwd[14] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0 };
+ CHAR tmp_pwd[14] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0 };
max = len > max ? max : len;
for (i = 0; i < max; i++)
tmp_pwd[i] = pwd[i];
- CRYPT_DEShash(dst, tmp_pwd, CRYPT_LMhash_Magic);
- CRYPT_DEShash(&dst[8], &tmp_pwd[7], CRYPT_LMhash_Magic);
+ CRYPT_DEShash((PUCHAR)dst, (PUCHAR)tmp_pwd, CRYPT_LMhash_Magic);
+ CRYPT_DEShash((PUCHAR)&dst[8], (PUCHAR)&tmp_pwd[7], CRYPT_LMhash_Magic);
}
NTSTATUS WINAPI SystemFunction006(LPCSTR password, LPSTR hash)
reactos/lib/advapi32/crypt
diff -u -r1.2.2.1 -r1.2.2.2
--- crypt_sha.c 13 Dec 2004 16:18:25 -0000 1.2.2.1
+++ crypt_sha.c 30 Dec 2004 04:36:29 -0000 1.2.2.2
@@ -51,7 +51,7 @@
/* Hash a single 512-bit block. This is the core of the algorithm. */
static VOID
-SHA1Transform(ULONG State[5], CHAR Buffer[64])
+SHA1Transform(ULONG State[5], UCHAR Buffer[64])
{
ULONG a, b, c, d, e;
ULONG *Block;
@@ -162,7 +162,7 @@
A_SHAFinal(PSHA_CTX Context, PULONG Result)
{
INT Pad, Index;
- UCHAR Buffer[72];
+ CHAR Buffer[72];
ULONG *Count;
ULONG BufferContentSize, LengthHi, LengthLo;
reactos/lib/advapi32/misc
diff -u -r1.8.8.2 -r1.8.8.3
--- sysfunc.c 13 Dec 2004 16:18:02 -0000 1.8.8.2
+++ sysfunc.c 30 Dec 2004 04:36:29 -0000 1.8.8.3
@@ -1,4 +1,4 @@
-/* $Id: sysfunc.c,v 1.8.8.2 2004/12/13 16:18:02 hyperion Exp $
+/* $Id: sysfunc.c,v 1.8.8.3 2004/12/30 04:36:29 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
reactos/lib/advapi32/reg
diff -u -r1.63.2.3 -r1.63.2.4
--- reg.c 13 Dec 2004 16:18:02 -0000 1.63.2.3
+++ reg.c 30 Dec 2004 04:36:29 -0000 1.63.2.4
@@ -1,4 +1,4 @@
-/* $Id: reg.c,v 1.63.2.3 2004/12/13 16:18:02 hyperion Exp $
+/* $Id: reg.c,v 1.63.2.4 2004/12/30 04:36:29 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
@@ -1730,6 +1730,7 @@
LONG ErrorCode;
NTSTATUS Status;
+ DPRINT("RegOpenKeyA hKey 0x%x lpSubKey %s phkResult %p\n", hKey, lpSubKey, phkResult);
Status = MapDefaultKey (&KeyHandle,
hKey);
if (!NT_SUCCESS(Status))
@@ -1780,6 +1781,7 @@
LONG ErrorCode;
NTSTATUS Status;
+ DPRINT("RegOpenKeyW hKey 0x%x lpSubKey %S phkResult %p\n", hKey, lpSubKey, phkResult);
Status = MapDefaultKey (&KeyHandle,
hKey);
if (!NT_SUCCESS(Status))
@@ -1828,6 +1830,8 @@
LONG ErrorCode;
NTSTATUS Status;
+ DPRINT("RegOpenKeyExA hKey 0x%x lpSubKey %s ulOptions 0x%x samDesired 0x%x phkResult %p\n",
+ hKey, lpSubKey, ulOptions, samDesired, phkResult);
Status = MapDefaultKey (&KeyHandle,
hKey);
if (!NT_SUCCESS(Status))
@@ -1877,6 +1881,8 @@
LONG ErrorCode;
NTSTATUS Status;
+ DPRINT("RegOpenKeyExW hKey 0x%x lpSubKey %S ulOptions 0x%x samDesired 0x%x phkResult %p\n",
+ hKey, lpSubKey, ulOptions, samDesired, phkResult);
Status = MapDefaultKey (&KeyHandle,
hKey);
if (!NT_SUCCESS(Status))
@@ -2210,7 +2216,7 @@
val_list[i].ve_valuename,
NULL,
&val_list[i].ve_type,
- bufptr,
+ (LPBYTE)bufptr,
&val_list[i].ve_valuelen);
if (ErrorCode != ERROR_SUCCESS)
{
@@ -2274,7 +2280,7 @@
val_list[i].ve_valuename,
NULL,
&val_list[i].ve_type,
- bufptr,
+ (LPBYTE)bufptr,
&val_list[i].ve_valuelen);
if (ErrorCode != ERROR_SUCCESS)
{
@@ -2435,6 +2441,9 @@
DWORD Length;
DWORD Type;
+ DPRINT("hKey 0x%X lpValueName %s lpData 0x%X lpcbData %d\n",
+ hKey, lpValueName, lpData, lpcbData ? *lpcbData : 0);
+
if (lpData != NULL && lpcbData == NULL)
{
SetLastError(ERROR_INVALID_PARAMETER);
@@ -2487,7 +2496,7 @@
if (ErrorCode == ERROR_SUCCESS && ValueData.Buffer != NULL)
{
RtlInitAnsiString(&AnsiString, NULL);
- AnsiString.Buffer = lpData;
+ AnsiString.Buffer = (LPSTR)lpData;
AnsiString.MaximumLength = *lpcbData;
ValueData.Length = Length;
ValueData.MaximumLength = ValueData.Length + sizeof(WCHAR);
@@ -2497,7 +2506,14 @@
}
else if (ErrorCode == ERROR_SUCCESS && ValueData.Buffer != NULL)
{
- RtlMoveMemory(lpData, ValueData.Buffer, Length);
+ if (*lpcbData < Length)
+ {
+ ErrorCode = ERROR_MORE_DATA;
+ }
+ else
+ {
+ RtlMoveMemory(lpData, ValueData.Buffer, Length);
+ }
}
if (lpcbData != NULL)
@@ -2533,6 +2549,9 @@
LONG ValueSize;
LONG ErrorCode;
+ DPRINT("hKey 0x%X lpSubKey %s lpValue %p lpcbValue %d\n",
+ hKey, lpSubKey, lpValue, lpcbValue ? *lpcbValue : 0);
+
if (lpValue != NULL &&
lpcbValue == NULL)
{
@@ -2621,6 +2640,9 @@
BOOL CloseRealKey;
NTSTATUS Status;
+ DPRINT("hKey 0x%X lpSubKey %S lpValue %p lpcbValue %d\n",
+ hKey, lpSubKey, lpValue, lpcbValue ? *lpcbValue : 0);
+
Status = MapDefaultKey (&KeyHandle,
hKey);
if (!NT_SUCCESS(Status))
reactos/lib/advapi32/sec
diff -u -r1.11 -r1.11.6.1
--- ac.c 13 Sep 2004 12:14:11 -0000 1.11
+++ ac.c 30 Dec 2004 04:36:30 -0000 1.11.6.1
@@ -1,4 +1,4 @@
-/* $Id: ac.c,v 1.11 2004/09/13 12:14:11 ekohl Exp $
+/* $Id: ac.c,v 1.11.6.1 2004/12/30 04:36:30 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
@@ -8,6 +8,8 @@
#include "advapi32.h"
+#define NDEBUG
+#include <debug.h>
/* --- ACL --- */
@@ -375,4 +377,66 @@
return TRUE;
}
+
+/*
+ * @unimplemented
+ */
+DWORD
+STDCALL
+GetInheritanceSourceW (
+ LPWSTR pObjectName,
+ SE_OBJECT_TYPE ObjectType,
+ SECURITY_INFORMATION SecurityInfo,
+ BOOL Container,
+ GUID** pObjectClassGuids OPTIONAL,
+ DWORD GuidCount,
+ PACL pAcl,
+ PFN_OBJECT_MGR_FUNCTS pfnArray OPTIONAL,
+ PGENERIC_MAPPING pGenericMapping,
+ PINHERITED_FROMW pInheritArray
+ )
+{
+ DPRINT1("%s() not implemented!\n", __FUNCTION__);
+ return ERROR_CALL_NOT_IMPLEMENTED;
+}
+
+
+/*
+ * @unimplemented
+ */
+DWORD
+STDCALL
+GetInheritanceSourceA (
+ LPSTR pObjectName,
+ SE_OBJECT_TYPE ObjectType,
+ SECURITY_INFORMATION SecurityInfo,
+ BOOL Container,
+ GUID** pObjectClassGuids OPTIONAL,
+ DWORD GuidCount,
+ PACL pAcl,
+ PFN_OBJECT_MGR_FUNCTS pfnArray OPTIONAL,
+ PGENERIC_MAPPING pGenericMapping,
+ PINHERITED_FROM pInheritArray
+ )
+{
+ DPRINT1("%s() not implemented!\n", __FUNCTION__);
+ return ERROR_CALL_NOT_IMPLEMENTED;
+}
+
+
+/*
+ * @unimplemented
+ */
+DWORD
+STDCALL
+FreeInheritedFromArray (
+ PINHERITED_FROM pInheritArray,
+ USHORT AceCnt,
+ PFN_OBJECT_MGR_FUNCTS pfnArray OPTIONAL
+ )
+{
+ DPRINT1("%s() not implemented!\n", __FUNCTION__);
+ return ERROR_CALL_NOT_IMPLEMENTED;
+}
+
/* EOF */
reactos/lib/advapi32/sec
diff -u -r1.27.2.2 -r1.27.2.3
--- misc.c 13 Dec 2004 16:18:02 -0000 1.27.2.2
+++ misc.c 30 Dec 2004 04:36:30 -0000 1.27.2.3
@@ -1,4 +1,4 @@
-/* $Id: misc.c,v 1.27.2.2 2004/12/13 16:18:02 hyperion Exp $
+/* $Id: misc.c,v 1.27.2.3 2004/12/30 04:36:30 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
@@ -9,6 +9,7 @@
#include "advapi32.h"
#include <accctrl.h>
#include <malloc.h>
+#include <ntsecapi.h>
#define NDEBUG
#include <debug.h>
@@ -484,36 +485,38 @@
BOOL WINAPI
GetUserNameA( LPSTR lpszName, LPDWORD lpSize )
{
- WCHAR* lpszNameW = NULL;
- DWORD len = 0;
-
- if ( !lpSize )
- {
- SetLastError(ERROR_INVALID_PARAMETER);
- return FALSE;
- }
-
- len = *lpSize;
- lpszNameW = LocalAlloc ( LMEM_FIXED, len * sizeof(WCHAR) );
+ UNICODE_STRING NameW;
+ ANSI_STRING NameA;
+ BOOL Ret;
+
+ /* apparently Win doesn't check whether lpSize is valid at all! */
- if ( !GetUserNameW ( lpszNameW, &len ) )
+ NameW.Length = 0;
+ NameW.MaximumLength = (*lpSize) * sizeof(WCHAR);
+ NameW.Buffer = LocalAlloc(LMEM_FIXED, NameW.MaximumLength);
+ if(NameW.Buffer == NULL)
{
- LocalFree ( lpszNameW );
+ SetLastError(ERROR_NOT_ENOUGH_MEMORY);
return FALSE;
}
-
- len = wcstombs ( lpszName, lpszNameW, len );
-
- LocalFree ( lpszNameW );
-
- if ( len > *lpSize )
+
+ NameA.Length = 0;
+ NameA.MaximumLength = ((*lpSize) < 0xFFFF ? (USHORT)(*lpSize) : 0xFFFF);
+ NameA.Buffer = lpszName;
+
+ Ret = GetUserNameW(NameW.Buffer,
+ lpSize);
+ if(Ret)
{
- SetLastError(ERROR_INSUFFICIENT_BUFFER);
- return FALSE;
+ RtlUnicodeStringToAnsiString(&NameA, &NameW, FALSE);
+ NameA.Buffer[NameA.Length] = '\0';
+
+ *lpSize = NameA.Length + 1;
}
-
- *lpSize = len;
- return TRUE;
+
+ LocalFree(NameW.Buffer);
+
+ return Ret;
}
/******************************************************************************
@@ -541,14 +544,14 @@
if ( dwLastError != ERROR_NO_TOKEN
&& dwLastError != ERROR_NO_IMPERSONATION_TOKEN )
{
- // don't call SetLastError(),
- // as OpenThreadToken() ought to have set one
+ /* don't call SetLastError(),
+ as OpenThreadToken() ought to have set one */
return FALSE;
}
if ( !OpenProcessToken ( GetCurrentProcess(), TOKEN_QUERY, &hToken ) )
{
- // don't call SetLastError(),
- // as OpenProcessToken() ought to have set one
+ /* don't call SetLastError(),
+ as OpenProcessToken() ought to have set one */
return FALSE;
}
}
@@ -569,8 +572,8 @@
}
if ( !GetTokenInformation ( hToken, TokenUser, tu_buf, tu_len, &tu_len ) )
{
- // don't call SetLastError(),
- // as GetTokenInformation() ought to have set one
+ /* don't call SetLastError(),
+ as GetTokenInformation() ought to have set one */
LocalFree ( tu_buf );
CloseHandle ( hToken );
return FALSE;
@@ -603,8 +606,8 @@
}
if ( !LookupAccountSidW ( NULL, token_user->User.Sid, lpszName, &an_len, domain_name, &dn_len, &snu ) )
{
- // don't call SetLastError(),
- // as LookupAccountSid() ought to have set one
+ /* don't call SetLastError(),
+ as LookupAccountSid() ought to have set one */
LocalFree ( domain_name );
CloseHandle ( hToken );
return FALSE;
@@ -629,7 +632,7 @@
/******************************************************************************
* LookupAccountSidA [ADVAPI32.@]
*
- * @unimplemented
+ * @implemented
*/
BOOL STDCALL
LookupAccountSidA (LPCSTR lpSystemName,
@@ -640,67 +643,225 @@
LPDWORD cchReferencedDomainName,
PSID_NAME_USE peUse)
{
- DWORD NameLength;
- DWORD DomainLength;
+ UNICODE_STRING NameW, ReferencedDomainNameW, SystemNameW;
+ DWORD szName, szReferencedDomainName;
+ BOOL Ret;
- DPRINT1("LookupAccountSidA is unimplemented, but returns success\n");
+ /*
+ * save the buffer sizes the caller passed to us, as they may get modified and
+ * we require the original values when converting back to ansi
+ */
+ szName = *cchName;
+ szReferencedDomainName = *cchReferencedDomainName;
- /* Calculate length needed */
- NameLength = strlen("Administrator") + 1;
- DomainLength = strlen("BUILTIN") + 1;
+ /*
+ * allocate buffers for the unicode strings to receive
+ */
- if (*cchName < NameLength || *cchReferencedDomainName < DomainLength)
+ if(szName > 0)
{
- *cchName = NameLength;
- *cchReferencedDomainName = DomainLength;
- SetLastError(ERROR_INSUFFICIENT_BUFFER);
- return FALSE;
+ NameW.Length = 0;
+ NameW.MaximumLength = szName * sizeof(WCHAR);
+ NameW.Buffer = (PWSTR)LocalAlloc(LMEM_FIXED, NameW.MaximumLength);
+ if(NameW.Buffer == NULL)
+ {
+ SetLastError(ERROR_OUTOFMEMORY);
+ return FALSE;
+ }
}
+ else
+ NameW.Buffer = NULL;
- if (lpName) lstrcpynA(lpName, "Administrator", *cchName);
- if (lpReferencedDomainName) lstrcpynA(lpReferencedDomainName, "BUILTIN", *cchReferencedDomainName);
- return TRUE;
-}
-
+ if(szReferencedDomainName > 0)
+ {
+ ReferencedDomainNameW.Length = 0;
+ ReferencedDomainNameW.MaximumLength = szReferencedDomainName * sizeof(WCHAR);
+ ReferencedDomainNameW.Buffer = (PWSTR)LocalAlloc(LMEM_FIXED, ReferencedDomainNameW.MaximumLength);
+ if(ReferencedDomainNameW.Buffer == NULL)
+ {
+ if(szName > 0)
+ {
+ LocalFree(NameW.Buffer);
+ }
+ SetLastError(ERROR_OUTOFMEMORY);
+ return FALSE;
+ }
+ }
+ else
+ ReferencedDomainNameW.Buffer = NULL;
+
+ /*
+ * convert the system name to unicode - if present
+ */
+
+ if(lpSystemName != NULL)
+ {
+ ANSI_STRING SystemNameA;
-/******************************************************************************
- * LookupAccountSidW [ADVAPI32.@]
- *
- * @unimplemented
- */
-BOOL STDCALL
-LookupAccountSidW (LPCWSTR lpSystemName,
- PSID lpSid,
- LPWSTR lpName,
- LPDWORD cchName,
- LPWSTR lpReferencedDomainName,
- LPDWORD cchReferencedDomainName,
- PSID_NAME_USE peUse)
-{
- DWORD NameLength;
- DWORD DomainLength;
+ RtlInitAnsiString(&SystemNameA, lpSystemName);
+ RtlAnsiStringToUnicodeString(&SystemNameW, &SystemNameA, TRUE);
+ }
+ else
+ SystemNameW.Buffer = NULL;
- DPRINT1("LookupAccountSidW is unimplemented, but returns success\n");
+ /*
+ * it's time to call the unicode version
+ */
- /* Calculate length needed */
- NameLength = wcslen(L"Administrator") + sizeof(WCHAR);
- DomainLength = wcslen(L"BUILTIN") + sizeof(WCHAR);
+ Ret = LookupAccountSidW(SystemNameW.Buffer,
+ lpSid,
+ NameW.Buffer,
+ cchName,
+ ReferencedDomainNameW.Buffer,
+ cchReferencedDomainName,
+ peUse);
+ if(Ret)
+ {
+ /*
+ * convert unicode strings back to ansi, don't forget that we can't convert
+ * more than 0xFFFF (USHORT) characters! Also don't forget to explicitly
+ * terminate the converted string, the Rtl functions don't do that!
+ */
+ if(lpName != NULL)
+ {
+ ANSI_STRING NameA;
+
+ NameA.Length = 0;
+ NameA.MaximumLength = ((szName <= 0xFFFF) ? (USHORT)szName : 0xFFFF);
+ NameA.Buffer = lpName;
+
+ RtlUnicodeStringToAnsiString(&NameA, &NameW, FALSE);
+ NameA.Buffer[NameA.Length] = '\0';
+ }
+
+ if(lpReferencedDomainName != NULL)
+ {
+ ANSI_STRING ReferencedDomainNameA;
+
+ ReferencedDomainNameA.Length = 0;
+ ReferencedDomainNameA.MaximumLength = ((szReferencedDomainName <= 0xFFFF) ?
+ (USHORT)szReferencedDomainName : 0xFFFF);
+ ReferencedDomainNameA.Buffer = lpReferencedDomainName;
+
+ RtlUnicodeStringToAnsiString(&ReferencedDomainNameA, &ReferencedDomainNameW, FALSE);
+ ReferencedDomainNameA.Buffer[ReferencedDomainNameA.Length] = '\0';
+ }
+ }
- if (*cchName < NameLength || *cchReferencedDomainName < DomainLength)
+ /*
+ * free previously allocated buffers
+ */
+
+ if(SystemNameW.Buffer != NULL)
{
- *cchName = NameLength;
- *cchReferencedDomainName = DomainLength;
- SetLastError(ERROR_INSUFFICIENT_BUFFER);
- return FALSE;
+ RtlFreeUnicodeString(&SystemNameW);
+ }
+ if(NameW.Buffer != NULL)
+ {
+ LocalFree(NameW.Buffer);
+ }
+ if(ReferencedDomainNameW.Buffer != NULL)
+ {
+ LocalFree(ReferencedDomainNameW.Buffer);
}
- if (lpName) lstrcpynW(lpName, L"Administrator", *cchName);
- if (lpReferencedDomainName) lstrcpynW(lpReferencedDomainName, L"BUILTIN", *cchReferencedDomainName);
- return TRUE;
+ return Ret;
}
/******************************************************************************
+ * LookupAccountSidW [ADVAPI32.@]
+ *
+ * @implemented
+ */
+BOOL WINAPI
+LookupAccountSidW (
+ LPCWSTR pSystemName,
+ PSID pSid,
+ LPWSTR pAccountName,
+ LPDWORD pdwAccountName,
+ LPWSTR pDomainName,
+ LPDWORD pdwDomainName,
+ PSID_NAME_USE peUse )
+{
+ LSA_UNICODE_STRING SystemName;
+ LSA_OBJECT_ATTRIBUTES ObjectAttributes;
+ LSA_HANDLE PolicyHandle = INVALID_HANDLE_VALUE;
+ NTSTATUS Status;
+ PLSA_REFERENCED_DOMAIN_LIST ReferencedDomain = NULL;
+ PLSA_TRANSLATED_NAME TranslatedName = NULL;
+ BOOL ret;
+
+ RtlInitUnicodeString ( &SystemName, pSystemName );
+ ZeroMemory(&ObjectAttributes, sizeof(ObjectAttributes));
+ Status = LsaOpenPolicy ( &SystemName, &ObjectAttributes, POLICY_LOOKUP_NAMES, &PolicyHandle );
+ if ( !NT_SUCCESS(Status) )
+ {
+ SetLastError ( LsaNtStatusToWinError(Status) );
+ return FALSE;
+ }
+ Status = LsaLookupSids ( PolicyHandle, 1, &pSid, &ReferencedDomain, &TranslatedName );
+
+ LsaClose ( PolicyHandle );
+
+ if ( !NT_SUCCESS(Status) || Status == STATUS_SOME_NOT_MAPPED )
+ {
+ SetLastError ( LsaNtStatusToWinError(Status) );
+ ret = FALSE;
+ }
+ else
+ {
+ ret = TRUE;
+ if ( TranslatedName )
+ {
+ DWORD dwSrcLen = TranslatedName->Name.Length / sizeof(WCHAR);
+ if ( *pdwAccountName <= dwSrcLen )
+ {
+ *pdwAccountName = dwSrcLen + 1;
+ ret = FALSE;
+ }
+ else
+ {
+ *pdwAccountName = dwSrcLen;
+ wcscpy ( pAccountName, TranslatedName->Name.Buffer );
+ }
+ if ( peUse )
+ *peUse = TranslatedName->Use;
+ }
+
+ if ( ReferencedDomain )
+ {
+ if ( ReferencedDomain->Entries > 0 )
+ {
+ DWORD dwSrcLen = ReferencedDomain->Domains[0].Name.Length / sizeof(WCHAR);
+ if ( *pdwDomainName <= dwSrcLen )
+ {
+ *pdwDomainName = dwSrcLen + 1;
+ ret = FALSE;
+ }
+ else
+ {
+ *pdwDomainName = dwSrcLen;
+ wcscpy ( pDomainName, ReferencedDomain->Domains[0].Name.Buffer );
+ }
+ }
+ }
+
+ if ( !ret )
+ SetLastError(ERROR_INSUFFICIENT_BUFFER);
+ }
+
+ if ( ReferencedDomain )
+ LsaFreeMemory ( ReferencedDomain );
+ if ( TranslatedName )
+ LsaFreeMemory ( TranslatedName );
+
+ return ret;
+}
+
+
+
+/******************************************************************************
* LookupAccountNameA [ADVAPI32.@]
*
* @unimplemented
@@ -1023,6 +1184,25 @@
}
+/**********************************************************************
+ * SetSecurityInfo EXPORTED
+ *
+ * @unimplemented
+ */
+DWORD
+WINAPI
+SetSecurityInfo(HANDLE handle,
+ SE_OBJECT_TYPE ObjectType,
+ SECURITY_INFORMATION SecurityInfo,
+ PSID psidOwner,
+ PSID psidGroup,
+ PACL pDacl,
+ PACL pSacl)
+{
+ DPRINT1("SetSecurityInfo: stub\n");
+ return ERROR_CALL_NOT_IMPLEMENTED;
+}
+
/******************************************************************************
* GetSecurityInfoExW EXPORTED
reactos/lib/advapi32/sec
diff -u -r1.2.2.1 -r1.2.2.2
--- trustee.c 13 Dec 2004 09:38:54 -0000 1.2.2.1
+++ trustee.c 30 Dec 2004 04:36:30 -0000 1.2.2.2
@@ -1,4 +1,4 @@
-/* $Id: trustee.c,v 1.2.2.1 2004/12/13 09:38:54 hyperion Exp $
+/* $Id: trustee.c,v 1.2.2.2 2004/12/30 04:36:30 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
@@ -13,9 +13,34 @@
/******************************************************************************
+ * BuildImpersonateTrusteeA [ADVAPI32.@]
+ */
+VOID WINAPI
+BuildImpersonateTrusteeA(PTRUSTEE_A pTrustee,
+ PTRUSTEE_A pImpersonateTrustee)
+{
+ pTrustee->pMultipleTrustee = pImpersonateTrustee;
+ pTrustee->MultipleTrusteeOperation = TRUSTEE_IS_IMPERSONATE;
+}
+
+
+/******************************************************************************
+ * BuildImpersonateTrusteeW [ADVAPI32.@]
+ */
+VOID WINAPI
+BuildImpersonateTrusteeW(PTRUSTEE_W pTrustee,
+ PTRUSTEE_W pImpersonateTrustee)
+{
+ pTrustee->pMultipleTrustee = pImpersonateTrustee;
+ pTrustee->MultipleTrusteeOperation = TRUSTEE_IS_IMPERSONATE;
+}
+
+
+/******************************************************************************
* BuildTrusteeWithSidA [ADVAPI32.@]
*/
-VOID WINAPI BuildTrusteeWithSidA(PTRUSTEEA pTrustee, PSID pSid)
+VOID WINAPI
+BuildTrusteeWithSidA(PTRUSTEE_A pTrustee, PSID pSid)
{
DPRINT("%p %p\n", pTrustee, pSid);
@@ -30,7 +55,8 @@
/******************************************************************************
* BuildTrusteeWithSidW [ADVAPI32.@]
*/
-VOID WINAPI BuildTrusteeWithSidW(PTRUSTEEW pTrustee, PSID pSid)
+VOID WINAPI
+BuildTrusteeWithSidW(PTRUSTEE_W pTrustee, PSID pSid)
{
DPRINT("%p %p\n", pTrustee, pSid);
@@ -45,7 +71,8 @@
/******************************************************************************
* BuildTrusteeWithNameA [ADVAPI32.@]
*/
-VOID WINAPI BuildTrusteeWithNameA(PTRUSTEEA pTrustee, LPSTR name)
+VOID WINAPI
+BuildTrusteeWithNameA(PTRUSTEE_A pTrustee, LPSTR name)
{
DPRINT("%p %s\n", pTrustee, name);
@@ -60,7 +87,8 @@
/******************************************************************************
* BuildTrusteeWithNameW [ADVAPI32.@]
*/
-VOID WINAPI BuildTrusteeWithNameW(PTRUSTEEW pTrustee, LPWSTR name)
+VOID WINAPI
+BuildTrusteeWithNameW(PTRUSTEE_W pTrustee, LPWSTR name)
{
DPRINT("%p %s\n", pTrustee, name);
@@ -70,3 +98,105 @@
pTrustee->TrusteeType = TRUSTEE_IS_UNKNOWN;
pTrustee->ptstrName = name;
}
+
+
+/******************************************************************************
+ * GetMultipleTrusteeA [ADVAPI32.@]
+ */
+PTRUSTEEA WINAPI
+GetMultipleTrusteeA(PTRUSTEE_A pTrustee)
+{
+ return pTrustee->pMultipleTrustee;
+}
+
+
+/******************************************************************************
+ * GetMultipleTrusteeW [ADVAPI32.@]
+ */
+PTRUSTEEW WINAPI
+GetMultipleTrusteeW(PTRUSTEE_W pTrustee)
+{
+ return pTrustee->pMultipleTrustee;
+}
+
+
+/******************************************************************************
+ * GetMultipleTrusteeOperationA [ADVAPI32.@]
+ */
+MULTIPLE_TRUSTEE_OPERATION WINAPI
+GetMultipleTrusteeOperationA(PTRUSTEE_A pTrustee)
+{
+ return pTrustee->MultipleTrusteeOperation;
+}
+
+
+/******************************************************************************
+ * GetMultipleTrusteeOperationW [ADVAPI32.@]
+ */
+MULTIPLE_TRUSTEE_OPERATION WINAPI
+GetMultipleTrusteeOperationW(PTRUSTEE_W pTrustee)
+{
+ return pTrustee->MultipleTrusteeOperation;
+}
+
+
+/******************************************************************************
+ * GetTrusteeFormW [ADVAPI32.@]
+ */
+TRUSTEE_FORM WINAPI
+GetTrusteeFormA(PTRUSTEE_A pTrustee)
+{
+ return pTrustee->TrusteeForm;
+}
+
+
+/******************************************************************************
+ * GetTrusteeFormW [ADVAPI32.@]
+ */
+TRUSTEE_FORM WINAPI
+GetTrusteeFormW(PTRUSTEE_W pTrustee)
+{
+ return pTrustee->TrusteeForm;
+}
+
+
+/******************************************************************************
+ * GetTrusteeNameA [ADVAPI32.@]
+ */
+LPSTR WINAPI
+GetTrusteeNameA(PTRUSTEE_A pTrustee)
+{
+ return (pTrustee->TrusteeForm == TRUSTEE_IS_NAME) ? pTrustee->ptstrName : NULL;
+}
+
+
+/******************************************************************************
+ * GetTrusteeNameW [ADVAPI32.@]
+ */
+LPWSTR WINAPI
+GetTrusteeNameW(PTRUSTEE_W pTrustee)
+{
+ return (pTrustee->TrusteeForm == TRUSTEE_IS_NAME) ? pTrustee->ptstrName : NULL;
+}
+
+
+/******************************************************************************
+ * GetTrusteeTypeA [ADVAPI32.@]
+ */
+TRUSTEE_TYPE WINAPI
+GetTrusteeTypeA(PTRUSTEE_A pTrustee)
+{
+ return pTrustee->TrusteeType;
+}
+
+
+/******************************************************************************
+ * GetTrusteeTypeW [ADVAPI32.@]
+ */
+TRUSTEE_TYPE WINAPI
+GetTrusteeTypeW(PTRUSTEE_W pTrustee)
+{
+ return pTrustee->TrusteeType;
+}
+
+/* EOF */
reactos/lib/advapi32/token
diff -u -r1.14.6.2 -r1.14.6.3
--- token.c 13 Dec 2004 16:18:02 -0000 1.14.6.2
+++ token.c 30 Dec 2004 04:36:30 -0000 1.14.6.3
@@ -1,4 +1,4 @@
-/* $Id: token.c,v 1.14.6.2 2004/12/13 16:18:02 hyperion Exp $
+/* $Id: token.c,v 1.14.6.3 2004/12/30 04:36:30 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
@@ -261,22 +261,27 @@
OBJECT_ATTRIBUTES ObjectAttributes;
HANDLE NewToken;
NTSTATUS Status;
-
- ObjectAttributes.Length = sizeof(OBJECT_ATTRIBUTES);
- ObjectAttributes.RootDirectory = NULL;
- ObjectAttributes.ObjectName = NULL;
- ObjectAttributes.Attributes = 0;
- if (lpTokenAttributes->bInheritHandle)
- {
- ObjectAttributes.Attributes |= OBJ_INHERIT;
- }
- ObjectAttributes.SecurityDescriptor = lpTokenAttributes->lpSecurityDescriptor;
- ObjectAttributes.SecurityQualityOfService = NULL;
+ SECURITY_QUALITY_OF_SERVICE Sqos;
+
+ Sqos.Length = sizeof(SECURITY_QUALITY_OF_SERVICE);
+ Sqos.ImpersonationLevel = ImpersonationLevel;
+ Sqos.ContextTrackingMode = 0;
+ Sqos.EffectiveOnly = FALSE;
+
+ InitializeObjectAttributes(
+ &ObjectAttributes,
+ NULL,
+ lpTokenAttributes->bInheritHandle ? OBJ_INHERIT : 0,
+ NULL,
+ lpTokenAttributes->lpSecurityDescriptor
+ );
+
+ ObjectAttributes.SecurityQualityOfService = &Sqos;
Status = NtDuplicateToken (ExistingTokenHandle,
dwDesiredAccess,
&ObjectAttributes,
- ImpersonationLevel,
+ Sqos.EffectiveOnly, /* why both here _and_ in Sqos? */
TokenType,
&NewToken);
if (!NT_SUCCESS(Status))
reactos/lib/cabinet
diff -u -r1.3.16.3 -r1.3.16.4
--- Makefile.ros-template 13 Dec 2004 16:18:02 -0000 1.3.16.3
+++ Makefile.ros-template 30 Dec 2004 04:36:30 -0000 1.3.16.4
@@ -1,4 +1,4 @@
-# $Id: Makefile.ros-template,v 1.3.16.3 2004/12/13 16:18:02 hyperion Exp $
+# $Id: Makefile.ros-template,v 1.3.16.4 2004/12/30 04:36:30 hyperion Exp $
TARGET_NAME = cabinet
reactos/lib/comctl32
diff -u -r1.3.16.3 -r1.3.16.4
--- Makefile.ros-template 13 Dec 2004 16:18:02 -0000 1.3.16.3
+++ Makefile.ros-template 30 Dec 2004 04:36:30 -0000 1.3.16.4
@@ -1,4 +1,4 @@
-# $Id: Makefile.ros-template,v 1.3.16.3 2004/12/13 16:18:02 hyperion Exp $
+# $Id: Makefile.ros-template,v 1.3.16.4 2004/12/30 04:36:30 hyperion Exp $
TARGET_NAME = comctl32
reactos/lib/comctl32
diff -u -r1.6.6.1 -r1.6.6.2
--- status.c 8 Dec 2004 21:57:02 -0000 1.6.6.1
+++ status.c 30 Dec 2004 04:36:30 -0000 1.6.6.2
@@ -650,6 +650,7 @@
{
STATUSWINDOWPART *part=NULL;
BOOL changed = FALSE;
+ WORD oldStyle;
if (style & SBT_OWNERDRAW) {
TRACE("part %d, text %p\n",nPart,text);
@@ -671,6 +672,7 @@
if (part->style != style)
changed = TRUE;
+ oldStyle = part->style;
part->style = style;
if (style & SBT_OWNERDRAW) {
if (part->text == text)
@@ -694,7 +696,7 @@
/* check if text is unchanged -> no need to redraw */
if (text) {
if (!changed && part->text && !lstrcmpW(ntext, part->text)) {
- if (!isW) Free(ntext);
+ Free(ntext);
return TRUE;
}
} else {
@@ -702,7 +704,7 @@
return TRUE;
}
- if (part->text)
+ if (part->text && !(oldStyle & SBT_OWNERDRAW))
Free (part->text);
part->text = ntext;
}
reactos/lib/comctl32
diff -u -r1.12.2.1 -r1.12.2.2
--- winehq2ros.patch 8 Dec 2004 21:57:03 -0000 1.12.2.1
+++ winehq2ros.patch 30 Dec 2004 04:36:30 -0000 1.12.2.2
@@ -177,3 +177,44 @@
{
MoveToEx(hdc, centerx - plussize + 1, centery, NULL);
LineTo(hdc, centerx + plussize, centery);
+Index: status.c
+===================================================================
+RCS file: /CVS/ReactOS/reactos/lib/comctl32/status.c,v
+retrieving revision 1.7
+diff -u -r1.7 status.c
+--- status.c 5 Dec 2004 23:09:27 -0000 1.7
++++ status.c 14 Dec 2004 00:58:03 -0000
+@@ -650,6 +650,7 @@
+ {
+ STATUSWINDOWPART *part=NULL;
+ BOOL changed = FALSE;
++ WORD oldStyle;
+
+ if (style & SBT_OWNERDRAW) {
+ TRACE("part %d, text %p\n",nPart,text);
+@@ -671,6 +672,7 @@
+ if (part->style != style)
+ changed = TRUE;
+
++ oldStyle = part->style;
+ part->style = style;
+ if (style & SBT_OWNERDRAW) {
+ if (part->text == text)
+@@ -694,7 +696,7 @@
+ /* check if text is unchanged -> no need to redraw */
+ if (text) {
+ if (!changed && part->text && !lstrcmpW(ntext, part->text)) {
+- if (!isW) Free(ntext);
++ Free(ntext);
+ return TRUE;
+ }
+ } else {
+@@ -702,7 +704,7 @@
+ return TRUE;
+ }
+
+- if (part->text)
++ if (part->text && !(oldStyle & SBT_OWNERDRAW))
+ Free (part->text);
+ part->text = ntext;
+ }
reactos/lib/cpl/desk
diff -u -r1.2 -r1.2.2.1
--- desk.rc 16 Oct 2004 20:27:31 -0000 1.2
+++ desk.rc 30 Dec 2004 04:36:30 -0000 1.2.2.1
@@ -1,4 +1,5 @@
#include "resource.h"
+
#ifdef _MSC_VER
#include <../../../include/defines.h>
#else
@@ -6,7 +7,7 @@
#endif
#define REACTOS_VERSION_DLL
-#define REACTOS_STR_FILE_DESCRIPTION "ReactOS Display Control Panel\0"
+#define REACTOS_STR_FILE_DESCRIPTION "ReactOS Display Panel\0"
#define REACTOS_STR_INTERNAL_NAME "desk\0"
#define REACTOS_STR_ORIGINAL_FILENAME "desk.cpl\0"
#ifdef _MSC_VER
@@ -15,44 +16,104 @@
#include <reactos/version.rc>
#endif
-LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT
-
-IDI_CPLSYSTEM ICON "resources/applet.ico"
-
-IDD_PROPPAGEBACKGROUND DIALOGEX 0, 0, PROPSHEETWIDTH, PROPSHEETHEIGHT
+IDD_PROPPAGEBACKGROUND DIALOGEX 0, 0, 246, 228
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION
CAPTION "Background"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
-
+ GROUPBOX "&Pattern",1001,5,118,115,92
+ LISTBOX 1002,11,130,103,42,LBS_SORT | LBS_NOINTEGRALHEIGHT |
+ WS_VSCROLL | WS_TABSTOP
+ PUSHBUTTON "&Edit Pattern...",1003,53,175,61,14
+ GROUPBOX "&Wallpaper",1004,127,118,115,92
+ LISTBOX 1005,133,130,103,42,LBS_SORT | LBS_NOINTEGRALHEIGHT |
+ WS_VSCROLL | WS_TABSTOP
+ PUSHBUTTON "&Browse...",1006,174,175,61,14
+ LTEXT "&Position:",1007,134,196,28,8
+ COMBOBOX 1008,169,193,67,30,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL |
+ WS_TABSTOP
END
-IDD_PROPPAGESCREENSAVER DIALOGEX 0, 0, PROPSHEETWIDTH, PROPSHEETHEIGHT
+IDD_PROPPAGESCREENSAVER DIALOGEX 0, 0, 246, 228
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION
CAPTION "Screen Saver"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
-
+ GROUPBOX "&Screen Saver",200,4,129,238,48
+ COMBOBOX 1000,10,140,115,200,CBS_DROPDOWNLIST | CBS_SORT |
+ WS_VSCROLL | WS_GROUP | WS_TABSTOP
+ PUSHBUTTON "Se&ttings...",1003,130,139,50,14,WS_GROUP
+ PUSHBUTTON "Pre&view",1004,183,139,50,14
+ CONTROL "&Lock desktop on resume",1020,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,13,157,112,9
+ LTEXT "&Wait:",1016,151,160,17,9
+ EDITTEXT 1006,170,158,30,12,ES_RIGHT | WS_GROUP
+ CONTROL "",1007,"msctls_updown32",UDS_SETBUDDYINT |
+ UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS |
+ UDS_NOTHOUSANDS | WS_BORDER | WS_GROUP,203,158,11,12
+ LTEXT "minutes",1022,204,160,28,9
+ GROUPBOX "Energy saving features of monitor",1017,4,179,238,33
+ PUSHBUTTON "P&ower...",1014,175,190,50,14
+ LTEXT "To adjust the power settings for your monitor, click Power.",
+ 1018,19,190,155,16
+ CONTROL "",1002,"Static",SS_BITMAP | SS_CENTERIMAGE,60,11,125,
+ 107
END
-IDD_PROPPAGEAPPEARANCE DIALOGEX 0, 0, PROPSHEETWIDTH, PROPSHEETHEIGHT
+IDD_PROPPAGEAPPEARANCE DIALOGEX 0, 0, 246, 228
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION
CAPTION "Appearance"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
-
+ LTEXT "&Color Scheme:",-1,3,130,30,9
+ COMBOBOX 1400,3,140,131,200,CBS_DROPDOWNLIST | CBS_SORT |
+ WS_VSCROLL | WS_TABSTOP
+ PUSHBUTTON "Sa&ve As...",1401,138,140,50,14
+ PUSHBUTTON "&Delete",1402,191,140,50,14
+ LTEXT "&Item:",-1,3,159,26,9
+ COMBOBOX 1403,3,169,131,200,CBS_DROPDOWNLIST | CBS_SORT |
+ WS_VSCROLL | WS_TABSTOP
+ LTEXT "Si&ze:",1450,138,159,16,9
+ EDITTEXT 1404,138,169,38,13,ES_RIGHT | WS_GROUP
+ CONTROL "",1411,"msctls_updown32",UDS_SETBUDDYINT |
+ UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS |
+ WS_BORDER | WS_GROUP,168,169,10,13
+ LTEXT "Co&lor:",1451,180,159,20,9
+ LTEXT "Color &2:",1455,212,159,28,9
+ LTEXT "&Font:",1452,3,188,20,9
+ COMBOBOX 1407,3,198,131,200,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL |
+ WS_TABSTOP
+ LTEXT "Siz&e:",1454,138,188,17,8
+ COMBOBOX 1408,138,198,38,200,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL |
+ WS_TABSTOP
+ LTEXT "Colo&r:",1453,180,188,20,9
+ CHECKBOX "B",1409,212,198,14,13,BS_PUSHLIKE
+ CHECKBOX "I",1410,226,198,14,13,BS_PUSHLIKE
END
-IDD_PROPPAGESETTINGS DIALOGEX 0, 0, PROPSHEETWIDTH, PROPSHEETHEIGHT
+IDD_PROPPAGESETTINGS DIALOGEX 0, 0, 246, 228
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION
CAPTION "Settings"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
-
+ LTEXT "&Display:",1820,3,140,30,8
+ GROUPBOX "&Colors",1817,3,160,115,43
+ COMBOBOX 1807,9,170,103,80,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL |
+ CBS_SORT | WS_VSCROLL | WS_TABSTOP
+ CONTROL "",1813,"Static",SS_BITMAP | SS_CENTERIMAGE | SS_SUNKEN,
+ 9,188,103,9
+ GROUPBOX "&Screen area",1818,125,160,115,43
+ CONTROL "",1808,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,
+ 152,170,58,17
+ LTEXT "Less",1815,131,170,15,8,NOT WS_GROUP
+ LTEXT "More",1816,215,170,21,8,NOT WS_GROUP
+ CTEXT "640 X 480 pixels",1814,132,190,100,10,NOT WS_GROUP
+ PUSHBUTTON "Ad&vanced...",1802,184,205,56,14
+ LTEXT "<none>",1050,19,149,224,8
END
STRINGTABLE
BEGIN
- IDS_CPLSYSTEMNAME "Display Properties"
+ IDS_CPLSYSTEMNAME "Display"
IDS_CPLSYSTEMDESCRIPTION "Customizes your desktop display and screen saver."
END
reactos/lib/cpl/ncpa
diff -u -r1.4.2.2 -r1.4.2.3
--- tcpip_properties.c 13 Dec 2004 16:18:02 -0000 1.4.2.2
+++ tcpip_properties.c 30 Dec 2004 04:36:30 -0000 1.4.2.3
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: tcpip_properties.c,v 1.4.2.2 2004/12/13 16:18:02 hyperion Exp $
+/* $Id: tcpip_properties.c,v 1.4.2.3 2004/12/30 04:36:30 hyperion Exp $
*
* PROJECT: ReactOS Network Control Panel
* FILE: lib/cpl/system/tcpip_properties.c
reactos/lib/crtdll/mbstring
diff -u -r1.3 -r1.3.34.1
--- iskmoji.c 24 Nov 2002 18:42:14 -0000 1.3
+++ iskmoji.c 30 Dec 2004 04:36:31 -0000 1.3.34.1
@@ -2,5 +2,5 @@
int _ismbbkalpha(unsigned char c)
{
- return (0xA7 <= c <= 0xDF);
+ return (0xA7 <= c && c <= 0xDF);
}
reactos/lib/dinput8
diff -u -r1.2.2.1 -r1.2.2.2
--- Makefile.ros-template 13 Dec 2004 16:18:26 -0000 1.2.2.1
+++ Makefile.ros-template 30 Dec 2004 04:36:31 -0000 1.2.2.2
@@ -1,7 +1,9 @@
-# $Id: Makefile.ros-template,v 1.2.2.1 2004/12/13 16:18:26 hyperion Exp $
+# $Id: Makefile.ros-template,v 1.2.2.2 2004/12/30 04:36:31 hyperion Exp $
TARGET_NAME = dinput8
+TARGET_BASE = $(TARGET_BASE_LIB_DINPUT8)
+
TARGET_OBJECTS = @C_SRCS@
TARGET_CFLAGS = @EXTRADEFS@ -D__REACTOS__
reactos/lib/dinput
diff -u -r1.2.16.3 -r1.2.16.4
--- Makefile 13 Dec 2004 16:18:02 -0000 1.2.16.3
+++ Makefile 30 Dec 2004 04:36:31 -0000 1.2.16.4
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.2.16.3 2004/12/13 16:18:02 hyperion Exp $
+# $Id: Makefile,v 1.2.16.4 2004/12/30 04:36:31 hyperion Exp $
PATH_TO_TOP = ../..
reactos/lib/dinput
diff -u -r1.2.2.1 -r1.2.2.2
--- Makefile.ros-template 8 Dec 2004 21:57:07 -0000 1.2.2.1
+++ Makefile.ros-template 30 Dec 2004 04:36:31 -0000 1.2.2.2
@@ -1,7 +1,9 @@
-# $Id: Makefile.ros-template,v 1.2.2.1 2004/12/08 21:57:07 hyperion Exp $
+# $Id: Makefile.ros-template,v 1.2.2.2 2004/12/30 04:36:31 hyperion Exp $
TARGET_NAME = dinput
+TARGET_BASE = $(TARGET_BASE_LIB_DINPUT)
+
TARGET_OBJECTS = @C_SRCS@
TARGET_CFLAGS = @EXTRADEFS@ -D__REACTOS__
reactos/lib/dnsapi
diff -u -r1.5.16.3 -r1.5.16.4
--- Makefile 13 Dec 2004 16:18:03 -0000 1.5.16.3
+++ Makefile 30 Dec 2004 04:36:31 -0000 1.5.16.4
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.5.16.3 2004/12/13 16:18:03 hyperion Exp $
+# $Id: Makefile,v 1.5.16.4 2004/12/30 04:36:31 hyperion Exp $
PATH_TO_TOP = ../..
reactos/lib/dnsapi/dnsapi
diff -u -r1.2.24.1 -r1.2.24.2
--- query.c 8 Dec 2004 21:57:08 -0000 1.2.24.1
+++ query.c 30 Dec 2004 04:36:31 -0000 1.2.24.2
@@ -64,7 +64,6 @@
adns_if_noserverwarn,
0 );
if( adns_error != adns_s_ok ) {
- adns_finish( astate );
return DnsIntTranslateAdnsToDNS_STATUS( adns_error );
}
reactos/lib/dxguid
diff -u -r1.1.2.1 -r1.1.2.2
--- dxguid-mingw.c 13 Dec 2004 09:39:26 -0000 1.1.2.1
+++ dxguid-mingw.c 30 Dec 2004 04:36:31 -0000 1.1.2.2
@@ -17,12 +17,13 @@
#include <basetyps.h>
#endif
-// wine own ?
-//DEFINE_GUID(IID_IDsDriver, 0x8C4233C0l, 0xB4CC, 0x11CE, 0x92, 0x94, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00);
-//DEFINE_GUID(IID_IDsDriverNotify, 0x00363EF44, 0x3B57, 0x11D3, 0xAC, 0x79, 0x00, 0x10, 0x5A, 0x01, 0x7f, 0xe1);
-//DEFINE_GUID(IID_IDsDriverPropertySet, 0x0F6F2E8E0, 0xD842, 0x11D0, 0x8F, 0x75, 0x00, 0xC0, 0x4F, 0xC2, 0x8A, 0xCA);
-//DEFINE_GUID(IID_IDsDriverBuffer, 0x8C4233C1l, 0xB4CC, 0x11CE, 0x92, 0x94, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00);
-// this is wrong but it keep dinput happy
+// wine own or ?
+// but it keep dsound happy
+DEFINE_GUID(IID_IDsDriver, 0x8C4233C0l, 0xB4CC, 0x11CE, 0x92, 0x94, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00);
+DEFINE_GUID(IID_IDsDriverNotify, 0x00363EF44, 0x3B57, 0x11D3, 0xAC, 0x79, 0x00, 0x10, 0x5A, 0x01, 0x7f, 0xe1);
+DEFINE_GUID(IID_IDsDriverPropertySet, 0x0F6F2E8E0, 0xD842, 0x11D0, 0x8F, 0x75, 0x00, 0xC0, 0x4F, 0xC2, 0x8A, 0xCA);
+DEFINE_GUID(IID_IDsDriverBuffer, 0x8C4233C1l, 0xB4CC, 0x11CE, 0x92, 0x94, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00);
+//
// ok
reactos/lib/expat
diff -u -r1.3.16.3 -r1.3.16.4
--- Makefile 13 Dec 2004 16:18:03 -0000 1.3.16.3
+++ Makefile 30 Dec 2004 04:36:31 -0000 1.3.16.4
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.3.16.3 2004/12/13 16:18:03 hyperion Exp $
+# $Id: Makefile,v 1.3.16.4 2004/12/30 04:36:31 hyperion Exp $
PATH_TO_TOP = ../..
reactos/lib/freetype/i386
diff -u -r1.1.34.3 -r1.1.34.4
--- setjmplongjmp.s 13 Dec 2004 16:18:03 -0000 1.1.34.3
+++ setjmplongjmp.s 30 Dec 2004 04:36:31 -0000 1.1.34.4
@@ -1,4 +1,4 @@
-/* $Id: setjmplongjmp.s,v 1.1.34.3 2004/12/13 16:18:03 hyperion Exp $
+/* $Id: setjmplongjmp.s,v 1.1.34.4 2004/12/30 04:36:31 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: FreeType implementation for ReactOS
reactos/lib/freetype
diff -u -r1.3 -r1.3.2.1
--- rosglue.c 18 Nov 2004 22:22:46 -0000 1.3
+++ rosglue.c 30 Dec 2004 04:36:31 -0000 1.3.2.1
@@ -1,11 +1,11 @@
-/* $Id: rosglue.c,v 1.3 2004/11/18 22:22:46 navaraf Exp $
- *
- * COPYRIGHT: See COPYING in the top level directory
- * PROJECT: FreeType implementation for ReactOS
- * PURPOSE: Glue functions between FreeType
- * FILE: thirdparty/freetype/rosglue.c
- * PROGRAMMER: Ge van Geldorp (ge@gse.nl)
- * NOTES:
+/* $Id: rosglue.c,v 1.3.2.1 2004/12/30 04:36:31 hyperion Exp $
+ *
+ * COPYRIGHT: See COPYING in the top level directory
+ * PROJECT: FreeType implementation for ReactOS
+ * PURPOSE: Glue functions between FreeType
+ * FILE: thirdparty/freetype/rosglue.c
+ * PROGRAMMER: Ge van Geldorp (ge@gse.nl)
+ * NOTES:
*/
#include <ddk/ntddk.h>
reactos/lib/gdi32/include
diff -u -r1.1 -r1.1.8.1
--- .cvsignore 15 Aug 2004 18:42:57 -0000 1.1
+++ .cvsignore 30 Dec 2004 04:36:31 -0000 1.1.8.1
@@ -1,2 +1,3 @@
*.o
*.gch
+*.d
reactos/lib/gdi32/objects
diff -u -r1.9 -r1.9.6.1
--- font.c 6 Sep 2004 21:15:46 -0000 1.9
+++ font.c 30 Dec 2004 04:36:32 -0000 1.9.6.1
@@ -1,4 +1,4 @@
-/* $Id: font.c,v 1.9 2004/09/06 21:15:46 weiden Exp $
+/* $Id: font.c,v 1.9.6.1 2004/12/30 04:36:32 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
@@ -16,7 +16,7 @@
#define INITIAL_FAMILY_COUNT 64
static BOOL FASTCALL
-MetricsCharConvert(WCHAR w, CHAR *b)
+MetricsCharConvert(WCHAR w, UCHAR *b)
{
UNICODE_STRING WString;
WCHAR WBuf[2];
@@ -243,11 +243,11 @@
{
RosRtlLogFontW2A(&EnumLogFontExA.elfLogFont, &Info[i].EnumLogFontEx.elfLogFont);
WideCharToMultiByte(CP_THREAD_ACP, 0, Info[i].EnumLogFontEx.elfFullName, -1,
- EnumLogFontExA.elfFullName, LF_FULLFACESIZE, NULL, NULL);
+ (LPSTR)EnumLogFontExA.elfFullName, LF_FULLFACESIZE, NULL, NULL);
WideCharToMultiByte(CP_THREAD_ACP, 0, Info[i].EnumLogFontEx.elfStyle, -1,
- EnumLogFontExA.elfStyle, LF_FACESIZE, NULL, NULL);
+ (LPSTR)EnumLogFontExA.elfStyle, LF_FACESIZE, NULL, NULL);
WideCharToMultiByte(CP_THREAD_ACP, 0, Info[i].EnumLogFontEx.elfScript, -1,
- EnumLogFontExA.elfScript, LF_FACESIZE, NULL, NULL);
+ (LPSTR)EnumLogFontExA.elfScript, LF_FACESIZE, NULL, NULL);
NewTextMetricExW2A(&NewTextMetricExA,
&Info[i].NewTextMetricEx);
Ret = ((FONTENUMPROCA) EnumProc)(
reactos/lib/icmp
diff -u -r1.1.6.3 -r1.1.6.4
--- Makefile.ros-template 13 Dec 2004 16:18:03 -0000 1.1.6.3
+++ Makefile.ros-template 30 Dec 2004 04:36:32 -0000 1.1.6.4
@@ -1,4 +1,4 @@
-# $Id: Makefile.ros-template,v 1.1.6.3 2004/12/13 16:18:03 hyperion Exp $
+# $Id: Makefile.ros-template,v 1.1.6.4 2004/12/30 04:36:32 hyperion Exp $
TARGET_NAME = icmp
reactos/lib/iphlpapi
diff -u -r1.2.16.3 -r1.2.16.4
--- Makefile.ros-template 13 Dec 2004 16:18:03 -0000 1.2.16.3
+++ Makefile.ros-template 30 Dec 2004 04:36:32 -0000 1.2.16.4
@@ -1,4 +1,4 @@
-# $Id: Makefile.ros-template,v 1.2.16.3 2004/12/13 16:18:03 hyperion Exp $
+# $Id: Makefile.ros-template,v 1.2.16.4 2004/12/30 04:36:32 hyperion Exp $
TARGET_NAME = iphlpapi
reactos/lib/iphlpapi
diff -u -r1.6.2.1 -r1.6.2.2
--- ipstats_reactos.c 8 Dec 2004 21:57:09 -0000 1.6.2.1
+++ ipstats_reactos.c 30 Dec 2004 04:36:32 -0000 1.6.2.2
@@ -466,14 +466,14 @@
DPRINT( "%d routes in instance %d\n", snmpInfo.ipsi_numroutes, i );
+ tdiGetRoutesForIpEntity( tcpFile, &ent, &route_set, &numRoutes );
+
if( !route_set ) {
closeTcpFile( tcpFile );
HeapFree( GetProcessHeap(), 0, out_route_table );
return 0;
}
- tdiGetRoutesForIpEntity( tcpFile, &ent, &route_set, &numRoutes );
-
DPRINT("Route set returned\n");
#if 0
HexDump( route_set,
reactos/lib/kernel32/debug
diff -u -r1.4.22.2 -r1.4.22.3
--- debugger.c 13 Dec 2004 16:18:03 -0000 1.4.22.2
+++ debugger.c 30 Dec 2004 04:36:32 -0000 1.4.22.3
@@ -1,4 +1,4 @@
-/* $Id: debugger.c,v 1.4.22.2 2004/12/13 16:18:03 hyperion Exp $
+/* $Id: debugger.c,v 1.4.22.3 2004/12/30 04:36:32 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
reactos/lib/kernel32/except
diff -u -r1.18.2.2 -r1.18.2.3
--- except.c 13 Dec 2004 16:18:03 -0000 1.18.2.2
+++ except.c 30 Dec 2004 04:36:32 -0000 1.18.2.3
@@ -1,4 +1,4 @@
-/* $Id: except.c,v 1.18.2.2 2004/12/13 16:18:03 hyperion Exp $
+/* $Id: except.c,v 1.18.2.3 2004/12/30 04:36:32 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
reactos/lib/kernel32/file
diff -u -r1.40.2.3 -r1.40.2.4
--- create.c 13 Dec 2004 16:18:03 -0000 1.40.2.3
+++ create.c 30 Dec 2004 04:36:32 -0000 1.40.2.4
@@ -1,4 +1,4 @@
-/* $Id: create.c,v 1.40.2.3 2004/12/13 16:18:03 hyperion Exp $
+/* $Id: create.c,v 1.40.2.4 2004/12/30 04:36:32 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
reactos/lib/kernel32/file
diff -u -r1.17.8.3 -r1.17.8.4
--- delete.c 13 Dec 2004 16:18:03 -0000 1.17.8.3
+++ delete.c 30 Dec 2004 04:36:32 -0000 1.17.8.4
@@ -1,4 +1,4 @@
-/* $Id: delete.c,v 1.17.8.3 2004/12/13 16:18:03 hyperion Exp $
+/* $Id: delete.c,v 1.17.8.4 2004/12/30 04:36:32 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
reactos/lib/kernel32/file
diff -u -r1.50.2.2 -r1.50.2.3
--- dir.c 13 Dec 2004 16:18:03 -0000 1.50.2.2
+++ dir.c 30 Dec 2004 04:36:32 -0000 1.50.2.3
@@ -1,4 +1,4 @@
-/* $Id: dir.c,v 1.50.2.2 2004/12/13 16:18:03 hyperion Exp $
+/* $Id: dir.c,v 1.50.2.3 2004/12/30 04:36:32 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
reactos/lib/kernel32/file
diff -u -r1.60.2.3 -r1.60.2.4
--- file.c 13 Dec 2004 16:18:03 -0000 1.60.2.3
+++ file.c 30 Dec 2004 04:36:32 -0000 1.60.2.4
@@ -1,4 +1,4 @@
-/* $Id: file.c,v 1.60.2.3 2004/12/13 16:18:03 hyperion Exp $
+/* $Id: file.c,v 1.60.2.4 2004/12/30 04:36:32 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
reactos/lib/kernel32/file
diff -u -r1.15.2.3 -r1.15.2.4
--- iocompl.c 13 Dec 2004 16:18:03 -0000 1.15.2.3
+++ iocompl.c 30 Dec 2004 04:36:34 -0000 1.15.2.4
@@ -1,4 +1,4 @@
-/* $Id: iocompl.c,v 1.15.2.3 2004/12/13 16:18:03 hyperion Exp $
+/* $Id: iocompl.c,v 1.15.2.4 2004/12/30 04:36:34 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
reactos/lib/kernel32/file
diff -u -r1.14.16.3 -r1.14.16.4
--- move.c 13 Dec 2004 16:18:03 -0000 1.14.16.3
+++ move.c 30 Dec 2004 04:36:34 -0000 1.14.16.4
@@ -1,4 +1,4 @@
-/* $Id: move.c,v 1.14.16.3 2004/12/13 16:18:03 hyperion Exp $
+/* $Id: move.c,v 1.14.16.4 2004/12/30 04:36:34 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
@@ -18,14 +18,6 @@
/* GLOBALS *****************************************************************/
-#if defined(__GNUC__)
-void * alloca(size_t size);
-#elif defined(_MSC_VER)
-void* _alloca(size_t size);
-#else
-#error Unknown compiler for alloca intrinsic stack allocation "function"
-#endif
-
/* FUNCTIONS ****************************************************************/
static BOOL
reactos/lib/kernel32/file
diff -u -r1.20 -r1.20.2.1
--- npipe.c 8 Oct 2004 23:24:01 -0000 1.20
+++ npipe.c 30 Dec 2004 04:36:34 -0000 1.20.2.1
@@ -1,4 +1,4 @@
-/* $Id: npipe.c,v 1.20 2004/10/08 23:24:01 weiden Exp $
+/* $Id: npipe.c,v 1.20.2.1 2004/12/30 04:36:34 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
@@ -73,14 +73,14 @@
ACCESS_MASK DesiredAccess;
ULONG CreateOptions;
ULONG CreateDisposition;
- BOOLEAN WriteModeMessage;
- BOOLEAN ReadModeMessage;
- BOOLEAN NonBlocking;
+ ULONG WriteModeMessage;
+ ULONG ReadModeMessage;
+ ULONG NonBlocking;
IO_STATUS_BLOCK Iosb;
ULONG ShareAccess, Attributes;
LARGE_INTEGER DefaultTimeOut;
PSECURITY_DESCRIPTOR SecurityDescriptor = NULL;
-
+
Result = RtlDosPathNameToNtPathName_U((LPWSTR)lpName,
&NamedPipeName,
NULL,
@@ -90,10 +90,10 @@
SetLastError(ERROR_PATH_NOT_FOUND);
return(INVALID_HANDLE_VALUE);
}
-
+
DPRINT("Pipe name: %wZ\n", &NamedPipeName);
DPRINT("Pipe name: %S\n", NamedPipeName.Buffer);
-
+
Attributes = OBJ_CASE_INSENSITIVE;
if(lpSecurityAttributes)
{
@@ -107,13 +107,10 @@
Attributes,
NULL,
SecurityDescriptor);
-
+
DesiredAccess = 0;
-
ShareAccess = 0;
-
CreateDisposition = FILE_OPEN_IF;
-
CreateOptions = 0;
if (dwOpenMode & FILE_FLAG_WRITE_THROUGH)
{
@@ -135,53 +132,53 @@
{
CreateOptions = CreateOptions | FILE_PIPE_OUTBOUND;
}
-
+
if (dwPipeMode & PIPE_TYPE_BYTE)
{
- WriteModeMessage = FALSE;
+ WriteModeMessage = FILE_PIPE_BYTE_STREAM_MODE;
}
else if (dwPipeMode & PIPE_TYPE_MESSAGE)
{
- WriteModeMessage = TRUE;
+ WriteModeMessage = FILE_PIPE_MESSAGE_MODE;
}
else
{
- WriteModeMessage = FALSE;
+ WriteModeMessage = FILE_PIPE_BYTE_STREAM_MODE;
}
-
+
if (dwPipeMode & PIPE_READMODE_BYTE)
{
- ReadModeMessage = FALSE;
+ ReadModeMessage = FILE_PIPE_BYTE_STREAM_MODE;
}
else if (dwPipeMode & PIPE_READMODE_MESSAGE)
{
- ReadModeMessage = TRUE;
+ ReadModeMessage = FILE_PIPE_MESSAGE_MODE;
}
else
{
- ReadModeMessage = FALSE;
+ ReadModeMessage = FILE_PIPE_BYTE_STREAM_MODE;
}
-
+
if (dwPipeMode & PIPE_WAIT)
{
- NonBlocking = FALSE;
+ NonBlocking = FILE_PIPE_QUEUE_OPERATION;
}
else if (dwPipeMode & PIPE_NOWAIT)
{
- NonBlocking = TRUE;
+ NonBlocking = FILE_PIPE_COMPLETE_OPERATION;
}
else
{
- NonBlocking = FALSE;
+ NonBlocking = FILE_PIPE_QUEUE_OPERATION;
}
-
+
if (nMaxInstances >= PIPE_UNLIMITED_INSTANCES)
{
nMaxInstances = ULONG_MAX;
}
-
+
DefaultTimeOut.QuadPart = nDefaultTimeOut * -10000;
-
+
Status = NtCreateNamedPipeFile(&PipeHandle,
DesiredAccess,
&ObjectAttributes,
@@ -196,17 +193,17 @@
nInBufferSize,
nOutBufferSize,
&DefaultTimeOut);
-
+
RtlFreeUnicodeString(&NamedPipeName);
-
+
if (!NT_SUCCESS(Status))
{
DPRINT("NtCreateNamedPipe failed (Status %x)!\n", Status);
SetLastErrorByStatus (Status);
- return(INVALID_HANDLE_VALUE);
+ return INVALID_HANDLE_VALUE;
}
-
- return(PipeHandle);
+
+ return PipeHandle;
}
@@ -251,7 +248,6 @@
&NamedPipeName,
NULL,
NULL);
-
if (!r)
{
return(FALSE);
@@ -611,7 +607,7 @@
IO_STATUS_BLOCK StatusBlock;
NTSTATUS Status;
- if(lpState != NULL)
+ if (lpState != NULL)
{
FILE_PIPE_INFORMATION PipeInfo;
@@ -620,7 +616,7 @@
&PipeInfo,
sizeof(FILE_PIPE_INFORMATION),
FilePipeInformation);
- if(!NT_SUCCESS(Status))
+ if (!NT_SUCCESS(Status))
{
SetLastErrorByStatus(Status);
return FALSE;
reactos/lib/kernel32
diff -u -r1.13 -r1.13.2.1
--- k32.h 5 Nov 2004 12:28:19 -0000 1.13
+++ k32.h 30 Dec 2004 04:36:34 -0000 1.13.2.1
@@ -3,6 +3,7 @@
#define NTOS_MODE_USER
#define __NO_CTYPE_INLINES
#include <ntos.h>
+#include <ctype.h>
#include <stdarg.h>
#include <stdio.h>
#include <limits.h>
@@ -35,3 +36,5 @@
#include <rosrtl/registry.h>
#include "include/kernel32.h"
+
+#include <pseh/framebased.h>
reactos/lib/kernel32
diff -u -r1.89.2.3 -r1.89.2.4
--- makefile 13 Dec 2004 16:18:03 -0000 1.89.2.3
+++ makefile 30 Dec 2004 04:36:34 -0000 1.89.2.4
@@ -1,4 +1,4 @@
-# $Id: makefile,v 1.89.2.3 2004/12/13 16:18:03 hyperion Exp $
+# $Id: makefile,v 1.89.2.4 2004/12/30 04:36:34 hyperion Exp $
PATH_TO_TOP = ../..
@@ -36,7 +36,6 @@
misc/muldiv.o misc/nls.o misc/computername.o \
misc/perfcnt.o misc/lzexpand_main.o misc/lcformat.o \
misc/chartype.o
-
FILE_OBJECTS = file/file.o file/curdir.o file/lfile.o file/dir.o \
file/iocompl.o file/volume.o file/deviceio.o file/dosdev.o \
@@ -51,8 +50,8 @@
NLS_OBJECTS =
THREAD_OBJECTS = \
- thread/fiber.o \
- thread/thread.o \
+ thread/fiber.o \
+ thread/thread.o \
thread/tls.o \
thread/fls.o
reactos/lib/kernel32/mem
diff -u -r1.27 -r1.27.16.1
--- heap.c 13 Jun 2004 20:04:55 -0000 1.27
+++ heap.c 30 Dec 2004 04:36:34 -0000 1.27.16.1
@@ -1,4 +1,4 @@
-/* $Id: heap.c,v 1.27 2004/06/13 20:04:55 navaraf Exp $
+/* $Id: heap.c,v 1.27.16.1 2004/12/30 04:36:34 hyperion Exp $
*
* kernel/heap.c
* Copyright (C) 1996, Onno Hovers, All rights reserved
@@ -53,7 +53,14 @@
*/
BOOL WINAPI HeapDestroy(HANDLE hheap)
{
- return(RtlDestroyHeap(hheap));
+ if (hheap == RtlGetProcessHeap())
+ {
+ return FALSE;
+ }
+
+ if (RtlDestroyHeap( hheap )==NULL) return TRUE;
+ SetLastError( ERROR_INVALID_HANDLE );
+ return FALSE;
}
/*********************************************************************
reactos/lib/kernel32/misc
diff -u -r1.20.16.3 -r1.20.16.4
--- atom.c 13 Dec 2004 16:18:04 -0000 1.20.16.3
+++ atom.c 30 Dec 2004 04:36:34 -0000 1.20.16.4
@@ -1,4 +1,4 @@
-/* $Id: atom.c,v 1.20.16.3 2004/12/13 16:18:04 hyperion Exp $
+/* $Id: atom.c,v 1.20.16.4 2004/12/30 04:36:34 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
reactos/lib/kernel32/misc
diff -u -r1.83 -r1.83.2.1
--- console.c 14 Nov 2004 18:47:09 -0000 1.83
+++ console.c 30 Dec 2004 04:36:34 -0000 1.83.2.1
@@ -1,4 +1,4 @@
-/* $Id: console.c,v 1.83 2004/11/14 18:47:09 hbirr Exp $
+/* $Id: console.c,v 1.83.2.1 2004/12/30 04:36:34 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
@@ -31,6 +31,7 @@
static PHANDLER_ROUTINE* CtrlHandlers = NULL;
static ULONG NrCtrlHandlers = 0;
+static WCHAR InputExeName[MAX_PATH + 1] = L"";
/* Default Console Control Handler *******************************************/
@@ -1271,7 +1272,7 @@
nNumberOfCharsToRead -= Reply->Data.ReadConsoleReply.NrCharactersRead;
memcpy((PVOID)((ULONG_PTR)lpBuffer + (ULONG_PTR)(CharsRead * CharSize)),
Reply->Data.ReadConsoleReply.Buffer,
- Reply->Data.ReadConsoleReply.NrCharactersRead);
+ Reply->Data.ReadConsoleReply.NrCharactersRead * CharSize);
CharsRead += Reply->Data.ReadConsoleReply.NrCharactersRead;
if(Reply->Status == STATUS_NOTIFY_CLEANUP)
@@ -1290,7 +1291,7 @@
*lpNumberOfCharsRead = CharsRead;
}
- return (nNumberOfCharsToRead == 0);
+ return TRUE;
}
@@ -3412,4 +3413,175 @@
return NT_SUCCESS(Status);
}
+
+/*--------------------------------------------------------------
+ * SetConsoleInputExeNameW
+ *
+ * @implemented
+ */
+BOOL STDCALL
+SetConsoleInputExeNameW(LPCWSTR lpInputExeName)
+{
+ BOOL Ret = FALSE;
+ int lenName = lstrlenW(lpInputExeName);
+
+ if(lenName < 1 ||
+ lenName > (sizeof(InputExeName) / sizeof(InputExeName[0])) - 1)
+ {
+ /* Fail if string is empty or too long */
+ SetLastError(ERROR_INVALID_PARAMETER);
+ return FALSE;
+ }
+
+ RtlEnterCriticalSection(&ConsoleLock);
+ /* wrap copying into SEH as we may copy from invalid buffer and in case of an
+ exception the console lock would've never been released, which would cause
+ further calls (if the exception was handled by the caller) to recursively
+ acquire the lock... */
+ _SEH_TRY
+ {
+ RtlCopyMemory(InputExeName, lpInputExeName, lenName * sizeof(WCHAR));
+ InputExeName[lenName] = L'\0';
+ Ret = TRUE;
+ }
+ _SEH_HANDLE
+ {
+ lenName = 0;
+ SetLastErrorByStatus(_SEH_GetExceptionCode());
+ }
+ _SEH_END;
+ RtlLeaveCriticalSection(&ConsoleLock);
+
+ return Ret;
+}
+
+
+/*--------------------------------------------------------------
+ * SetConsoleInputExeNameA
+ *
+ * @implemented
+ */
+BOOL STDCALL
+SetConsoleInputExeNameA(LPCSTR lpInputExeName)
+{
+ ANSI_STRING InputExeNameA;
+ UNICODE_STRING InputExeNameU;
+ NTSTATUS Status;
+ BOOL Ret;
+
+ RtlInitAnsiString(&InputExeNameA, lpInputExeName);
+
+ if(InputExeNameA.Length < sizeof(InputExeNameA.Buffer[0]) ||
+ InputExeNameA.Length >= (sizeof(InputExeName) / sizeof(InputExeName[0])) - 1)
+ {
+ /* Fail if string is empty or too long */
+ SetLastError(ERROR_INVALID_PARAMETER);
+ return FALSE;
+ }
+
+ Status = RtlAnsiStringToUnicodeString(&InputExeNameU, &InputExeNameA, TRUE);
+ if(NT_SUCCESS(Status))
+ {
+ Ret = SetConsoleInputExeNameW(InputExeNameU.Buffer);
+ RtlFreeUnicodeString(&InputExeNameU);
+ }
+ else
+ {
+ SetLastErrorByStatus(Status);
+ Ret = FALSE;
+ }
+
+ return Ret;
+}
+
+
+/*--------------------------------------------------------------
+ * GetConsoleInputExeNameW
+ *
+ * @implemented
+ */
+DWORD STDCALL
+GetConsoleInputExeNameW(DWORD nBufferLength, LPWSTR lpBuffer)
+{
+ int lenName;
+
+ RtlEnterCriticalSection(&ConsoleLock);
+
+ lenName = lstrlenW(InputExeName);
+ if(lenName >= nBufferLength)
+ {
+ /* buffer is not large enough, return the required size */
+ RtlLeaveCriticalSection(&ConsoleLock);
+ return lenName + 1;
+ }
+
+ /* wrap copying into SEH as we may copy to invalid buffer and in case of an
+ exception the console lock would've never been released, which would cause
+ further calls (if the exception was handled by the caller) to recursively
+ acquire the lock... */
+ _SEH_TRY
+ {
+ RtlCopyMemory(lpBuffer, InputExeName, (lenName + 1) * sizeof(WCHAR));
+ }
+ _SEH_HANDLE
+ {
+ lenName = 0;
+ SetLastErrorByStatus(_SEH_GetExceptionCode());
+ }
+ _SEH_END;
+
+ RtlLeaveCriticalSection(&ConsoleLock);
+
+ return lenName;
+}
+
+
+/*--------------------------------------------------------------
+ * GetConsoleInputExeNameA
+ *
+ * @implemented
+ */
+DWORD STDCALL
+GetConsoleInputExeNameA(DWORD nBufferLength, LPSTR lpBuffer)
+{
+ WCHAR *Buffer;
+ DWORD Ret;
+
+ if(nBufferLength > 0)
+ {
+ Buffer = RtlAllocateHeap(RtlGetProcessHeap(), 0, nBufferLength * sizeof(WCHAR));
+ if(Buffer == NULL)
+ {
+ SetLastError(ERROR_NOT_ENOUGH_MEMORY);
+ return 0;
+ }
+ }
+ else
+ {
+ Buffer = NULL;
+ }
+
+ Ret = GetConsoleInputExeNameW(nBufferLength, Buffer);
+ if(nBufferLength > 0)
+ {
+ if(Ret > 0)
+ {
+ UNICODE_STRING BufferU;
+ ANSI_STRING BufferA;
+
+ RtlInitUnicodeString(&BufferU, Buffer);
+
+ BufferA.Length = 0;
+ BufferA.MaximumLength = nBufferLength;
+ BufferA.Buffer = lpBuffer;
+
+ RtlUnicodeStringToAnsiString(&BufferA, &BufferU, FALSE);
+ }
+
+ RtlFreeHeap(RtlGetProcessHeap(), 0, Buffer);
+ }
+
+ return Ret;
+}
+
/* EOF */
reactos/lib/kernel32/misc
diff -u -r1.37.2.3 -r1.37.2.4
--- dllmain.c 13 Dec 2004 16:18:04 -0000 1.37.2.3
+++ dllmain.c 30 Dec 2004 04:36:34 -0000 1.37.2.4
@@ -1,4 +1,4 @@
-/* $Id: dllmain.c,v 1.37.2.3 2004/12/13 16:18:04 hyperion Exp $
+/* $Id: dllmain.c,v 1.37.2.4 2004/12/30 04:36:34 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
reactos/lib/kernel32/misc
diff -u -r1.25 -r1.25.22.1
--- env.c 23 Jan 2004 21:16:03 -0000 1.25
+++ env.c 30 Dec 2004 04:36:34 -0000 1.25.22.1
@@ -1,4 +1,4 @@
-/* $Id: env.c,v 1.25 2004/01/23 21:16:03 ekohl Exp $
+/* $Id: env.c,v 1.25.22.1 2004/12/30 04:36:34 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
@@ -254,6 +254,7 @@
)
{
PPEB pPeb = NtCurrentPeb();
+ WCHAR *RosVersion;
/* TODO: move this into RtlGetVersion */
switch(lpVersionInformation->dwOSVersionInfoSize)
@@ -281,12 +282,18 @@
lpVersionInformation->dwBuildNumber = pPeb->OSBuildNumber;
lpVersionInformation->dwPlatformId = pPeb->OSPlatformId;
- /* version string is "ReactOS x.y.z" */
+ /* First the Windows compatible string */
+ _snwprintf(lpVersionInformation->szCSDVersion,
+ sizeof(lpVersionInformation->szCSDVersion) / sizeof(WCHAR),
+ L"Service Pack %u", pPeb->SPMajorVersion);
+ /* Add the Reactos-specific string */
+ RosVersion = lpVersionInformation->szCSDVersion + wcslen(lpVersionInformation->szCSDVersion) + 1;
wcsncpy
(
- lpVersionInformation->szCSDVersion,
+ RosVersion,
L"ReactOS " KERNEL_VERSION_STR L" (Build " KERNEL_VERSION_BUILD_STR L")",
- sizeof(lpVersionInformation->szCSDVersion) / sizeof(WCHAR)
+ sizeof(lpVersionInformation->szCSDVersion) / sizeof(WCHAR) -
+ ((RosVersion - lpVersionInformation->szCSDVersion) + 1)
);
/* null-terminate, just in case */
@@ -377,7 +384,24 @@
] = 0;
wstrVerStr.Length = wcslen(wstrVerStr.Buffer) * sizeof(WCHAR);
- /* convert the version string */
+ /* convert the win version string */
+ nErrCode = RtlUnicodeStringToAnsiString(&strVerStr, &wstrVerStr, FALSE);
+
+ if(!NT_SUCCESS(nErrCode))
+ {
+ /* failure */
+ SetLastErrorByStatus(nErrCode);
+ return FALSE;
+ }
+
+ wstrVerStr.Buffer = oviVerInfo.szCSDVersion + wstrVerStr.Length / sizeof(WCHAR) + 1;
+ wstrVerStr.MaximumLength = sizeof(oviVerInfo.szCSDVersion) - (wstrVerStr.Length + sizeof(WCHAR));
+ wstrVerStr.Length = wcslen(wstrVerStr.Buffer) * sizeof(WCHAR);
+ strVerStr.Buffer = lpVersionInformation->szCSDVersion + strVerStr.Length + 1;
+ strVerStr.MaximumLength = sizeof(lpVersionInformation->szCSDVersion) - (strVerStr.Length + 1);
+ strVerStr.Length = 0;
+
+ /* convert the ReactOS version string */
nErrCode = RtlUnicodeStringToAnsiString(&strVerStr, &wstrVerStr, FALSE);
if(!NT_SUCCESS(nErrCode))
@@ -557,7 +581,7 @@
Destination.Length = 0;
Destination.MaximumLength = nSize;
- Destination.Buffer = lpDst,
+ Destination.Buffer = lpDst;
DestinationU.Length = 0;
DestinationU.MaximumLength = nSize * sizeof(WCHAR);
@@ -574,11 +598,14 @@
if (!NT_SUCCESS(Status))
{
- RtlFreeHeap (RtlGetProcessHeap (),
- 0,
- DestinationU.Buffer);
SetLastErrorByStatus (Status);
- return 0;
+ if (Status != STATUS_BUFFER_TOO_SMALL)
+ {
+ RtlFreeHeap (RtlGetProcessHeap (),
+ 0,
+ DestinationU.Buffer);
+ return 0;
+ }
}
RtlUnicodeStringToAnsiString (&Destination,
@@ -623,7 +650,8 @@
if (!NT_SUCCESS(Status))
{
SetLastErrorByStatus (Status);
- return 0;
+ if (Status != STATUS_BUFFER_TOO_SMALL)
+ return 0;
}
return (Length / sizeof(WCHAR));
reactos/lib/kernel32/misc
diff -u -r1.24.2.3 -r1.24.2.4
--- lang.c 13 Dec 2004 16:18:04 -0000 1.24.2.3
+++ lang.c 30 Dec 2004 04:36:35 -0000 1.24.2.4
@@ -1,4 +1,4 @@
-/* $Id: lang.c,v 1.24.2.3 2004/12/13 16:18:04 hyperion Exp $
+/* $Id: lang.c,v 1.24.2.4 2004/12/30 04:36:35 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT : ReactOS user mode libraries
reactos/lib/kernel32/misc
diff -u -r1.21 -r1.21.16.1
--- ldr.c 13 Jun 2004 20:04:56 -0000 1.21
+++ ldr.c 30 Dec 2004 04:36:35 -0000 1.21.16.1
@@ -1,4 +1,4 @@
-/* $Id: ldr.c,v 1.21 2004/06/13 20:04:56 navaraf Exp $
+/* $Id: ldr.c,v 1.21.16.1 2004/12/30 04:36:35 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT : ReactOS user mode libraries
reactos/lib/kernel32/misc
diff -u -r1.3 -r1.3.10.1
--- lzexpand_main.c 3 Jul 2004 17:40:22 -0000 1.3
+++ lzexpand_main.c 30 Dec 2004 04:36:35 -0000 1.3.10.1
@@ -1,4 +1,4 @@
-/* $Id: lzexpand_main.c,v 1.3 2004/07/03 17:40:22 navaraf Exp $
+/* $Id: lzexpand_main.c,v 1.3.10.1 2004/12/30 04:36:35 hyperion Exp $
*
* LZ Decompression functions
*
@@ -460,7 +460,7 @@
struct lzstate *lzs;
#define BUFLEN 1000
- BYTE buf[BUFLEN];
+ CHAR buf[BUFLEN];
/* we need that weird typedef, for i can't seem to get function pointer
* casts right. (Or they probably just do not like WINAPI in general)
*/
reactos/lib/kernel32/misc
diff -u -r1.14.2.1 -r1.14.2.2
--- profile.c 8 Dec 2004 21:57:11 -0000 1.14.2.1
+++ profile.c 30 Dec 2004 04:36:35 -0000 1.14.2.2
@@ -18,26 +18,14 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-
-
-/*
- * Whole file ripped from Wine's dlls\kernel\profile.c, rev 1.13 and is
- * unchanged (to make merging easier) except that includes are different
- * and some prototypes were changed to comply with w32api.
- *
- * -Gunnar
- */
#define WINVER 0x0500
#include <k32.h>
-#include "wine/config.h"
-//#include "wine/port.h"
-#include "wine/debug.h"
-#include "wine/unicode.h"
+#define NDEBUG
+#include "debug.h"
-WINE_DEFAULT_DEBUG_CHANNEL(profile);
static const char bom_utf8[] = {0xEF,0xBB,0xBF};
@@ -85,7 +73,6 @@
#define IS_ENTRY_COMMENT(str) ((str)[0] == ';')
static const WCHAR emptystringW[] = {0};
-static const WCHAR wininiW[] = { 'w','i','n','.','i','n','i',0 };
static CRITICAL_SECTION PROFILE_CritSect;
static CRITICAL_SECTION_DEBUG critsect_debug =
@@ -98,6 +85,25 @@
static const char hex[16] = "0123456789ABCDEF";
+
+static inline WCHAR *memchrW( const WCHAR *ptr, WCHAR ch, size_t n )
+{
+ const WCHAR *end;
+ for (end = ptr + n; ptr < end; ptr++)
+ if (*ptr == ch)
+ return (WCHAR *)ptr;
+ return NULL;
+}
+
+static inline WCHAR *memrchrW( const WCHAR *ptr, WCHAR ch, size_t n )
+{
+ const WCHAR *end, *ret = NULL;
+ for (end = ptr + n; ptr < end; ptr++)
+ if (*ptr == ch)
+ ret = ptr;
+ return (WCHAR *)ret;
+}
+
/***********************************************************************
* PROFILE_CopyEntry
*
@@ -109,17 +115,21 @@
{
WCHAR quote = '\0';
- if(!buffer) return;
+ if (!buffer)
+ return;
if (strip_quote && ((*value == '\'') || (*value == '\"')))
{
- if (value[1] && (value[strlenW(value)-1] == *value)) quote = *value++;
+ if (value[1] && (value[wcslen(value)-1] == *value))
+ quote = *value++;
}
- lstrcpynW( buffer, value, len );
- if (quote && (len >= strlenW(value))) buffer[strlenW(buffer)-1] = '\0';
+ wcsncpy( buffer, value, len );
+ if (quote && (len >= wcslen(value)))
+ buffer[wcslen(buffer) - 1] = '\0';
}
+
/* byte-swaps shorts in-place in a buffer. len is in WCHARs */
static inline void PROFILE_ByteSwapShortBuffer(WCHAR * buffer, int len)
{
@@ -129,6 +139,7 @@
shortbuffer[i] = RtlUshortByteSwap(shortbuffer[i]);
}
+
/* writes any necessary encoding marker to the file */
static inline void PROFILE_WriteMarker(HANDLE hFile, ENCODING encoding)
{
@@ -152,13 +163,14 @@
}
}
+
static void PROFILE_WriteLine( HANDLE hFile, WCHAR * szLine, int len, ENCODING encoding)
{
char * write_buffer;
int write_buffer_len;
DWORD dwBytesWritten;
- TRACE("writing: %s\n", debugstr_wn(szLine, len));
+ DPRINT("writing: %.*S\n", len, szLine);
switch (encoding)
{
@@ -186,7 +198,7 @@
WriteFile(hFile, szLine, len * sizeof(WCHAR), &dwBytesWritten, NULL);
break;
default:
- FIXME("encoding type %d not implemented\n", encoding);
+ DPRINT1("encoding type %d not implemented\n", encoding);
}
}
@@ -206,16 +218,19 @@
{
int len = 0;
- if (section->name[0]) len += strlenW(section->name) + 6;
+ if (section->name[0])
+ len += wcslen(section->name) + 6;
for (key = section->key; key; key = key->next)
{
- len += strlenW(key->name) + 2;
- if (key->value) len += strlenW(key->value) + 1;
+ len += wcslen(key->name) + 2;
+ if (key->value)
+ len += wcslen(key->value) + 1;
}
buffer = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
- if (!buffer) return;
+ if (!buffer)
+ return;
p = buffer;
if (section->name[0])
@@ -223,21 +238,21 @@
*p++ = '\r';
*p++ = '\n';
*p++ = '[';
- strcpyW( p, section->name );
- p += strlenW(p);
+ wcscpy( p, section->name );
+ p += wcslen(p);
*p++ = ']';
*p++ = '\r';
*p++ = '\n';
}
for (key = section->key; key; key = key->next)
{
- strcpyW( p, key->name );
- p += strlenW(p);
+ wcscpy( p, key->name );
+ p += wcslen(p);
if (key->value)
{
*p++ = '=';
- strcpyW( p, key->value );
- p += strlenW(p);
+ wcscpy( p, key->value );
+ p += wcslen(p);
}
*p++ = '\r';
*p++ = '\n';
@@ -263,7 +278,8 @@
for (key = section->key; key; key = next_key)
{
next_key = key->next;
- if (key->value) HeapFree( GetProcessHeap(), 0, key->value );
+ if (key->value)
+ HeapFree( GetProcessHeap(), 0, key->value );
HeapFree( GetProcessHeap(), 0, key );
}
next_section = section->next;
@@ -271,15 +287,19 @@
}
}
+
/* returns 1 if a character white space else 0 */
static inline int PROFILE_isspaceW(WCHAR c)
{
- if (isspaceW(c)) return 1;
- if (c=='\r' || c==0x1a) return 1;
+ if (iswspace(c))
+ return 1;
+ if (c=='\r' || c==0x1a)
+ return 1;
/* CR and ^Z (DOS EOF) are spaces too (found on CD-ROMs) */
return 0;
}
+
static inline ENCODING PROFILE_DetectTextEncoding(const void * buffer, int * len)
{
DWORD flags = IS_TEXT_UNICODE_SIGNATURE |
@@ -326,22 +346,24 @@
PROFILESECTION **next_section;
PROFILEKEY *key, *prev_key, **next_key;
DWORD dwFileSize;
-
- TRACE("%p\n", hFile);
-
+
+ DPRINT("%p\n", hFile);
+
dwFileSize = GetFileSize(hFile, NULL);
if (dwFileSize == INVALID_FILE_SIZE)
return NULL;
pBuffer = HeapAlloc(GetProcessHeap(), 0 , dwFileSize);
- if (!pBuffer) return NULL;
-
+ if (!pBuffer)
+ return NULL;
+
if (!ReadFile(hFile, pBuffer, dwFileSize, &dwFileSize, NULL))
{
HeapFree(GetProcessHeap(), 0, pBuffer);
- WARN("Error %ld reading file\n", GetLastError());
+ DPRINT("Error %ld reading file\n", GetLastError());
return NULL;
}
+
len = dwFileSize;
*pEncoding = PROFILE_DetectTextEncoding(pBuffer, &len);
/* len is set to the number of bytes in the character marker.
@@ -351,7 +373,7 @@
switch (*pEncoding)
{
case ENCODING_ANSI:
- TRACE("ANSI encoding\n");
+ DPRINT("ANSI encoding\n");
len = MultiByteToWideChar(CP_ACP, 0, (char *)pBuffer, dwFileSize, NULL, 0);
szFile = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
@@ -363,9 +385,10 @@
MultiByteToWideChar(CP_ACP, 0, (char *)pBuffer, dwFileSize, szFile, len);
szEnd = szFile + len;
break;
+
case ENCODING_UTF8:
- TRACE("UTF8 encoding\n");
-
+ DPRINT("UTF8 encoding\n");
+
len = MultiByteToWideChar(CP_UTF8, 0, (char *)pBuffer, dwFileSize, NULL, 0);
szFile = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
if (!szFile)
@@ -376,25 +399,28 @@
MultiByteToWideChar(CP_UTF8, 0, (char *)pBuffer, dwFileSize, szFile, len);
szEnd = szFile + len;
break;
+
case ENCODING_UTF16LE:
- TRACE("UTF16 Little Endian encoding\n");
+ DPRINT("UTF16 Little Endian encoding\n");
szFile = (WCHAR *)pBuffer + 1;
szEnd = (WCHAR *)((char *)pBuffer + dwFileSize);
break;
+
case ENCODING_UTF16BE:
- TRACE("UTF16 Big Endian encoding\n");
+ DPRINT("UTF16 Big Endian encoding\n");
szFile = (WCHAR *)pBuffer + 1;
szEnd = (WCHAR *)((char *)pBuffer + dwFileSize);
PROFILE_ByteSwapShortBuffer(szFile, dwFileSize / sizeof(WCHAR));
break;
+
default:
- FIXME("encoding type %d not implemented\n", *pEncoding);
+ DPRINT("encoding type %d not implemented\n", *pEncoding);
HeapFree(GetProcessHeap(), 0, pBuffer);
return NULL;
}
first_section = HeapAlloc( GetProcessHeap(), 0, sizeof(*section) );
- if(first_section == NULL)
+ if (first_section == NULL)
{
if (szFile != pBuffer)
HeapFree(GetProcessHeap(), 0, szFile);
@@ -418,18 +444,20 @@
if (!szLineEnd)
szLineEnd = szEnd;
line++;
-
- while (szLineStart < szLineEnd && PROFILE_isspaceW(*szLineStart)) szLineStart++;
-
- if (szLineStart >= szLineEnd) continue;
+
+ while (szLineStart < szLineEnd && PROFILE_isspaceW(*szLineStart))
+ szLineStart++;
+
+ if (szLineStart >= szLineEnd)
+ continue;
if (*szLineStart == '[') /* section start */
{
const WCHAR * szSectionEnd;
if (!(szSectionEnd = memrchrW( szLineStart, ']', szLineEnd - szLineStart )))
{
- WARN("Invalid section header at line %d: %s\n",
- line, debugstr_wn(szLineStart, (int)(szLineEnd - szLineStart)) );
+ DPRINT("Invalid section header at line %d: %.*S\n",
+ line, (int)(szLineEnd - szLineStart), szLineStart);
}
else
{
@@ -448,14 +476,15 @@
next_key = §ion->key;
prev_key = NULL;
- TRACE("New section: %s\n", debugstr_w(section->name));
+ DPRINT("New section: %S\n", section->name);
continue;
}
}
/* get rid of white space at the end of the line */
- while ((szLineEnd > szLineStart) && ((*szLineEnd == '\n') || PROFILE_isspaceW(*szLineEnd))) szLineEnd--;
+ while ((szLineEnd > szLineStart) && ((*szLineEnd == '\n') || PROFILE_isspaceW(*szLineEnd)))
+ szLineEnd--;
/* line end should be pointing to character *after* the last wanted character */
szLineEnd++;
@@ -465,9 +494,11 @@
if ((szNameEnd = szValueStart = memchrW( szLineStart, '=', szLineEnd - szLineStart )) != NULL)
{
szNameEnd = szValueStart - 1;
- while ((szNameEnd > szLineStart) && PROFILE_isspaceW(*szNameEnd)) szNameEnd--;
+ while ((szNameEnd > szLineStart) && PROFILE_isspaceW(*szNameEnd))
+ szNameEnd--;
szValueStart++;
- while (szValueStart < szLineEnd && PROFILE_isspaceW(*szValueStart)) szValueStart++;
+ while (szValueStart < szLineEnd && PROFILE_isspaceW(*szValueStart))
+ szValueStart++;
}
if (!szNameEnd)
szNameEnd = szLineEnd - 1;
@@ -497,8 +528,8 @@
next_key = &key->next;
prev_key = key;
- TRACE("New key: name=%s, value=%s\n",
- debugstr_w(key->name), key->value ? debugstr_w(key->value) : "(none)");
+ DPRINT("New key: name=%S, value=%S\n",
+ key->name, key->value ?key->value : L"(none)");
}
}
if (szFile != pBuffer)
@@ -517,7 +548,7 @@
{
while (*section)
{
- if ((*section)->name[0] && !strcmpiW( (*section)->name, name ))
+ if ((*section)->name[0] && !_wcsicmp( (*section)->name, name ))
{
PROFILESECTION *to_del = *section;
*section = to_del->next;
@@ -541,16 +572,17 @@
{
while (*section)
{
- if ((*section)->name[0] && !strcmpiW( (*section)->name, section_name ))
+ if ((*section)->name[0] && !_wcsicmp( (*section)->name, section_name ))
{
PROFILEKEY **key = &(*section)->key;
while (*key)
{
- if (!strcmpiW( (*key)->name, key_name ))
+ if (!_wcsicmp( (*key)->name, key_name ))
{
PROFILEKEY *to_del = *key;
*key = to_del->next;
- if (to_del->value) HeapFree( GetProcessHeap(), 0, to_del->value);
+ if (to_del->value)
+ HeapFree( GetProcessHeap(), 0, to_del->value);
HeapFree( GetProcessHeap(), 0, to_del );
return TRUE;
}
@@ -573,16 +605,17 @@
PROFILESECTION **section= &CurProfile->section;
while (*section)
{
- if ((*section)->name[0] && !strcmpiW( (*section)->name, section_name ))
+ if ((*section)->name[0] && !_wcsicmp( (*section)->name, section_name ))
{
PROFILEKEY **key = &(*section)->key;
while (*key)
{
PROFILEKEY *to_del = *key;
- *key = to_del->next;
- if (to_del->value) HeapFree( GetProcessHeap(), 0, to_del->value);
- HeapFree( GetProcessHeap(), 0, to_del );
- CurProfile->changed =TRUE;
+ *key = to_del->next;
+ if (to_del->value)
+ HeapFree( GetProcessHeap(), 0, to_del->value);
+ HeapFree( GetProcessHeap(), 0, to_del );
+ CurProfile->changed =TRUE;
}
}
section = &(*section)->next;
@@ -602,19 +635,19 @@
int seclen, keylen;
while (PROFILE_isspaceW(*section_name)) section_name++;
- p = section_name + strlenW(section_name) - 1;
+ p = section_name + wcslen(section_name) - 1;
while ((p > section_name) && PROFILE_isspaceW(*p)) p--;
seclen = p - section_name + 1;
while (PROFILE_isspaceW(*key_name)) key_name++;
- p = key_name + strlenW(key_name) - 1;
+ p = key_name + wcslen(key_name) - 1;
while ((p > key_name) && PROFILE_isspaceW(*p)) p--;
keylen = p - key_name + 1;
while (*section)
{
if ( ((*section)->name[0])
- && (!(strncmpiW( (*section)->name, section_name, seclen )))
+ && (!(_wcsnicmp( (*section)->name, section_name, seclen )))
&& (((*section)->name)[seclen] == '\0') )
{
PROFILEKEY **key = &(*section)->key;
@@ -628,16 +661,17 @@
*/
if(!create_always)
{
- if ( (!(strncmpiW( (*key)->name, key_name, keylen )))
+ if ( (!(_wcsnicmp( (*key)->name, key_name, keylen )))
&& (((*key)->name)[keylen] == '\0') )
return *key;
}
key = &(*key)->next;
}
- if (!create) return NULL;
- if (!(*key = HeapAlloc( GetProcessHeap(), 0, sizeof(PROFILEKEY) + strlenW(key_name) * sizeof(WCHAR) )))
+ if (!create)
return NULL;
- strcpyW( (*key)->name, key_name );
+ if (!(*key = HeapAlloc( GetProcessHeap(), 0, sizeof(PROFILEKEY) + wcslen(key_name) * sizeof(WCHAR) )))
+ return NULL;
+ wcscpy( (*key)->name, key_name );
(*key)->value = NULL;
(*key)->next = NULL;
return *key;
@@ -645,17 +679,17 @@
section = &(*section)->next;
}
if (!create) return NULL;
- *section = HeapAlloc( GetProcessHeap(), 0, sizeof(PROFILESECTION) + strlenW(section_name) * sizeof(WCHAR) );
+ *section = HeapAlloc( GetProcessHeap(), 0, sizeof(PROFILESECTION) + wcslen(section_name) * sizeof(WCHAR) );
if(*section == NULL) return NULL;
- strcpyW( (*section)->name, section_name );
+ wcscpy( (*section)->name, section_name );
(*section)->next = NULL;
if (!((*section)->key = HeapAlloc( GetProcessHeap(), 0,
- sizeof(PROFILEKEY) + strlenW(key_name) * sizeof(WCHAR) )))
+ sizeof(PROFILEKEY) + wcslen(key_name) * sizeof(WCHAR) )))
{
HeapFree(GetProcessHeap(), 0, *section);
return NULL;
}
- strcpyW( (*section)->key->name, key_name );
+ wcscpy( (*section)->key->name, key_name );
(*section)->key->value = NULL;
(*section)->key->next = NULL;
return (*section)->key;
@@ -674,7 +708,7 @@
if(!CurProfile)
{
- WARN("No current profile!\n");
+ DPRINT("No current profile!\n");
return FALSE;
}
@@ -684,11 +718,11 @@
if (hFile == INVALID_HANDLE_VALUE)
{
- WARN("could not save profile file %s (error was %ld)\n", debugstr_w(CurProfile->filename), GetLastError());
+ DPRINT("could not save profile file %S (error was %ld)\n", CurProfile->filename, GetLastError());
return FALSE;
}
- TRACE("Saving %s\n", debugstr_w(CurProfile->filename));
+ DPRINT("Saving %S\n", CurProfile->filename);
PROFILE_Save( hFile, CurProfile->section, CurProfile->encoding );
if(GetFileTime(hFile, NULL, NULL, &LastWriteTime))
CurProfile->LastWriteTime=LastWriteTime;
@@ -707,7 +741,8 @@
{
PROFILE_FlushFile();
PROFILE_Free( CurProfile->section );
- if (CurProfile->filename) HeapFree( GetProcessHeap(), 0, CurProfile->filename );
+ if (CurProfile->filename)
+ HeapFree( GetProcessHeap(), 0, CurProfile->filename );
CurProfile->changed = FALSE;
CurProfile->section = NULL;
CurProfile->filename = NULL;
@@ -729,7 +764,7 @@
FILETIME LastWriteTime;
int i,j;
PROFILE *tempProfile;
-
+
ZeroMemory(&LastWriteTime, sizeof(LastWriteTime));
/* First time around */
@@ -749,49 +784,53 @@
GetWindowsDirectoryW( windirW, MAX_PATH );
if ((RtlDetermineDosPathNameType_U(filename) == RELATIVE_PATH) &&
- !strchrW(filename, '\\') && !strchrW(filename, '/'))
+ !wcschr(filename, '\\') && !wcschr(filename, '/'))
{
static const WCHAR wszSeparator[] = {'\\', 0};
- strcpyW(buffer, windirW);
- strcatW(buffer, wszSeparator);
- strcatW(buffer, filename);
+ wcscpy(buffer, windirW);
+ wcscat(buffer, wszSeparator);
+ wcscat(buffer, filename);
}
else
{
LPWSTR dummy;
GetFullPathNameW(filename, sizeof(buffer)/sizeof(buffer[0]), buffer, &dummy);
}
-
- TRACE("path: %s\n", debugstr_w(buffer));
-
+
+ DPRINT("path: %S\n", buffer);
+
hFile = CreateFileW(buffer, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
-
+
if ((hFile == INVALID_HANDLE_VALUE) && (GetLastError() != ERROR_FILE_NOT_FOUND))
{
- WARN("Error %ld opening file %s\n", GetLastError(), debugstr_w(buffer));
+ DPRINT("Error %ld opening file %S\n", GetLastError(), buffer);
return FALSE;
}
- for(i=0;i<N_CACHED_PROFILES;i++)
+ for(i = 0; i < N_CACHED_PROFILES; i++)
{
- if ((MRUProfile[i]->filename && !strcmpW( buffer, MRUProfile[i]->filename )))
+ if ((MRUProfile[i]->filename && !wcscmp( buffer, MRUProfile[i]->filename )))
{
- TRACE("MRU Filename: %s, new filename: %s\n", debugstr_w(MRUProfile[i]->filename), debugstr_w(buffer));
+ DPRINT("MRU Filename: %S, new filename: %S\n", MRUProfile[i]->filename, buffer);
if(i)
{
PROFILE_FlushFile();
tempProfile=MRUProfile[i];
- for(j=i;j>0;j--)
- MRUProfile[j]=MRUProfile[j-1];
+ for (j = i; j > 0; j--)
+ MRUProfile[j] = MRUProfile[j-1];
CurProfile=tempProfile;
}
GetFileTime(hFile, NULL, NULL, &LastWriteTime);
- if(memcmp(&CurProfile->LastWriteTime, &LastWriteTime, sizeof(FILETIME)))
- TRACE("(%s): already opened (mru=%d)\n",
- debugstr_w(buffer), i );
+ if (memcmp(&CurProfile->LastWriteTime, &LastWriteTime, sizeof(FILETIME)))
+ {
+ DPRINT("(%S): already opened (mru = %d)\n",
+ buffer, i );
+ }
else
- TRACE("(%s): already opened, needs refreshing (mru=%d)\n",
- debugstr_w(buffer), i );
+ {
+ DPRINT("(%S): already opened, needs refreshing (mru = %d)\n",
+ buffer, i );
+ }
CloseHandle(hFile);
return TRUE;
}
@@ -801,18 +840,20 @@
PROFILE_FlushFile();
/* Make the oldest profile the current one only in order to get rid of it */
- if(i==N_CACHED_PROFILES)
+ if(i == N_CACHED_PROFILES)
{
- tempProfile=MRUProfile[N_CACHED_PROFILES-1];
- for(i=N_CACHED_PROFILES-1;i>0;i--)
- MRUProfile[i]=MRUProfile[i-1];
+ tempProfile = MRUProfile[N_CACHED_PROFILES-1];
+ for (i = N_CACHED_PROFILES - 1; i > 0; i--)
+ MRUProfile[i] = MRUProfile[i-1];
CurProfile=tempProfile;
}
- if(CurProfile->filename) PROFILE_ReleaseFile();
+
+ if (CurProfile->filename)
+ PROFILE_ReleaseFile();
/* OK, now that CurProfile is definitely free we assign it our new file */
- CurProfile->filename = HeapAlloc( GetProcessHeap(), 0, (strlenW(buffer)+1) * sizeof(WCHAR) );
- strcpyW( CurProfile->filename, buffer );
+ CurProfile->filename = HeapAlloc( GetProcessHeap(), 0, (wcslen(buffer)+1) * sizeof(WCHAR) );
+ wcscpy( CurProfile->filename, buffer );
if (hFile != INVALID_HANDLE_VALUE)
{
@@ -823,7 +864,7 @@
else
{
/* Does not exist yet, we will create it in PROFILE_FlushFile */
- WARN("profile file %s not found\n", debugstr_w(buffer) );
+ DPRINT("profile file %S not found\n", buffer);
}
return TRUE;
}
@@ -840,41 +881,46 @@
{
PROFILEKEY *key;
- if(!buffer) return 0;
+ if (!buffer)
+ return 0;
- TRACE("%s,%p,%u\n", debugstr_w(section_name), buffer, len);
+ DPRINT("%S,%p,%u\n", section_name, buffer, len);
while (section)
{
- if (section->name[0] && !strcmpiW( section->name, section_name ))
+ if (section->name[0] && !_wcsicmp( section->name, section_name ))
{
UINT oldlen = len;
for (key = section->key; key; key = key->next)
{
- if (len <= 2) break;
- if (!*key->name) continue; /* Skip empty lines */
- if (IS_ENTRY_COMMENT(key->name)) continue; /* Skip comments */
+ if (len <= 2)
+ break;
+ if (!*key->name)
+ continue; /* Skip empty lines */
+ if (IS_ENTRY_COMMENT(key->name))
+ continue; /* Skip comments */
PROFILE_CopyEntry( buffer, key->name, len - 1, 0 );
- len -= strlenW(buffer) + 1;
- buffer += strlenW(buffer) + 1;
- if (len < 2)
- break;
- if (return_values && key->value) {
- buffer[-1] = '=';
- PROFILE_CopyEntry ( buffer, key->value, len - 1, 0 );
- len -= strlenW(buffer) + 1;
- buffer += strlenW(buffer) + 1;
+ len -= wcslen(buffer) + 1;
+ buffer += wcslen(buffer) + 1;
+ if (len < 2)
+ break;
+ if (return_values && key->value)
+ {
+ buffer[-1] = '=';
+ PROFILE_CopyEntry ( buffer, key->value, len - 1, 0 );
+ len -= wcslen(buffer) + 1;
+ buffer += wcslen(buffer) + 1;
}
}
*buffer = '\0';
if (len <= 1)
+ {
/*If either lpszSection or lpszKey is NULL and the supplied
destination buffer is too small to hold all the strings,
the last string is truncated and followed by two null characters.
In this case, the return value is equal to cchReturnBuffer
minus two. */
- {
- buffer[-1] = '\0';
+ buffer[-1] = '\0';
return oldlen - 2;
}
return oldlen - len;
@@ -892,38 +938,43 @@
UINT f,l;
PROFILESECTION *section;
- TRACE("(%p, %d)\n", buffer, len);
+ DPRINT("(%p, %d)\n", buffer, len);
if (!buffer || !len)
return 0;
- if (len==1) {
- *buffer='\0';
+ if (len == 1)
+ {
+ *buffer = '\0';
return 0;
}
- f=len-1;
- buf=buffer;
+ f = len - 1;
+ buf = buffer;
section = CurProfile->section;
- while ((section!=NULL)) {
- if (section->name[0]) {
- l = strlenW(section->name)+1;
- if (l > f) {
- if (f>0) {
- strncpyW(buf, section->name, f-1);
- buf += f-1;
- *buf++='\0';
+ while ((section!=NULL))
+ {
+ if (section->name[0])
+ {
+ l = wcslen(section->name)+1;
+ if (l > f)
+ {
+ if (f > 0)
+ {
+ wcsncpy(buf, section->name, f - 1);
+ buf += f - 1;
+ *buf++ = '\0';
}
*buf='\0';
- return len-2;
+ return len - 2;
}
- strcpyW(buf, section->name);
+ wcscpy(buf, section->name);
buf += l;
f -= l;
}
section = section->next;
}
- *buf='\0';
- return buf-buffer;
+ *buf = '\0';
+ return buf - buffer;
}
@@ -955,12 +1006,15 @@
PROFILEKEY *key = NULL;
static const WCHAR empty_strW[] = { 0 };
- if(!buffer) return 0;
+ if (!buffer)
+ return 0;
+
+ if (!def_val)
+ def_val = empty_strW;
- if (!def_val) def_val = empty_strW;
if (key_name)
{
- if (!key_name[0])
+ if (!key_name[0])
{
/* Win95 returns 0 on keyname "". Tested with Likse32 bon 000227 */
return 0;
@@ -968,11 +1022,12 @@
key = PROFILE_Find( &CurProfile->section, section, key_name, FALSE, FALSE);
PROFILE_CopyEntry( buffer, (key && key->value) ? key->value : def_val,
len, TRUE );
- TRACE("(%s,%s,%s): returning %s\n",
- debugstr_w(section), debugstr_w(key_name),
- debugstr_w(def_val), debugstr_w(buffer) );
- return strlenW( buffer );
+ DPRINT("(%S, %S, %S): returning %S\n",
+ section, key_name,
+ def_val, buffer);
+ return wcslen(buffer);
}
+
/* no "else" here ! */
if (section && section[0])
{
@@ -980,7 +1035,7 @@
if (!buffer[0]) /* no luck -> def_val */
{
PROFILE_CopyEntry(buffer, def_val, len, TRUE);
- ret = strlenW(buffer);
+ ret = wcslen(buffer);
}
return ret;
}
@@ -999,7 +1054,7 @@
{
if (!key_name) /* Delete a whole section */
{
- TRACE("(%s)\n", debugstr_w(section_name));
+ DPRINT("(%S)\n", section_name);
CurProfile->changed |= PROFILE_DeleteSection( &CurProfile->section,
section_name );
return TRUE; /* Even if PROFILE_DeleteSection() has failed,
@@ -1007,7 +1062,7 @@
}
else if (!value) /* Delete a key */
{
- TRACE("(%s,%s)\n", debugstr_w(section_name), debugstr_w(key_name) );
+ DPRINT("(%S, %S)\n", section_name, key_name);
CurProfile->changed |= PROFILE_DeleteKey( &CurProfile->section,
section_name, key_name );
return TRUE; /* same error handling as above */
@@ -1016,27 +1071,32 @@
{
PROFILEKEY *key = PROFILE_Find(&CurProfile->section, section_name,
key_name, TRUE, create_always );
- TRACE("(%s,%s,%s):\n",
- debugstr_w(section_name), debugstr_w(key_name), debugstr_w(value) );
- if (!key) return FALSE;
+ DPRINT("(%S, %S, %S):\n",
+ section_name, key_name, value);
+ if (!key)
+ return FALSE;
/* strip the leading spaces. We can safely strip \n\r and
* friends too, they should not happen here anyway. */
- while (PROFILE_isspaceW(*value)) value++;
+ while (PROFILE_isspaceW(*value))
+ value++;
if (key->value)
{
- if (!strcmpW( key->value, value ))
+ if (!wcscmp( key->value, value ))
{
- TRACE(" no change needed\n" );
+ DPRINT(" no change needed\n" );
return TRUE; /* No change needed */
}
- TRACE(" replacing %s\n", debugstr_w(key->value) );
+ DPRINT(" replacing %S\n", key->value);
HeapFree( GetProcessHeap(), 0, key->value );
}
- else TRACE(" creating key\n" );
- key->value = HeapAlloc( GetProcessHeap(), 0, (strlenW(value)+1) * sizeof(WCHAR) );
- strcpyW( key->value, value );
+ else
+ {
+ DPRINT(" creating key\n");
+ }
+ key->value = HeapAlloc( GetProcessHeap(), 0, (wcslen(value) + 1) * sizeof(WCHAR) );
+ wcscpy( key->value, value );
CurProfile->changed = TRUE;
}
return TRUE;
@@ -1059,7 +1119,7 @@
*/
UINT WINAPI GetProfileIntW( LPCWSTR section, LPCWSTR entry, INT def_val )
{
- return GetPrivateProfileIntW( section, entry, def_val, wininiW );
+ return GetPrivateProfileIntW( section, entry, def_val, L"win.ini" );
}
/*
@@ -1077,101 +1137,72 @@
LPCWSTR pDefVal = NULL;
if (!filename)
- filename = wininiW;
+ filename = L"win.ini";
- TRACE("%s,%s,%s,%p,%u,%s\n", debugstr_w(section), debugstr_w(entry),
- debugstr_w(def_val), buffer, len, debugstr_w(filename));
+ DPRINT("%S, %S, %S, %p, %u, %S\n",
+ section, entry,
+ def_val, buffer, len, filename);
/* strip any trailing ' ' of def_val. */
if (def_val)
{
- LPCWSTR p = &def_val[strlenW(def_val)]; /* even "" works ! */
+ LPCWSTR p = &def_val[wcslen(def_val)]; /* even "" works ! */
+
+ while (p > def_val)
+ {
+ p--;
+ if ((*p) != ' ')
+ break;
+ }
+
+ if (*p == ' ') /* ouch, contained trailing ' ' */
+ {
+ int len = (int)(p - def_val);
+ LPWSTR p;
- while (p > def_val)
- {
- p--;
- if ((*p) != ' ')
- break;
- }
- if (*p == ' ') /* ouch, contained trailing ' ' */
- {
- int len = (int)(p - def_val);
- LPWSTR p;
-
- p = HeapAlloc(GetProcessHeap(), 0, (len + 1) * sizeof(WCHAR));
- strncpyW(p, def_val, len);
- p[len] = '\0';
- pDefVal = p;
- }
+ p = HeapAlloc(GetProcessHeap(), 0, (len + 1) * sizeof(WCHAR));
+ wcsncpy(p, def_val, len);
+ p[len] = '\0';
+ pDefVal = p;
+ }
}
+
if (!pDefVal)
- pDefVal = (LPCWSTR)def_val;
+ pDefVal = (LPCWSTR)def_val;
RtlEnterCriticalSection( &PROFILE_CritSect );
- if (PROFILE_Open( filename )) {
- if ((allow_section_name_copy) && (section == NULL))
+ if (PROFILE_Open( filename ))
+ {
+ if ((allow_section_name_copy) && (section == NULL))
ret = PROFILE_GetSectionNames(buffer, len);
- else
- /* PROFILE_GetString already handles the 'entry == NULL' case */
+ else
+ /* PROFILE_GetString already handles the 'entry == NULL' case */
ret = PROFILE_GetString( section, entry, pDefVal, buffer, len );
- } else {
- lstrcpynW( buffer, pDefVal, len );
- ret = strlenW( buffer );
+ }
+ else
+ {
+ wcsncpy( buffer, pDefVal, len );
+ ret = wcslen( buffer );
}
RtlLeaveCriticalSection( &PROFILE_CritSect );
if (pDefVal != def_val) /* allocated */
- HeapFree(GetProcessHeap(), 0, (void*)pDefVal);
+ HeapFree(GetProcessHeap(), 0, (void*)pDefVal);
- TRACE("returning %s, %d\n", debugstr_w(buffer), ret);
+ DPRINT("returning %S, %d\n", buffer, ret);
return ret;
}
/***********************************************************************
- * GetPrivateProfileString (KERNEL.128)
+ * WriteProfileStringA (KERNEL32.@)
*/
-INT16 WINAPI GetPrivateProfileString16( LPCSTR section, LPCSTR entry,
- LPCSTR def_val, LPSTR buffer,
- UINT16 len, LPCSTR filename )
+BOOL WINAPI WriteProfileStringA( LPCSTR section, LPCSTR entry,
+ LPCSTR string )
{
- UNICODE_STRING sectionW, entryW, def_valW, filenameW;
- LPWSTR bufferW;
- INT16 retW, ret = 0;
-
- bufferW = buffer ? HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)) : NULL;
- if (section) RtlCreateUnicodeStringFromAsciiz(§ionW, section);
- else sectionW.Buffer = NULL;
- if (entry) RtlCreateUnicodeStringFromAsciiz(&entryW, entry);
- else entryW.Buffer = NULL;
- if (def_val) RtlCreateUnicodeStringFromAsciiz(&def_valW, def_val);
- else def_valW.Buffer = NULL;
- if (filename) RtlCreateUnicodeStringFromAsciiz(&filenameW, filename);
- else filenameW.Buffer = NULL;
-
- retW = PROFILE_GetPrivateProfileString( sectionW.Buffer, entryW.Buffer,
- def_valW.Buffer, bufferW, len,
- filenameW.Buffer, FALSE );
- if (len)
- {
- ret = WideCharToMultiByte(CP_ACP, 0, bufferW, retW + 1, buffer, len, NULL, NULL);
[truncated at 1000 lines; 463 more skipped]
reactos/lib/kernel32/misc
diff -u -r1.94.2.3 -r1.94.2.4
--- stubs.c 13 Dec 2004 16:18:04 -0000 1.94.2.3
+++ stubs.c 30 Dec 2004 04:36:35 -0000 1.94.2.4
@@ -1,4 +1,4 @@
-/* $Id: stubs.c,v 1.94.2.3 2004/12/13 16:18:04 hyperion Exp $
+/* $Id: stubs.c,v 1.94.2.4 2004/12/30 04:36:35 hyperion Exp $
*
* KERNEL32.DLL stubs (STUB functions)
* Remove from this file, if you implement them.
@@ -1673,24 +1673,6 @@
/*
* @unimplemented
*/
-BOOL STDCALL SetConsoleInputExeNameA(LPCSTR name)
-{
- STUB;
- return 0;
-}
-
-/*
- * @unimplemented
- */
-BOOL STDCALL SetConsoleInputExeNameW(LPCWSTR name)
-{
- STUB;
- return 0;
-}
-
-/*
- * @unimplemented
- */
BOOL STDCALL UTRegister( HMODULE hModule, LPSTR lpsz16BITDLL,
LPSTR lpszInitName, LPSTR lpszProcName,
FARPROC *ppfn32Thunk, FARPROC pfnUT32CallBack,
@@ -1733,24 +1715,6 @@
/*
* @unimplemented
*/
-BOOL STDCALL GetConsoleInputExeNameA(ULONG length,LPCSTR name)
-{
- STUB;
- return 0;
-}
-
-/*
- * @unimplemented
- */
-BOOL STDCALL GetConsoleInputExeNameW(ULONG length,LPCWSTR name)
-{
- STUB;
- return 0;
-}
-
-/*
- * @unimplemented
- */
BOOL STDCALL IsValidUILanguage(LANGID langid)
{
STUB;
reactos/lib/kernel32/misc
diff -u -r1.32.2.3 -r1.32.2.4
--- time.c 13 Dec 2004 16:18:04 -0000 1.32.2.3
+++ time.c 30 Dec 2004 04:36:35 -0000 1.32.2.4
@@ -1,4 +1,4 @@
-/* $Id: time.c,v 1.32.2.3 2004/12/13 16:18:04 hyperion Exp $
+/* $Id: time.c,v 1.32.2.4 2004/12/30 04:36:35 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
reactos/lib/kernel32/process
diff -u -r1.89.2.3 -r1.89.2.4
--- create.c 18 Dec 2004 02:58:55 -0000 1.89.2.3
+++ create.c 30 Dec 2004 04:36:35 -0000 1.89.2.4
@@ -1,4 +1,4 @@
-/* $Id: create.c,v 1.89.2.3 2004/12/18 02:58:55 hyperion Exp $
+/* $Id: create.c,v 1.89.2.4 2004/12/30 04:36:35 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
reactos/lib/kernel32/synch
diff -u -r1.31.2.3 -r1.31.2.4
--- wait.c 13 Dec 2004 16:18:06 -0000 1.31.2.3
+++ wait.c 30 Dec 2004 04:36:35 -0000 1.31.2.4
@@ -1,4 +1,4 @@
-/* $Id: wait.c,v 1.31.2.3 2004/12/13 16:18:06 hyperion Exp $
+/* $Id: wait.c,v 1.31.2.4 2004/12/30 04:36:35 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
reactos/lib/kernel32/thread
diff -u -r1.56.2.3 -r1.56.2.4
--- thread.c 13 Dec 2004 16:18:06 -0000 1.56.2.3
+++ thread.c 30 Dec 2004 04:36:36 -0000 1.56.2.4
@@ -1,4 +1,4 @@
-/* $Id: thread.c,v 1.56.2.3 2004/12/13 16:18:06 hyperion Exp $
+/* $Id: thread.c,v 1.56.2.4 2004/12/30 04:36:36 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
reactos/lib/kjs/include
diff -u -r1.1 -r1.1.24.1
--- js.h 10 Jan 2004 20:38:17 -0000 1.1
+++ js.h 30 Dec 2004 04:36:36 -0000 1.1.24.1
@@ -24,7 +24,7 @@
/*
* $Source: /CVS/ReactOS/reactos/lib/kjs/include/js.h,v $
- * $Id: js.h,v 1.1 2004/01/10 20:38:17 arty Exp $
+ * $Id: js.h,v 1.1.24.1 2004/12/30 04:36:36 hyperion Exp $
*/
#ifndef JS_H
@@ -261,7 +261,7 @@
* number. The returned string is in format "MAJOR.MINOR.PATCH",
* where MAJOR, MINOR, and PATCH are integer numbers.
*/
-const JSCharPtr JS_DLLEXPORT js_version ();
+JSCharPtr JS_DLLEXPORT js_version ();
/* Initialize interpreter options to system's default values. */
void JS_DLLEXPORT js_init_default_options (JSInterpOptions *options);
@@ -275,7 +275,7 @@
void JS_DLLEXPORT js_destroy_interp (JSInterpPtr interp);
/* Return error message from the latest error. */
-const JSCharPtr JS_DLLEXPORT js_error_message (JSInterpPtr interp);
+JSCharPtr JS_DLLEXPORT js_error_message (JSInterpPtr interp);
/*
* Get the result of the latest evaluation or execution in interpreter
@@ -456,8 +456,8 @@
void *ictx, JSFreeProc ictx_destructor,
JSType *result_return);
-const JSClassPtr JS_DLLEXPORT js_lookup_class (JSInterpPtr interp,
- char *name);
+JSClassPtr JS_DLLEXPORT js_lookup_class (JSInterpPtr interp,
+ char *name);
/*
* Check if object <object> is an instance of class <cls>. The
reactos/lib/kjs/ksrc
diff -u -r1.1 -r1.1.24.1
--- b_core.c 10 Jan 2004 20:38:17 -0000 1.1
+++ b_core.c 30 Dec 2004 04:36:36 -0000 1.1.24.1
@@ -24,7 +24,7 @@
/*
* $Source: /CVS/ReactOS/reactos/lib/kjs/ksrc/b_core.c,v $
- * $Id: b_core.c,v 1.1 2004/01/10 20:38:17 arty Exp $
+ * $Id: b_core.c,v 1.1.24.1 2004/12/30 04:36:36 hyperion Exp $
*/
/*
@@ -185,7 +185,7 @@
EMIT_TO_RESULT (c);
else if (c > 0xFF)
{
- unsigned char buf[6];
+ char buf[6];
sprintf (buf, "%04x", c);
EMIT_TO_RESULT ('%');
@@ -197,7 +197,7 @@
}
else
{
- unsigned char buf[4];
+ char buf[4];
sprintf (buf, "%02x", c);
EMIT_TO_RESULT ('%');
reactos/lib/kjs/ksrc
diff -u -r1.1 -r1.1.24.1
--- b_regexp.c 10 Jan 2004 20:38:17 -0000 1.1
+++ b_regexp.c 30 Dec 2004 04:36:36 -0000 1.1.24.1
@@ -24,7 +24,7 @@
/*
* $Source: /CVS/ReactOS/reactos/lib/kjs/ksrc/b_regexp.c,v $
- * $Id: b_regexp.c,v 1.1 2004/01/10 20:38:17 arty Exp $
+ * $Id: b_regexp.c,v 1.1.24.1 2004/12/30 04:36:36 hyperion Exp $
*/
#include "jsint.h"
@@ -275,7 +275,7 @@
input_str = &cvt;
}
- input = input_str->u.vstring->data;
+ input = (char*)input_str->u.vstring->data;
input_len = input_str->u.vstring->len;
}
else if (args->u.vinteger == 1)
@@ -288,7 +288,7 @@
input_str = &cvt;
}
- input = input_str->u.vstring->data;
+ input = (char*)input_str->u.vstring->data;
input_len = input_str->u.vstring->len;
/* Set the input property to the class context. */
@@ -317,7 +317,7 @@
input_str = &cvt;
}
- input = input_str->u.vstring->data;
+ input = (char*)input_str->u.vstring->data;
input_len = input_str->u.vstring->len;
}
else if (args->u.vinteger == 1)
@@ -330,7 +330,7 @@
input_str = &cvt;
}
- input = input_str->u.vstring->data;
+ input = (char*)input_str->u.vstring->data;
input_len = input_str->u.vstring->len;
/* Set the input property to the class context. */
@@ -370,10 +370,10 @@
js_vm_symname (vm, method));
js_vm_error (vm);
- /* argument_type_error: */
- sprintf (vm->error, "RegExp.%s(): illegal argument",
- js_vm_symname (vm, method));
- js_vm_error (vm);
+/* argument_type_error: */
+ sprintf (vm->error, "RegExp.%s(): illegal argument",
+ js_vm_symname (vm, method));
+ js_vm_error (vm);
immutable:
sprintf (vm->error, "RegExp.%s(): immutable object",
@@ -406,7 +406,7 @@
sprintf (vm->error, "RegExp(): RegExp.input is not a string");
js_vm_error (vm);
}
- input = ctx->input.u.vstring->data;
+ input = (char*)ctx->input.u.vstring->data;
input_len = ctx->input.u.vstring->len;
}
else if (args->u.vinteger == 1)
@@ -417,7 +417,7 @@
js_vm_error (vm);
}
- input = args[1].u.vstring->data;
+ input = (char*)args[1].u.vstring->data;
input_len = args[1].u.vstring->len;
/* Set the input property to the class context. */
@@ -466,7 +466,7 @@
node->type = JS_UNDEFINED;
else
js_vm_make_string (vm, node,
- ctx->input.u.vstring->data
+ (char*)ctx->input.u.vstring->data
+ ctx->regs.start[index],
ctx->regs.end[index] - ctx->regs.start[index]);
}
@@ -542,7 +542,8 @@
node->type = JS_UNDEFINED;
else
js_vm_make_string (vm, node,
- ctx->input.u.vstring->data + ctx->regs.start[0],
+ (char*)ctx->input.u.vstring->data +
+ ctx->regs.start[0],
ctx->regs.end[0] - ctx->regs.start[0]);
}
/* ********************************************************************** */
@@ -565,7 +566,7 @@
node->type = JS_UNDEFINED;
else
js_vm_make_string (vm, node,
- ctx->input.u.vstring->data
+ (char*)ctx->input.u.vstring->data
+ ctx->regs.start[i],
ctx->regs.end[i] - ctx->regs.start[i]);
}
@@ -580,7 +581,7 @@
|| ctx->regs.end[0] > ctx->input.u.vstring->len)
node->type = JS_UNDEFINED;
else
- js_vm_make_string (vm, node, ctx->input.u.vstring->data,
+ js_vm_make_string (vm, node, (char*)ctx->input.u.vstring->data,
ctx->regs.start[0]);
}
/* ********************************************************************** */
@@ -598,7 +599,7 @@
node->type = JS_UNDEFINED;
else
js_vm_make_string (vm, node,
- ctx->input.u.vstring->data + ctx->regs.end[0],
+ (char*)ctx->input.u.vstring->data + ctx->regs.end[0],
ctx->input.u.vstring->len - ctx->regs.end[0]);
}
/* ********************************************************************** */
@@ -726,7 +727,7 @@
js_vm_error (vm);
}
- source = args[1].u.vstring->data;
+ source = (char*)args[1].u.vstring->data;
source_len = args[1].u.vstring->len;
}
reactos/lib/kjs/ksrc
diff -u -r1.1 -r1.1.24.1
--- ejumps.h 10 Jan 2004 20:38:17 -0000 1.1
+++ ejumps.h 30 Dec 2004 04:36:36 -0000 1.1.24.1
@@ -576,7 +576,7 @@
else if (JS_SP1->type == JS_STRING)
{
/* Intern the string. */
- j = js_vm_intern_with_len (vm, JS_SP1->u.vstring->data,
+ j = js_vm_intern_with_len (vm, (char*)JS_SP1->u.vstring->data,
JS_SP1->u.vstring->len);
/* The code below must be in sync with operand `load_property'. */
@@ -697,7 +697,7 @@
else if (JS_SP1->type == JS_STRING)
{
/* Intern the string. */
- j = js_vm_intern_with_len (vm, JS_SP1->u.vstring->data,
+ j = js_vm_intern_with_len (vm, (char*)JS_SP1->u.vstring->data,
JS_SP1->u.vstring->len);
/* The code below msut be in sync with operand `store_property'. */
@@ -1005,7 +1005,7 @@
memcpy (ndata, d2, d2_len);
memcpy (ndata + d2_len, d1, d1_len);
- js_vm_make_static_string (vm, JS_SP2, ndata, nlen);
+ js_vm_make_static_string (vm, JS_SP2, (char*)ndata, nlen);
JS_SP2->u.vstring->staticp = 0;
JS_POP ();
JS_MAYBE_GC ();
reactos/lib/kjs/ksrc
diff -u -r1.1 -r1.1.24.1
--- eswitch.h 10 Jan 2004 20:38:17 -0000 1.1
+++ eswitch.h 30 Dec 2004 04:36:36 -0000 1.1.24.1
@@ -550,7 +550,7 @@
else if (JS_SP1->type == JS_STRING)
{
/* Intern the string. */
- j = js_vm_intern_with_len (vm, JS_SP1->u.vstring->data,
+ j = js_vm_intern_with_len (vm, (char*)JS_SP1->u.vstring->data,
JS_SP1->u.vstring->len);
/* The code below must be in sync with operand `load_property'. */
@@ -670,7 +670,7 @@
else if (JS_SP1->type == JS_STRING)
{
/* Intern the string. */
- j = js_vm_intern_with_len (vm, JS_SP1->u.vstring->data,
+ j = js_vm_intern_with_len (vm, (char*)JS_SP1->u.vstring->data,
JS_SP1->u.vstring->len);
/* The code below msut be in sync with operand `store_property'. */
@@ -967,7 +967,7 @@
memcpy (ndata, d2, d2_len);
memcpy (ndata + d2_len, d1, d1_len);
- js_vm_make_static_string (vm, JS_SP2, ndata, nlen);
+ js_vm_make_static_string (vm, JS_SP2, (char*)ndata, nlen);
JS_SP2->u.vstring->staticp = 0;
JS_POP ();
JS_MAYBE_GC ();
reactos/lib/kjs/ksrc
diff -u -r1.1 -r1.1.24.1
--- eswt0.h 10 Jan 2004 20:38:17 -0000 1.1
+++ eswt0.h 30 Dec 2004 04:36:36 -0000 1.1.24.1
@@ -548,7 +548,7 @@
else if (JS_SP1->type == JS_STRING)
{
/* Intern the string. */
- j = js_vm_intern_with_len (vm, JS_SP1->u.vstring->data,
+ j = js_vm_intern_with_len (vm, (char*)JS_SP1->u.vstring->data,
JS_SP1->u.vstring->len);
/* The code below must be in sync with operand `load_property'. */
@@ -668,7 +668,7 @@
else if (JS_SP1->type == JS_STRING)
{
/* Intern the string. */
- j = js_vm_intern_with_len (vm, JS_SP1->u.vstring->data,
+ j = js_vm_intern_with_len (vm, (char*)JS_SP1->u.vstring->data,
JS_SP1->u.vstring->len);
/* The code below msut be in sync with operand `store_property'. */
@@ -965,7 +965,7 @@
memcpy (ndata, d2, d2_len);
memcpy (ndata + d2_len, d1, d1_len);
- js_vm_make_static_string (vm, JS_SP2, ndata, nlen);
+ js_vm_make_static_string (vm, JS_SP2, (char*)ndata, nlen);
JS_SP2->u.vstring->staticp = 0;
JS_POP ();
JS_MAYBE_GC ();
reactos/lib/kjs/ksrc
diff -u -r1.2 -r1.2.18.1
--- js.c 7 May 2004 05:12:10 -0000 1.2
+++ js.c 30 Dec 2004 04:36:36 -0000 1.2.18.1
@@ -24,7 +24,7 @@
/*
* $Source: /CVS/ReactOS/reactos/lib/kjs/ksrc/js.c,v $
- * $Id: js.c,v 1.2 2004/05/07 05:12:10 royce Exp $
+ * $Id: js.c,v 1.2.18.1 2004/12/30 04:36:36 hyperion Exp $
*/
#include "js.h"
@@ -160,7 +160,7 @@
* Global functions.
*/
-const JSCharPtr
+JSCharPtr
js_version ()
{
return VERSION;
@@ -278,7 +278,7 @@
}
-const JSCharPtr
+JSCharPtr
js_error_message (JSInterpPtr interp)
{
return interp->vm->error;
@@ -792,7 +792,7 @@
}
-const JSClassPtr
+JSClassPtr
js_lookup_class (JSInterpPtr interp, char *name)
{
JSNode *n;
@@ -840,7 +840,7 @@
{
JSNode *n = (JSNode *) type;
- js_vm_make_string (interp->vm, n, data, length);
+ js_vm_make_string (interp->vm, n, (char*)data, length);
}
reactos/lib/kjs/ksrc
diff -u -r1.1 -r1.1.24.1
--- object.c 10 Jan 2004 20:38:17 -0000 1.1
+++ object.c 30 Dec 2004 04:36:36 -0000 1.1.24.1
@@ -24,7 +24,7 @@
/*
* $Source: /CVS/ReactOS/reactos/lib/kjs/ksrc/object.c,v $
- * $Id: object.c,v 1.1 2004/01/10 20:38:17 arty Exp $
+ * $Id: object.c,v 1.1.24.1 2004/12/30 04:36:36 hyperion Exp $
*/
#include "ddk/ntddk.h"
@@ -431,7 +431,7 @@
abort ();
}
- js_vm_make_string (vm, value_return, b->data, b->len);
+ js_vm_make_string (vm, value_return, (char*)b->data, b->len);
return 1;
}
reactos/lib/kjs/ksrc
diff -u -r1.1 -r1.1.24.1
--- regex.c 10 Jan 2004 20:38:17 -0000 1.1
+++ regex.c 30 Dec 2004 04:36:36 -0000 1.1.24.1
@@ -1564,7 +1564,7 @@
reg_syntax_t syntax));
static reg_errcode_t compile_range _RE_ARGS ((const char **p_ptr,
const char *pend,
- char *translate,
+ RE_TRANSLATE_TYPE translate,
reg_syntax_t syntax,
unsigned char *b));
@@ -3807,7 +3807,7 @@
unsigned char *end,
register_info_type *reg_info));
static int bcmp_translate _RE_ARGS ((const char *s1, const char *s2,
- int len, char *translate));
+ int len, RE_TRANSLATE_TYPE translate));
/* re_match_2 matches the compiled pattern in BUFP against the
the (virtual) concatenation of STRING1 and STRING2 (of length SIZE1
reactos/lib/kjs/ksrc
diff -u -r1.1 -r1.1.24.1
--- vm.c 10 Jan 2004 20:38:17 -0000 1.1
+++ vm.c 30 Dec 2004 04:36:36 -0000 1.1.24.1
@@ -24,7 +24,7 @@
/*
* $Source: /CVS/ReactOS/reactos/lib/kjs/ksrc/vm.c,v $
- * $Id: vm.c,v 1.1 2004/01/10 20:38:17 arty Exp $
+ * $Id: vm.c,v 1.1.24.1 2004/12/30 04:36:36 hyperion Exp $
*/
#include "jsint.h"
@@ -296,7 +296,7 @@
{
int i, sect;
unsigned int ui;
- unsigned char *cp;
+ char *cp;
unsigned int consts_offset;
char buf[256];
JSSymtabEntry *symtab = NULL;
reactos/lib/kjs
diff -u -r1.1.24.3 -r1.1.24.4
--- makefile 13 Dec 2004 16:18:06 -0000 1.1.24.3
+++ makefile 30 Dec 2004 04:36:37 -0000 1.1.24.4
@@ -1,4 +1,4 @@
-# $Id: makefile,v 1.1.24.3 2004/12/13 16:18:06 hyperion Exp $
+# $Id: makefile,v 1.1.24.4 2004/12/30 04:36:37 hyperion Exp $
# Kernel JavaScript
#
# You can use this for various things but the most obvious is as a powerful
@@ -70,8 +70,7 @@
src/dl_dummy.o \
src/heap.o \
src/utils.o
-TARGET_OBJECTS = $(ORIG_OBJECTS) $(MOD_OBJECTS) $(ARCH_OBJECTS) \
- ../../dk/w32/lib/libntdll.a
+TARGET_OBJECTS = $(ORIG_OBJECTS) $(MOD_OBJECTS) $(ARCH_OBJECTS)
DEP_OBJECTS = $(TARGET_OBJECTS)
include $(PATH_TO_TOP)/rules.mak
reactos/lib/kjs/src
diff -u -r1.1 -r1.1.24.1
--- b_string.c 10 Jan 2004 20:38:18 -0000 1.1
+++ b_string.c 30 Dec 2004 04:36:37 -0000 1.1.24.1
@@ -24,7 +24,7 @@
/*
* $Source: /CVS/ReactOS/reactos/lib/kjs/src/b_string.c,v $
- * $Id: b_string.c,v 1.1 2004/01/10 20:38:18 arty Exp $
+ * $Id: b_string.c,v 1.1.24.1 2004/12/30 04:36:37 hyperion Exp $
*/
/* TODO: global method: String (obj) => string */
@@ -141,7 +141,7 @@
unsigned int arg = 2;
JSUInt32 ui;
double dval;
- unsigned char *buffer = NULL;
+ char *buffer = NULL;
unsigned int bufpos = 0;
if (args->u.vinteger < 1)
@@ -442,8 +442,8 @@
|| args[1].u.vbuiltin->info != ctx->regexp_info)
goto argument_type_error;
- js_builtin_RegExp_match (vm, n->u.vstring->data, n->u.vstring->len,
- &args[1], result_return);
+ js_builtin_RegExp_match (vm, (char*)n->u.vstring->data,
+ n->u.vstring->len, &args[1], result_return);
}
/* ***************************************************************** */
else if (method == ctx->s_replace)
@@ -456,8 +456,9 @@
|| args[2].type != JS_STRING)
goto argument_type_error;
- js_builtin_RegExp_replace (vm, n->u.vstring->data, n->u.vstring->len,
- &args[1], args[2].u.vstring->data,
+ js_builtin_RegExp_replace (vm, (char*)n->u.vstring->data,
+ n->u.vstring->len, &args[1],
+ (char*)args[2].u.vstring->data,
args[2].u.vstring->len, result_return);
}
/* ***************************************************************** */
@@ -470,8 +471,8 @@
|| args[1].u.vbuiltin->info != ctx->regexp_info)
goto argument_type_error;
- js_builtin_RegExp_search (vm, n->u.vstring->data, n->u.vstring->len,
- &args[1], result_return);
+ js_builtin_RegExp_search (vm, (char*)n->u.vstring->data,
+ n->u.vstring->len, &args[1], result_return);
}
/* ***************************************************************** */
else if (method == ctx->s_slice)
@@ -511,8 +512,8 @@
if (start > end)
end = start;
- js_vm_make_string (vm, result_return, n->u.vstring->data + start,
- end - start);
+ js_vm_make_string (vm, result_return, (char*)n->u.vstring->data +
+ start, end - start);
}
/* ***************************************************************** */
else if (method == ctx->s_split)
@@ -521,7 +522,7 @@
{
js_vm_make_array (vm, result_return, 1);
js_vm_make_string (vm, &result_return->u.varray->data[0],
- n->u.vstring->data, n->u.vstring->len);
+ (char*)n->u.vstring->data, n->u.vstring->len);
}
else
{
@@ -560,7 +561,7 @@
js_vm_make_string (vm,
&(result_return
->u.varray->data[alen]),
- n->u.vstring->data + start,
+ (char*)n->u.vstring->data + start,
pos - start);
alen++;
@@ -585,14 +586,14 @@
js_vm_expand_array (vm, result_return, alen + 1);
js_vm_make_string (vm,
&result_return->u.varray->data[alen],
- n->u.vstring->data + start,
+ (char*)n->u.vstring->data + start,
n->u.vstring->len - start);
}
}
else if (args[1].type == JS_BUILTIN
&& args[1].u.vbuiltin->info == ctx->regexp_info)
{
- js_builtin_RegExp_split (vm, n->u.vstring->data,
+ js_builtin_RegExp_split (vm, (char*)n->u.vstring->data,
n->u.vstring->len, &args[1],
limit, result_return);
}
@@ -635,8 +636,8 @@
if (start + length > n->u.vstring->len)
length = n->u.vstring->len - start;
- js_vm_make_string (vm, result_return, n->u.vstring->data + start,
- length);
+ js_vm_make_string (vm, result_return, (char*)n->u.vstring->data +
+ start, length);
}
/* ***************************************************************** */
else if (method == ctx->s_substring)
@@ -675,8 +676,8 @@
js_vm_error (vm);
}
- js_vm_make_string (vm, result_return, n->u.vstring->data + start,
- end - start);
+ js_vm_make_string (vm, result_return, (char*)n->u.vstring->data +
+ start, end - start);
}
/* ***************************************************************** */
else if (method == ctx->s_toLowerCase)
@@ -684,7 +685,7 @@
if (args->u.vinteger != 0)
goto argument_type_error;
- js_vm_make_string (vm, result_return, n->u.vstring->data,
+ js_vm_make_string (vm, result_return, (char*)n->u.vstring->data,
n->u.vstring->len);
for (i = 0; i < result_return->u.vstring->len; i++)
@@ -697,7 +698,7 @@
if (args->u.vinteger != 0)
goto argument_type_error;
- js_vm_make_string (vm, result_return, n->u.vstring->data,
+ js_vm_make_string (vm, result_return, (char*)n->u.vstring->data,
n->u.vstring->len);
for (i = 0; i < result_return->u.vstring->len; i++)
@@ -869,7 +870,7 @@
source = &source_n;
}
- js_vm_make_string (vm, result_return, source->u.vstring->data,
+ js_vm_make_string (vm, result_return, (char*)source->u.vstring->data,
source->u.vstring->len);
}
else
reactos/lib/kjs/src
diff -u -r1.1 -r1.1.24.1
--- regex.h 10 Jan 2004 20:38:18 -0000 1.1
+++ regex.h 30 Dec 2004 04:36:37 -0000 1.1.24.1
@@ -317,7 +317,7 @@
private to the regex routines. */
#ifndef RE_TRANSLATE_TYPE
-# define RE_TRANSLATE_TYPE char *
+# define RE_TRANSLATE_TYPE unsigned char *
#endif
struct re_pattern_buffer
reactos/lib/kjs/src
diff -u -r1.1 -r1.1.24.1
--- utils.c 10 Jan 2004 20:38:18 -0000 1.1
+++ utils.c 30 Dec 2004 04:36:37 -0000 1.1.24.1
@@ -24,7 +24,7 @@
/*
* $Source: /CVS/ReactOS/reactos/lib/kjs/src/utils.c,v $
- * $Id: utils.c,v 1.1 2004/01/10 20:38:18 arty Exp $
+ * $Id: utils.c,v 1.1.24.1 2004/12/30 04:36:37 hyperion Exp $
*/
#include "jsint.h"
@@ -354,7 +354,7 @@
break;
case JS_STRING:
- js_vm_make_string (vm, result_return, n->u.vstring->data,
+ js_vm_make_string (vm, result_return, (char*)n->u.vstring->data,
n->u.vstring->len);
break;
reactos/lib/libwine
diff -u -r1.3.6.3 -r1.3.6.4
--- makefile 13 Dec 2004 16:18:06 -0000 1.3.6.3
+++ makefile 30 Dec 2004 04:36:37 -0000 1.3.6.4
@@ -1,4 +1,4 @@
-# $Id: makefile,v 1.3.6.3 2004/12/13 16:18:06 hyperion Exp $
+# $Id: makefile,v 1.3.6.4 2004/12/30 04:36:37 hyperion Exp $
PATH_TO_TOP = ../..
reactos/lib/mesa32/src/main
diff -u -r1.2 -r1.2.8.1
--- texformat_tmp.h 25 Aug 2004 12:35:12 -0000 1.2
+++ texformat_tmp.h 30 Dec 2004 04:36:37 -0000 1.2.8.1
@@ -1,6 +1,7 @@
+/* $XFree86$ */
/*
* Mesa 3-D graphics library
- * Version: 6.1
+ * Version: 6.2
*
* Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
*
@@ -44,46 +45,34 @@
#if DIM == 1
#define CHAN_SRC( t, i, j, k, sz ) \
- ((void) (j), (void) (k), \
- ((GLchan *)(t)->Data + (i) * (sz)))
+ ((GLchan *)(t)->Data + (i) * (sz))
#define UBYTE_SRC( t, i, j, k, sz ) \
- ((void) (j), (void) (k), \
- ((GLubyte *)(t)->Data + (i) * (sz)))
+ ((GLubyte *)(t)->Data + (i) * (sz))
#define USHORT_SRC( t, i, j, k ) \
- ((void) (j), (void) (k), \
- ((GLushort *)(t)->Data + (i)))
+ ((GLushort *)(t)->Data + (i))
#define UINT_SRC( t, i, j, k ) \
- ((void) (j), (void) (k), \
- ((GLuint *)(t)->Data + (i)))
+ ((GLuint *)(t)->Data + (i))
#define FLOAT_SRC( t, i, j, k, sz ) \
- ((void) (j), (void) (k), \
- ((GLfloat *)(t)->Data + (i) * (sz)))
+ ((GLfloat *)(t)->Data + (i) * (sz))
#define HALF_SRC( t, i, j, k, sz ) \
- ((void) (j), (void) (k), \
- ((GLhalfARB *)(t)->Data + (i) * (sz)))
+ ((GLhalfARB *)(t)->Data + (i) * (sz))
#define FETCH(x) fetch_texel_1d_##x
#elif DIM == 2
#define CHAN_SRC( t, i, j, k, sz ) \
- ((void) (k), \
- ((GLchan *)(t)->Data + ((t)->RowStride * (j) + (i)) * (sz)))
+ ((GLchan *)(t)->Data + ((t)->RowStride * (j) + (i)) * (sz))
#define UBYTE_SRC( t, i, j, k, sz ) \
- ((void) (k), \
- ((GLubyte *)(t)->Data + ((t)->RowStride * (j) + (i)) * (sz)))
+ ((GLubyte *)(t)->Data + ((t)->RowStride * (j) + (i)) * (sz))
#define USHORT_SRC( t, i, j, k ) \
- ((void) (k), \
- ((GLushort *)(t)->Data + ((t)->RowStride * (j) + (i))))
+ ((GLushort *)(t)->Data + ((t)->RowStride * (j) + (i)))
#define UINT_SRC( t, i, j, k ) \
- ((void) (k), \
- ((GLuint *)(t)->Data + ((t)->RowStride * (j) + (i))))
+ ((GLuint *)(t)->Data + ((t)->RowStride * (j) + (i)))
#define FLOAT_SRC( t, i, j, k, sz ) \
- ((void) (k), \
- ((GLfloat *)(t)->Data + ((t)->RowStride * (j) + (i)) * (sz)))
+ ((GLfloat *)(t)->Data + ((t)->RowStride * (j) + (i)) * (sz))
#define HALF_SRC( t, i, j, k, sz ) \
- ((void) (k), \
- ((GLhalfARB *)(t)->Data + ((t)->RowStride * (j) + (i)) * (sz)))
+ ((GLhalfARB *)(t)->Data + ((t)->RowStride * (j) + (i)) * (sz))
#define FETCH(x) fetch_texel_2d_##x
@@ -1023,9 +1012,9 @@
GLint i, GLint j, GLint k, GLchan *texel )
{
const GLubyte *src = UBYTE_SRC( texImage, i, j, k, 1 );
- const GLuint index = *src;
const struct gl_color_table *palette;
const GLchan *table;
+ GLuint index;
GET_CURRENT_CONTEXT(ctx);
if (ctx->Texture.SharedPalette) {
@@ -1039,6 +1028,9 @@
ASSERT(palette->Type != GL_FLOAT);
table = (const GLchan *) palette->Table;
+ /* Mask the index against size of palette to avoid going out of bounds */
+ index = (*src) & (palette->Size - 1);
+
switch (palette->Format) {
case GL_ALPHA:
texel[RCOMP] =
reactos/lib/midimap
diff -u -r1.1.2.3 -r1.1.2.4
--- Makefile.ros-template 13 Dec 2004 16:18:06 -0000 1.1.2.3
+++ Makefile.ros-template 30 Dec 2004 04:36:38 -0000 1.1.2.4
@@ -1,4 +1,4 @@
-# $Id: Makefile.ros-template,v 1.1.2.3 2004/12/13 16:18:06 hyperion Exp $
+# $Id: Makefile.ros-template,v 1.1.2.4 2004/12/30 04:36:38 hyperion Exp $
TARGET_NAME = midimap
reactos/lib/mpr
diff -u -r1.3.2.3 -r1.3.2.4
--- Makefile.ros-template 13 Dec 2004 16:18:07 -0000 1.3.2.3
+++ Makefile.ros-template 30 Dec 2004 04:36:38 -0000 1.3.2.4
@@ -1,4 +1,4 @@
-# $Id: Makefile.ros-template,v 1.3.2.3 2004/12/13 16:18:07 hyperion Exp $
+# $Id: Makefile.ros-template,v 1.3.2.4 2004/12/30 04:36:38 hyperion Exp $
TARGET_NAME = mpr
reactos/lib/msacm
diff -u -r1.3.8.3 -r1.3.8.4
--- Makefile.ros-template 13 Dec 2004 16:18:07 -0000 1.3.8.3
+++ Makefile.ros-template 30 Dec 2004 04:36:38 -0000 1.3.8.4
@@ -1,4 +1,4 @@
-# $Id: Makefile.ros-template,v 1.3.8.3 2004/12/13 16:18:07 hyperion Exp $
+# $Id: Makefile.ros-template,v 1.3.8.4 2004/12/30 04:36:38 hyperion Exp $
TARGET_NAME = msacm32
reactos/lib/msafd/include
diff -u -r1.9.2.1 -r1.9.2.2
--- msafd.h 8 Dec 2004 21:57:12 -0000 1.9.2.1
+++ msafd.h 30 Dec 2004 04:36:38 -0000 1.9.2.2
@@ -49,7 +49,7 @@
INT Protocol;
INT SizeOfLocalAddress;
INT SizeOfRemoteAddress;
- ULONG LingerData;
+ struct linger LingerData;
ULONG SendTimeout;
ULONG RecvTimeout;
ULONG SizeOfRecvBuffer;
@@ -154,7 +154,7 @@
INT
WSPAPI WSPBind(
IN SOCKET s,
- IN CONST LPSOCKADDR name,
+ IN CONST SOCKADDR *name,
IN INT namelen,
OUT LPINT lpErrno);
@@ -178,7 +178,7 @@
WSPAPI
WSPConnect(
IN SOCKET s,
- IN CONST LPSOCKADDR name,
+ IN CONST SOCKADDR *name,
IN INT namelen,
IN LPWSABUF lpCallerData,
OUT LPWSABUF lpCalleeData,
@@ -273,7 +273,7 @@
WSPAPI
WSPJoinLeaf(
IN SOCKET s,
- IN CONST LPSOCKADDR name,
+ IN CONST SOCKADDR *name,
IN INT namelen,
IN LPWSABUF lpCallerData,
OUT LPWSABUF lpCalleeData,
@@ -362,7 +362,7 @@
IN DWORD dwBufferCount,
OUT LPDWORD lpNumberOfBytesSent,
IN DWORD dwFlags,
- IN CONST LPSOCKADDR lpTo,
+ IN CONST SOCKADDR *lpTo,
IN INT iTolen,
IN LPWSAOVERLAPPED lpOverlapped,
IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine,
@@ -460,6 +460,12 @@
PIO_STATUS_BLOCK IoStatusBlock
);
+VOID
+SockReenableAsyncSelectEvent (
+ IN PSOCKET_INFORMATION Socket,
+ IN ULONG Event
+ );
+
DWORD MsafdReturnWithErrno( NTSTATUS Status, LPINT Errno, DWORD Received,
LPDWORD ReturnedBytes );
reactos/lib/msafd/misc
diff -u -r1.19.2.2 -r1.19.2.3
--- dllmain.c 13 Dec 2004 09:38:57 -0000 1.19.2.2
+++ dllmain.c 30 Dec 2004 04:36:39 -0000 1.19.2.3
@@ -23,7 +23,7 @@
HANDLE GlobalHeap;
WSPUPCALLTABLE Upcalls;
LPWPUCOMPLETEOVERLAPPEDREQUEST lpWPUCompleteOverlappedRequest;
-ULONG SocketCount;
+ULONG SocketCount = 0;
PSOCKET_INFORMATION *Sockets = NULL;
LIST_ENTRY SockHelpersListHead = {NULL};
ULONG SockAsyncThreadRefCount;
@@ -253,7 +253,7 @@
error:
AFD_DbgPrint(MID_TRACE,("Ending\n"));
- *lpErrno = Status;
+ if( lpErrno ) *lpErrno = Status;
return INVALID_SOCKET;
}
@@ -267,9 +267,13 @@
case STATUS_SUCCESS:
/* Return Number of bytes Read */
if( ReturnedBytes ) *ReturnedBytes = Received; break;
+ case STATUS_END_OF_FILE: *Errno = WSAESHUTDOWN; *ReturnedBytes = 0; break;
case STATUS_PENDING: *Errno = WSA_IO_PENDING; break;
case STATUS_BUFFER_OVERFLOW: *Errno = WSAEMSGSIZE; break;
- default: *Errno = WSAEINVAL; break;
+ default: {
+ DbgPrint("MSAFD: Error %x is unknown\n", Status);
+ *Errno = WSAEINVAL; break;
+ } break;
}
/* Success */
@@ -280,7 +284,7 @@
INT
WSPAPI
WSPCloseSocket(
- IN SOCKET s,
+ IN SOCKET Handle,
OUT LPINT lpErrno)
/*
* FUNCTION: Closes an open socket
@@ -291,15 +295,133 @@
* NO_ERROR, or SOCKET_ERROR if the socket could not be closed
*/
{
- return 0;
-}
+ IO_STATUS_BLOCK IoStatusBlock;
+ PSOCKET_INFORMATION Socket = NULL;
+ NTSTATUS Status;
+ HANDLE SockEvent;
+ AFD_DISCONNECT_INFO DisconnectInfo;
+ SOCKET_STATE OldState;
+
+ /* Create the Wait Event */
+ Status = NtCreateEvent(&SockEvent,
+ GENERIC_READ | GENERIC_WRITE,
+ NULL,
+ 1,
+ FALSE);
+
+ if(!NT_SUCCESS(Status)) return SOCKET_ERROR;
+
+ /* Get the Socket Structure associate to this Socket*/
+ Socket = GetSocketStructure(Handle);
+ /* If a Close is already in Process, give up */
+ if (Socket->SharedData.State == SocketClosed) {
+ *lpErrno = WSAENOTSOCK;
+ return SOCKET_ERROR;
+ }
+
+ /* Set the state to close */
+ OldState = Socket->SharedData.State;
+ Socket->SharedData.State = SocketClosed;
+
+ /* If SO_LINGER is ON and the Socket is connected, we need to disconnect */
+ /* FIXME: Should we do this on Datagram Sockets too? */
+ if ((OldState == SocketConnected) && (Socket->SharedData.LingerData.l_onoff)) {
+ ULONG LingerWait;
+ ULONG SendsInProgress;
+ ULONG SleepWait;
+
+ /* We need to respect the timeout */
+ SleepWait = 100;
+ LingerWait = Socket->SharedData.LingerData.l_linger * 1000;
+
+ /* Loop until no more sends are pending, within the timeout */
+ while (LingerWait) {
+
+ /* Find out how many Sends are in Progress */
+ if (GetSocketInformation(Socket,
+ AFD_INFO_SENDS_IN_PROGRESS,
+ &SendsInProgress,
+ NULL)) {
+ /* Bail out if anything but NO_ERROR */
+ LingerWait = 0;
+ break;
+ }
+
+ /* Bail out if no more sends are pending */
+ if (!SendsInProgress) break;
+
+ /*
+ * We have to execute a sleep, so it's kind of like
+ * a block. If the socket is Nonblock, we cannot
+ * go on since asyncronous operation is expected
+ * and we cannot offer it
+ */
+ if (Socket->SharedData.NonBlocking) {
+ Socket->SharedData.State = OldState;
+ *lpErrno = WSAEWOULDBLOCK;
+ return SOCKET_ERROR;
+ }
+
+ /* Now we can sleep, and decrement the linger wait */
+ /*
+ * FIXME: It seems Windows does some funky acceleration
+ * since the waiting seems to be longer and longer. I
+ * don't think this improves performance so much, so we
+ * wait a fixed time instead.
+ */
+ Sleep(SleepWait);
+ LingerWait -= SleepWait;
+ }
+
+ /*
+ * We have reached the timeout or sends are over.
+ * Disconnect if the timeout has been reached.
+ */
+ if (LingerWait <= 0) {
+
+ DisconnectInfo.Timeout = RtlConvertLongToLargeInteger(0);
+ DisconnectInfo.DisconnectType = AFD_DISCONNECT_ABORT;
+
+ /* Send IOCTL */
+ Status = NtDeviceIoControlFile((HANDLE)Handle,
+ SockEvent,
+ NULL,
+ NULL,
+ &IoStatusBlock,
+ IOCTL_AFD_DISCONNECT,
+ &DisconnectInfo,
+ sizeof(DisconnectInfo),
+ NULL,
+ 0);
+
+ /* Wait for return */
+ if (Status == STATUS_PENDING) {
+ WaitForSingleObject(SockEvent, INFINITE);
+ }
+ }
+ }
+
+ /* FIXME: We should notify the Helper DLL of WSH_NOTIFY_CLOSE */
+
+ /* Cleanup Time! */
+ Socket->HelperContext = NULL;
+ Socket->SharedData.AsyncDisabledEvents = -1;
+ NtClose(Socket->TdiAddressHandle);
+ Socket->TdiAddressHandle = NULL;
+ NtClose(Socket->TdiConnectionHandle);
+ Socket->TdiConnectionHandle = NULL;
+
+ /* Close the handle */
+ NtClose((HANDLE)Handle);
+ return NO_ERROR;
+}
INT
WSPAPI
WSPBind(
SOCKET Handle,
- struct sockaddr *SocketAddress,
+ const struct sockaddr *SocketAddress,
int SocketAddressLength,
LPINT lpErrno)
/*
@@ -486,26 +608,29 @@
if (readfds != NULL) {
for (i = 0; i < readfds->fd_count; i++, j++) {
PollInfo->Handles[j].Handle = readfds->fd_array[i];
- PollInfo->Handles[j].Events = AFD_EVENT_RECEIVE | AFD_EVENT_DISCONNECT | AFD_EVENT_ABORT;
+ PollInfo->Handles[j].Events = AFD_EVENT_RECEIVE |
+ AFD_EVENT_DISCONNECT |
+ AFD_EVENT_ABORT |
+ AFD_EVENT_ACCEPT;
}
}
if (writefds != NULL) {
for (i = 0; i < writefds->fd_count; i++, j++) {
PollInfo->Handles[j].Handle = writefds->fd_array[i];
- PollInfo->Handles[j].Events |= AFD_EVENT_SEND;
- }
-
+ PollInfo->Handles[j].Events = AFD_EVENT_SEND |
+ AFD_EVENT_CONNECT;
+ }
}
if (exceptfds != NULL) {
for (i = 0; i < exceptfds->fd_count; i++, j++) {
PollInfo->Handles[j].Handle = exceptfds->fd_array[i];
- PollInfo->Handles[j].Events |=
- AFD_EVENT_OOB_RECEIVE | AFD_EVENT_CONNECT_FAIL;
+ PollInfo->Handles[j].Events = AFD_EVENT_OOB_RECEIVE |
+ AFD_EVENT_CONNECT_FAIL;
}
}
/* Send IOCTL */
- Status = NtDeviceIoControlFile( (HANDLE)Sockets[0]->Handle,
+ Status = NtDeviceIoControlFile( (HANDLE)PollInfo->Handles[0].Handle,
SockEvent,
NULL,
NULL,
@@ -545,6 +670,8 @@
PollInfo->Handles[i].Handle));
OutCount++;
if( readfds ) FD_SET(PollInfo->Handles[i].Handle, readfds);
+ break;
+
case AFD_EVENT_SEND: case AFD_EVENT_CONNECT:
AFD_DbgPrint(MID_TRACE,("Event %x on handle %x\n",
PollInfo->Handles[i].Events,
@@ -566,10 +693,14 @@
NtClose( SockEvent );
- switch( IOSB.Status ) {
- case STATUS_SUCCESS:
- case STATUS_TIMEOUT: *lpErrno = 0; break;
- default: *lpErrno = WSAEINVAL;
+ AFD_DbgPrint(MID_TRACE,("lpErrno = %x\n", lpErrno));
+
+ if( lpErrno ) {
+ switch( IOSB.Status ) {
+ case STATUS_SUCCESS:
+ case STATUS_TIMEOUT: *lpErrno = 0; break;
+ default: *lpErrno = WSAEINVAL; break;
+ }
}
AFD_DbgPrint(MID_TRACE,("%d events\n", OutCount));
@@ -611,7 +742,10 @@
Status = NtCreateEvent( &SockEvent, GENERIC_READ | GENERIC_WRITE,
NULL, 1, FALSE );
- if( !NT_SUCCESS(Status) ) return -1;
+ if( !NT_SUCCESS(Status) ) {
+ MsafdReturnWithErrno( Status, lpErrno, 0, NULL );
+ return INVALID_SOCKET;
+ }
/* Dynamic Structure...ugh */
ListenReceiveData = (PAFD_RECEIVED_ACCEPT_DATA)ReceiveBuffer;
@@ -624,7 +758,9 @@
FD_SET(Socket->Handle, &ReadSet);
Timeout.tv_sec=0;
Timeout.tv_usec=0;
+
WSPSelect(0, &ReadSet, NULL, NULL, &Timeout, NULL);
+
if (ReadSet.fd_array[0] != Socket->Handle) return 0;
/* Send IOCTL */
@@ -639,9 +775,20 @@
ListenReceiveData,
0xA + sizeof(*ListenReceiveData));
+ /* Wait for return */
+ if (Status == STATUS_PENDING) {
+ WaitForSingleObject(SockEvent, INFINITE);
+ Status = IOSB.Status;
+ }
+
+ if (!NT_SUCCESS(Status)) {
+ NtClose( SockEvent );
+ MsafdReturnWithErrno( Status, lpErrno, 0, NULL );
+ return INVALID_SOCKET;
+ }
+
if (lpfnCondition != NULL) {
if ((Socket->SharedData.ServiceFlags1 & XP1_CONNECT_DATA) != 0) {
-
/* Find out how much data is pending */
PendingAcceptData.SequenceNumber = ListenReceiveData->SequenceNumber;
PendingAcceptData.ReturnSize = TRUE;
@@ -658,11 +805,16 @@
&PendingAcceptData,
sizeof(PendingAcceptData));
+ if (!NT_SUCCESS(Status)) {
+ NtClose( SockEvent );
+ MsafdReturnWithErrno( Status, lpErrno, 0, NULL );
+ return INVALID_SOCKET;
+ }
+
/* How much data to allocate */
PendingDataLength = IOSB.Information;
if (PendingDataLength) {
-
/* Allocate needed space */
PendingData = HeapAlloc(GlobalHeap, 0, PendingDataLength);
@@ -680,10 +832,15 @@
sizeof(PendingAcceptData),
PendingData,
PendingDataLength);
+
+ if (!NT_SUCCESS(Status)) {
+ NtClose( SockEvent );
+ MsafdReturnWithErrno( Status, lpErrno, 0, NULL );
+ return INVALID_SOCKET;
+ }
}
}
-
if ((Socket->SharedData.ServiceFlags1 & XP1_QOS_SUPPORTED) != 0) {
/* I don't support this yet */
}
@@ -707,14 +864,11 @@
/* Check if socket supports Conditional Accept */
if (Socket->SharedData.UseDelayedAcceptance != 0) {
-
/* Allocate Buffer for Callee Data */
CalleeDataBuffer = HeapAlloc(GlobalHeap, 0, 4096);
CalleeData.buf = CalleeDataBuffer;
CalleeData.len = 4096;
-
} else {
-
/* Nothing */
CalleeData.buf = 0;
CalleeData.len = 0;
@@ -767,10 +921,17 @@
NtClose( SockEvent );
+ if (!NT_SUCCESS(Status)) {
+ MsafdReturnWithErrno( Status, lpErrno, 0, NULL );
+ return INVALID_SOCKET;
+ }
+
if (CallBack == CF_REJECT ) {
- return WSAECONNREFUSED;
+ *lpErrno = WSAECONNREFUSED;
+ return INVALID_SOCKET;
} else {
- return WSATRY_AGAIN;
+ *lpErrno = WSAECONNREFUSED;
+ return INVALID_SOCKET;
}
}
}
@@ -779,13 +940,14 @@
ProtocolInfo.dwCatalogEntryId = Socket->SharedData.CatalogEntryId;
ProtocolInfo.dwServiceFlags1 = Socket->SharedData.ServiceFlags1;
ProtocolInfo.dwProviderFlags = Socket->SharedData.ProviderFlags;
+
AcceptSocket = WSPSocket (Socket->SharedData.AddressFamily,
- Socket->SharedData.SocketType,
- Socket->SharedData.Protocol,
- &ProtocolInfo,
- GroupID,
- Socket->SharedData.CreateFlags,
- NULL);
+ Socket->SharedData.SocketType,
+ Socket->SharedData.Protocol,
+ &ProtocolInfo,
+ GroupID,
+ Socket->SharedData.CreateFlags,
+ NULL);
/* Set up the Accept Structure */
AcceptData.ListenHandle = AcceptSocket;
@@ -803,12 +965,23 @@
NULL,
0);
+ if (!NT_SUCCESS(Status)) {
+ WSPCloseSocket( AcceptSocket, lpErrno );
+ MsafdReturnWithErrno( Status, lpErrno, 0, NULL );
+ return INVALID_SOCKET;
+ }
+
/* Return Address in SOCKADDR FORMAT */
RtlCopyMemory (SocketAddress,
&ListenReceiveData->Address.Address[0].AddressType,
sizeof(RemoteAddress));
NtClose( SockEvent );
+
+ /* Re-enable Async Event */
+ SockReenableAsyncSelectEvent(Socket, FD_ACCEPT);
+
+ AFD_DbgPrint(MID_TRACE,("Socket %x\n", AcceptSocket));
/* Return Socket */
return AcceptSocket;
@@ -818,7 +991,7 @@
WSPAPI
WSPConnect(
SOCKET Handle,
- struct sockaddr * SocketAddress,
+ const struct sockaddr * SocketAddress,
int SocketAddressLength,
LPWSABUF lpCallerData,
LPWSABUF lpCalleeData,
@@ -833,7 +1006,7 @@
UCHAR ConnectBuffer[0x22];
ULONG ConnectDataLength;
ULONG InConnectDataLength;
- UINT BindAddressLength;
+ INT BindAddressLength;
PSOCKADDR BindAddress;
HANDLE SockEvent;
@@ -887,6 +1060,16 @@
SocketAddress->sa_data,
SocketAddressLength - sizeof(SocketAddress->sa_family));
+ /*
+ * Disable FD_WRITE and FD_CONNECT
+ * The latter fixes a race condition where the FD_CONNECT is re-enabled
+ * at the end of this function right after the Async Thread disables it.
+ * This should only happen at the *next* WSPConnect
+ */
+ if (Socket->SharedData.AsyncEvents & FD_CONNECT) {
+ Socket->SharedData.AsyncDisabledEvents |= FD_CONNECT | FD_WRITE;
+ }
+
/* Tell AFD that we want Connection Data back, have it allocate a buffer */
if (lpCalleeData != NULL) {
InConnectDataLength = lpCalleeData->len;
@@ -907,6 +1090,11 @@
ConnectInfo->UseSAN = FALSE;
ConnectInfo->Unknown = 0;
+ /* FIXME: Handle Async Connect */
+ if (Socket->SharedData.NonBlocking) {
+ AFD_DbgPrint(MIN_TRACE, ("Async Connect UNIMPLEMENTED!\n"));
+ }
+
/* Send IOCTL */
Status = NtDeviceIoControlFile((HANDLE)Handle,
SockEvent,
@@ -933,6 +1121,12 @@
lpCalleeData->len);
}
+ /* Re-enable Async Event */
+ SockReenableAsyncSelectEvent(Socket, FD_WRITE);
+
+ /* FIXME: THIS IS NOT RIGHT!!! HACK HACK HACK! */
+ SockReenableAsyncSelectEvent(Socket, FD_CONNECT);
+
AFD_DbgPrint(MID_TRACE,("Ending\n"));
NtClose( SockEvent );
@@ -1127,7 +1321,9 @@
AFD_DbgPrint(MID_TRACE,("[%x] Set nonblocking %d\n",
Handle, Socket->SharedData.NonBlocking));
return 0;
+
default:
+ *lpErrno = WSAEINVAL;
return SOCKET_ERROR;
}
}
@@ -1135,6 +1331,107 @@
INT
WSPAPI
+WSPGetSockOpt(
+ IN SOCKET Handle,
+ IN INT Level,
+ IN INT OptionName,
+ OUT CHAR FAR* OptionValue,
+ IN OUT LPINT OptionLength,
+ OUT LPINT lpErrno)
+{
+ PSOCKET_INFORMATION Socket = NULL;
+ PVOID Buffer;
+ INT BufferSize;
+ BOOLEAN BoolBuffer;
+
+ /* Get the Socket Structure associate to this Socket*/
+ Socket = GetSocketStructure(Handle);
+ if (Socket == NULL)
+ {
+ *lpErrno = WSAENOTSOCK;
+ return SOCKET_ERROR;
+ }
+
+ AFD_DbgPrint(MID_TRACE, ("Called\n"));
+
+ switch (Level)
+ {
+ case SOL_SOCKET:
+ switch (OptionName)
+ {
+ case SO_TYPE:
+ Buffer = &Socket->SharedData.SocketType;
+ BufferSize = sizeof(INT);
+ break;
+
+ case SO_RCVBUF:
+ Buffer = &Socket->SharedData.SizeOfRecvBuffer;
+ BufferSize = sizeof(INT);
+ break;
+
+ case SO_SNDBUF:
+ Buffer = &Socket->SharedData.SizeOfSendBuffer;
+ BufferSize = sizeof(INT);
+ break;
+
+ case SO_ACCEPTCONN:
+ BoolBuffer = Socket->SharedData.Listening;
+ Buffer = &BoolBuffer;
+ BufferSize = sizeof(BOOLEAN);
+ break;
+
+ case SO_BROADCAST:
+ BoolBuffer = Socket->SharedData.Broadcast;
+ Buffer = &BoolBuffer;
+ BufferSize = sizeof(BOOLEAN);
+ break;
+
+ case SO_DEBUG:
+ BoolBuffer = Socket->SharedData.Debug;
+ Buffer = &BoolBuffer;
+ BufferSize = sizeof(BOOLEAN);
+ break;
+
+ /* case SO_CONDITIONAL_ACCEPT: */
+ case SO_DONTLINGER:
+ case SO_DONTROUTE:
+ case SO_ERROR:
+ case SO_GROUP_ID:
+ case SO_GROUP_PRIORITY:
+ case SO_KEEPALIVE:
+ case SO_LINGER:
+ case SO_MAX_MSG_SIZE:
+ case SO_OOBINLINE:
+ case SO_PROTOCOL_INFO:
+ case SO_REUSEADDR:
+ AFD_DbgPrint(MID_TRACE, ("Unimplemented option (%x)\n",
+ OptionName));
+
+ default:
+ *lpErrno = WSAEINVAL;
+ return SOCKET_ERROR;
+ }
+
+ if (*OptionLength < BufferSize)
+ {
+ *lpErrno = WSAEFAULT;
+ *OptionLength = BufferSize;
+ return SOCKET_ERROR;
+ }
+ RtlCopyMemory(OptionValue, Buffer, BufferSize);
+
+ return 0;
+
+ case IPPROTO_TCP: /* FIXME */
+ default:
+ *lpErrno = WSAEINVAL;
+ return SOCKET_ERROR;
+ }
+}
+
+
+INT
+WSPAPI
WSPStartup(
IN WORD wVersionRequested,
OUT LPWSPDATA lpWSPData,
@@ -1165,11 +1462,11 @@
lpProcTable->lpWSPAccept = WSPAccept;
lpProcTable->lpWSPAddressToString = WSPAddressToString;
lpProcTable->lpWSPAsyncSelect = WSPAsyncSelect;
- lpProcTable->lpWSPBind = (LPWSPBIND)WSPBind;
+ lpProcTable->lpWSPBind = WSPBind;
lpProcTable->lpWSPCancelBlockingCall = WSPCancelBlockingCall;
lpProcTable->lpWSPCleanup = WSPCleanup;
lpProcTable->lpWSPCloseSocket = WSPCloseSocket;
- lpProcTable->lpWSPConnect = (LPWSPCONNECT)WSPConnect;
+ lpProcTable->lpWSPConnect = WSPConnect;
lpProcTable->lpWSPDuplicateSocket = WSPDuplicateSocket;
lpProcTable->lpWSPEnumNetworkEvents = WSPEnumNetworkEvents;
lpProcTable->lpWSPEventSelect = WSPEventSelect;
@@ -1179,7 +1476,7 @@
lpProcTable->lpWSPGetSockOpt = WSPGetSockOpt;
lpProcTable->lpWSPGetQOSByName = WSPGetQOSByName;
lpProcTable->lpWSPIoctl = WSPIoctl;
- lpProcTable->lpWSPJoinLeaf = (LPWSPJOINLEAF)WSPJoinLeaf;
+ lpProcTable->lpWSPJoinLeaf = WSPJoinLeaf;
lpProcTable->lpWSPListen = WSPListen;
lpProcTable->lpWSPRecv = WSPRecv;
lpProcTable->lpWSPRecvDisconnect = WSPRecvDisconnect;
@@ -1187,7 +1484,7 @@
lpProcTable->lpWSPSelect = WSPSelect;
lpProcTable->lpWSPSend = WSPSend;
lpProcTable->lpWSPSendDisconnect = WSPSendDisconnect;
- lpProcTable->lpWSPSendTo = (LPWSPSENDTO)WSPSendTo;
+ lpProcTable->lpWSPSendTo = WSPSendTo;
lpProcTable->lpWSPSetSockOpt = WSPSetSockOpt;
lpProcTable->lpWSPShutdown = WSPShutdown;
lpProcTable->lpWSPSocket = WSPSocket;
@@ -1442,7 +1739,6 @@
PASYNC_COMPLETION_ROUTINE AsyncCompletionRoutine;
IO_STATUS_BLOCK IOSB;
NTSTATUS Status;
- LARGE_INTEGER Timeout;
/* Make the Thread Higher Priority */
SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_ABOVE_NORMAL);
@@ -1453,11 +1749,11 @@
(PVOID*)&AsyncCompletionRoutine,
&AsyncContext,
&IOSB,
- &Timeout);
+ NULL);
/* Call the Async Function */
if (NT_SUCCESS(Status)) {
- //(*AsyncCompletionRoutine)(AsyncContext, IOSB);
+ (*AsyncCompletionRoutine)(AsyncContext, &IOSB);
} else {
/* It Failed, sleep for a second */
Sleep(1000);
@@ -1551,11 +1847,10 @@
return;
}
-
for (x = 1; x; x<<=1) {
switch (AsyncData->AsyncSelectInfo.Handles[0].Events & x) {
case AFD_EVENT_RECEIVE:
- if ((Socket->SharedData.AsyncEvents & FD_READ) && (!Socket->SharedData.AsyncDisabledEvents & FD_READ)) {
+ if (0 != (Socket->SharedData.AsyncEvents & FD_READ) && 0 == (Socket->SharedData.AsyncDisabledEvents & FD_READ)) {
/* Make the Notifcation */
(Upcalls.lpWPUPostMessage)(Socket->SharedData.hWnd,
Socket->SharedData.wMsg,
@@ -1564,9 +1859,10 @@
/* Disable this event until the next read(); */
Socket->SharedData.AsyncDisabledEvents |= FD_READ;
}
+ break;
case AFD_EVENT_OOB_RECEIVE:
- if ((Socket->SharedData.AsyncEvents & FD_OOB) && (!Socket->SharedData.AsyncDisabledEvents & FD_OOB)) {
+ if (0 != (Socket->SharedData.AsyncEvents & FD_OOB) && 0 == (Socket->SharedData.AsyncDisabledEvents & FD_OOB)) {
/* Make the Notifcation */
(Upcalls.lpWPUPostMessage)(Socket->SharedData.hWnd,
Socket->SharedData.wMsg,
@@ -1575,9 +1871,10 @@
/* Disable this event until the next read(); */
Socket->SharedData.AsyncDisabledEvents |= FD_OOB;
}
+ break;
case AFD_EVENT_SEND:
- if ((Socket->SharedData.AsyncEvents & FD_WRITE) && (!Socket->SharedData.AsyncDisabledEvents & FD_WRITE)) {
+ if (0 != (Socket->SharedData.AsyncEvents & FD_WRITE) && 0 == (Socket->SharedData.AsyncDisabledEvents & FD_WRITE)) {
/* Make the Notifcation */
(Upcalls.lpWPUPostMessage)(Socket->SharedData.hWnd,
Socket->SharedData.wMsg,
@@ -1586,9 +1883,23 @@
/* Disable this event until the next write(); */
Socket->SharedData.AsyncDisabledEvents |= FD_WRITE;
}
+ break;
+
+ /* FIXME: THIS IS NOT RIGHT!!! HACK HACK HACK! */
+ case AFD_EVENT_CONNECT:
+ if (0 != (Socket->SharedData.AsyncEvents & FD_CONNECT) && 0 == (Socket->SharedData.AsyncDisabledEvents & FD_CONNECT)) {
+ /* Make the Notifcation */
+ (Upcalls.lpWPUPostMessage)(Socket->SharedData.hWnd,
+ Socket->SharedData.wMsg,
+ Socket->Handle,
+ WSAMAKESELECTREPLY(FD_CONNECT, 0));
+ /* Disable this event forever; */
+ Socket->SharedData.AsyncDisabledEvents |= FD_CONNECT;
+ }
+ break;
case AFD_EVENT_ACCEPT:
- if ((Socket->SharedData.AsyncEvents & FD_ACCEPT) && (!Socket->SharedData.AsyncDisabledEvents & FD_ACCEPT)) {
+ if (0 != (Socket->SharedData.AsyncEvents & FD_ACCEPT) && 0 == (Socket->SharedData.AsyncDisabledEvents & FD_ACCEPT)) {
/* Make the Notifcation */
(Upcalls.lpWPUPostMessage)(Socket->SharedData.hWnd,
Socket->SharedData.wMsg,
@@ -1597,11 +1908,12 @@
/* Disable this event until the next accept(); */
Socket->SharedData.AsyncDisabledEvents |= FD_ACCEPT;
}
+ break;
case AFD_EVENT_DISCONNECT:
case AFD_EVENT_ABORT:
case AFD_EVENT_CLOSE:
- if ((Socket->SharedData.AsyncEvents & FD_CLOSE) && (!Socket->SharedData.AsyncDisabledEvents & FD_CLOSE)) {
+ if (0 != (Socket->SharedData.AsyncEvents & FD_CLOSE) && 0 == (Socket->SharedData.AsyncDisabledEvents & FD_CLOSE)) {
/* Make the Notifcation */
(Upcalls.lpWPUPostMessage)(Socket->SharedData.hWnd,
Socket->SharedData.wMsg,
@@ -1610,6 +1922,7 @@
/* Disable this event forever; */
Socket->SharedData.AsyncDisabledEvents |= FD_CLOSE;
}
+ break;
/* FIXME: Support QOS */
}
@@ -1659,6 +1972,7 @@
AsyncData->AsyncSelectInfo.Handles[0].Events |= AFD_EVENT_ACCEPT;
}
+ /* FIXME: THIS IS NOT RIGHT!!! HACK HACK HACK! */
if (lNetworkEvents & FD_CONNECT) {
AsyncData->AsyncSelectInfo.Handles[0].Events |= AFD_EVENT_CONNECT | AFD_EVENT_CONNECT_FAIL;
}
@@ -1699,6 +2013,7 @@
VOID SockProcessQueuedAsyncSelect(PVOID Context, PIO_STATUS_BLOCK IoStatusBlock)
{
PASYNC_DATA AsyncData = Context;
+ BOOL FreeContext = TRUE;
PSOCKET_INFORMATION Socket;
/* Get the Socket */
@@ -1711,15 +2026,64 @@
/* Do the actuall select, if needed */
if ((Socket->SharedData.AsyncEvents & (~Socket->SharedData.AsyncDisabledEvents))) {
SockProcessAsyncSelect(Socket, AsyncData);
+ FreeContext = FALSE;
}
}
}
/* Free the Context */
- HeapFree(GetProcessHeap(), 0, AsyncData);
+ if (FreeContext) {
+ HeapFree(GetProcessHeap(), 0, AsyncData);
+ }
+
return;
}
+VOID
+SockReenableAsyncSelectEvent (
+ IN PSOCKET_INFORMATION Socket,
+ IN ULONG Event
+ )
+{
+ PASYNC_DATA AsyncData;
+
+ /* Make sure the event is actually disabled */
+ if (!(Socket->SharedData.AsyncDisabledEvents & Event)) {
+ return;
+ }
+
+ /* Re-enable it */
+ Socket->SharedData.AsyncDisabledEvents &= ~Event;
+
+ /* Return if no more events are being polled */
+ if ((Socket->SharedData.AsyncEvents & (~Socket->SharedData.AsyncDisabledEvents)) == 0 ) {
+ return;
+ }
+
+ /* Wait on new events */
+ AsyncData = HeapAlloc(GetProcessHeap(), 0, sizeof(ASYNC_DATA));
+
+ /* Create the Asynch Thread if Needed */
+ SockCreateOrReferenceAsyncThread();
+
+ /* Increase the sequence number to stop anything else */
+ Socket->SharedData.SequenceNumber++;
+
+ /* Set up the Async Data */
+ AsyncData->ParentSocket = Socket;
+ AsyncData->SequenceNumber = Socket->SharedData.SequenceNumber;
+
+ /* Begin Async Select by using I/O Completion */
+ NtSetIoCompletion(SockAsyncCompletionPort,
+ (PVOID)&SockProcessQueuedAsyncSelect,
+ AsyncData,
+ 0,
+ 0);
+
+ /* All done */
+ return;
+}
+
BOOL
STDCALL
DllMain(HANDLE hInstDll,
reactos/lib/msafd/misc
diff -u -r1.11.2.2 -r1.11.2.3
--- sndrcv.c 13 Dec 2004 09:38:58 -0000 1.11.2.2
+++ sndrcv.c 30 Dec 2004 04:36:39 -0000 1.11.2.3
@@ -33,7 +33,7 @@
Socket = GetSocketStructure(Handle);
/* Allocate the Async Data Structure to pass on to the Thread later */
- HeapAlloc(GetProcessHeap(), 0, sizeof(*AsyncData));
+ AsyncData = HeapAlloc(GetProcessHeap(), 0, sizeof(*AsyncData));
/* Change the Socket to Non Blocking */
BlockMode = 1;
@@ -58,7 +58,7 @@
Socket->SharedData.AsyncDisabledEvents = 0;
Socket->SharedData.SequenceNumber++;
- /* Return if there are no more Events */
+ /* Return if there are no more Events */
if ((Socket->SharedData.AsyncEvents & (~Socket->SharedData.AsyncDisabledEvents)) == 0) {
HeapFree(GetProcessHeap(), 0, AsyncData);
return 0;
@@ -76,7 +76,7 @@
0);
/* Return */
- return 0;
+ return ERROR_SUCCESS;
}
@@ -207,6 +207,13 @@
*ReceiveFlags = MSG_PARTIAL | MSG_OOB; break;
case STATUS_RECEIVE_PARTIAL: *ReceiveFlags = MSG_PARTIAL; break;
}
+
+ /* Re-enable Async Event */
+ if (*ReceiveFlags == MSG_OOB) {
+ SockReenableAsyncSelectEvent(Socket, FD_OOB);
+ } else {
+ SockReenableAsyncSelectEvent(Socket, FD_READ);
+ }
return MsafdReturnWithErrno
( Status, lpErrno, IOSB->Information, lpNumberOfBytesRead );
@@ -337,6 +344,9 @@
case STATUS_RECEIVE_PARTIAL: *ReceiveFlags = MSG_PARTIAL; break;
}
+ /* Re-enable Async Event */
+ SockReenableAsyncSelectEvent(Socket, FD_READ);
+
return MsafdReturnWithErrno
( Status, lpErrno, IOSB->Information, lpNumberOfBytesRead );
}
@@ -448,6 +458,9 @@
return WSA_IO_PENDING;
}
+ /* Re-enable Async Event */
+ SockReenableAsyncSelectEvent(Socket, FD_WRITE);
+
AFD_DbgPrint(MID_TRACE,("Leaving (Success, %d)\n", IOSB->Information));
return MsafdReturnWithErrno
@@ -462,7 +475,7 @@
DWORD dwBufferCount,
LPDWORD lpNumberOfBytesSent,
DWORD iFlags,
- struct sockaddr *SocketAddress,
+ const struct sockaddr *SocketAddress,
int SocketAddressLength,
LPWSAOVERLAPPED lpOverlapped,
LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine,
@@ -572,6 +585,9 @@
if (Status == STATUS_PENDING) {
return WSA_IO_PENDING;
}
+
+ /* Re-enable Async Event */
+ SockReenableAsyncSelectEvent(Socket, FD_WRITE);
return MsafdReturnWithErrno
( Status, lpErrno, IOSB->Information, lpNumberOfBytesSent );
reactos/lib/msafd/misc
diff -u -r1.5 -r1.5.2.1
--- stubs.c 15 Nov 2004 18:24:56 -0000 1.5
+++ stubs.c 30 Dec 2004 04:36:39 -0000 1.5.2.1
@@ -81,27 +81,11 @@
}
-INT
-WSPAPI
-WSPGetSockOpt(
- IN SOCKET s,
- IN INT level,
- IN INT optname,
- OUT CHAR FAR* optval,
- IN OUT LPINT optlen,
- OUT LPINT lpErrno)
-{
- UNIMPLEMENTED
-
- return 0;
-}
-
-
SOCKET
WSPAPI
WSPJoinLeaf(
IN SOCKET s,
- IN CONST LPSOCKADDR name,
+ IN CONST SOCKADDR *name,
IN INT namelen,
IN LPWSABUF lpCallerData,
OUT LPWSABUF lpCalleeData,
reactos/lib/msi
diff -u -r1.3.2.1 -r1.3.2.2
--- action.c 13 Dec 2004 16:18:26 -0000 1.3.2.1
+++ action.c 30 Dec 2004 04:36:39 -0000 1.3.2.2
@@ -28,6 +28,7 @@
#include <stdarg.h>
#include <stdio.h>
+
#include <fcntl.h>
#define COBJMACROS
@@ -2263,7 +2264,7 @@
version = HeapAlloc(GetProcessHeap(),0,versize);
GetFileVersionInfoW(file->TargetPath, 0, versize, version);
- VerQueryValueW(version, (LPWSTR) name, (LPVOID*)&lpVer, &sz);
+ VerQueryValueW(version, name, (LPVOID*)&lpVer, &sz);
sprintfW(filever,name_fmt,
HIWORD(lpVer->dwFileVersionMS),
reactos/lib/msi
diff -u -r1.3.2.1 -r1.3.2.2
--- msi.c 13 Dec 2004 16:18:26 -0000 1.3.2.1
+++ msi.c 30 Dec 2004 04:36:39 -0000 1.3.2.2
@@ -702,7 +702,8 @@
goto end;
MultiByteToWideChar( CP_ACP, 0, szAttribute, -1, szwAttribute, len );
} else {
- return ERROR_INVALID_PARAMETER;
+ hr = ERROR_INVALID_PARAMETER;
+ goto end;
}
if( szBuffer )
@@ -1266,7 +1267,10 @@
len = MultiByteToWideChar( CP_ACP, 0, szComponent, -1, NULL, 0 );
szwComponent= HeapAlloc( GetProcessHeap(), 0, len*sizeof(WCHAR) );
if( !szwComponent)
+ {
+ HeapFree( GetProcessHeap(), 0, szwProduct);
return ERROR_OUTOFMEMORY;
+ }
MultiByteToWideChar( CP_ACP, 0, szComponent, -1, szwComponent, len );
}
@@ -1319,7 +1323,10 @@
len = MultiByteToWideChar( CP_ACP, 0, szFeature, -1, NULL, 0 );
szwFeature= HeapAlloc( GetProcessHeap(), 0, len*sizeof(WCHAR) );
if( !szwFeature)
+ {
+ HeapFree( GetProcessHeap(), 0, szwProduct);
return ERROR_OUTOFMEMORY;
+ }
MultiByteToWideChar( CP_ACP, 0, szFeature, -1, szwFeature, len );
}
@@ -1356,13 +1363,19 @@
if(lpVersionBuf && pcchVersionBuf && *pcchVersionBuf) {
lpwVersionBuff = HeapAlloc(GetProcessHeap(), 0, *pcchVersionBuf * sizeof(WCHAR));
if( !lpwVersionBuff)
- return ERROR_OUTOFMEMORY;
+ {
+ ret = ERROR_OUTOFMEMORY;
+ goto end;
+ }
}
if(lpLangBuf && pcchLangBuf && *pcchLangBuf) {
lpwLangBuff = HeapAlloc(GetProcessHeap(), 0, *pcchVersionBuf * sizeof(WCHAR));
if( !lpwLangBuff)
- return ERROR_OUTOFMEMORY;
+ {
+ ret = ERROR_OUTOFMEMORY;
+ goto end;
+ }
}
ret = MsiGetFileVersionW(szwFilePath, lpwVersionBuff, pcchVersionBuf, lpwLangBuff, pcchLangBuf);
@@ -1372,6 +1385,7 @@
if(lpwLangBuff)
WideCharToMultiByte(CP_ACP, 0, lpwLangBuff, -1, lpLangBuf, *pcchLangBuf, NULL, NULL);
+end:
if(szwFilePath) HeapFree(GetProcessHeap(), 0, szwFilePath);
if(lpwVersionBuff) HeapFree(GetProcessHeap(), 0, lpwVersionBuff);
if(lpwLangBuff) HeapFree(GetProcessHeap(), 0, lpwLangBuff);
@@ -1395,7 +1409,7 @@
lpVersionBuf, pcchVersionBuf?*pcchVersionBuf:0,
lpLangBuf, pcchLangBuf?*pcchLangBuf:0);
- dwVerLen = GetFileVersionInfoSizeW( (LPWSTR) szFilePath, NULL);
+ dwVerLen = GetFileVersionInfoSizeW(szFilePath, NULL);
if(!dwVerLen)
return GetLastError();
@@ -1405,12 +1419,12 @@
goto end;
}
- if(!GetFileVersionInfoW((LPWSTR) szFilePath, 0, dwVerLen, lpVer)) {
+ if(!GetFileVersionInfoW(szFilePath, 0, dwVerLen, lpVer)) {
ret = GetLastError();
goto end;
}
if(lpVersionBuf && pcchVersionBuf && *pcchVersionBuf) {
- if(VerQueryValueW(lpVer, (LPWSTR) szVersionResource, (LPVOID*)&ffi, &puLen) && puLen > 0) {
+ if(VerQueryValueW(lpVer, szVersionResource, (LPVOID*)&ffi, &puLen) && puLen > 0) {
wsprintfW(tmp, szVersionFormat, HIWORD(ffi->dwFileVersionMS), LOWORD(ffi->dwFileVersionMS), HIWORD(ffi->dwFileVersionLS), LOWORD(ffi->dwFileVersionLS));
lstrcpynW(lpVersionBuf, tmp, *pcchVersionBuf);
*pcchVersionBuf = strlenW(lpVersionBuf);
reactos/lib/msi
diff -u -r1.1.2.1 -r1.1.2.2
--- msiquery.c 13 Dec 2004 16:18:26 -0000 1.1.2.1
+++ msiquery.c 30 Dec 2004 04:36:39 -0000 1.1.2.2
@@ -121,6 +121,7 @@
r = MsiDatabaseOpenViewW( hdb, szwQuery, phView);
+ HeapFree( GetProcessHeap(), 0, szwQuery );
return r;
}
reactos/lib/msi
diff -u -r1.1.2.1 -r1.1.2.2
--- record.c 13 Dec 2004 16:18:26 -0000 1.1.2.1
+++ record.c 30 Dec 2004 04:36:39 -0000 1.1.2.2
@@ -534,7 +534,10 @@
count = 0;
r = IStream_Read( stm, buf, *sz, &count );
if( FAILED( r ) )
+ {
+ *sz = 0;
return ERROR_FUNCTION_FAILED;
+ }
*sz = count;
reactos/lib/msi
diff -u -r1.1.2.1 -r1.1.2.2
--- sql.tab.c 13 Dec 2004 16:18:26 -0000 1.1.2.1
+++ sql.tab.c 30 Dec 2004 04:36:39 -0000 1.1.2.2
@@ -221,7 +221,7 @@
static struct expr * EXPR_column( LPWSTR );
static struct expr * EXPR_ival( struct sql_str *);
static struct expr * EXPR_sval( struct sql_str *);
-static struct expr * EXPR_wildcard();
+static struct expr * EXPR_wildcard(void);
#line 73 "./sql.y"
reactos/lib/msi
diff -u -r1.1.2.1 -r1.1.2.2
--- sql.y 13 Dec 2004 16:18:26 -0000 1.1.2.1
+++ sql.y 30 Dec 2004 04:36:39 -0000 1.1.2.2
@@ -64,7 +64,7 @@
static struct expr * EXPR_column( LPWSTR );
static struct expr * EXPR_ival( struct sql_str *);
static struct expr * EXPR_sval( struct sql_str *);
-static struct expr * EXPR_wildcard();
+static struct expr * EXPR_wildcard(void);
%}
reactos/lib/msi
diff -u -r1.2.2.1 -r1.2.2.2
--- suminfo.c 13 Dec 2004 16:18:26 -0000 1.2.2.1
+++ suminfo.c 30 Dec 2004 04:36:39 -0000 1.2.2.2
@@ -118,7 +118,6 @@
ERR("storage = %p propertysetstorage = %p\n", db->storage, psstg);
grfMode = STGM_READ | STGM_SHARE_EXCLUSIVE;
-
r = IPropertySetStorage_Open( psstg, &FMTID_SummaryInformation, grfMode, &ps );
if( FAILED( r ) )
{
reactos/lib/msi
diff -u -r1.3.2.1 -r1.3.2.2
--- table.c 13 Dec 2004 16:18:26 -0000 1.3.2.1
+++ table.c 30 Dec 2004 04:36:39 -0000 1.3.2.2
@@ -466,8 +466,8 @@
t->data[i][ofs] = rawdata[ofs*t->row_count + i ];
break;
case 4:
- t->data[i][ofs] = rawdata[ofs*t->row_count + i ];
- t->data[i][ofs+1] = rawdata[ofs*t->row_count + i + 1];
+ t->data[i][ofs] = rawdata[ofs*t->row_count + i*2 ];
+ t->data[i][ofs+1] = rawdata[ofs*t->row_count + i*2 + 1];
break;
default:
ERR("oops - unknown column width %d\n", n);
@@ -1203,7 +1203,10 @@
else
p = HeapAlloc( GetProcessHeap(), 0, sz );
if( !p )
+ {
+ HeapFree( GetProcessHeap(), 0, row );
return ERROR_NOT_ENOUGH_MEMORY;
+ }
tv->table->data = p;
tv->table->data[tv->table->row_count] = row;
reactos/lib/msvcrt
diff -u -r1.48.6.3 -r1.48.6.4
--- Makefile 13 Dec 2004 16:18:07 -0000 1.48.6.3
+++ Makefile 30 Dec 2004 04:36:40 -0000 1.48.6.4
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.48.6.3 2004/12/13 16:18:07 hyperion Exp $
+# $Id: Makefile,v 1.48.6.4 2004/12/30 04:36:40 hyperion Exp $
PATH_TO_TOP = ../..
reactos/lib/msvcrt
diff -u -r1.36 -r1.36.6.1
--- msvcrt.def 27 Aug 2004 03:08:23 -0000 1.36
+++ msvcrt.def 30 Dec 2004 04:36:40 -0000 1.36.6.1
@@ -1,4 +1,4 @@
-; $Id: msvcrt.def,v 1.36 2004/08/27 03:08:23 navaraf Exp $
+; $Id: msvcrt.def,v 1.36.6.1 2004/12/30 04:36:40 hyperion Exp $
;
; ReactOS MSVCRT Compatibility Library
;
@@ -119,9 +119,9 @@
__isascii
__iscsym
__iscsymf
-;__lc_codepage
+__lc_codepage
__lc_collate_cp
-;__lc_handle
+__lc_handle
;__lconv_init
__mb_cur_max DATA
__p___argc
@@ -156,14 +156,14 @@
__pioinfo
;__pxcptinfoptrs
__set_app_type
-;__setlc_active
+__setlc_active DATA
__setusermatherr
__threadhandle
__threadid
__toascii
__unDName
;__unDNameEx
-;__unguarded_readlc_active
+__unguarded_readlc_active DATA
__wargv
__wgetmainargs
__winitenv
@@ -183,15 +183,15 @@
_access
_acmdln DATA
;_adj_fdiv_m16i
-;_adj_fdiv_m32
-;_adj_fdiv_m32i
-;_adj_fdiv_m64
-;_adj_fdiv_r
+_adj_fdiv_m32 = _adj_fdiv_m32@4
+_adj_fdiv_m32i = _adj_fdiv_m32i@4
+_adj_fdiv_m64 = _adj_fdiv_m64@8
+_adj_fdiv_r
;_adj_fdivr_m16i
-;_adj_fdivr_m32
-;_adj_fdivr_m32i
-;_adj_fdivr_m64
-;_adj_fpatan
+_adj_fdivr_m32 = _adj_fdivr_m32@4
+_adj_fdivr_m32i = _adj_fdivr_m32i@4
+_adj_fdivr_m64 = _adj_fdivr_m64@8
+_adj_fpatan
;_adj_fprem
;_adj_fprem1
;_adj_fptan
reactos/lib/msvcrt/ctype
diff -u -r1.6 -r1.6.34.1
--- tolower.c 11 Jul 2003 21:57:54 -0000 1.6
+++ tolower.c 30 Dec 2004 04:36:40 -0000 1.6.34.1
@@ -16,8 +16,7 @@
/*
* @implemented
*/
-int towlower(wint_t c)
-//wchar_t towlower(wchar_t c)
+wchar_t towlower(wchar_t c)
{
if (iswctype (c, _UPPER))
return (c - (L'A' - L'a'));
reactos/lib/msvcrt/ctype
diff -u -r1.7 -r1.7.34.1
--- toupper.c 11 Jul 2003 21:57:54 -0000 1.7
+++ toupper.c 30 Dec 2004 04:36:40 -0000 1.7.34.1
@@ -17,7 +17,7 @@
/*
* @implemented
*/
-int towupper(wint_t c)
+wchar_t towupper(wchar_t c)
{
if (iswctype (c, _LOWER))
return (c + (L'A' - L'a'));
reactos/lib/msvcrt/locale
diff -u -r1.8 -r1.8.8.1
--- locale.c 15 Aug 2004 18:16:36 -0000 1.8
+++ locale.c 30 Dec 2004 04:36:40 -0000 1.8.8.1
@@ -9,6 +9,8 @@
#define NDEBUG
#include <msvcrt/msvcrtdbg.h>
+unsigned int __setlc_active;
+unsigned int __unguarded_readlc_active;
int _current_category; /* used by setlocale */
const char *_current_locale;
@@ -175,3 +177,27 @@
DPRINT1("__lc_collate_cp - stub\n");
return;
}
+
+
+/*********************************************************************
+ * __lc_handle (MSVCRT.@)
+ *
+ * @unimplemented
+ */
+void __lc_handle(void)
+{
+DPRINT1("__lc_handle - stub\n");
+return;
+}
+
+
+/*********************************************************************
+ * __lc_codepage (MSVCRT.@)
+ *
+ * @unimplemented
+ */
+void __lc_codepage(void)
+{
+DPRINT1("__lc_codepage - stub\n");
+return;
+}
reactos/lib/msvcrt/mbstring
diff -u -r1.4 -r1.4.34.1
--- iskmoji.c 29 Nov 2002 15:59:03 -0000 1.4
+++ iskmoji.c 30 Dec 2004 04:36:40 -0000 1.4.34.1
@@ -2,5 +2,5 @@
int _ismbbkalpha(unsigned char c)
{
- return (0xA7 <= c <= 0xDF);
+ return (0xA7 <= c && c <= 0xDF);
}
reactos/lib/msvcrt/mbstring
diff -u -r1.5 -r1.5.34.1
--- mbclen.c 11 Jul 2003 21:57:54 -0000 1.5
+++ mbclen.c 30 Dec 2004 04:36:40 -0000 1.5.34.1
@@ -26,7 +26,7 @@
if ( s == NULL )
return 0;
- l = _mbclen(s);
+ l = _mbclen((const unsigned char *)s);
if ( l < count )
return -1;
return l;
reactos/lib/msvcrt/mbstring
diff -u -r1.5 -r1.5.34.1
--- mbscat.c 11 Jul 2003 21:57:54 -0000 1.5
+++ mbscat.c 30 Dec 2004 04:36:40 -0000 1.5.34.1
@@ -5,5 +5,5 @@
*/
unsigned char * _mbscat(unsigned char *dst, const unsigned char *src)
{
- return strcat(dst,src);
+ return (unsigned char *)strcat((char*)dst,(const char*)src);
}
reactos/lib/msvcrt/mbstring
diff -u -r1.5 -r1.5.34.1
--- mbschr.c 11 Jul 2003 21:57:54 -0000 1.5
+++ mbschr.c 30 Dec 2004 04:36:40 -0000 1.5.34.1
@@ -5,5 +5,5 @@
*/
unsigned char * _mbschr(const unsigned char *str, unsigned int c)
{
- return strchr(str,c);
+ return (unsigned char *)strchr((const char*)str, c);
}
reactos/lib/msvcrt/mbstring
diff -u -r1.5 -r1.5.34.1
--- mbscmp.c 11 Jul 2003 21:57:54 -0000 1.5
+++ mbscmp.c 30 Dec 2004 04:36:40 -0000 1.5.34.1
@@ -6,5 +6,5 @@
*/
int _mbscmp(const unsigned char *str1, const unsigned char *str2)
{
- return strcmp(str1,str2);
+ return strcmp((const char*)str1, (char*)str2);
}
reactos/lib/msvcrt/mbstring
diff -u -r1.5 -r1.5.34.1
--- mbscpy.c 11 Jul 2003 21:57:54 -0000 1.5
+++ mbscpy.c 30 Dec 2004 04:36:40 -0000 1.5.34.1
@@ -6,5 +6,5 @@
*/
unsigned char * _mbscpy(unsigned char *dst, const unsigned char *str)
{
- return strcpy(dst,str);
+ return (unsigned char*)strcpy((char*)dst,(const char*)str);
}
reactos/lib/msvcrt/mbstring
diff -u -r1.4 -r1.4.34.1
--- mbscspn.c 11 Jul 2003 21:57:54 -0000 1.4
+++ mbscspn.c 30 Dec 2004 04:36:40 -0000 1.4.34.1
@@ -7,7 +7,7 @@
*/
size_t _mbscspn(const unsigned char *s1, const unsigned char *s2)
{
- const char *p, *spanp;
+ const unsigned char *p, *spanp;
char c, sc;
for (p = s1;;)
reactos/lib/msvcrt/mbstring
diff -u -r1.6 -r1.6.34.1
--- mbsdup.c 11 Jul 2003 21:57:54 -0000 1.6
+++ mbsdup.c 30 Dec 2004 04:36:40 -0000 1.6.34.1
@@ -17,10 +17,10 @@
*/
unsigned char * _mbsdup(const unsigned char *_s)
{
- char *rv;
+ unsigned char *rv;
if (_s == 0)
return 0;
- rv = (char *)malloc(_mbslen(_s) + 1);
+ rv = (unsigned char *)malloc(_mbslen(_s) + 1);
if (rv == 0)
return 0;
_mbscpy(rv, _s);
reactos/lib/msvcrt/mbstring
diff -u -r1.7 -r1.7.34.1
--- mbsncat.c 11 Jul 2003 21:57:54 -0000 1.7
+++ mbsncat.c 30 Dec 2004 04:36:40 -0000 1.7.34.1
@@ -18,10 +18,10 @@
*/
unsigned char * _mbsncat(unsigned char *dst, const unsigned char *src, size_t n)
{
- char *d = (char *)dst;
- char *s = (char *)src;
+ unsigned char *d = dst;
+ const unsigned char *s = src;
if (n != 0) {
- d = dst + strlen(dst); // get the end of string
+ d = dst + _mbslen(dst); // get the end of string
d += _mbclen2(*d); // move 1 or 2 up
do {
@@ -43,10 +43,10 @@
*/
unsigned char * _mbsnbcat(unsigned char *dst, const unsigned char *src, size_t n)
{
- char *d;
- char *s = (char *)src;
+ unsigned char *d;
+ const unsigned char *s = src;
if (n != 0) {
- d = dst + strlen(dst); // get the end of string
+ d = dst + _mbslen(dst); // get the end of string
d += _mbclen2(*d); // move 1 or 2 up
do {
reactos/lib/msvcrt/mbstring
diff -u -r1.5 -r1.5.34.1
--- mbsspn.c 11 Jul 2003 21:58:09 -0000 1.5
+++ mbsspn.c 30 Dec 2004 04:36:40 -0000 1.5.34.1
@@ -7,7 +7,7 @@
*/
size_t _mbsspn(const unsigned char *s1, const unsigned char *s2)
{
- const char *p = s1, *spanp;
+ const unsigned char *p = s1, *spanp;
char c, sc;
cont:
reactos/lib/msvcrt/mbstring
diff -u -r1.5 -r1.5.34.1
--- mbsspnp.c 11 Jul 2003 21:58:09 -0000 1.5
+++ mbsspnp.c 30 Dec 2004 04:36:40 -0000 1.5.34.1
@@ -7,7 +7,7 @@
*/
unsigned char * _mbsspnp(const unsigned char *s1, const unsigned char *s2)
{
- const char *p = s1, *spanp;
+ const unsigned char *p = s1, *spanp;
char c, sc;
cont:
reactos/lib/msvcrt/mbstring
diff -u -r1.5 -r1.5.34.1
--- mbsstr.c 11 Jul 2003 21:58:09 -0000 1.5
+++ mbsstr.c 30 Dec 2004 04:36:40 -0000 1.5.34.1
@@ -11,7 +11,7 @@
if (src2 ==NULL || *src2 == 0)
return (unsigned char *)src1;
- len = _mbstrlen(src2);
+ len = _mbslen(src2);
while(*src1)
{
reactos/lib/msvcrt/mbstring
diff -u -r1.6 -r1.6.34.1
--- mbstok.c 11 Jul 2003 21:58:09 -0000 1.6
+++ mbstok.c 30 Dec 2004 04:36:40 -0000 1.6.34.1
@@ -5,10 +5,10 @@
*/
unsigned char * _mbstok(unsigned char *s, unsigned char *delim)
{
- const char *spanp;
+ const unsigned char *spanp;
int c, sc;
- char *tok;
- static char *last;
+ unsigned char *tok;
+ static unsigned char *last;
if (s == NULL && (s = last) == NULL)
reactos/lib/msvcrt/misc
diff -u -r1.11 -r1.11.6.1
--- environ.c 31 Aug 2004 14:40:50 -0000 1.11
+++ environ.c 30 Dec 2004 04:36:40 -0000 1.11.6.1
@@ -1,4 +1,4 @@
-/* $Id: environ.c,v 1.11 2004/08/31 14:40:50 hbirr Exp $
+/* $Id: environ.c,v 1.11.6.1 2004/12/30 04:36:40 hyperion Exp $
*
* dllmain.c
*
@@ -56,7 +56,7 @@
count++;
}
- _environ = HeapAlloc(GetProcessHeap(), 0, count * sizeof(char*));
+ _environ = malloc(count * sizeof(char*));
if (_environ)
{
for (ptr = environment_strings, envptr = _environ; count > 1; ptr += len)
@@ -70,7 +70,7 @@
for (envptr--; envptr >= _environ; envptr--);
free(*envptr);
FreeEnvironmentStringsA(environment_strings);
- HeapFree(GetProcessHeap(), 0, _environ);
+ free(_environ);
return -1;
}
memcpy(*envptr++, ptr, len);
@@ -106,7 +106,7 @@
count++;
}
- _wenviron = HeapAlloc(GetProcessHeap(), 0, count * sizeof(wchar_t*));
+ _wenviron = malloc(count * sizeof(wchar_t*));
if (_wenviron)
{
for (ptr = environment_strings, envptr = _wenviron; count > 1; ptr += len)
@@ -120,7 +120,7 @@
for (envptr--; envptr >= _wenviron; envptr--);
free(*envptr);
FreeEnvironmentStringsW(environment_strings);
- HeapFree(GetProcessHeap(), 0, _wenviron);
+ free(_wenviron);
return -1;
}
memcpy(*envptr++, ptr, len * sizeof(wchar_t));
@@ -156,7 +156,7 @@
for (envptr = original_environment; *envptr != NULL; envptr++, count++)
;
- newenvptr = newenv = HeapAlloc(GetProcessHeap(), 0, count * sizeof(char*));
+ newenvptr = newenv = malloc(count * sizeof(char*));
if (newenv == NULL)
return original_environment;
@@ -170,7 +170,7 @@
{
for (newenvptr--; newenvptr >= newenv; newenvptr--);
free(*newenvptr);
- HeapFree(GetProcessHeap(), 0, newenv);
+ free(newenv);
return original_environment;
}
}
@@ -191,7 +191,7 @@
char **envptr;
for (envptr = environment; *envptr != NULL; envptr++)
free(*envptr);
- HeapFree(GetProcessHeap(), 0, environment);
+ free(environment);
}
/**
@@ -260,8 +260,7 @@
free(*wenvptr);
for (count = index; *wenvptr != NULL; wenvptr++, count++)
*wenvptr = *(wenvptr + 1);
- _wenviron = HeapReAlloc(GetProcessHeap(), 0, _wenviron,
- count * sizeof(wchar_t*));
+ _wenviron = realloc(_wenviron, count * sizeof(wchar_t*));
/* Remove the option from multibyte environment. We assume
* the environments are in sync and the option is at the
@@ -269,8 +268,7 @@
free(_environ[index]);
for (; _environ[index] != NULL; index++)
_environ[index] = _environ[index + 1];
- _environ = HeapReAlloc(GetProcessHeap(), 0, _environ,
- count * sizeof(char*));
+ _environ = realloc(_environ, count * sizeof(char*));
result = SetEnvironmentVariableW(name, NULL) ? 0 : -1;
}
@@ -313,8 +311,7 @@
;
/* Create a new entry. */
- if ((wnewenv = HeapReAlloc(GetProcessHeap(), 0, _wenviron,
- (count + 2) * sizeof(wchar_t*))) == NULL)
+ if ((wnewenv = realloc(_wenviron, (count + 2) * sizeof(wchar_t*))) == NULL)
{
free(name);
free(mboption);
@@ -322,8 +319,7 @@
return -1;
}
_wenviron = wnewenv;
- if ((mbnewenv = HeapReAlloc(GetProcessHeap(), 0, _environ,
- (count + 2) * sizeof(char*))) == NULL)
+ if ((mbnewenv = realloc(_environ, (count + 2) * sizeof(char*))) == NULL)
{
free(name);
free(mboption);
reactos/lib/msvcrt/misc
diff -u -r1.6 -r1.6.28.1
--- initterm.c 14 Nov 2003 17:13:31 -0000 1.6
+++ initterm.c 30 Dec 2004 04:36:40 -0000 1.6.28.1
@@ -18,22 +18,3 @@
i++;
}
}
-
-
-typedef int (* _onexit_t)(void);
-
-/*
- * @unimplemented
- */
-_onexit_t __dllonexit(_onexit_t func, void (** fStart[])(void), void (** fEnd[])(void))
-{
- return 0;
-}
-
-/*
- * @unimplemented
- */
-_onexit_t _onexit(_onexit_t x)
-{
- return x;
-}
reactos/lib/msvcrt/misc
diff -u -r1.1.2.1 -r1.1.2.2
--- stubs.c 13 Dec 2004 09:39:27 -0000 1.1.2.1
+++ stubs.c 30 Dec 2004 04:36:40 -0000 1.1.2.2
@@ -1,5 +1,8 @@
#include "precomp.h"
+#define NDEBUG
+#include <msvcrt/msvcrtdbg.h>
+
/*********************************************************************
* $I10_OUTPUT (MSVCRT.@)
* Function not really understood but needed to make the DLL work
@@ -8,3 +11,103 @@
{
/* FIXME: This is probably data, not a function */
}
+
+/***********************************************************************
+ * _adj_fdiv_m32 (MSVCRT.@)
+ *
+ * NOTE
+ * I _think_ this function is intended to work around the Pentium
+ * fdiv bug.
+ */
+void __stdcall _adj_fdiv_m32( unsigned int arg )
+{
+ DPRINT1("_adj_fdiv_m32 stub\n");
+}
+
+/***********************************************************************
+ * _adj_fdiv_m32i (MSVCRT.@)
+ *
+ * NOTE
+ * I _think_ this function is intended to work around the Pentium
+ * fdiv bug.
+ */
+void __stdcall _adj_fdiv_m32i( int arg )
+{
+ DPRINT1("_adj_fdiv_m32i stub\n");
+}
+
+/***********************************************************************
+ * _adj_fdiv_m64 (MSVCRT.@)
+ *
+ * NOTE
+ * I _think_ this function is intended to work around the Pentium
+ * fdiv bug.
+ */
+void __stdcall _adj_fdiv_m64( unsigned __int64 arg )
+{
+ DPRINT1("_adj_fdiv_m64 stub\n");
+}
+
+/***********************************************************************
+ * _adj_fdiv_r (MSVCRT.@)
+ * FIXME
+ * This function is likely to have the wrong number of arguments.
+ *
+ * NOTE
+ * I _think_ this function is intended to work around the Pentium
+ * fdiv bug.
+ */
+void _adj_fdiv_r(void)
+{
+ DPRINT1("_adj_fdiv_r stub\n");
+}
+
+/***********************************************************************
+ * _adj_fdivr_m32 (MSVCRT.@)
+ *
+ * NOTE
+ * I _think_ this function is intended to work around the Pentium
+ * fdiv bug.
+ */
+void __stdcall _adj_fdivr_m32( unsigned int arg )
+{
+ DPRINT1("_adj_fdivr_m32i stub\n");
+}
+
+/***********************************************************************
+ * _adj_fdivr_m32i (MSVCRT.@)
+ *
+ * NOTE
+ * I _think_ this function is intended to work around the Pentium
+ * fdiv bug.
+ */
+void __stdcall _adj_fdivr_m32i( int arg )
+{
+ DPRINT1("_adj_fdivr_m32i stub\n");
+}
+
+/***********************************************************************
+ * _adj_fdivr_m64 (MSVCRT.@)
+ *
+ * NOTE
+ * I _think_ this function is intended to work around the Pentium
+ * fdiv bug.
+ */
+void __stdcall _adj_fdivr_m64( unsigned __int64 arg )
+{
+ DPRINT1("_adj_fdivr_m64 stub\n");
+}
+
+/***********************************************************************
+ * _adj_fpatan (MSVCRT.@)
+ * FIXME
+ * This function is likely to have the wrong number of arguments.
+ *
+ * NOTE
+ * I _think_ this function is intended to work around the Pentium
+ * fdiv bug.
+ */
+void _adj_fpatan(void)
+{
+ DPRINT1("_adj_fpatan stub\n");
+}
reactos/lib/msvcrt/setjmp/i386
diff -u -r1.1.34.3 -r1.1.34.4
--- setjmp.s 13 Dec 2004 16:18:07 -0000 1.1.34.3
+++ setjmp.s 30 Dec 2004 04:36:40 -0000 1.1.34.4
@@ -1,4 +1,4 @@
-/* $Id: setjmp.s,v 1.1.34.3 2004/12/13 16:18:07 hyperion Exp $
+/* $Id: setjmp.s,v 1.1.34.4 2004/12/30 04:36:40 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
reactos/lib/msvcrt/stdio
diff -u -r1.8 -r1.8.8.1
--- fputs.c 15 Aug 2004 18:16:38 -0000 1.8
+++ fputs.c 30 Dec 2004 04:36:41 -0000 1.8.8.1
@@ -1,4 +1,4 @@
-/* $Id: fputs.c,v 1.8 2004/08/15 18:16:38 chorns Exp $
+/* $Id: fputs.c,v 1.8.8.1 2004/12/30 04:36:41 hyperion Exp $
*
* ReactOS msvcrt library
*
@@ -76,7 +76,7 @@
if (unbuffered)
{
f->_flag &= ~_IONBF;
- f->_ptr = f->_base = (unsigned char*)localbuf;
+ f->_ptr = f->_base = (char*)localbuf;
f->_bufsiz = BUFSIZ;
}
reactos/lib/msvcrt/stdio
diff -u -r1.20 -r1.20.8.1
--- vfprintf.c 22 Aug 2004 20:32:32 -0000 1.20
+++ vfprintf.c 30 Dec 2004 04:36:41 -0000 1.20.8.1
@@ -723,7 +723,7 @@
long double _ldouble;
double _double;
const char *s;
- const short int* sw;
+ const wchar_t *sw;
int result, done = 0;
int flags; /* flags to number() */
reactos/lib/msvcrt/stdio
diff -u -r1.7 -r1.7.34.1
--- vsprintf.c 7 Aug 2003 09:08:45 -0000 1.7
+++ vsprintf.c 30 Dec 2004 04:36:41 -0000 1.7.34.1
@@ -13,7 +13,7 @@
FILE f;
int len;
- f._flag = _IOWRT|_IOSTRG|_IOBINARY;;
+ f._flag = _IOWRT|_IOSTRG|_IOBINARY;
f._ptr = str;
f._cnt = INT_MAX;
f._file = -1;
reactos/lib/msvcrt/stdio
diff -u -r1.4 -r1.4.34.1
--- vsscanf.c 8 Sep 2002 10:22:57 -0000 1.4
+++ vsscanf.c 30 Dec 2004 04:36:41 -0000 1.4.34.1
@@ -39,7 +39,7 @@
memset((void *) &f, 0, sizeof (f));
- f._flag = _IOREAD;
+ f._flag = _IOREAD|_IOSTRG|_IOBINARY;
f._ptr = (char *)s;
f._base = (char *)s;
f._bufsiz = strlen(s);
reactos/lib/msvcrt/stdlib
diff -u -r1.6 -r1.6.34.1
--- atexit.c 11 Jul 2003 21:58:09 -0000 1.6
+++ atexit.c 30 Dec 2004 04:36:41 -0000 1.6.34.1
@@ -2,20 +2,58 @@
#include <msvcrt/stdlib.h>
#include <msvcrt/internal/atexit.h>
+typedef int (* _onexit_t)(void);
+
/*
* @implemented
+ *
+ * Ported from WINE
+ * Copyright (C) 2000 Jon Griffiths
*/
-int
-atexit(void (*a)(void))
+_onexit_t __dllonexit(_onexit_t func, _onexit_t **start, _onexit_t **end)
+{
+ _onexit_t *tmp;
+ int len;
+
+ if (!start || !*start || !end || !*end)
+ return NULL;
+
+ len = (*end - *start);
+ if (++len <= 0)
+ return NULL;
+
+ tmp = (_onexit_t *)realloc(*start, len * sizeof(tmp));
+ if (!tmp)
+ return NULL;
+
+ *start = tmp;
+ *end = tmp + len;
+ tmp[len - 1] = func;
+
+ return func;
+}
+
+/*
+ * @implemented
+ */
+_onexit_t _onexit(_onexit_t a)
{
struct __atexit *ap;
if (a == 0)
- return -1;
+ return NULL;
ap = (struct __atexit *)malloc(sizeof(struct __atexit));
if (!ap)
- return -1;
+ return NULL;
ap->__next = __atexit_ptr;
- ap->__function = a;
+ ap->__function = (void (*)(void))a;
__atexit_ptr = ap;
- return 0;
+ return a;
+}
+
+/*
+ * @implemented
+ */
+int atexit(void (*a)(void))
+{
+ return _onexit((_onexit_t)a) == (_onexit_t)a ? 0 : -1;
}
reactos/lib/msvcrt/stdlib
diff -u -r1.5 -r1.5.34.1
--- swab.c 11 Jul 2003 21:58:09 -0000 1.5
+++ swab.c 30 Dec 2004 04:36:41 -0000 1.5.34.1
@@ -1,4 +1,3 @@
-/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#include <msvcrt/stdlib.h>
/*
@@ -6,16 +5,14 @@
*/
void _swab (const char* caFrom, char* caTo, size_t sizeToCopy)
{
- unsigned long temp;
+ if (sizeToCopy > 1)
+ {
+ sizeToCopy = sizeToCopy >> 1;
- sizeToCopy >>= 1; sizeToCopy++;
-#define STEP temp = *((const char *)caFrom)++,*((char *)caTo)++ = *((const char *)caFrom)++,*((char *)caTo)++ = temp
- /* round to multiple of 8 */
- while ((--sizeToCopy) & 07)
- STEP;
- sizeToCopy >>= 3;
- while (--sizeToCopy >= 0) {
- STEP; STEP; STEP; STEP;
- STEP; STEP; STEP; STEP;
+ while (sizeToCopy--) {
+ *caTo++ = caFrom[1];
+ *caTo++ = *caFrom++;
+ caFrom++;
+ }
}
}
reactos/lib/msvideo
diff -u -r1.1.8.3 -r1.1.8.4
--- Makefile.ros-template 13 Dec 2004 16:18:07 -0000 1.1.8.3
+++ Makefile.ros-template 30 Dec 2004 04:36:41 -0000 1.1.8.4
@@ -1,4 +1,4 @@
-# $Id: Makefile.ros-template,v 1.1.8.3 2004/12/13 16:18:07 hyperion Exp $
+# $Id: Makefile.ros-template,v 1.1.8.4 2004/12/30 04:36:41 hyperion Exp $
TARGET_NAME = msvfw32
reactos/lib/netapi32
diff -u -r1.3.16.3 -r1.3.16.4
--- Makefile.ros-template 13 Dec 2004 16:18:07 -0000 1.3.16.3
+++ Makefile.ros-template 30 Dec 2004 04:36:41 -0000 1.3.16.4
@@ -1,4 +1,4 @@
-# $Id: Makefile.ros-template,v 1.3.16.3 2004/12/13 16:18:07 hyperion Exp $
+# $Id: Makefile.ros-template,v 1.3.16.4 2004/12/30 04:36:41 hyperion Exp $
TARGET_NAME = netapi32
reactos/lib/ntdll/csr
diff -u -r1.13 -r1.13.10.1
--- lpc.c 3 Jul 2004 17:13:09 -0000 1.13
+++ lpc.c 30 Dec 2004 04:36:41 -0000 1.13.10.1
@@ -1,4 +1,4 @@
-/* $Id: lpc.c,v 1.13 2004/07/03 17:13:09 hbirr Exp $
+/* $Id: lpc.c,v 1.13.10.1 2004/12/30 04:36:41 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
reactos/lib/ntdll/def
diff -u -r1.134.2.3 -r1.134.2.4
--- ntdll.def 13 Dec 2004 16:18:07 -0000 1.134.2.3
+++ ntdll.def 30 Dec 2004 04:36:41 -0000 1.134.2.4
@@ -1,4 +1,4 @@
-; $Id: ntdll.def,v 1.134.2.3 2004/12/13 16:18:07 hyperion Exp $
+; $Id: ntdll.def,v 1.134.2.4 2004/12/30 04:36:41 hyperion Exp $
;
; ReactOS Operating System
;
reactos/lib/ntdll/ldr
diff -u -r1.59 -r1.59.2.1
--- startup.c 21 Nov 2004 21:09:42 -0000 1.59
+++ startup.c 30 Dec 2004 04:36:41 -0000 1.59.2.1
@@ -1,4 +1,4 @@
-/* $Id: startup.c,v 1.59 2004/11/21 21:09:42 weiden Exp $
+/* $Id: startup.c,v 1.59.2.1 2004/12/30 04:36:41 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -375,11 +375,11 @@
InsertTailList(&Peb->Ldr->InInitializationOrderModuleList,
&NtModule->InInitializationOrderModuleList);
-#ifdef KDBG
+#if defined(DBG) || defined(KDBG)
LdrpLoadUserModuleSymbols(NtModule);
-#endif /* DBG */
+#endif /* DBG || KDBG */
/* add entry for executable (becomes first list entry) */
ExeModule = (PLDR_MODULE)RtlAllocateHeap (Peb->ProcessHeap,
@@ -423,11 +423,11 @@
LdrpInitLoader();
-#ifdef KDBG
+#if defined(DBG) || defined(KDBG)
LdrpLoadUserModuleSymbols(ExeModule);
-#endif /* DBG */
+#endif /* DBG || KDBG */
EntryPoint = LdrPEStartup((PVOID)ImageBase, NULL, NULL, NULL);
ExeModule->EntryPoint = (ULONG)EntryPoint;
reactos/lib/ntdll/ldr
diff -u -r1.101.2.2 -r1.101.2.3
--- utils.c 30 Dec 2004 01:59:58 -0000 1.101.2.2
+++ utils.c 30 Dec 2004 04:36:41 -0000 1.101.2.3
@@ -1,4 +1,4 @@
-/* $Id: utils.c,v 1.101.2.2 2004/12/30 01:59:58 hyperion Exp $
+/* $Id: utils.c,v 1.101.2.3 2004/12/30 04:36:41 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -68,7 +68,7 @@
/* FUNCTIONS *****************************************************************/
-#ifdef KDBG
+#if defined(DBG) || defined(KDBG)
VOID
LdrpLoadUserModuleSymbols(PLDR_MODULE LdrModule)
@@ -82,7 +82,7 @@
NULL);
}
-#endif /* DBG */
+#endif /* DBG || KDBG */
static inline LONG LdrpDecrementLoadCount(PLDR_MODULE Module, BOOL Locked)
{
@@ -974,7 +974,7 @@
DPRINT("BaseAddress: %p\n", Module->BaseAddress);
- return LdrGetExportByName(Module->BaseAddress, p+1, -1);
+ return LdrGetExportByName(Module->BaseAddress, (PUCHAR)(p+1), -1);
}
return NULL;
@@ -1110,7 +1110,7 @@
if (Hint < ExportDir->NumberOfNames)
{
ExName = RVA(BaseAddress, ExNames[Hint]);
- if (strcmp(ExName, SymbolName) == 0)
+ if (strcmp(ExName, (PCHAR)SymbolName) == 0)
{
Ordinal = ExOrdinals[Hint];
Function = RVA(BaseAddress, ExFunctions[Ordinal]);
@@ -1143,7 +1143,7 @@
mid = (minn + maxn) / 2;
ExName = RVA(BaseAddress, ExNames[mid]);
- res = strcmp(ExName, SymbolName);
+ res = strcmp(ExName, (PCHAR)SymbolName);
if (res == 0)
{
Ordinal = ExOrdinals[mid];
@@ -1184,7 +1184,7 @@
for (i = 0; i < ExportDir->NumberOfNames; i++)
{
ExName = RVA(BaseAddress, ExNames[i]);
- if (strcmp(ExName,SymbolName) == 0)
+ if (strcmp(ExName, (PCHAR)SymbolName) == 0)
{
Ordinal = ExOrdinals[i];
Function = RVA(BaseAddress, ExFunctions[Ordinal]);
@@ -1504,7 +1504,7 @@
static NTSTATUS
LdrpAdjustImportDirectory(PLDR_MODULE Module,
PLDR_MODULE ImportedModule,
- PUCHAR ImportedName)
+ PCHAR ImportedName)
{
PIMAGE_IMPORT_MODULE_DIRECTORY ImportModuleDirectory;
NTSTATUS Status;
@@ -1535,7 +1535,7 @@
while (ImportModuleDirectory->dwRVAModuleName)
{
Name = (PCHAR)Module->BaseAddress + ImportModuleDirectory->dwRVAModuleName;
- if (0 == _stricmp(Name, ImportedName))
+ if (0 == _stricmp(Name, (PCHAR)ImportedName))
{
/* Get the import address list. */
@@ -1727,7 +1727,7 @@
PIMAGE_BOUND_FORWARDER_REF BoundForwarderRef;
ULONG i;
PLDR_MODULE ForwarderModule;
- PUCHAR ForwarderName;
+ PCHAR ForwarderName;
BoundForwarderRef = (PIMAGE_BOUND_FORWARDER_REF)(BoundImportDescriptorCurrent + 1);
for (i = 0; i < BoundImportDescriptorCurrent->NumberOfModuleForwarderRefs; i++, BoundForwarderRef++)
@@ -2017,7 +2017,6 @@
{
DPRINT1("Failed to create or open dll section of '%wZ' (Status %lx)\n", &AdjustedName, Status);
RtlFreeUnicodeString(&AdjustedName);
- RtlFreeUnicodeString(&FullDosName);
return Status;
}
RtlFreeUnicodeString(&AdjustedName);
@@ -2085,9 +2084,9 @@
DPRINT1("LdrFixupImports failed for %wZ, status=%x\n", &(*Module)->BaseDllName, Status);
return Status;
}
-#ifdef KDBG
+#if defined(DBG) || defined(KDBG)
LdrpLoadUserModuleSymbols(*Module);
-#endif
+#endif /* DBG || KDBG */
RtlEnterCriticalSection(NtCurrentPeb()->LoaderLock);
InsertTailList(&NtCurrentPeb()->Ldr->InInitializationOrderModuleList,
&(*Module)->InInitializationOrderModuleList);
@@ -2320,7 +2319,7 @@
if (Name && Name->Length)
{
/* by name */
- *ProcedureAddress = LdrGetExportByName(BaseAddress, Name->Buffer, 0xffff);
+ *ProcedureAddress = LdrGetExportByName(BaseAddress, (PUCHAR)Name->Buffer, 0xffff);
if (*ProcedureAddress != NULL)
{
return STATUS_SUCCESS;
reactos/lib/ntdll/rtl
diff -u -r1.10 -r1.10.8.1
--- misc.c 5 Aug 2004 18:17:36 -0000 1.10
+++ misc.c 30 Dec 2004 04:36:42 -0000 1.10.8.1
@@ -1,4 +1,4 @@
-/* $Id: misc.c,v 1.10 2004/08/05 18:17:36 ion Exp $
+/* $Id: misc.c,v 1.10.8.1 2004/12/30 04:36:42 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -84,7 +84,10 @@
if (minor)
{
- *minor = pPeb->OSMinorVersion;
+ if (pPeb->OSMinorVersion <= 5)
+ *minor = pPeb->OSMinorVersion < 1 ? 1 : pPeb->OSMinorVersion;
+ else
+ *minor = pPeb->OSMinorVersion;
}
if (build)
reactos/lib/ntdll/rtl
diff -u -r1.29.8.3 -r1.29.8.4
--- path.c 13 Dec 2004 16:18:07 -0000 1.29.8.3
+++ path.c 30 Dec 2004 04:36:42 -0000 1.29.8.4
@@ -1,4 +1,4 @@
-/* $Id: path.c,v 1.29.8.3 2004/12/13 16:18:07 hyperion Exp $
+/* $Id: path.c,v 1.29.8.4 2004/12/30 04:36:42 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
reactos/lib/odbc32
diff -u -r1.2.16.3 -r1.2.16.4
--- Makefile.ros-template 13 Dec 2004 16:18:07 -0000 1.2.16.3
+++ Makefile.ros-template 30 Dec 2004 04:36:42 -0000 1.2.16.4
@@ -1,4 +1,4 @@
-# $Id: Makefile.ros-template,v 1.2.16.3 2004/12/13 16:18:07 hyperion Exp $
+# $Id: Makefile.ros-template,v 1.2.16.4 2004/12/30 04:36:42 hyperion Exp $
TARGET_NAME = odbc32
reactos/lib/ole32
diff -u -r1.2.16.3 -r1.2.16.4
--- Makefile.ros-template 13 Dec 2004 16:18:07 -0000 1.2.16.3
+++ Makefile.ros-template 30 Dec 2004 04:36:42 -0000 1.2.16.4
@@ -1,4 +1,4 @@
-# $Id: Makefile.ros-template,v 1.2.16.3 2004/12/13 16:18:07 hyperion Exp $
+# $Id: Makefile.ros-template,v 1.2.16.4 2004/12/30 04:36:42 hyperion Exp $
TARGET_NAME = ole32
reactos/lib/ole32
diff -u -r1.12 -r1.12.2.1
--- ifs.c 20 Oct 2004 09:27:43 -0000 1.12
+++ ifs.c 30 Dec 2004 04:36:42 -0000 1.12.2.1
@@ -77,8 +77,8 @@
{
LPVOID *NewSpyedBlocks;
- if (!Malloc32.SpyedBlocks) NewSpyedBlocks = LocalAlloc(GMEM_ZEROINIT, NewLength);
- else NewSpyedBlocks = LocalReAlloc(Malloc32.SpyedBlocks, NewLength, GMEM_ZEROINIT);
+ if (!Malloc32.SpyedBlocks) NewSpyedBlocks = LocalAlloc(GMEM_ZEROINIT, NewLength * sizeof(PVOID));
+ else NewSpyedBlocks = LocalReAlloc(Malloc32.SpyedBlocks, NewLength * sizeof(PVOID), GMEM_ZEROINIT);
if (NewSpyedBlocks) {
Malloc32.SpyedBlocks = NewSpyedBlocks;
Malloc32.SpyedBlockTableLength = NewLength;
reactos/lib/oleaut32
diff -N typelib16.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ typelib16.c 30 Dec 2004 04:36:43 -0000 1.1.2.1
@@ -0,0 +1,180 @@
+/*
+ * TYPELIB 16bit part.
+ *
+ * Copyright 1997 Marcus Meissner
+ * Copyright 1999 Rein Klazes
+ * Copyright 2000 Francois Jacques
+ * Copyright 2001 Huw D M Davies for CodeWeavers
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include "config.h"
+#include "wine/port.h"
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <ctype.h>
+
+#include "winerror.h"
+#include "windef.h"
+#include "winbase.h"
+#include "winnls.h"
+#include "winreg.h"
+#include "winuser.h"
+
+#include "objbase.h"
+#include "ole2disp.h"
+#include "typelib.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(ole);
+
+/*************************************************************************
+ * TYPELIB {TYPELIB}
+ *
+ * This dll is the 16 bit version of the Typelib API, part the original
+ * implementation of Ole automation. It and its companion ole2disp.dll were
+ * superseded by oleaut32.dll which provides 32 bit implementations of these
+ * functions and greatly extends the Ole Api.
+ *
+ * Winelib developers cannot use these functions directly, they are implemented
+ * solely for backwards compatibility with existing legacy applications.
+ *
+ * SEE ALSO
+ * oleaut32(), ole2disp().
+ */
+
+/****************************************************************************
+ * QueryPathOfRegTypeLib [TYPELIB.14]
+ *
+ * Get the registry key of a registered type library.
+ *
+ * RETURNS
+ * Success: S_OK. path is updated with the key name
+ * Failure: E_FAIL, if guid was not found in the registry
+ *
+ * NOTES
+ * The key takes the form "Classes\Typelib\<guid>\<major>.<minor>\<lcid>\win16\"
+ */
+HRESULT WINAPI
+QueryPathOfRegTypeLib16(
+ REFGUID guid, /* [in] Guid to get the key name for */
+ WORD wMaj, /* [in] Major version */
+ WORD wMin, /* [in] Minor version */
+ LCID lcid, /* [in] Locale Id */
+ LPBSTR16 path) /* [out] Destination for the registry key name */
+{
+ char xguid[80];
+ char typelibkey[100],pathname[260];
+ DWORD plen;
+
+ TRACE("\n");
+
+ if (HIWORD(guid)) {
+ sprintf( typelibkey, "SOFTWARE\\Classes\\Typelib\\{%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}\\%d.%d\\%lx\\win16",
+ guid->Data1, guid->Data2, guid->Data3,
+ guid->Data4[0], guid->Data4[1], guid->Data4[2], guid->Data4[3],
+ guid->Data4[4], guid->Data4[5], guid->Data4[6], guid->Data4[7],
+ wMaj,wMin,lcid);
+ } else {
+ sprintf(xguid,"<guid 0x%08lx>",(DWORD)guid);
+ FIXME("(%s,%d,%d,0x%04lx,%p),can't handle non-string guids.\n",xguid,wMaj,wMin,(DWORD)lcid,path);
+ return E_FAIL;
+ }
+ plen = sizeof(pathname);
+ if (RegQueryValueA(HKEY_LOCAL_MACHINE,typelibkey,pathname,&plen)) {
+ /* try again without lang specific id */
+ if (SUBLANGID(lcid))
+ return QueryPathOfRegTypeLib16(guid,wMaj,wMin,PRIMARYLANGID(lcid),path);
+ FIXME("key %s not found\n",typelibkey);
+ return E_FAIL;
+ }
+ *path = SysAllocString16(pathname);
+ return S_OK;
+}
+
+/******************************************************************************
+ * LoadTypeLib [TYPELIB.3]
+ *
+ * Load and register a type library.
+ *
+ * RETURNS
+ * Success: S_OK. pptLib contains the type libraries ITypeLib interface.
+ * Failure: An HRESULT error code.
+ *
+ * NOTES
+ * Both parameters are FAR pointers.
+ */
+HRESULT WINAPI LoadTypeLib16(
+ LPOLESTR szFile, /* [in] Name of file to load from */
+ ITypeLib** pptLib) /* [out] Destination for loaded ITypeLib interface */
+{
+ FIXME("(%s,%p): stub\n",debugstr_w((LPWSTR)szFile),pptLib);
+
+ if (pptLib!=0)
+ *pptLib=0;
+
+ return E_FAIL;
+}
+
+/****************************************************************************
+ * OaBuildVersion (TYPELIB.15)
+ *
+ * Get the Ole Automation build version.
+ *
+ * PARAMS
+ * None
+ *
+ * RETURNS
+ * The build version.
+ *
+ * NOTES
+ * Known typelib.dll versions:
+ *| OLE Ver. Comments Date Build Ver.
+ *| -------- ------------------------- ---- ---------
+ *| OLE 2.01 Call not available 1993 N/A
+ *| OLE 2.02 1993-94 02 3002
+ *| OLE 2.03 23 730
+ *| OLE 2.03 03 3025
+ *| OLE 2.03 W98 SE orig. file !! 1993-95 10 3024
+ *| OLE 2.1 NT 1993-95 ?? ???
+ *| OLE 2.3.1 W95 23 700
+ *| OLE2 4.0 NT4SP6 1993-98 40 4277
+ */
+DWORD WINAPI OaBuildVersion16(void)
+{
+ /* FIXME: I'd like to return the highest currently known version value
+ * in case the user didn't force a --winver, but I don't know how
+ * to retrieve the "versionForced" info from misc/version.c :(
+ * (this would be useful in other places, too) */
+ FIXME("If you get version error messages, please report them\n");
+ switch(GetVersion() & 0x8000ffff) /* mask off build number */
+ {
+ case 0x80000a03: /* WIN31 */
+ return MAKELONG(3027, 3); /* WfW 3.11 */
+ case 0x80000004: /* WIN95 */
+ return MAKELONG(700, 23); /* Win95A */
+ case 0x80000a04: /* WIN98 */
+ return MAKELONG(3024, 10); /* W98 SE */
+ case 0x00000004: /* NT4 */
+ return MAKELONG(4277, 40); /* NT4 SP6 */
+ default:
+ FIXME("Version value not known yet. Please investigate it!\n");
+ return 0;
+ }
+}
reactos/lib/oleaut32
diff -u -r1.5.2.3 -r1.5.2.4
--- Makefile.ros-template 13 Dec 2004 16:18:07 -0000 1.5.2.3
+++ Makefile.ros-template 30 Dec 2004 04:36:43 -0000 1.5.2.4
@@ -1,4 +1,4 @@
-# $Id: Makefile.ros-template,v 1.5.2.3 2004/12/13 16:18:07 hyperion Exp $
+# $Id: Makefile.ros-template,v 1.5.2.4 2004/12/30 04:36:43 hyperion Exp $
TARGET_NAME = oleaut32
reactos/lib/oledlg
diff -u -r1.3.16.3 -r1.3.16.4
--- Makefile.ros-template 13 Dec 2004 16:18:07 -0000 1.3.16.3
+++ Makefile.ros-template 30 Dec 2004 04:36:44 -0000 1.3.16.4
@@ -1,4 +1,4 @@
-# $Id: Makefile.ros-template,v 1.3.16.3 2004/12/13 16:18:07 hyperion Exp $
+# $Id: Makefile.ros-template,v 1.3.16.4 2004/12/30 04:36:44 hyperion Exp $
TARGET_NAME = oledlg
reactos/lib/olepro32
diff -u -r1.2 -r1.2.10.1
--- .cvsignore 1 Jul 2004 18:12:47 -0000 1.2
+++ .cvsignore 30 Dec 2004 04:36:44 -0000 1.2.10.1
@@ -8,3 +8,4 @@
*.tmp
Makefile.ros
olepro32.spec.def
+olepro32.stubs.c
reactos/lib/olepro32
diff -u -r1.2.16.3 -r1.2.16.4
--- Makefile.ros-template 13 Dec 2004 16:18:08 -0000 1.2.16.3
+++ Makefile.ros-template 30 Dec 2004 04:36:44 -0000 1.2.16.4
@@ -1,4 +1,4 @@
-# $Id: Makefile.ros-template,v 1.2.16.3 2004/12/13 16:18:08 hyperion Exp $
+# $Id: Makefile.ros-template,v 1.2.16.4 2004/12/30 04:36:44 hyperion Exp $
TARGET_NAME = olepro32
reactos/lib/olepro32
diff -u -r1.1 -r1.1.20.1
--- olepro32stubs.c 26 Feb 2004 02:01:13 -0000 1.1
+++ olepro32stubs.c 30 Dec 2004 04:36:44 -0000 1.1.20.1
@@ -52,7 +52,7 @@
/***********************************************************************
* DllCanUnloadNow (OLEPRO32.255)
*/
-HRESULT WINAPI OLEPRO32_DllCanUnloadNow( )
+HRESULT WINAPI OLEPRO32_DllCanUnloadNow(void)
{
FIXME("not implemented (olepro32.dll) \n");
return S_OK;
reactos/lib/riched20
diff -u -r1.1.2.3 -r1.1.2.4
--- Makefile.ros-template 13 Dec 2004 16:18:08 -0000 1.1.2.3
+++ Makefile.ros-template 30 Dec 2004 04:36:44 -0000 1.1.2.4
@@ -1,4 +1,4 @@
-# $Id: Makefile.ros-template,v 1.1.2.3 2004/12/13 16:18:08 hyperion Exp $
+# $Id: Makefile.ros-template,v 1.1.2.4 2004/12/30 04:36:44 hyperion Exp $
TARGET_NAME = riched20
reactos/lib/richedit
diff -u -r1.2.16.3 -r1.2.16.4
--- Makefile.ros-template 13 Dec 2004 16:18:08 -0000 1.2.16.3
+++ Makefile.ros-template 30 Dec 2004 04:36:44 -0000 1.2.16.4
@@ -1,4 +1,4 @@
-# $Id: Makefile.ros-template,v 1.2.16.3 2004/12/13 16:18:08 hyperion Exp $
+# $Id: Makefile.ros-template,v 1.2.16.4 2004/12/30 04:36:44 hyperion Exp $
TARGET_NAME = riched32
reactos/lib/rosrtl/misc
diff -u -r1.4 -r1.4.8.1
--- devmode.c 18 Jul 2004 00:30:08 -0000 1.4
+++ devmode.c 30 Dec 2004 04:36:44 -0000 1.4.8.1
@@ -12,9 +12,8 @@
void
RosRtlDevModeA2W ( LPDEVMODEW pW, const LPDEVMODEA pA )
{
-#define COPYS(f,len) MultiByteToWideChar ( CP_THREAD_ACP, 0, pA->f, len, pW->f, len )
+#define COPYS(f,len) MultiByteToWideChar ( CP_THREAD_ACP, 0, (LPSTR)pA->f, len, pW->f, len )
#define COPYN(f) pW->f = pA->f
- memset ( pW, 0, sizeof(DEVMODEW) );
COPYS(dmDeviceName, CCHDEVICENAME );
COPYN(dmSpecVersion);
COPYN(dmDriverVersion);
@@ -78,9 +77,8 @@
void
RosRtlDevModeW2A( LPDEVMODEA pA, const LPDEVMODEW pW )
{
-#define COPYS(f,len) WideCharToMultiByte( CP_THREAD_ACP, 0, pW->f, len, pA->f, len, NULL, NULL )
+#define COPYS(f,len) WideCharToMultiByte( CP_THREAD_ACP, 0, pW->f, len, (LPSTR)pA->f, len, NULL, NULL )
#define COPYN(f) pA->f = pW->f
- memset ( pA, 0, sizeof(DEVMODEA) );
COPYS(dmDeviceName, CCHDEVICENAME );
COPYN(dmSpecVersion);
COPYN(dmDriverVersion);
reactos/lib/rosrtl/string
diff -u -r1.2 -r1.2.8.1
--- resstr.c 10 Aug 2004 12:00:55 -0000 1.2
+++ resstr.c 30 Dec 2004 04:36:44 -0000 1.2.8.1
@@ -62,7 +62,7 @@
ln = RosLenOfStrResource(hInst, uID);
if(ln++ > 0)
{
- (*lpTarget) = (LPSTR)LocalAlloc(LHND, ln * sizeof(CHAR));
+ (*lpTarget) = (LPSTR)LocalAlloc(LMEM_FIXED, ln * sizeof(CHAR));
if((*lpTarget) != NULL)
{
int Ret;
@@ -94,7 +94,7 @@
ln = RosLenOfStrResource(hInst, uID);
if(ln++ > 0)
{
- (*lpTarget) = (LPWSTR)LocalAlloc(LHND, ln * sizeof(WCHAR));
+ (*lpTarget) = (LPWSTR)LocalAlloc(LMEM_FIXED, ln * sizeof(WCHAR));
if((*lpTarget) != NULL)
{
int Ret;
reactos/lib/rpcrt4
diff -u -r1.3.16.3 -r1.3.16.4
--- Makefile.ros-template 13 Dec 2004 16:18:08 -0000 1.3.16.3
+++ Makefile.ros-template 30 Dec 2004 04:36:44 -0000 1.3.16.4
@@ -1,4 +1,4 @@
-# $Id: Makefile.ros-template,v 1.3.16.3 2004/12/13 16:18:08 hyperion Exp $
+# $Id: Makefile.ros-template,v 1.3.16.4 2004/12/30 04:36:44 hyperion Exp $
TARGET_NAME = rpcrt4
reactos/lib/rtl
diff -u -r1.4.2.3 -r1.4.2.4
--- acl.c 13 Dec 2004 16:18:08 -0000 1.4.2.3
+++ acl.c 30 Dec 2004 04:36:44 -0000 1.4.2.4
@@ -1,4 +1,4 @@
-/* $Id: acl.c,v 1.4.2.3 2004/12/13 16:18:08 hyperion Exp $
+/* $Id: acl.c,v 1.4.2.4 2004/12/30 04:36:44 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
reactos/lib/rtl
diff -u -r1.3 -r1.3.6.1
--- env.c 18 Sep 2004 09:31:53 -0000 1.3
+++ env.c 30 Dec 2004 04:36:44 -0000 1.3.6.1
@@ -1,4 +1,4 @@
-/* $Id: env.c,v 1.3 2004/09/18 09:31:53 greatlrd Exp $
+/* $Id: env.c,v 1.3.6.1 2004/12/30 04:36:44 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
@@ -14,6 +14,7 @@
#include <ddk/ntddk.h>
#include <ntdll/rtl.h>
#include <napi/teb.h>
+#include <ntos/minmax.h>
#include <string.h>
#define NDEBUG
@@ -120,83 +121,127 @@
PUNICODE_STRING Destination,
PULONG Length)
{
- UNICODE_STRING var;
- UNICODE_STRING val;
- NTSTATUS Status = STATUS_SUCCESS;
- BOOLEAN flag = FALSE;
- PWSTR s;
- PWSTR d;
- PWSTR w;
- int src_len;
- int dst_max;
- int tail;
+ UNICODE_STRING Variable;
+ UNICODE_STRING Value;
+ NTSTATUS ReturnStatus = STATUS_SUCCESS;
+ NTSTATUS Status;
+ PWSTR SourceBuffer;
+ PWSTR DestBuffer;
+ PWSTR CopyBuffer;
+ PWSTR VariableEnd;
+ ULONG SourceLength;
+ ULONG DestMax;
+ ULONG CopyLength;
+ ULONG Tail;
+ ULONG TotalLength = 1; /* for terminating NULL */
DPRINT("RtlExpandEnvironmentStrings_U %p %wZ %p %p\n",
Environment, Source, Destination, Length);
- src_len = Source->Length / sizeof(WCHAR);
- s = Source->Buffer;
- dst_max = Destination->MaximumLength / sizeof(WCHAR);
- d = Destination->Buffer;
-
- while (src_len)
- {
- if (*s == L'%')
+ SourceLength = Source->Length / sizeof(WCHAR);
+ SourceBuffer = Source->Buffer;
+ DestMax = Destination->MaximumLength / sizeof(WCHAR);
+ DestBuffer = Destination->Buffer;
+
+ while (SourceLength)
+ {
+ if (*SourceBuffer != L'%')
+ {
+ CopyBuffer = SourceBuffer;
+ CopyLength = 0;
+ while (SourceLength != 0 && *SourceBuffer != L'%')
+ {
+ SourceBuffer++;
+ CopyLength++;
+ SourceLength--;
+ }
+ }
+ else
{
- if (flag)
+ /* Process environment variable. */
+
+ VariableEnd = SourceBuffer + 1;
+ Tail = SourceLength - 1;
+ while (*VariableEnd != L'%' && Tail != 0)
{
- flag = FALSE;
- goto copy;
+ VariableEnd++;
+ Tail--;
}
- w = s + 1;
- tail = src_len - 1;
- while (*w != L'%' && tail)
+
+ if (Tail != 0)
{
- w++;
- tail--;
- }
- if (!tail)
- goto copy;
+ Variable.MaximumLength =
+ Variable.Length = (VariableEnd - (SourceBuffer + 1)) * sizeof(WCHAR);
+ Variable.Buffer = SourceBuffer + 1;
- var.Length = (w - ( s + 1)) * sizeof(WCHAR);
- var.MaximumLength = var.Length;
- var.Buffer = s + 1;
+ Value.Length = 0;
+ Value.MaximumLength = DestMax * sizeof(WCHAR);
+ Value.Buffer = DestBuffer;
- val.Length = 0;
- val.MaximumLength = dst_max * sizeof(WCHAR);
- val.Buffer = d;
- Status = RtlQueryEnvironmentVariable_U (Environment, &var, &val);
- if (NT_SUCCESS(Status))
+ Status = RtlQueryEnvironmentVariable_U(Environment, &Variable,
+ &Value);
+ if (NT_SUCCESS(Status) || Status == STATUS_BUFFER_TOO_SMALL)
+ {
+ SourceBuffer = VariableEnd + 1;
+ SourceLength = Tail - 1;
+ TotalLength += Value.Length / sizeof(WCHAR);
+ if (Status != STATUS_BUFFER_TOO_SMALL)
+ {
+ DestBuffer += Value.Length / sizeof(WCHAR);
+ DestMax -= Value.Length / sizeof(WCHAR);
+ }
+ else
+ {
+ DestMax = 0;
+ ReturnStatus = STATUS_BUFFER_TOO_SMALL;
+ }
+ continue;
+ }
+ else
+ {
+ /* Variable not found. */
+ CopyBuffer = SourceBuffer;
+ CopyLength = SourceLength - Tail + 1;
+ SourceLength -= CopyLength;
+ SourceBuffer += CopyLength;
+ }
+ }
+ else
{
- d += val.Length / sizeof(WCHAR);
- dst_max -= val.Length / sizeof(WCHAR);
- s = w + 1;
- src_len = tail - 1;
- continue;
+ /* Unfinished variable name. */
+ CopyBuffer = SourceBuffer;
+ CopyLength = SourceLength;
+ SourceLength = 0;
}
- /* variable not found or buffer too small, just copy %var% */
- flag = TRUE;
}
-copy:
- if (!dst_max)
+
+ TotalLength += CopyLength;
+ if (DestMax)
{
- Status = STATUS_BUFFER_TOO_SMALL;
- break;
+ if (DestMax < CopyLength)
+ {
+ CopyLength = DestMax;
+ ReturnStatus = STATUS_BUFFER_TOO_SMALL;
+ }
+ RtlCopyMemory(DestBuffer, CopyBuffer, CopyLength * sizeof(WCHAR));
+ DestMax -= CopyLength;
+ DestBuffer += CopyLength;
}
-
- *d++ = *s++;
- dst_max--;
- src_len--;
}
- Destination->Length = (d - Destination->Buffer) * sizeof(WCHAR);
+ /* NULL-terminate the buffer. */
+ if (DestMax)
+ *DestBuffer = 0;
+ else
+ ReturnStatus = STATUS_BUFFER_TOO_SMALL;
+
+ Destination->Length = (DestBuffer - Destination->Buffer) * sizeof(WCHAR);
if (Length != NULL)
- *Length = Destination->Length;
- if (dst_max)
- Destination->Buffer[Destination->Length / sizeof(WCHAR)] = 0;
+ *Length = TotalLength * sizeof(WCHAR);
DPRINT("Destination %wZ\n", Destination);
- return(Status);
+
+ return ReturnStatus;
}
@@ -244,6 +289,15 @@
DPRINT("RtlSetEnvironmentVariable(Environment %p Name %wZ Value %wZ)\n",
Environment, Name, Value);
+ /* Variable names can't contain a '=' except as a first character. */
+ for (wcs = Name->Buffer + 1;
+ wcs < Name->Buffer + (Name->Length / sizeof(WCHAR));
+ wcs++)
+ {
+ if (*wcs == L'=')
+ return STATUS_INVALID_PARAMETER;
+ }
+
if (Environment)
{
env = *Environment;
@@ -304,7 +358,7 @@
}
found:
- if (Value->Length > 0)
+ if (Value != NULL && Value->Length > 0)
{
hole_len = tail - hole;
/* calculate new environment size */
@@ -450,7 +504,6 @@
PWSTR wcs;
UNICODE_STRING var;
PWSTR val;
- int len;
BOOLEAN SysEnvUsed = FALSE;
DPRINT("RtlQueryEnvironmentVariable_U Environment %p Variable %wZ Value %p\n",
@@ -470,7 +523,6 @@
RtlAcquirePebLock();
wcs = Environment;
- len = Name->Length / sizeof(WCHAR);
while (*wcs)
{
var.Buffer = wcs++;
@@ -488,9 +540,10 @@
if (RtlEqualUnicodeString(&var, Name, TRUE))
{
Value->Length = (wcs - val) * sizeof(WCHAR);
- if (Value->Length < Value->MaximumLength)
+ if (Value->Length <= Value->MaximumLength)
{
- memcpy(Value->Buffer, val, Value->Length + sizeof(WCHAR));
+ memcpy(Value->Buffer, val,
+ min(Value->Length + sizeof(WCHAR), Value->MaximumLength));
DPRINT("Value %S\n", val);
DPRINT("Return STATUS_SUCCESS\n");
Status = STATUS_SUCCESS;
reactos/lib/rtl
diff -u -r1.2 -r1.2.8.1
--- error.c 5 Aug 2004 18:17:36 -0000 1.2
+++ error.c 30 Dec 2004 04:36:44 -0000 1.2.8.1
@@ -1,4 +1,4 @@
-/* $Id: error.c,v 1.2 2004/08/05 18:17:36 ion Exp $
+/* $Id: error.c,v 1.2.8.1 2004/12/30 04:36:44 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -241,8 +241,8 @@
ERROR_FILE_CORRUPT, /* c0000051 (STATUS_NONEXISTENT_EA_ENTRY) */
ERROR_FILE_CORRUPT, /* c0000052 (STATUS_NO_EAS_ON_FILE) */
ERROR_FILE_CORRUPT, /* c0000053 (STATUS_EA_CORRUPT_ERROR) */
- ERROR_LOCK_VIOLATION, /* c0000054 (STATUS_LOCK_NOT_GRANTED) */
- ERROR_LOCK_VIOLATION, /* c0000055 (STATUS_FILE_LOCK_CONFLICT) */
+ ERROR_LOCK_VIOLATION, /* c0000054 (STATUS_FILE_LOCK_CONFLICT) */
+ ERROR_LOCK_VIOLATION, /* c0000055 (STATUS_LOCK_NOT_GRANTED) */
ERROR_ACCESS_DENIED, /* c0000056 (STATUS_DELETE_PENDING) */
ERROR_NOT_SUPPORTED, /* c0000057 (STATUS_CTL_FILE_NOT_SUPPORTED) */
ERROR_UNKNOWN_REVISION, /* c0000058 (STATUS_UNKNOWN_REVISION) */
@@ -782,7 +782,7 @@
RPC_X_SS_CHAR_TRANS_OPEN_FAIL, /* c0030002 (RPC_NT_SS_CHAR_TRANS_OPEN_FAIL) */
RPC_X_SS_CHAR_TRANS_SHORT_FILE, /* c0030003 (RPC_NT_SS_CHAR_TRANS_SHORT_FILE) */
ERROR_INVALID_HANDLE, /* c0030004 (RPC_NT_SS_IN_NULL_CONTEXT) */
- ERROR_INVALID_HANDLE, /* c0030005 */
+ ERROR_INVALID_HANDLE, /* c0030005 (RPC_NT_SS_CONTEXT_MISMATCH)*/
RPC_X_SS_CONTEXT_DAMAGED, /* c0030006 (RPC_NT_SS_CONTEXT_DAMAGED) */
RPC_X_SS_HANDLES_MISMATCH, /* c0030007 (RPC_NT_SS_HANDLES_MISMATCH) */
RPC_X_SS_CANNOT_GET_CALL_HANDLE, /* c0030008 (RPC_NT_SS_CANNOT_GET_CALL_HANDLE) */
@@ -821,16 +821,6 @@
};
-#if 0
-/* currently not assigned values */
-ERROR_ARENA_TRASHED
-STATUS_HANDLE_NOT_WAITABLE ERROR_INVALID_HANDLE;
-STATUS_LOCK_NOT_GRANTED ERROR_LOCK_VIOLATION;
-
-RPC_NT_SS_CONTEXT_MISMATCH ERROR_INVALID_HANDLE
-#endif
-
-
/* FUNCTIONS ***************************************************************/
/*
reactos/lib/rtl
diff -u -r1.3.6.2 -r1.3.6.3
--- heap.c 13 Dec 2004 09:39:01 -0000 1.3.6.2
+++ heap.c 30 Dec 2004 04:36:44 -0000 1.3.6.3
@@ -1077,7 +1077,7 @@
PRTL_HEAP_DEFINITION Definition)
{
SUBHEAP *subheap;
- ULONG i;
+ HEAP *heapPtr;
/* Allocate the heap block */
@@ -1091,15 +1091,14 @@
return 0;
}
+ /* link it into the per-process heap list */
RtlEnterCriticalSection (&RtlpProcessHeapsListLock);
- for (i = 0; i < NtCurrentPeb ()->NumberOfHeaps; i++)
- {
- if (NtCurrentPeb ()->ProcessHeaps[i] == NULL)
- {
- NtCurrentPeb()->ProcessHeaps[i] = (PVOID)subheap;
- break;
- }
- }
+
+ heapPtr = subheap->heap;
+ heapPtr->next = (HEAP*)NtCurrentPeb()->ProcessHeaps;
+ NtCurrentPeb()->ProcessHeaps = (HANDLE)heapPtr;
+ NtCurrentPeb()->NumberOfHeaps++;
+
RtlLeaveCriticalSection (&RtlpProcessHeapsListLock);
return (HANDLE)subheap;
@@ -1112,27 +1111,34 @@
* FALSE: Failure
*
* @implemented
+ *
+ * RETURNS
+ * Success: A NULL HANDLE, if heap is NULL or it was destroyed
+ * Failure: The Heap handle, if heap is the process heap.
*/
-BOOLEAN STDCALL
+HANDLE STDCALL
RtlDestroyHeap(HANDLE heap) /* [in] Handle of heap */
{
HEAP *heapPtr = HEAP_GetPtr( heap );
SUBHEAP *subheap;
- ULONG i, flags;
+ ULONG flags;
+ HEAP **pptr;
DPRINT("%08x\n", heap );
if (!heapPtr)
- return FALSE;
+ return heap;
+ if (heap == NtCurrentPeb()->ProcessHeap)
+ return heap; /* cannot delete the main process heap */
+
+ /* remove it from the per-process list */
RtlEnterCriticalSection (&RtlpProcessHeapsListLock);
- for (i = 0; i < NtCurrentPeb ()->NumberOfHeaps; i++)
- {
- if (NtCurrentPeb ()->ProcessHeaps[i] == heap)
- {
- NtCurrentPeb()->ProcessHeaps[i] = NULL;
- break;
- }
- }
+
+ pptr = (HEAP**)&NtCurrentPeb()->ProcessHeaps;
+ while (*pptr && *pptr != heapPtr) pptr = &(*pptr)->next;
+ if (*pptr) *pptr = (*pptr)->next;
+ NtCurrentPeb()->NumberOfHeaps--;
+
RtlLeaveCriticalSection (&RtlpProcessHeapsListLock);
RtlDeleteCriticalSection( &heapPtr->critSection );
@@ -1155,7 +1161,7 @@
}
subheap = next;
}
- return TRUE;
+ return (HANDLE)NULL;
}
@@ -1713,8 +1719,8 @@
Peb = NtCurrentPeb();
Peb->NumberOfHeaps = 0;
- Peb->MaximumNumberOfHeaps = (PAGE_SIZE - sizeof(PEB)) / sizeof(HANDLE);
- Peb->ProcessHeaps = (PVOID)Peb + sizeof(PEB);
+ Peb->MaximumNumberOfHeaps = -1; /* no limit */
+ Peb->ProcessHeaps = NULL;
RtlInitializeCriticalSection(&RtlpProcessHeapsListLock);
}
@@ -1728,13 +1734,13 @@
LONG lParam)
{
NTSTATUS Status = STATUS_SUCCESS;
- ULONG i;
-
+ HEAP** pptr;
+
RtlEnterCriticalSection(&RtlpProcessHeapsListLock);
- for (i = 0; i < NtCurrentPeb()->NumberOfHeaps; i++)
+ for (pptr = (HEAP**)&NtCurrentPeb()->ProcessHeaps; *pptr; pptr = &(*pptr)->next)
{
- Status = func(NtCurrentPeb()->ProcessHeaps[i],lParam);
+ Status = func(*pptr,lParam);
if (!NT_SUCCESS(Status))
break;
}
@@ -1753,15 +1759,19 @@
HANDLE *HeapArray)
{
ULONG Result = 0;
+ HEAP ** pptr;
RtlEnterCriticalSection(&RtlpProcessHeapsListLock);
+ Result = NtCurrentPeb()->NumberOfHeaps;
+
if (NtCurrentPeb()->NumberOfHeaps <= HeapCount)
{
- Result = NtCurrentPeb()->NumberOfHeaps;
- memmove(HeapArray,
- NtCurrentPeb()->ProcessHeaps,
- Result * sizeof(HANDLE));
+ int i = 0;
+ for (pptr = (HEAP**)&NtCurrentPeb()->ProcessHeaps; *pptr; pptr = &(*pptr)->next)
+ {
+ HeapArray[i++] = *pptr;
+ }
}
RtlLeaveCriticalSection (&RtlpProcessHeapsListLock);
@@ -1776,18 +1786,22 @@
BOOLEAN STDCALL
RtlValidateProcessHeaps(VOID)
{
- HANDLE Heaps[128];
BOOLEAN Result = TRUE;
- ULONG HeapCount;
- ULONG i;
+ HEAP ** pptr;
+
+ RtlEnterCriticalSection(&RtlpProcessHeapsListLock);
- HeapCount = RtlGetProcessHeaps(128, Heaps);
- for (i = 0; i < HeapCount; i++)
+ for (pptr = (HEAP**)&NtCurrentPeb()->ProcessHeaps; *pptr; pptr = &(*pptr)->next)
{
- if (!RtlValidateHeap(Heaps[i], 0, NULL))
+ if (!RtlValidateHeap(*pptr, 0, NULL))
+ {
Result = FALSE;
+ break;
+ }
}
+ RtlLeaveCriticalSection (&RtlpProcessHeapsListLock);
+
return Result;
}
reactos/lib/rtl
diff -u -r1.1.18.2 -r1.1.18.3
--- largeint.c 13 Dec 2004 16:18:08 -0000 1.1.18.2
+++ largeint.c 30 Dec 2004 04:36:44 -0000 1.1.18.3
@@ -1,4 +1,4 @@
-/* $Id: largeint.c,v 1.1.18.2 2004/12/13 16:18:08 hyperion Exp $
+/* $Id: largeint.c,v 1.1.18.3 2004/12/30 04:36:44 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
reactos/lib/rtl
diff -u -r1.2.8.3 -r1.2.8.4
--- mem.c 13 Dec 2004 16:18:08 -0000 1.2.8.3
+++ mem.c 30 Dec 2004 04:36:44 -0000 1.2.8.4
@@ -1,5 +1,5 @@
-/* $Id: mem.c,v 1.2.8.3 2004/12/13 16:18:08 hyperion Exp $
+/* $Id: mem.c,v 1.2.8.4 2004/12/30 04:36:44 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
reactos/lib/rtl
diff -u -r1.1.18.3 -r1.1.18.4
--- nls.c 13 Dec 2004 16:18:08 -0000 1.1.18.3
+++ nls.c 30 Dec 2004 04:36:44 -0000 1.1.18.4
@@ -1,4 +1,4 @@
-/* $Id: nls.c,v 1.1.18.3 2004/12/13 16:18:08 hyperion Exp $
+/* $Id: nls.c,v 1.1.18.4 2004/12/30 04:36:44 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
reactos/lib/rtl
diff -u -r1.2 -r1.2.8.1
--- security.c 13 Jul 2004 11:52:09 -0000 1.2
+++ security.c 30 Dec 2004 04:36:44 -0000 1.2.8.1
@@ -1,4 +1,4 @@
-/* $Id: security.c,v 1.2 2004/07/13 11:52:09 ekohl Exp $
+/* $Id: security.c,v 1.2.8.1 2004/12/30 04:36:44 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -27,7 +27,9 @@
HANDLE ProcessToken;
HANDLE ImpersonationToken;
NTSTATUS Status;
-
+ OBJECT_ATTRIBUTES ObjAttr;
+ SECURITY_QUALITY_OF_SERVICE Sqos;
+
Status = NtOpenProcessToken(NtCurrentProcess(),
TOKEN_DUPLICATE,
&ProcessToken);
@@ -36,11 +38,26 @@
DPRINT1("NtOpenProcessToken() failed (Status %lx)\n", Status);
return(Status);
}
-
+
+ Sqos.Length = sizeof(SECURITY_QUALITY_OF_SERVICE);
+ Sqos.ImpersonationLevel = ImpersonationLevel;
+ Sqos.ContextTrackingMode = 0;
+ Sqos.EffectiveOnly = FALSE;
+
+ InitializeObjectAttributes(
+ &ObjAttr,
+ NULL,
+ 0,
+ NULL,
+ NULL
+ );
+
+ ObjAttr.SecurityQualityOfService = &Sqos;
+
Status = NtDuplicateToken(ProcessToken,
TOKEN_IMPERSONATE,
- NULL,
- ImpersonationLevel,
+ &ObjAttr,
+ Sqos.EffectiveOnly, /* why both here _and_ in Sqos? */
TokenImpersonation,
&ImpersonationToken);
if (!NT_SUCCESS(Status))
reactos/lib/rtl
diff -u -r1.1 -r1.1.18.1
--- time.c 31 May 2004 19:29:02 -0000 1.1
+++ time.c 30 Dec 2004 04:36:44 -0000 1.1.18.1
@@ -1,4 +1,4 @@
-/* $Id: time.c,v 1.1 2004/05/31 19:29:02 gdalsnes Exp $
+/* $Id: time.c,v 1.1.18.1 2004/12/30 04:36:44 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -75,78 +75,71 @@
BOOLEAN
STDCALL
RtlTimeFieldsToTime(
- PTIME_FIELDS tfTimeFields,
+ PTIME_FIELDS TimeFields,
PLARGE_INTEGER Time)
{
int CurYear;
int CurMonth;
-#if defined(__GNUC__)
-
- long long int rcTime;
-#else
+ TIME_FIELDS IntTimeFields;
- __int64 rcTime;
-#endif
+ Time->QuadPart = 0;
+ memcpy(&IntTimeFields,
+ TimeFields,
+ sizeof(TIME_FIELDS));
- TIME_FIELDS TimeFields = *tfTimeFields;
-
- rcTime = 0;
-
- /* FIXME: normalize the TIME_FIELDS structure here */
- while (TimeFields.Second >= SECSPERMIN)
+ /* Normalize the TIME_FIELDS structure here */
+ while (IntTimeFields.Second >= SECSPERMIN)
{
- NormalizeTimeFields(&TimeFields.Second,
- &TimeFields.Minute,
+ NormalizeTimeFields(&IntTimeFields.Second,
+ &IntTimeFields.Minute,
SECSPERMIN);
}
- while (TimeFields.Minute >= MINSPERHOUR)
+ while (IntTimeFields.Minute >= MINSPERHOUR)
{
- NormalizeTimeFields(&TimeFields.Minute,
- &TimeFields.Hour,
+ NormalizeTimeFields(&IntTimeFields.Minute,
+ &IntTimeFields.Hour,
MINSPERHOUR);
}
- while (TimeFields.Hour >= HOURSPERDAY)
+ while (IntTimeFields.Hour >= HOURSPERDAY)
{
- NormalizeTimeFields(&TimeFields.Hour,
- &TimeFields.Day,
+ NormalizeTimeFields(&IntTimeFields.Hour,
+ &IntTimeFields.Day,
HOURSPERDAY);
}
- while (TimeFields.Day >
- MonthLengths[IsLeapYear(TimeFields.Year)][TimeFields.Month - 1])
+ while (IntTimeFields.Day >
+ MonthLengths[IsLeapYear(IntTimeFields.Year)][IntTimeFields.Month - 1])
{
- NormalizeTimeFields(&TimeFields.Day,
- &TimeFields.Month,
+ NormalizeTimeFields(&IntTimeFields.Day,
+ &IntTimeFields.Month,
SECSPERMIN);
}
- while (TimeFields.Month > MONSPERYEAR)
+ while (IntTimeFields.Month > MONSPERYEAR)
{
- NormalizeTimeFields(&TimeFields.Month,
- &TimeFields.Year,
+ NormalizeTimeFields(&IntTimeFields.Month,
+ &IntTimeFields.Year,
MONSPERYEAR);
}
- /* FIXME: handle calendar corrections here */
- for (CurYear = EPOCHYEAR; CurYear < TimeFields.Year; CurYear++)
+ /* Compute the time */
+ for (CurYear = EPOCHYEAR; CurYear < IntTimeFields.Year; CurYear++)
{
- rcTime += YearLengths[IsLeapYear(CurYear)];
+ Time->QuadPart += YearLengths[IsLeapYear(CurYear)];
}
- for (CurMonth = 1; CurMonth < TimeFields.Month; CurMonth++)
+ for (CurMonth = 1; CurMonth < IntTimeFields.Month; CurMonth++)
{
- rcTime += MonthLengths[IsLeapYear(CurYear)][CurMonth - 1];
+ Time->QuadPart += MonthLengths[IsLeapYear(CurYear)][CurMonth - 1];
}
- rcTime += TimeFields.Day - 1;
- rcTime *= SECSPERDAY;
- rcTime += TimeFields.Hour * SECSPERHOUR + TimeFields.Minute * SECSPERMIN +
- TimeFields.Second;
- rcTime *= TICKSPERSEC;
- rcTime += TimeFields.Milliseconds * TICKSPERMSEC;
- *Time = *(LARGE_INTEGER *)&rcTime;
+ Time->QuadPart += IntTimeFields.Day - 1;
+ Time->QuadPart *= SECSPERDAY;
+ Time->QuadPart += IntTimeFields.Hour * SECSPERHOUR + IntTimeFields.Minute * SECSPERMIN +
+ IntTimeFields.Second;
+ Time->QuadPart *= TICKSPERSEC;
+ Time->QuadPart += IntTimeFields.Milliseconds * TICKSPERMSEC;
return TRUE;
}
-
/*
* @implemented
*/
@@ -185,44 +178,30 @@
}
-
/*
* @unimplemented
*/
VOID
STDCALL
RtlTimeToTimeFields(
- PLARGE_INTEGER liTime,
+ PLARGE_INTEGER Time,
PTIME_FIELDS TimeFields)
{
const int *Months;
- int LeapSecondCorrections, SecondsInDay, CurYear;
- int LeapYear, CurMonth, GMTOffset;
+ int SecondsInDay, CurYear;
+ int LeapYear, CurMonth;
long int Days;
-#if defined(__GNUC__)
-
- long long int Time = (long long int)liTime->QuadPart;
-#else
-
- __int64 Time = (__int64)liTime->QuadPart;
-#endif
+ LONGLONG IntTime = (LONGLONG)Time->QuadPart;
/* Extract millisecond from time and convert time into seconds */
- TimeFields->Milliseconds = (CSHORT) ((Time % TICKSPERSEC) / TICKSPERMSEC);
- Time = Time / TICKSPERSEC;
-
- /* FIXME: Compute the number of leap second corrections here */
- LeapSecondCorrections = 0;
-
- /* FIXME: get the GMT offset here */
- GMTOffset = 0;
+ TimeFields->Milliseconds = (CSHORT) ((IntTime % TICKSPERSEC) / TICKSPERMSEC);
+ IntTime = IntTime / TICKSPERSEC;
/* Split the time into days and seconds within the day */
- Days = Time / SECSPERDAY;
- SecondsInDay = Time % SECSPERDAY;
+ Days = IntTime / SECSPERDAY;
+ SecondsInDay = IntTime % SECSPERDAY;
- /* Adjust the values for GMT and leap seconds */
- SecondsInDay += (GMTOffset - LeapSecondCorrections);
+ /* Adjust the values for days and seconds in day */
while (SecondsInDay < 0)
{
SecondsInDay += SECSPERDAY;
@@ -240,8 +219,6 @@
TimeFields->Minute = (CSHORT) (SecondsInDay / SECSPERMIN);
TimeFields->Second = (CSHORT) (SecondsInDay % SECSPERMIN);
- /* FIXME: handle the possibility that we are on a leap second (i.e. Second = 60) */
-
/* compute day of week */
TimeFields->Weekday = (CSHORT) ((EPOCHWEEKDAY + Days) % DAYSPERWEEK);
@@ -285,15 +262,15 @@
PLARGE_INTEGER Time,
PULONG SecondsSince1970)
{
- LARGE_INTEGER liTime;
+ LARGE_INTEGER IntTime;
- liTime.QuadPart = Time->QuadPart - TICKSTO1970;
- liTime.QuadPart = liTime.QuadPart / TICKSPERSEC;
+ IntTime.QuadPart = Time->QuadPart - TICKSTO1970;
+ IntTime.QuadPart = IntTime.QuadPart / TICKSPERSEC;
- if (liTime.u.HighPart != 0)
+ if (IntTime.u.HighPart != 0)
return FALSE;
- *SecondsSince1970 = liTime.u.LowPart;
+ *SecondsSince1970 = IntTime.u.LowPart;
return TRUE;
}
@@ -308,15 +285,15 @@
PLARGE_INTEGER Time,
PULONG SecondsSince1980)
{
- LARGE_INTEGER liTime;
+ LARGE_INTEGER IntTime;
- liTime.QuadPart = Time->QuadPart - TICKSTO1980;
- liTime.QuadPart = liTime.QuadPart / TICKSPERSEC;
+ IntTime.QuadPart = Time->QuadPart - TICKSTO1980;
+ IntTime.QuadPart = IntTime.QuadPart / TICKSPERSEC;
- if (liTime.u.HighPart != 0)
+ if (IntTime.u.HighPart != 0)
return FALSE;
- *SecondsSince1980 = liTime.u.LowPart;
+ *SecondsSince1980 = IntTime.u.LowPart;
return TRUE;
}
@@ -347,8 +324,6 @@
}
-
-
/*
* @implemented
*/
@@ -383,11 +358,7 @@
ULONG SecondsSince1970,
PLARGE_INTEGER Time)
{
- LONGLONG llTime;
-
- llTime = (SecondsSince1970 * TICKSPERSEC) + TICKSTO1970;
-
- *Time = *(LARGE_INTEGER *)&llTime;
+ Time->QuadPart = ((LONGLONG)SecondsSince1970 * TICKSPERSEC) + TICKSTO1970;
}
@@ -400,13 +371,7 @@
ULONG SecondsSince1980,
PLARGE_INTEGER Time)
{
- LONGLONG llTime;
-
- llTime = (SecondsSince1980 * TICKSPERSEC) + TICKSTO1980;
-
- *Time = *(LARGE_INTEGER *)&llTime;
+ Time->QuadPart = ((LONGLONG)SecondsSince1980 * TICKSPERSEC) + TICKSTO1980;
}
-
-
/* EOF */
reactos/lib/setupapi
diff -u -r1.4.16.3 -r1.4.16.4
--- Makefile.ros-template 13 Dec 2004 16:18:08 -0000 1.4.16.3
+++ Makefile.ros-template 30 Dec 2004 04:36:45 -0000 1.4.16.4
@@ -1,4 +1,4 @@
-# $Id: Makefile.ros-template,v 1.4.16.3 2004/12/13 16:18:08 hyperion Exp $
+# $Id: Makefile.ros-template,v 1.4.16.4 2004/12/30 04:36:45 hyperion Exp $
TARGET_NAME = setupapi
reactos/lib/shell32
diff -u -r1.6.2.3 -r1.6.2.4
--- Makefile.ros-template 13 Dec 2004 16:18:08 -0000 1.6.2.3
+++ Makefile.ros-template 30 Dec 2004 04:36:45 -0000 1.6.2.4
@@ -1,4 +1,4 @@
-# $Id: Makefile.ros-template,v 1.6.2.3 2004/12/13 16:18:08 hyperion Exp $
+# $Id: Makefile.ros-template,v 1.6.2.4 2004/12/30 04:36:45 hyperion Exp $
TARGET_NAME = shell32
reactos/lib/shlwapi
diff -u -r1.9.2.3 -r1.9.2.4
--- Makefile.ros-template 13 Dec 2004 16:18:08 -0000 1.9.2.3
+++ Makefile.ros-template 30 Dec 2004 04:36:45 -0000 1.9.2.4
@@ -1,4 +1,4 @@
-# $Id: Makefile.ros-template,v 1.9.2.3 2004/12/13 16:18:08 hyperion Exp $
+# $Id: Makefile.ros-template,v 1.9.2.4 2004/12/30 04:36:45 hyperion Exp $
TARGET_NAME = shlwapi
reactos/lib/string
diff -u -r1.2.34.3 -r1.2.34.4
--- strncpy.c 13 Dec 2004 16:18:08 -0000 1.2.34.3
+++ strncpy.c 30 Dec 2004 04:36:45 -0000 1.2.34.4
@@ -1,4 +1,4 @@
-/* $Id: strncpy.c,v 1.2.34.3 2004/12/13 16:18:08 hyperion Exp $
+/* $Id: strncpy.c,v 1.2.34.4 2004/12/30 04:36:45 hyperion Exp $
*/
#include <string.h>
#include "tcsncpy.h"
reactos/lib/syssetup
diff -u -r1.13 -r1.13.2.1
--- Makefile 22 Nov 2004 11:01:45 -0000 1.13
+++ Makefile 30 Dec 2004 04:36:45 -0000 1.13.2.1
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.13 2004/11/22 11:01:45 gvg Exp $
+# $Id: Makefile,v 1.13.2.1 2004/12/30 04:36:45 hyperion Exp $
PATH_TO_TOP = ../..
@@ -9,7 +9,9 @@
TARGET_BASE = $(TARGET_BASE_LIB_SYSSETUP)
TARGET_SDKLIBS = ntdll.a kernel32.a advapi32.a gdi32.a user32.a samlib.a userenv.a \
- comctl32.a setupapi.a
+ comctl32.a setupapi.a ole32.a shell32.a shlwapi.a
+
+TARGET_GCCLIBS = uuid
TARGET_CFLAGS = -Wall -Werror -fno-builtin
reactos/lib/syssetup
diff -u -r1.20 -r1.20.2.1
--- install.c 24 Nov 2004 23:09:46 -0000 1.20
+++ install.c 30 Dec 2004 04:36:45 -0000 1.20.2.1
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: install.c,v 1.20 2004/11/24 23:09:46 ekohl Exp $
+/* $Id: install.c,v 1.20.2.1 2004/12/30 04:36:45 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
@@ -39,13 +39,15 @@
#include <userenv.h>
#include <setupapi.h>
+#include <shlobj.h>
+#include <objidl.h>
+#include <shlwapi.h>
+
#include "globals.h"
#include "resource.h"
#define VMWINST
-VOID WINAPI CreateCmdLink(VOID);
-
/* GLOBALS ******************************************************************/
@@ -97,6 +99,74 @@
#endif
+HRESULT CreateShellLink(LPCSTR linkPath, LPCSTR cmd, LPCSTR arg, LPCSTR dir, LPCSTR iconPath, int icon_nr, LPCSTR comment)
+{
+ IShellLinkA* psl;
+ IPersistFile* ppf;
+ WCHAR buffer[MAX_PATH];
+
+ HRESULT hr = CoCreateInstance(&CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, &IID_IShellLink, (LPVOID*)&psl);
+
+ if (SUCCEEDED(hr))
+ {
+ hr = psl->lpVtbl->SetPath(psl, cmd);
+
+ if (arg)
+ {
+ hr = psl->lpVtbl->SetArguments(psl, arg);
+ }
+
+ if (dir)
+ {
+ hr = psl->lpVtbl->SetWorkingDirectory(psl, dir);
+ }
+
+ if (iconPath)
+ {
+ hr = psl->lpVtbl->SetIconLocation(psl, iconPath, icon_nr);
+ }
+
+ if (comment)
+ {
+ hr = psl->lpVtbl->SetDescription(psl, comment);
+ }
+
+ hr = psl->lpVtbl->QueryInterface(psl, &IID_IPersistFile, (LPVOID*)&ppf);
+
+ if (SUCCEEDED(hr))
+ {
+ MultiByteToWideChar(CP_ACP, 0, linkPath, -1, buffer, MAX_PATH);
+
+ hr = ppf->lpVtbl->Save(ppf, buffer, TRUE);
+
+ ppf->lpVtbl->Release(ppf);
+ }
+
+ psl->lpVtbl->Release(psl);
+ }
+
+ return hr;
+}
+
+
+static VOID
+CreateCmdLink(VOID)
+{
+ char path[MAX_PATH];
+ LPSTR p;
+
+ CoInitialize(NULL);
+
+ SHGetSpecialFolderPathA(0, path, CSIDL_DESKTOP, TRUE);
+ p = PathAddBackslashA(path);
+
+ strcpy(p, "Command Prompt.lnk");
+ CreateShellLink(path, "cmd.exe", "", NULL, NULL, 0, "Open command prompt");
+
+ CoUninitialize();
+}
+
+
static VOID
CreateRandomSid (PSID *Sid)
{
@@ -320,6 +390,8 @@
return 0;
}
+ CreateCmdLink();
+
/* Create the semi-random Domain-SID */
CreateRandomSid (&DomainSid);
if (DomainSid == NULL)
@@ -368,7 +440,8 @@
* and not completing it, let it restart instead
*/
LastError = GetLastError();
- if (LastError != ERROR_USER_EXISTS) {
+ if (LastError != ERROR_USER_EXISTS)
+ {
DebugPrint("SamCreateUser() failed!\n");
RtlFreeSid(AdminSid);
RtlFreeSid(DomainSid);
reactos/lib/syssetup
diff -u -r1.8.2.3 -r1.8.2.4
--- syssetup.rc 13 Dec 2004 16:18:08 -0000 1.8.2.3
+++ syssetup.rc 30 Dec 2004 04:36:45 -0000 1.8.2.4
@@ -1,4 +1,4 @@
-/* $Id: syssetup.rc,v 1.8.2.3 2004/12/13 16:18:08 hyperion Exp $ */
+/* $Id: syssetup.rc,v 1.8.2.4 2004/12/30 04:36:45 hyperion Exp $ */
#include <windows.h>
#include "resource.h"
reactos/lib/syssetup
diff -u -r1.15.2.3 -r1.15.2.4
--- wizard.c 13 Dec 2004 16:18:08 -0000 1.15.2.3
+++ wizard.c 30 Dec 2004 04:36:45 -0000 1.15.2.4
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: wizard.c,v 1.15.2.3 2004/12/13 16:18:08 hyperion Exp $
+/* $Id: wizard.c,v 1.15.2.4 2004/12/30 04:36:45 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
@@ -1398,14 +1398,14 @@
psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER;
psp.pfnDlgProc = FinishDlgProc;
psp.pszTemplate = MAKEINTRESOURCE(IDD_FINISHPAGE);
- ahpsp[7] = CreatePropertySheetPage(&psp);
+ ahpsp[6] = CreatePropertySheetPage(&psp);
/* Create the property sheet */
psh.dwSize = sizeof(PROPSHEETHEADER);
psh.dwFlags = PSH_WIZARD97 | PSH_WATERMARK | PSH_HEADER;
psh.hInstance = hDllInstance;
psh.hwndParent = NULL;
- psh.nPages = 8;
+ psh.nPages = 7;
psh.nStartPage = 0;
psh.phpage = ahpsp;
psh.pszbmWatermark = MAKEINTRESOURCE(IDB_WATERMARK);
reactos/lib/twain
diff -u -r1.7.16.3 -r1.7.16.4
--- Makefile 13 Dec 2004 16:18:08 -0000 1.7.16.3
+++ Makefile 30 Dec 2004 04:36:45 -0000 1.7.16.4
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.7.16.3 2004/12/13 16:18:08 hyperion Exp $
+# $Id: Makefile,v 1.7.16.4 2004/12/30 04:36:45 hyperion Exp $
PATH_TO_TOP = ../..
reactos/lib/unicode
diff -u -r1.3.2.3 -r1.3.2.4
--- Makefile.ros-template 13 Dec 2004 16:18:08 -0000 1.3.2.3
+++ Makefile.ros-template 30 Dec 2004 04:36:45 -0000 1.3.2.4
@@ -1,4 +1,4 @@
-# $Id: Makefile.ros-template,v 1.3.2.3 2004/12/13 16:18:08 hyperion Exp $
+# $Id: Makefile.ros-template,v 1.3.2.4 2004/12/30 04:36:45 hyperion Exp $
TARGET_NAME = wine_unicode
reactos/lib/urlmon
diff -N sec_mgr.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ sec_mgr.c 30 Dec 2004 04:36:46 -0000 1.1.2.1
@@ -0,0 +1,455 @@
+/*
+ * Internet Security and Zone Manager
+ *
+ * Copyright (c) 2004 Huw D M Davies
+ * Copyright 2004 Jacek Caban
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <stdarg.h>
+#include <stdio.h>
+
+#define COBJMACROS
+
+#include "windef.h"
+#include "winbase.h"
+#include "winuser.h"
+#include "wine/debug.h"
+#include "ole2.h"
+#include "wine/unicode.h"
+#include "urlmon.h"
+#include "urlmon_main.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(urlmon);
+
+/***********************************************************************
+ * InternetSecurityManager implementation
+ *
+ */
+typedef struct SecManagerImpl{
+
+ IInternetSecurityManagerVtbl* lpvtbl1; /* VTable relative to the IInternetSecurityManager interface.*/
+
+ ULONG ref; /* reference counter for this object */
+
+} SecManagerImpl;
+
+static HRESULT WINAPI SecManagerImpl_QueryInterface(IInternetSecurityManager* iface,REFIID riid,void** ppvObject)
+{
+ SecManagerImpl *This = (SecManagerImpl *)iface;
+
+ TRACE("(%p)->(%s,%p)\n",This,debugstr_guid(riid),ppvObject);
+
+ /* Perform a sanity check on the parameters.*/
+ if ( (This==0) || (ppvObject==0) )
+ return E_INVALIDARG;
+
+ /* Initialize the return parameter */
+ *ppvObject = 0;
+
+ /* Compare the riid with the interface IDs implemented by this object.*/
+ if (IsEqualIID(&IID_IUnknown, riid) ||
+ IsEqualIID(&IID_IInternetSecurityManager, riid))
+ *ppvObject = iface;
+
+ /* Check that we obtained an interface.*/
+ if ((*ppvObject)==0)
+ return E_NOINTERFACE;
+
+ /* Query Interface always increases the reference count by one when it is successful */
+ IInternetSecurityManager_AddRef(iface);
+
+ return S_OK;
+}
+
+static ULONG WINAPI SecManagerImpl_AddRef(IInternetSecurityManager* iface)
+{
+ SecManagerImpl *This = (SecManagerImpl *)iface;
+
+ TRACE("(%p)\n",This);
+
+ return InterlockedIncrement(&This->ref);
+}
+
+static ULONG WINAPI SecManagerImpl_Release(IInternetSecurityManager* iface)
+{
+ SecManagerImpl *This = (SecManagerImpl *)iface;
+ ULONG ref;
+ TRACE("(%p)\n",This);
+
+ ref = InterlockedDecrement(&This->ref);
+
+ /* destroy the object if there's no more reference on it */
+ if (ref==0){
+ HeapFree(GetProcessHeap(),0,This);
+ }
+ return ref;
+}
+
+static HRESULT WINAPI SecManagerImpl_SetSecuritySite(IInternetSecurityManager *iface,
+ IInternetSecurityMgrSite *pSite)
+{
+ FIXME("(%p)->(%p)\n", iface, pSite);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI SecManagerImpl_GetSecuritySite(IInternetSecurityManager *iface,
+ IInternetSecurityMgrSite **ppSite)
+{
+ FIXME("(%p)->( %p)\n", iface, ppSite);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI SecManagerImpl_MapUrlToZone(IInternetSecurityManager *iface,
+ LPCWSTR pwszUrl, DWORD *pdwZone,
+ DWORD dwFlags)
+{
+ FIXME("(%p)->(%s %p %08lx)\n", iface, debugstr_w(pwszUrl), pdwZone, dwFlags);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI SecManagerImpl_GetSecurityId(IInternetSecurityManager *iface,
+ LPCWSTR pwszUrl,
+ BYTE *pbSecurityId, DWORD *pcbSecurityId,
+ DWORD dwReserved)
+{
+ FIXME("(%p)->(%s %p %p %08lx)\n", iface, debugstr_w(pwszUrl), pbSecurityId, pcbSecurityId,
+ dwReserved);
+ return E_NOTIMPL;
+}
+
+
+static HRESULT WINAPI SecManagerImpl_ProcessUrlAction(IInternetSecurityManager *iface,
+ LPCWSTR pwszUrl, DWORD dwAction,
+ BYTE *pPolicy, DWORD cbPolicy,
+ BYTE *pContext, DWORD cbContext,
+ DWORD dwFlags, DWORD dwReserved)
+{
+ FIXME("(%p)->(%s %08lx %p %08lx %p %08lx %08lx %08lx)\n", iface, debugstr_w(pwszUrl), dwAction,
+ pPolicy, cbPolicy, pContext, cbContext, dwFlags, dwReserved);
+ return E_NOTIMPL;
+}
+
+
+static HRESULT WINAPI SecManagerImpl_QueryCustomPolicy(IInternetSecurityManager *iface,
+ LPCWSTR pwszUrl, REFGUID guidKey,
+ BYTE **ppPolicy, DWORD *pcbPolicy,
+ BYTE *pContext, DWORD cbContext,
+ DWORD dwReserved)
+{
+ FIXME("(%p)->(%s %s %p %p %p %08lx %08lx )\n", iface, debugstr_w(pwszUrl), debugstr_guid(guidKey),
+ ppPolicy, pcbPolicy, pContext, cbContext, dwReserved);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI SecManagerImpl_SetZoneMapping(IInternetSecurityManager *iface,
+ DWORD dwZone, LPCWSTR pwszPattern, DWORD dwFlags)
+{
+ FIXME("(%p)->(%08lx %s %08lx)\n", iface, dwZone, debugstr_w(pwszPattern),dwFlags);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI SecManagerImpl_GetZoneMappings(IInternetSecurityManager *iface,
+ DWORD dwZone, IEnumString **ppenumString, DWORD dwFlags)
+{
+ FIXME("(%p)->(%08lx %p %08lx)\n", iface, dwZone, ppenumString,dwFlags);
+ return E_NOTIMPL;
+}
+
+static IInternetSecurityManagerVtbl VT_SecManagerImpl =
+{
+ SecManagerImpl_QueryInterface,
+ SecManagerImpl_AddRef,
+ SecManagerImpl_Release,
+ SecManagerImpl_SetSecuritySite,
+ SecManagerImpl_GetSecuritySite,
+ SecManagerImpl_MapUrlToZone,
+ SecManagerImpl_GetSecurityId,
+ SecManagerImpl_ProcessUrlAction,
+ SecManagerImpl_QueryCustomPolicy,
+ SecManagerImpl_SetZoneMapping,
+ SecManagerImpl_GetZoneMappings
+};
+
+HRESULT SecManagerImpl_Construct(IUnknown *pUnkOuter, LPVOID *ppobj)
+{
+ SecManagerImpl *This;
+
+ TRACE("(%p,%p)\n",pUnkOuter,ppobj);
+ This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This));
+
+ /* Initialize the virtual function table. */
+ This->lpvtbl1 = &VT_SecManagerImpl;
+ This->ref = 1;
+
+ *ppobj = This;
+ return S_OK;
+}
+
+/***********************************************************************
+ * InternetZoneManager implementation
+ *
+ */
+typedef struct {
+ IInternetZoneManagerVtbl* lpVtbl;
+ ULONG ref;
+} ZoneMgrImpl;
+
+/********************************************************************
+ * IInternetZoneManager_QueryInterface
+ */
+static HRESULT WINAPI ZoneMgrImpl_QueryInterface(IInternetZoneManager* iface, REFIID riid, void** ppvObject)
+{
+ ZoneMgrImpl* This = (ZoneMgrImpl*)iface;
+
+ TRACE("(%p)->(%s,%p)\n", This, debugstr_guid(riid), ppvObject);
+
+ if(!This || !ppvObject)
+ return E_INVALIDARG;
+
+ if(!IsEqualIID(&IID_IUnknown, riid) && !IsEqualIID(&IID_IInternetZoneManager, riid)) {
+ FIXME("Unknown interface: %s\n", debugstr_guid(riid));
+ *ppvObject = NULL;
+ return E_NOINTERFACE;
+ }
+
+ *ppvObject = iface;
+ IInternetZoneManager_AddRef(iface);
+
+ return S_OK;
+}
+
+/********************************************************************
+ * IInternetZoneManager_AddRef
+ */
+static ULONG WINAPI ZoneMgrImpl_AddRef(IInternetZoneManager* iface)
+{
+ ZoneMgrImpl* This = (ZoneMgrImpl*)iface;
+
+ TRACE("(%p) was %lu\n", This, This->ref);
+
+ return InterlockedIncrement(&This->ref);
+}
+
+/********************************************************************
+ * IInternetZoneManager_Release
+ */
+static ULONG WINAPI ZoneMgrImpl_Release(IInternetZoneManager* iface)
+{
+ ZoneMgrImpl* This = (ZoneMgrImpl*)iface;
+ ULONG ref;
+
+ TRACE("(%p) was %lu\n", This, This->ref);
+ ref = InterlockedDecrement(&This->ref);
+
+ if(!ref)
+ HeapFree(GetProcessHeap(), 0, This);
+
+ return ref;
+}
+
+/********************************************************************
+ * IInternetZoneManager_GetZoneAttributes
+ */
+static HRESULT WINAPI ZoneMgrImpl_GetZoneAttributes(IInternetZoneManager* iface,
+ DWORD dwZone,
+ ZONEATTRIBUTES* pZoneAttributes)
+{
+ FIXME("(%p)->(%ld %p) stub\n", iface, dwZone, pZoneAttributes);
+ return E_NOTIMPL;
+}
+
+/********************************************************************
+ * IInternetZoneManager_SetZoneAttributes
+ */
+static HRESULT WINAPI ZoneMgrImpl_SetZoneAttributes(IInternetZoneManager* iface,
+ DWORD dwZone,
+ ZONEATTRIBUTES* pZoneAttributes)
+{
+ FIXME("(%p)->(%08lx %p) stub\n", iface, dwZone, pZoneAttributes);
+ return E_NOTIMPL;
+}
+
+/********************************************************************
+ * IInternetZoneManager_GetZoneCustomPolicy
+ */
+static HRESULT WINAPI ZoneMgrImpl_GetZoneCustomPolicy(IInternetZoneManager* iface,
+ DWORD dwZone,
+ REFGUID guidKey,
+ BYTE** ppPolicy,
+ DWORD* pcbPolicy,
+ URLZONEREG ulrZoneReg)
+{
+ FIXME("(%p)->(%08lx %s %p %p %08x) stub\n", iface, dwZone, debugstr_guid(guidKey),
+ ppPolicy, pcbPolicy, ulrZoneReg);
+ return E_NOTIMPL;
+}
+
+/********************************************************************
+ * IInternetZoneManager_SetZoneCustomPolicy
+ */
+static HRESULT WINAPI ZoneMgrImpl_SetZoneCustomPolicy(IInternetZoneManager* iface,
+ DWORD dwZone,
+ REFGUID guidKey,
+ BYTE* ppPolicy,
+ DWORD cbPolicy,
+ URLZONEREG ulrZoneReg)
+{
+ FIXME("(%p)->(%08lx %s %p %08lx %08x) stub\n", iface, dwZone, debugstr_guid(guidKey),
+ ppPolicy, cbPolicy, ulrZoneReg);
+ return E_NOTIMPL;
+}
+
+/********************************************************************
+ * IInternetZoneManager_GetZoneActionPolicy
+ */
+static HRESULT WINAPI ZoneMgrImpl_GetZoneActionPolicy(IInternetZoneManager* iface,
+ DWORD dwZone,
+ DWORD dwAction,
+ BYTE* pPolicy,
+ DWORD cbPolicy,
+ URLZONEREG urlZoneReg)
+{
+ FIXME("(%p)->(%08lx %08lx %p %08lx %08x) stub\n", iface, dwZone, dwAction, pPolicy,
+ cbPolicy, urlZoneReg);
+ return E_NOTIMPL;
+}
+
+/********************************************************************
+ * IInternetZoneManager_SetZoneActionPolicy
+ */
+static HRESULT WINAPI ZoneMgrImpl_SetZoneActionPolicy(IInternetZoneManager* iface,
+ DWORD dwZone,
+ DWORD dwAction,
+ BYTE* pPolicy,
+ DWORD cbPolicy,
+ URLZONEREG urlZoneReg)
+{
+ FIXME("(%p)->(%08lx %08lx %p %08lx %08x) stub\n", iface, dwZone, dwAction, pPolicy,
+ cbPolicy, urlZoneReg);
+ return E_NOTIMPL;
+}
+
+/********************************************************************
+ * IInternetZoneManager_LogAction
+ */
+static HRESULT WINAPI ZoneMgrImpl_LogAction(IInternetZoneManager* iface,
+ DWORD dwAction,
+ LPCWSTR pwszUrl,
+ LPCWSTR pwszText,
+ DWORD dwLogFlags)
+{
+ FIXME("(%p)->(%08lx %s %s %08lx) stub\n", iface, dwAction, debugstr_w(pwszUrl),
+ debugstr_w(pwszText), dwLogFlags);
+ return E_NOTIMPL;
+}
+
+/********************************************************************
+ * IInternetZoneManager_CreateZoneEnumerator
+ */
+static HRESULT WINAPI ZoneMgrImpl_CreateZoneEnumerator(IInternetZoneManager* iface,
+ DWORD* pdwEnum,
+ DWORD* pdwCount,
+ DWORD dwFlags)
+{
+ FIXME("(%p)->(%p %p %08lx) stub\n", iface, pdwEnum, pdwCount, dwFlags);
+ return E_NOTIMPL;
+}
+
+/********************************************************************
+ * IInternetZoneManager_GetZoneAt
+ */
+static HRESULT WINAPI ZoneMgrImpl_GetZoneAt(IInternetZoneManager* iface,
+ DWORD dwEnum,
+ DWORD dwIndex,
+ DWORD* pdwZone)
+{
+ FIXME("(%p)->(%08lx %08lx %p) stub\n", iface, dwEnum, dwIndex, pdwZone);
+ return E_NOTIMPL;
+}
+
+/********************************************************************
+ * IInternetZoneManager_DestroyZoneEnumerator
+ */
+static HRESULT WINAPI ZoneMgrImpl_DestroyZoneEnumerator(IInternetZoneManager* iface,
+ DWORD dwEnum)
+{
+ FIXME("(%p)->(%08lx) stub\n", iface, dwEnum);
+ return E_NOTIMPL;
+}
+
+/********************************************************************
+ * IInternetZoneManager_CopyTemplatePoliciesToZone
+ */
+static HRESULT WINAPI ZoneMgrImpl_CopyTemplatePoliciesToZone(IInternetZoneManager* iface,
+ DWORD dwTemplate,
+ DWORD dwZone,
+ DWORD dwReserved)
+{
+ FIXME("(%p)->(%08lx %08lx %08lx) stub\n", iface, dwTemplate, dwZone, dwReserved);
+ return E_NOTIMPL;
+}
+
+/********************************************************************
+ * IInternetZoneManager_Construct
+ */
+static IInternetZoneManagerVtbl ZoneMgrImplVtbl = {
+ ZoneMgrImpl_QueryInterface,
+ ZoneMgrImpl_AddRef,
+ ZoneMgrImpl_Release,
+ ZoneMgrImpl_GetZoneAttributes,
+ ZoneMgrImpl_SetZoneAttributes,
+ ZoneMgrImpl_GetZoneCustomPolicy,
+ ZoneMgrImpl_SetZoneCustomPolicy,
+ ZoneMgrImpl_GetZoneActionPolicy,
+ ZoneMgrImpl_SetZoneActionPolicy,
+ ZoneMgrImpl_LogAction,
+ ZoneMgrImpl_CreateZoneEnumerator,
+ ZoneMgrImpl_GetZoneAt,
+ ZoneMgrImpl_DestroyZoneEnumerator,
+ ZoneMgrImpl_CopyTemplatePoliciesToZone,
+};
+HRESULT ZoneMgrImpl_Construct(IUnknown *pUnkOuter, LPVOID *ppobj)
+{
+ ZoneMgrImpl* ret = HeapAlloc(GetProcessHeap(), 0, sizeof(ZoneMgrImpl));
+
+ TRACE("(%p %p)\n", pUnkOuter, ppobj);
+ ret->lpVtbl = &ZoneMgrImplVtbl;
+ ret->ref = 1;
+ *ppobj = (IInternetZoneManager*)ret;
+
+ return S_OK;
+}
+
+/***********************************************************************
+ * CoInternetCreateSecurityManager (URLMON.@)
+ *
+ */
+HRESULT WINAPI CoInternetCreateSecurityManager( IServiceProvider *pSP,
+ IInternetSecurityManager **ppSM, DWORD dwReserved )
+{
+ TRACE("%p %p %ld\n", pSP, ppSM, dwReserved );
+ return SecManagerImpl_Construct(NULL, (void**) ppSM);
+}
+
+/********************************************************************
+ * CoInternetCreateZoneManager (URLMON.@)
+ */
+HRESULT WINAPI CoInternetCreateZoneManager(IServiceProvider* pSP, IInternetZoneManager** ppZM, DWORD dwReserved)
+{
+ TRACE("(%p %p %lx)\n", pSP, ppZM, dwReserved);
+ return ZoneMgrImpl_Construct(NULL, (void**)ppZM);
+}
reactos/lib/urlmon
diff -u -r1.1 -r1.1.8.1
--- .cvsignore 13 Aug 2004 06:14:48 -0000 1.1
+++ .cvsignore 30 Dec 2004 04:36:45 -0000 1.1.8.1
@@ -0,0 +1,11 @@
+*.coff
+*.dll
+*.d
+*.a
+*.o
+*.sym
+*.map
+*.tmp
+Makefile.ros
+urlmon.spec.def
+urlmon.stubs.c
reactos/lib/urlmon
diff -u -r1.1 -r1.1.8.1
--- Makefile.in 13 Aug 2004 06:14:48 -0000 1.1
+++ Makefile.in 30 Dec 2004 04:36:45 -0000 1.1.8.1
@@ -3,11 +3,12 @@
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = urlmon.dll
-IMPORTS = wininet cabinet ole32 shlwapi user32 advapi32 kernel32 ntdll
+IMPORTS = cabinet ole32 shlwapi wininet user32 advapi32 kernel32 ntdll
EXTRALIBS = -luuid
C_SRCS = \
regsvr.c \
+ sec_mgr.c \
umon.c \
urlmon_main.c
reactos/lib/urlmon
diff -u -r1.2.8.3 -r1.2.8.4
--- Makefile.ros-template 13 Dec 2004 16:18:09 -0000 1.2.8.3
+++ Makefile.ros-template 30 Dec 2004 04:36:45 -0000 1.2.8.4
@@ -1,4 +1,4 @@
-# $Id: Makefile.ros-template,v 1.2.8.3 2004/12/13 16:18:09 hyperion Exp $
+# $Id: Makefile.ros-template,v 1.2.8.4 2004/12/30 04:36:45 hyperion Exp $
TARGET_NAME = urlmon
reactos/lib/urlmon
diff -u -r1.2 -r1.2.8.1
--- umon.c 14 Aug 2004 20:43:40 -0000 1.2
+++ umon.c 30 Dec 2004 04:36:45 -0000 1.2.8.1
@@ -19,15 +19,14 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "config.h"
-#include "wine/port.h"
-
#define COM_NO_WINDOWS_H
#include <stdarg.h>
#include <stdio.h>
+#define COBJMACROS
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
+
#include "windef.h"
#include "winbase.h"
#include "winreg.h"
@@ -64,107 +63,12 @@
HINTERNET hinternet, hconnect, hrequest;
} URLMonikerImpl;
-/********************************************************************************/
-/* URLMoniker prototype functions : */
-
-/* IUnknown prototype functions */
-static HRESULT WINAPI URLMonikerImpl_QueryInterface(IMoniker* iface,REFIID riid,void** ppvObject);
-static ULONG WINAPI URLMonikerImpl_AddRef(IMoniker* iface);
-static ULONG WINAPI URLMonikerImpl_Release(IMoniker* iface);
-
-/* IPersist prototype functions */
-static HRESULT WINAPI URLMonikerImpl_GetClassID(IMoniker* iface, CLSID *pClassID);
-
-/* IPersistStream prototype functions */
-static HRESULT WINAPI URLMonikerImpl_IsDirty(IMoniker* iface);
-static HRESULT WINAPI URLMonikerImpl_Load(IMoniker* iface, IStream* pStm);
-static HRESULT WINAPI URLMonikerImpl_Save(IMoniker* iface, IStream* pStm, BOOL fClearDirty);
-static HRESULT WINAPI URLMonikerImpl_GetSizeMax(IMoniker* iface, ULARGE_INTEGER* pcbSize);
-
-/* IMoniker prototype functions */
-static HRESULT WINAPI URLMonikerImpl_BindToObject(IMoniker* iface,IBindCtx* pbc, IMoniker* pmkToLeft, REFIID riid, VOID** ppvResult);
-static HRESULT WINAPI URLMonikerImpl_BindToStorage(IMoniker* iface,IBindCtx* pbc, IMoniker* pmkToLeft, REFIID riid, VOID** ppvResult);
-static HRESULT WINAPI URLMonikerImpl_Reduce(IMoniker* iface,IBindCtx* pbc, DWORD dwReduceHowFar,IMoniker** ppmkToLeft, IMoniker** ppmkReduced);
-static HRESULT WINAPI URLMonikerImpl_ComposeWith(IMoniker* iface,IMoniker* pmkRight,BOOL fOnlyIfNotGeneric, IMoniker** ppmkComposite);
-static HRESULT WINAPI URLMonikerImpl_Enum(IMoniker* iface,BOOL fForward, IEnumMoniker** ppenumMoniker);
-static HRESULT WINAPI URLMonikerImpl_IsEqual(IMoniker* iface,IMoniker* pmkOtherMoniker);
-static HRESULT WINAPI URLMonikerImpl_Hash(IMoniker* iface,DWORD* pdwHash);
-static HRESULT WINAPI URLMonikerImpl_IsRunning(IMoniker* iface,IBindCtx* pbc, IMoniker* pmkToLeft, IMoniker* pmkNewlyRunning);
-static HRESULT WINAPI URLMonikerImpl_GetTimeOfLastChange(IMoniker* iface, IBindCtx* pbc, IMoniker* pmkToLeft, FILETIME* pFileTime);
-static HRESULT WINAPI URLMonikerImpl_Inverse(IMoniker* iface,IMoniker** ppmk);
-static HRESULT WINAPI URLMonikerImpl_CommonPrefixWith(IMoniker* iface,IMoniker* pmkOther, IMoniker** ppmkPrefix);
-static HRESULT WINAPI URLMonikerImpl_RelativePathTo(IMoniker* iface,IMoniker* pmOther, IMoniker** ppmkRelPath);
-static HRESULT WINAPI URLMonikerImpl_GetDisplayName(IMoniker* iface,IBindCtx* pbc, IMoniker* pmkToLeft, LPOLESTR *ppszDisplayName);
-static HRESULT WINAPI URLMonikerImpl_ParseDisplayName(IMoniker* iface,IBindCtx* pbc, IMoniker* pmkToLeft, LPOLESTR pszDisplayName, ULONG* pchEaten, IMoniker** ppmkOut);
-static HRESULT WINAPI URLMonikerImpl_IsSystemMoniker(IMoniker* iface,DWORD* pwdMksys);
-
-/* IBinding interface to moniker */
-static HRESULT WINAPI URLMonikerImpl_IBinding_QueryInterface(IBinding* iface,REFIID riid,void** ppvObject);
-static ULONG WINAPI URLMonikerImpl_IBinding_AddRef(IBinding* iface);
-static ULONG WINAPI URLMonikerImpl_IBinding_Release(IBinding* iface);
-static HRESULT WINAPI URLMonikerImpl_IBinding_Abort(IBinding* iface);
-static HRESULT WINAPI URLMonikerImpl_IBinding_Suspend(IBinding* iface);
-static HRESULT WINAPI URLMonikerImpl_IBinding_Resume(IBinding* iface);
-static HRESULT WINAPI URLMonikerImpl_IBinding_SetPriority(IBinding* iface, LONG nPriority);
-static HRESULT WINAPI URLMonikerImpl_IBinding_GetPriority(IBinding* iface, LONG* pnPriority);
-static HRESULT WINAPI URLMonikerImpl_IBinding_GetBindResult(IBinding* iface, CLSID* pclsidProtocol, DWORD* pdwResult, LPOLESTR* pszResult, DWORD* pdwReserved);
-
-/* Local function used by urlmoniker implementation */
-static HRESULT URLMonikerImpl_Construct(URLMonikerImpl* iface, LPCOLESTR lpszLeftURL, LPCOLESTR lpszURL);
-static HRESULT URLMonikerImpl_Destroy(URLMonikerImpl* iface);
-
-/********************************************************************************/
-/* Virtual function table for the URLMonikerImpl class which include IPersist,*/
-/* IPersistStream and IMoniker functions. */
-static IMonikerVtbl VT_URLMonikerImpl =
-{
- ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
- URLMonikerImpl_QueryInterface,
- URLMonikerImpl_AddRef,
- URLMonikerImpl_Release,
- URLMonikerImpl_GetClassID,
- URLMonikerImpl_IsDirty,
- URLMonikerImpl_Load,
- URLMonikerImpl_Save,
- URLMonikerImpl_GetSizeMax,
- URLMonikerImpl_BindToObject,
- URLMonikerImpl_BindToStorage,
- URLMonikerImpl_Reduce,
- URLMonikerImpl_ComposeWith,
- URLMonikerImpl_Enum,
- URLMonikerImpl_IsEqual,
- URLMonikerImpl_Hash,
- URLMonikerImpl_IsRunning,
- URLMonikerImpl_GetTimeOfLastChange,
- URLMonikerImpl_Inverse,
- URLMonikerImpl_CommonPrefixWith,
- URLMonikerImpl_RelativePathTo,
- URLMonikerImpl_GetDisplayName,
- URLMonikerImpl_ParseDisplayName,
- URLMonikerImpl_IsSystemMoniker
-};
-
-static IBindingVtbl VTBinding_URLMonikerImpl =
-{
- ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
- URLMonikerImpl_IBinding_QueryInterface,
- URLMonikerImpl_IBinding_AddRef,
- URLMonikerImpl_IBinding_Release,
- URLMonikerImpl_IBinding_Abort,
- URLMonikerImpl_IBinding_Suspend,
- URLMonikerImpl_IBinding_Resume,
- URLMonikerImpl_IBinding_SetPriority,
- URLMonikerImpl_IBinding_GetPriority,
- URLMonikerImpl_IBinding_GetBindResult
-};
-
-
/*******************************************************************************
* URLMoniker_QueryInterface
*******************************************************************************/
static HRESULT WINAPI URLMonikerImpl_QueryInterface(IMoniker* iface,REFIID riid,void** ppvObject)
{
- ICOM_THIS(URLMonikerImpl,iface);
+ URLMonikerImpl *This = (URLMonikerImpl *)iface;
TRACE("(%p)->(%s,%p)\n",This,debugstr_guid(riid),ppvObject);
@@ -188,7 +92,7 @@
return E_NOINTERFACE;
/* Query Interface always increases the reference count by one when it is successful */
- URLMonikerImpl_AddRef(iface);
+ IMoniker_AddRef(iface);
return S_OK;
}
@@ -198,11 +102,11 @@
******************************************************************************/
static ULONG WINAPI URLMonikerImpl_AddRef(IMoniker* iface)
{
- ICOM_THIS(URLMonikerImpl,iface);
+ URLMonikerImpl *This = (URLMonikerImpl *)iface;
TRACE("(%p)\n",This);
- return ++(This->ref);
+ return InterlockedIncrement(&This->ref);
}
/******************************************************************************
@@ -210,20 +114,22 @@
******************************************************************************/
static ULONG WINAPI URLMonikerImpl_Release(IMoniker* iface)
{
- ICOM_THIS(URLMonikerImpl,iface);
+ URLMonikerImpl *This = (URLMonikerImpl *)iface;
+ ULONG ref;
TRACE("(%p)\n",This);
- This->ref--;
+ ref = InterlockedDecrement(&This->ref);
/* destroy the object if there's no more reference on it */
- if (This->ref==0){
-
- URLMonikerImpl_Destroy(This);
+ if (ref == 0) {
+ if (This->URLName!=NULL)
+ HeapFree(GetProcessHeap(),0,This->URLName);
- return 0;
+ HeapFree(GetProcessHeap(),0,This);
}
- return This->ref;
+
+ return ref;
}
/******************************************************************************
@@ -232,7 +138,7 @@
static HRESULT WINAPI URLMonikerImpl_GetClassID(IMoniker* iface,
CLSID *pClassID)/* Pointer to CLSID of object */
{
- ICOM_THIS(URLMonikerImpl,iface);
+ URLMonikerImpl *This = (URLMonikerImpl *)iface;
TRACE("(%p,%p)\n",This,pClassID);
@@ -248,7 +154,7 @@
******************************************************************************/
static HRESULT WINAPI URLMonikerImpl_IsDirty(IMoniker* iface)
{
- ICOM_THIS(URLMonikerImpl,iface);
+ URLMonikerImpl *This = (URLMonikerImpl *)iface;
/* Note that the OLE-provided implementations of the IPersistStream::IsDirty
method in the OLE-provided moniker interfaces always return S_FALSE because
their internal state never changes. */
@@ -267,7 +173,7 @@
******************************************************************************/
static HRESULT WINAPI URLMonikerImpl_Load(IMoniker* iface,IStream* pStm)
{
- ICOM_THIS(URLMonikerImpl,iface);
+ URLMonikerImpl *This = (URLMonikerImpl *)iface;
HRESULT res;
ULONG len;
@@ -303,7 +209,7 @@
IStream* pStm,/* pointer to the stream where the object is to be saved */
BOOL fClearDirty)/* Specifies whether to clear the dirty flag */
{
- ICOM_THIS(URLMonikerImpl,iface);
+ URLMonikerImpl *This = (URLMonikerImpl *)iface;
HRESULT res;
ULONG len;
@@ -326,7 +232,7 @@
static HRESULT WINAPI URLMonikerImpl_GetSizeMax(IMoniker* iface,
ULARGE_INTEGER* pcbSize)/* Pointer to size of stream needed to save object */
{
- ICOM_THIS(URLMonikerImpl,iface);
+ URLMonikerImpl *This = (URLMonikerImpl *)iface;
TRACE("(%p,%p)\n",This,pcbSize);
@@ -339,67 +245,6 @@
}
/******************************************************************************
- * URLMoniker_Construct (local function)
- *******************************************************************************/
-static HRESULT URLMonikerImpl_Construct(URLMonikerImpl* This, LPCOLESTR lpszLeftURLName, LPCOLESTR lpszURLName)
-{
- HRESULT hres;
- DWORD sizeStr;
-
- TRACE("(%p,%s,%s)\n",This,debugstr_w(lpszLeftURLName),debugstr_w(lpszURLName));
- memset(This, 0, sizeof(*This));
-
- /* Initialize the virtual function table. */
- This->lpvtbl1 = &VT_URLMonikerImpl;
- This->lpvtbl2 = &VTBinding_URLMonikerImpl;
- This->ref = 0;
-
- if(lpszLeftURLName) {
- hres = UrlCombineW(lpszLeftURLName, lpszURLName, NULL, &sizeStr, 0);
- if(FAILED(hres)) {
- return hres;
- }
- sizeStr++;
- }
- else
- sizeStr = lstrlenW(lpszURLName)+1;
-
- This->URLName=HeapAlloc(GetProcessHeap(),0,sizeof(WCHAR)*(sizeStr));
-
- if (This->URLName==NULL)
- return E_OUTOFMEMORY;
-
- if(lpszLeftURLName) {
- hres = UrlCombineW(lpszLeftURLName, lpszURLName, This->URLName, &sizeStr, 0);
- if(FAILED(hres)) {
- HeapFree(GetProcessHeap(), 0, This->URLName);
- return hres;
- }
- }
- else
- strcpyW(This->URLName,lpszURLName);
-
- return S_OK;
-}
-
-
-
-/******************************************************************************
- * URLMoniker_Destroy (local function)
- *******************************************************************************/
-static HRESULT URLMonikerImpl_Destroy(URLMonikerImpl* This)
-{
- TRACE("(%p)\n",This);
-
- if (This->URLName!=NULL)
- HeapFree(GetProcessHeap(),0,This->URLName);
-
- HeapFree(GetProcessHeap(),0,This);
-
- return S_OK;
-}
-
-/******************************************************************************
* URLMoniker_BindToObject
******************************************************************************/
static HRESULT WINAPI URLMonikerImpl_BindToObject(IMoniker* iface,
@@ -408,7 +253,7 @@
REFIID riid,
VOID** ppvResult)
{
- ICOM_THIS(URLMonikerImpl,iface);
+ URLMonikerImpl *This = (URLMonikerImpl *)iface;
*ppvResult=0;
@@ -474,7 +319,7 @@
REFIID riid,
VOID** ppvObject)
{
- ICOM_THIS(URLMonikerImpl,iface);
+ URLMonikerImpl *This = (URLMonikerImpl *)iface;
HRESULT hres;
IBindStatusCallback *pbscb;
BINDINFO bi;
@@ -618,7 +463,7 @@
IMoniker** ppmkToLeft,
IMoniker** ppmkReduced)
{
- ICOM_THIS(URLMonikerImpl,iface);
+ URLMonikerImpl *This = (URLMonikerImpl *)iface;
TRACE("(%p,%p,%ld,%p,%p)\n",This,pbc,dwReduceHowFar,ppmkToLeft,ppmkReduced);
@@ -638,7 +483,7 @@
BOOL fOnlyIfNotGeneric,
IMoniker** ppmkComposite)
{
- ICOM_THIS(URLMonikerImpl,iface);
+ URLMonikerImpl *This = (URLMonikerImpl *)iface;
FIXME("(%p)->(%p,%d,%p): stub\n",This,pmkRight,fOnlyIfNotGeneric,ppmkComposite);
return E_NOTIMPL;
@@ -649,7 +494,7 @@
******************************************************************************/
static HRESULT WINAPI URLMonikerImpl_Enum(IMoniker* iface,BOOL fForward, IEnumMoniker** ppenumMoniker)
{
- ICOM_THIS(URLMonikerImpl,iface);
+ URLMonikerImpl *This = (URLMonikerImpl *)iface;
TRACE("(%p,%d,%p)\n",This,fForward,ppenumMoniker);
if(!ppenumMoniker)
@@ -665,7 +510,7 @@
******************************************************************************/
static HRESULT WINAPI URLMonikerImpl_IsEqual(IMoniker* iface,IMoniker* pmkOtherMoniker)
{
- ICOM_THIS(URLMonikerImpl,iface);
+ URLMonikerImpl *This = (URLMonikerImpl *)iface;
CLSID clsid;
LPOLESTR urlPath;
IBindCtx* bind;
@@ -702,7 +547,7 @@
******************************************************************************/
static HRESULT WINAPI URLMonikerImpl_Hash(IMoniker* iface,DWORD* pdwHash)
{
- ICOM_THIS(URLMonikerImpl,iface);
+ URLMonikerImpl *This = (URLMonikerImpl *)iface;
int h = 0,i,skip,len;
int off = 0;
@@ -740,7 +585,7 @@
IMoniker* pmkToLeft,
IMoniker* pmkNewlyRunning)
{
- ICOM_THIS(URLMonikerImpl,iface);
+ URLMonikerImpl *This = (URLMonikerImpl *)iface;
FIXME("(%p)->(%p,%p,%p): stub\n",This,pbc,pmkToLeft,pmkNewlyRunning);
return E_NOTIMPL;
@@ -754,7 +599,7 @@
IMoniker* pmkToLeft,
FILETIME* pFileTime)
{
- ICOM_THIS(URLMonikerImpl,iface);
+ URLMonikerImpl *This = (URLMonikerImpl *)iface;
FIXME("(%p)->(%p,%p,%p): stub\n",This,pbc,pmkToLeft,pFileTime);
return E_NOTIMPL;
@@ -765,7 +610,7 @@
******************************************************************************/
static HRESULT WINAPI URLMonikerImpl_Inverse(IMoniker* iface,IMoniker** ppmk)
{
- ICOM_THIS(URLMonikerImpl,iface);
+ URLMonikerImpl *This = (URLMonikerImpl *)iface;
TRACE("(%p,%p)\n",This,ppmk);
return MK_E_NOINVERSE;
@@ -776,7 +621,7 @@
******************************************************************************/
static HRESULT WINAPI URLMonikerImpl_CommonPrefixWith(IMoniker* iface,IMoniker* pmkOther,IMoniker** ppmkPrefix)
{
- ICOM_THIS(URLMonikerImpl,iface);
+ URLMonikerImpl *This = (URLMonikerImpl *)iface;
FIXME("(%p)->(%p,%p): stub\n",This,pmkOther,ppmkPrefix);
return E_NOTIMPL;
@@ -787,7 +632,7 @@
******************************************************************************/
static HRESULT WINAPI URLMonikerImpl_RelativePathTo(IMoniker* iface,IMoniker* pmOther, IMoniker** ppmkRelPath)
{
- ICOM_THIS(URLMonikerImpl,iface);
+ URLMonikerImpl *This = (URLMonikerImpl *)iface;
FIXME("(%p)->(%p,%p): stub\n",This,pmOther,ppmkRelPath);
return E_NOTIMPL;
@@ -801,7 +646,7 @@
IMoniker* pmkToLeft,
LPOLESTR *ppszDisplayName)
{
- ICOM_THIS(URLMonikerImpl,iface);
+ URLMonikerImpl *This = (URLMonikerImpl *)iface;
int len;
@@ -831,7 +676,7 @@
ULONG* pchEaten,
IMoniker** ppmkOut)
{
- ICOM_THIS(URLMonikerImpl,iface);
+ URLMonikerImpl *This = (URLMonikerImpl *)iface;
FIXME("(%p)->(%p,%p,%p,%p,%p): stub\n",This,pbc,pmkToLeft,pszDisplayName,pchEaten,ppmkOut);
return E_NOTIMPL;
@@ -842,7 +687,7 @@
******************************************************************************/
static HRESULT WINAPI URLMonikerImpl_IsSystemMoniker(IMoniker* iface,DWORD* pwdMksys)
{
- ICOM_THIS(URLMonikerImpl,iface);
+ URLMonikerImpl *This = (URLMonikerImpl *)iface;
TRACE("(%p,%p)\n",This,pwdMksys);
if(!pwdMksys)
@@ -874,7 +719,7 @@
return E_NOINTERFACE;
/* Query Interface always increases the reference count by one when it is successful */
- URLMonikerImpl_IBinding_AddRef(iface);
+ IBinding_AddRef(iface);
return S_OK;
@@ -944,6 +789,93 @@
return E_NOTIMPL;
}
+/********************************************************************************/
+/* Virtual function table for the URLMonikerImpl class which include IPersist,*/
+/* IPersistStream and IMoniker functions. */
+static IMonikerVtbl VT_URLMonikerImpl =
+{
+ URLMonikerImpl_QueryInterface,
+ URLMonikerImpl_AddRef,
+ URLMonikerImpl_Release,
+ URLMonikerImpl_GetClassID,
+ URLMonikerImpl_IsDirty,
+ URLMonikerImpl_Load,
+ URLMonikerImpl_Save,
+ URLMonikerImpl_GetSizeMax,
+ URLMonikerImpl_BindToObject,
+ URLMonikerImpl_BindToStorage,
+ URLMonikerImpl_Reduce,
+ URLMonikerImpl_ComposeWith,
+ URLMonikerImpl_Enum,
+ URLMonikerImpl_IsEqual,
+ URLMonikerImpl_Hash,
+ URLMonikerImpl_IsRunning,
+ URLMonikerImpl_GetTimeOfLastChange,
+ URLMonikerImpl_Inverse,
+ URLMonikerImpl_CommonPrefixWith,
+ URLMonikerImpl_RelativePathTo,
+ URLMonikerImpl_GetDisplayName,
+ URLMonikerImpl_ParseDisplayName,
+ URLMonikerImpl_IsSystemMoniker
+};
+
+static IBindingVtbl VTBinding_URLMonikerImpl =
+{
+ URLMonikerImpl_IBinding_QueryInterface,
+ URLMonikerImpl_IBinding_AddRef,
+ URLMonikerImpl_IBinding_Release,
+ URLMonikerImpl_IBinding_Abort,
+ URLMonikerImpl_IBinding_Suspend,
+ URLMonikerImpl_IBinding_Resume,
+ URLMonikerImpl_IBinding_SetPriority,
+ URLMonikerImpl_IBinding_GetPriority,
+ URLMonikerImpl_IBinding_GetBindResult
+};
+
+/******************************************************************************
+ * URLMoniker_Construct (local function)
+ *******************************************************************************/
+static HRESULT URLMonikerImpl_Construct(URLMonikerImpl* This, LPCOLESTR lpszLeftURLName, LPCOLESTR lpszURLName)
+{
+ HRESULT hres;
+ DWORD sizeStr;
+
+ TRACE("(%p,%s,%s)\n",This,debugstr_w(lpszLeftURLName),debugstr_w(lpszURLName));
+ memset(This, 0, sizeof(*This));
+
+ /* Initialize the virtual function table. */
+ This->lpvtbl1 = &VT_URLMonikerImpl;
+ This->lpvtbl2 = &VTBinding_URLMonikerImpl;
+ This->ref = 0;
+
+ if(lpszLeftURLName) {
+ hres = UrlCombineW(lpszLeftURLName, lpszURLName, NULL, &sizeStr, 0);
+ if(FAILED(hres)) {
+ return hres;
+ }
+ sizeStr++;
+ }
+ else
+ sizeStr = lstrlenW(lpszURLName)+1;
+
+ This->URLName=HeapAlloc(GetProcessHeap(),0,sizeof(WCHAR)*(sizeStr));
+
+ if (This->URLName==NULL)
+ return E_OUTOFMEMORY;
+
+ if(lpszLeftURLName) {
+ hres = UrlCombineW(lpszLeftURLName, lpszURLName, This->URLName, &sizeStr, 0);
+ if(FAILED(hres)) {
+ HeapFree(GetProcessHeap(), 0, This->URLName);
+ return hres;
+ }
+ }
+ else
+ strcpyW(This->URLName,lpszURLName);
+
+ return S_OK;
+}
+
/***********************************************************************
* CreateAsyncBindCtx (URLMON.@)
*/
@@ -1069,22 +1001,9 @@
return S_OK;
}
-/***********************************************************************
- * CoInternetCreateSecurityManager (URLMON.@)
- *
- */
-typedef void *IInternetSecurityManager;
-HRESULT CoInternetCreateSecurityManager( IServiceProvider *pSP,
- IInternetSecurityManager **ppSM, DWORD dwReserved )
-{
- FIXME("%p %ld\n", pSP, dwReserved );
- return E_NOTIMPL;
-}
-
static BOOL URLMON_IsBinary(LPVOID pBuffer, DWORD cbSize)
{
- int binarycount = 0;
- int i;
+ unsigned int i, binarycount = 0;
unsigned char *buff = pBuffer;
for(i=0; i<cbSize; i++) {
if(buff[i] < 32)
@@ -1186,7 +1105,7 @@
{
IBindStatusCallback *prev;
- TRACE("(%p,%p,%p,%lu)\n", pbc, pbsc, ppbscPrevious, dwReserved);
+ TRACE("(%p,%p,%p,%lu)\n", pbc, pbsc, ppbscPrevious, dwReserved);
if (pbc == NULL || pbsc == NULL)
return E_INVALIDARG;
reactos/lib/urlmon
diff -u -r1.1 -r1.1.8.1
--- urlmon.spec 13 Aug 2004 06:14:48 -0000 1.1
+++ urlmon.spec 30 Dec 2004 04:36:46 -0000 1.1.8.1
@@ -8,7 +8,7 @@
@ stdcall CoInternetCombineUrl(wstr wstr long wstr long ptr long)
@ stdcall CoInternetCompareUrl(wstr wstr long)
@ stdcall CoInternetCreateSecurityManager(ptr ptr long)
-@ stub CoInternetCreateZoneManager
+@ stdcall CoInternetCreateZoneManager(ptr ptr long)
@ stub CoInternetGetProtocolFlags
@ stub CoInternetGetSecurityUrl
@ stdcall CoInternetGetSession(long ptr long)
@@ -46,7 +46,7 @@
@ stdcall IsAsyncMoniker(ptr)
@ stub IsLoggingEnabledA
@ stub IsLoggingEnabledW
-@ stub IsValidURL
+@ stdcall IsValidURL(ptr wstr long)
@ stdcall MkParseDisplayNameEx(ptr ptr ptr ptr) ole32.MkParseDisplayName
@ stdcall ObtainUserAgentString(long str ptr)
@ stub PrivateCoInstall
@@ -71,7 +71,7 @@
@ stub URLOpenStreamA
@ stub URLOpenStreamW
@ stub UrlMkBuildVersion
-@ stub UrlMkGetSessionOption
+@ stdcall UrlMkGetSessionOption(long ptr long ptr long)
@ stdcall UrlMkSetSessionOption(long ptr long long)
@ stub WriteHitLogging
@ stub ZonesReInit
reactos/lib/urlmon
diff -u -r1.1 -r1.1.8.1
--- urlmon_main.c 13 Aug 2004 06:14:48 -0000 1.1
+++ urlmon_main.c 30 Dec 2004 04:36:46 -0000 1.1.8.1
@@ -20,6 +20,8 @@
#include <stdarg.h>
+#define COBJMACROS
+
#include "windef.h"
#include "winbase.h"
#include "winerror.h"
@@ -29,6 +31,8 @@
#include "wine/debug.h"
+#include "winuser.h"
+#include "urlmon.h"
#include "urlmon_main.h"
WINE_DEFAULT_DEBUG_CHANNEL(urlmon);
@@ -77,18 +81,153 @@
return S_FALSE;
}
-/***********************************************************************
- * DllGetClassObject (URLMON.@)
+
+
+/******************************************************************************
+ * Urlmon ClassFactory
*/
-HRESULT WINAPI URLMON_DllGetClassObject(REFCLSID rclsid, REFIID riid,
- LPVOID *ppv)
+typedef struct {
+ IClassFactory ITF_IClassFactory;
+
+ DWORD ref;
+ HRESULT (*pfnCreateInstance)(IUnknown *pUnkOuter, LPVOID *ppObj);
+} IClassFactoryImpl;
+
+struct object_creation_info
+{
+ const CLSID *clsid;
+ HRESULT (*pfnCreateInstance)(IUnknown *pUnkOuter, LPVOID *ppObj);
+};
+
+static const struct object_creation_info object_creation[] =
+{
+ { &CLSID_InternetSecurityManager, &SecManagerImpl_Construct },
+ { &CLSID_InternetZoneManager, ZoneMgrImpl_Construct }
+};
+
+static HRESULT WINAPI
+CF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj)
{
- FIXME("(%p, %p, %p): stub\n", debugstr_guid(rclsid),
- debugstr_guid(riid), ppv);
+ IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
- return CLASS_E_CLASSNOTAVAILABLE;
+ if (IsEqualGUID(riid, &IID_IUnknown)
+ || IsEqualGUID(riid, &IID_IClassFactory))
+ {
+ IClassFactory_AddRef(iface);
+ *ppobj = This;
+ return S_OK;
+ }
+
+ WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
+ return E_NOINTERFACE;
+}
+
+static ULONG WINAPI CF_AddRef(LPCLASSFACTORY iface)
+{
+ IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
+ return InterlockedIncrement(&This->ref);
+}
+
+static ULONG WINAPI CF_Release(LPCLASSFACTORY iface)
+{
+ IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
+
+ ULONG ref = InterlockedDecrement(&This->ref);
+
+ if (ref == 0)
+ HeapFree(GetProcessHeap(), 0, This);
+
+ return ref;
+}
+
+
+static HRESULT WINAPI CF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter,
+ REFIID riid, LPVOID *ppobj)
+{
+ IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
+ HRESULT hres;
+ LPUNKNOWN punk;
+
+ TRACE("(%p)->(%p,%s,%p)\n",This,pOuter,debugstr_guid(riid),ppobj);
+
+ *ppobj = NULL;
+ if(SUCCEEDED(hres = This->pfnCreateInstance(pOuter, (LPVOID *) &punk))) {
+ hres = IUnknown_QueryInterface(punk, riid, ppobj);
+ IUnknown_Release(punk);
+ }
+ return hres;
+}
+
+static HRESULT WINAPI CF_LockServer(LPCLASSFACTORY iface,BOOL dolock)
+{
+ IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
+ FIXME("(%p)->(%d),stub!\n",This,dolock);
+ return S_OK;
}
+static IClassFactoryVtbl CF_Vtbl =
+{
+ CF_QueryInterface,
+ CF_AddRef,
+ CF_Release,
+ CF_CreateInstance,
+ CF_LockServer
+};
+
+/*******************************************************************************
+ * DllGetClassObject [URLMON.@]
+ * Retrieves class object from a DLL object
+ *
+ * NOTES
+ * Docs say returns STDAPI
+ *
+ * PARAMS
+ * rclsid [I] CLSID for the class object
+ * riid [I] Reference to identifier of interface for class object
+ * ppv [O] Address of variable to receive interface pointer for riid
+ *
+ * RETURNS
+ * Success: S_OK
+ * Failure: CLASS_E_CLASSNOTAVAILABLE, E_OUTOFMEMORY, E_INVALIDARG,
+ * E_UNEXPECTED
+ */
+
+DWORD WINAPI URLMON_DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
+{
+ int i;
+ IClassFactoryImpl *factory;
+
+ TRACE("(%s,%s,%p)\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
+
+ if ( !IsEqualGUID( &IID_IClassFactory, riid )
+ && ! IsEqualGUID( &IID_IUnknown, riid) )
+ return E_NOINTERFACE;
+
+ for (i=0; i < sizeof(object_creation)/sizeof(object_creation[0]); i++)
+ {
+ if (IsEqualGUID(object_creation[i].clsid, rclsid))
+ break;
+ }
+
+ if (i == sizeof(object_creation)/sizeof(object_creation[0]))
+ {
+ FIXME("%s: no class found.\n", debugstr_guid(rclsid));
+ return CLASS_E_CLASSNOTAVAILABLE;
+ }
+
+ factory = HeapAlloc(GetProcessHeap(), 0, sizeof(*factory));
+ if (factory == NULL) return E_OUTOFMEMORY;
+
+ factory->ITF_IClassFactory.lpVtbl = &CF_Vtbl;
+ factory->ref = 1;
+
+ factory->pfnCreateInstance = object_creation[i].pfnCreateInstance;
+
+ *ppv = &(factory->ITF_IClassFactory);
+ return S_OK;
+}
+
+
/***********************************************************************
* DllRegisterServerEx (URLMON.@)
*/
@@ -102,10 +241,21 @@
/**************************************************************************
* UrlMkSetSessionOption (URLMON.@)
*/
- HRESULT WINAPI UrlMkSetSessionOption(long lost, LPVOID *splat, long time,
- long nosee)
+HRESULT WINAPI UrlMkSetSessionOption(DWORD dwOption, LPVOID *pBuffer, DWORD dwBufferLength,
+ DWORD Reserved)
+{
+ FIXME("(%#lx, %p, %#lx): stub\n", dwOption, pBuffer, dwBufferLength);
+
+ return S_OK;
+}
+
+/**************************************************************************
+ * UrlMkGetSessionOption (URLMON.@)
+ */
+HRESULT WINAPI UrlMkGetSessionOption(DWORD dwOption, LPVOID *pBuffer, DWORD dwBufferLength,
+ DWORD* pdwBufferLength, DWORD dwReserved)
{
- FIXME("(%#lx, %p, %#lx, %#lx): stub\n", lost, splat, time, nosee);
+ FIXME("(%#lx, %p, %#lx, %p): stub\n", dwOption, pBuffer, dwBufferLength, pdwBufferLength);
return S_OK;
}
@@ -142,3 +292,31 @@
TRACE("(%s,%s,%08lx)\n", debugstr_w(pwzUrl1), debugstr_w(pwzUrl2), dwCompareFlags);
return UrlCompareW(pwzUrl1, pwzUrl2, dwCompareFlags)==0?S_OK:S_FALSE;
}
+
+/**************************************************************************
+ * IsValidURL (URLMON.@)
+ *
+ * Determines if a specified string is a valid URL.
+ *
+ * PARAMS
+ * pBC [I] ignored, must be NULL.
+ * szURL [I] string that represents the URL in question.
+ * dwReserved [I] reserved and must be zero.
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: S_FALSE.
+ * returns E_INVALIDARG if one or more of the args is invalid.
+ *
+ * TODO:
+ * test functionality against windows to see what a valid URL is.
+ */
+HRESULT WINAPI IsValidURL(LPBC pBC, LPCWSTR szURL, DWORD dwReserved)
+{
+ FIXME("(%p, %s, %ld): stub\n", pBC, debugstr_w(szURL), dwReserved);
+
+ if (pBC != NULL || dwReserved != 0)
+ return E_INVALIDARG;
+
+ return S_OK;
+}
reactos/lib/urlmon
diff -u -r1.1 -r1.1.8.1
--- urlmon_main.h 13 Aug 2004 06:14:48 -0000 1.1
+++ urlmon_main.h 30 Dec 2004 04:36:46 -0000 1.1.8.1
@@ -25,5 +25,9 @@
#include "winbase.h"
extern HINSTANCE URLMON_hInstance;
+extern HRESULT SecManagerImpl_Construct(IUnknown *pUnkOuter, LPVOID *ppobj);
+extern HRESULT ZoneMgrImpl_Construct(IUnknown *pUnkOuter, LPVOID *ppobj);
+
+#define ICOM_THIS_MULTI(impl,field,iface) impl* const This=(impl*)((char*)(iface) - offsetof(impl,field))
#endif /* __WINE_URLMON_MAIN_H */
reactos/lib/urlmon
diff -N urlmon.h
--- urlmon.h 13 Aug 2004 06:14:48 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,1623 +0,0 @@
-/*** Autogenerated by WIDL 0.1 from urlmon.idl - Do not edit ***/
-#include <rpc.h>
-#include <rpcndr.h>
-
-#ifndef __WIDL_URLMON_H
-#define __WIDL_URLMON_H
-#ifdef __cplusplus
-extern "C" {
-#endif
-#include <objidl.h>
-#include <oleidl.h>
-#include <servprov.h>
-#ifndef __IBinding_FWD_DEFINED__
-#define __IBinding_FWD_DEFINED__
-typedef struct IBinding IBinding;
-#endif
-
-typedef IBinding *LPBINDING;
-
-/*****************************************************************************
- * IBinding interface
- */
-#ifndef __IBinding_INTERFACE_DEFINED__
-#define __IBinding_INTERFACE_DEFINED__
-
-DEFINE_GUID(IID_IBinding, 0x79eac9c0, 0xbaf9, 0x11ce, 0x8c,0x82, 0x00,0xaa,0x00,0x4b,0xa9,0x0b);
-#if defined(__cplusplus) && !defined(CINTERFACE)
-struct IBinding : public IUnknown
-{
- virtual HRESULT STDMETHODCALLTYPE Abort(
- ) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE Suspend(
- ) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE Resume(
- ) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE SetPriority(
- LONG nPriority) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE GetPriority(
- LONG* pnPriority) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE GetBindResult(
- CLSID* pclsidProtocol,
- DWORD* pdwResult,
- LPOLESTR* pszResult,
- DWORD* pdwReserved) = 0;
-
-};
-#else
-typedef struct IBindingVtbl IBindingVtbl;
-struct IBinding {
- const IBindingVtbl* lpVtbl;
-};
-struct IBindingVtbl {
- ICOM_MSVTABLE_COMPAT_FIELDS
-
- /*** IUnknown methods ***/
- HRESULT (STDMETHODCALLTYPE *QueryInterface)(
- IBinding* This,
- REFIID riid,
- void** ppvObject);
-
- ULONG (STDMETHODCALLTYPE *AddRef)(
- IBinding* This);
-
- ULONG (STDMETHODCALLTYPE *Release)(
- IBinding* This);
-
- /*** IBinding methods ***/
- HRESULT (STDMETHODCALLTYPE *Abort)(
- IBinding* This);
-
- HRESULT (STDMETHODCALLTYPE *Suspend)(
- IBinding* This);
-
- HRESULT (STDMETHODCALLTYPE *Resume)(
- IBinding* This);
-
- HRESULT (STDMETHODCALLTYPE *SetPriority)(
- IBinding* This,
- LONG nPriority);
-
- HRESULT (STDMETHODCALLTYPE *GetPriority)(
- IBinding* This,
- LONG* pnPriority);
-
- HRESULT (STDMETHODCALLTYPE *GetBindResult)(
- IBinding* This,
- CLSID* pclsidProtocol,
- DWORD* pdwResult,
- LPOLESTR* pszResult,
- DWORD* pdwReserved);
-
-};
-
-/*** IUnknown methods ***/
-#define IBinding_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
-#define IBinding_AddRef(p) (p)->lpVtbl->AddRef(p)
-#define IBinding_Release(p) (p)->lpVtbl->Release(p)
-/*** IBinding methods ***/
-#define IBinding_Abort(p) (p)->lpVtbl->Abort(p)
-#define IBinding_Suspend(p) (p)->lpVtbl->Suspend(p)
-#define IBinding_Resume(p) (p)->lpVtbl->Resume(p)
-#define IBinding_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a)
-#define IBinding_GetPriority(p,a) (p)->lpVtbl->GetPriority(p,a)
-#define IBinding_GetBindResult(p,a,b,c,d) (p)->lpVtbl->GetBindResult(p,a,b,c,d)
-
-#endif
-
-#define IBinding_METHODS \
- ICOM_MSVTABLE_COMPAT_FIELDS \
- /*** IUnknown methods ***/ \
- STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; \
- STDMETHOD_(ULONG,AddRef)(THIS) PURE; \
- STDMETHOD_(ULONG,Release)(THIS) PURE; \
- /*** IBinding methods ***/ \
- STDMETHOD_(HRESULT,Abort)(THIS) PURE; \
- STDMETHOD_(HRESULT,Suspend)(THIS) PURE; \
- STDMETHOD_(HRESULT,Resume)(THIS) PURE; \
- STDMETHOD_(HRESULT,SetPriority)(THIS_ LONG nPriority) PURE; \
- STDMETHOD_(HRESULT,GetPriority)(THIS_ LONG* pnPriority) PURE; \
- STDMETHOD_(HRESULT,GetBindResult)(THIS_ CLSID* pclsidProtocol, DWORD* pdwResult, LPOLESTR* pszResult, DWORD* pdwReserved) PURE;
-
-HRESULT CALLBACK IBinding_Abort_Proxy(
- IBinding* This);
-void __RPC_STUB IBinding_Abort_Stub(
- struct IRpcStubBuffer* This,
- struct IRpcChannelBuffer* pRpcChannelBuffer,
- PRPC_MESSAGE pRpcMessage,
- DWORD* pdwStubPhase);
-HRESULT CALLBACK IBinding_Suspend_Proxy(
- IBinding* This);
-void __RPC_STUB IBinding_Suspend_Stub(
- struct IRpcStubBuffer* This,
- struct IRpcChannelBuffer* pRpcChannelBuffer,
- PRPC_MESSAGE pRpcMessage,
- DWORD* pdwStubPhase);
-HRESULT CALLBACK IBinding_Resume_Proxy(
- IBinding* This);
-void __RPC_STUB IBinding_Resume_Stub(
- struct IRpcStubBuffer* This,
- struct IRpcChannelBuffer* pRpcChannelBuffer,
- PRPC_MESSAGE pRpcMessage,
- DWORD* pdwStubPhase);
-HRESULT CALLBACK IBinding_SetPriority_Proxy(
- IBinding* This,
- LONG nPriority);
-void __RPC_STUB IBinding_SetPriority_Stub(
- struct IRpcStubBuffer* This,
- struct IRpcChannelBuffer* pRpcChannelBuffer,
- PRPC_MESSAGE pRpcMessage,
- DWORD* pdwStubPhase);
-HRESULT CALLBACK IBinding_GetPriority_Proxy(
- IBinding* This,
- LONG* pnPriority);
-void __RPC_STUB IBinding_GetPriority_Stub(
- struct IRpcStubBuffer* This,
- struct IRpcChannelBuffer* pRpcChannelBuffer,
- PRPC_MESSAGE pRpcMessage,
- DWORD* pdwStubPhase);
-HRESULT CALLBACK IBinding_RemoteGetBindResult_Proxy(
- IBinding* This,
- CLSID* pclsidProtocol,
- DWORD* pdwResult,
- LPOLESTR* pszResult,
- DWORD dwReserved);
-void __RPC_STUB IBinding_RemoteGetBindResult_Stub(
- struct IRpcStubBuffer* This,
- struct IRpcChannelBuffer* pRpcChannelBuffer,
- PRPC_MESSAGE pRpcMessage,
- DWORD* pdwStubPhase);
-HRESULT CALLBACK IBinding_GetBindResult_Proxy(
- IBinding* This,
- CLSID* pclsidProtocol,
- DWORD* pdwResult,
- LPOLESTR* pszResult,
- DWORD* pdwReserved);
-HRESULT __RPC_STUB IBinding_GetBindResult_Stub(
- IBinding* This,
- CLSID* pclsidProtocol,
- DWORD* pdwResult,
- LPOLESTR* pszResult,
- DWORD dwReserved);
-
-#endif /* __IBinding_INTERFACE_DEFINED__ */
-
-#ifndef __IBindStatusCallback_FWD_DEFINED__
-#define __IBindStatusCallback_FWD_DEFINED__
-typedef struct IBindStatusCallback IBindStatusCallback;
-#endif
-
-typedef IBindStatusCallback *LPBINDSTATUSCALLBACK;
-
-typedef enum {
- BINDF_ASYNCHRONOUS = 0x1,
- BINDF_ASYNCSTORAGE = 0x2,
- BINDF_NOPROGRESSIVERENDERING = 0x4,
- BINDF_OFFLINEOPERATION = 0x8,
- BINDF_GETNEWESTVERSION = 0x10,
- BINDF_NOWRITECACHE = 0x20,
- BINDF_NEEDFILE = 0x40,
- BINDF_PULLDATA = 0x80,
- BINDF_IGNORESECURITYPROBLEM = 0x100,
- BINDF_RESYNCHRONIZE = 0x200,
- BINDF_HYPERLINK = 0x400,
- BINDF_NO_UI = 0x800,
- BINDF_SILENTOPERATION = 0x1000,
- BINDF_PRAGMA_NO_CACHE = 0x2000,
- BINDF_GETCLASSOBJECT = 0x4000,
- BINDF_RESERVED_1 = 0x8000,
- BINDF_FREE_THREADED = 0x10000,
- BINDF_DIRECT_READ = 0x20000,
- BINDF_FORMS_SUBMIT = 0x40000,
- BINDF_GETFROMCACHE_IF_NET_FAIL = 0x80000,
- BINDF_FROMURLMON = 0x100000,
- BINDF_FWD_BACK = 0x200000,
- BINDF_PREFERDEFAULTHANDLER = 0x400000,
- BINDF_ENFORCERESTRICTED = 0x800000
-} BINDF;
-
-typedef struct _tagBINDINFO {
- ULONG cbSize;
- LPWSTR szExtraInfo;
- STGMEDIUM stgmedData;
- DWORD grfBindInfoF;
- DWORD dwBindVerb;
- LPWSTR szCustomVerb;
- DWORD cbStgmedData;
- DWORD dwOptions;
- DWORD dwOptionsFlags;
- DWORD dwCodePage;
- SECURITY_ATTRIBUTES securityAttributes;
- IID iid;
- IUnknown *pUnk;
- DWORD dwReserved;
-} BINDINFO;
-
-typedef struct _REMSECURITY_ATTRIBUTES {
- DWORD nLength;
- DWORD lpSecurityDescriptor;
- BOOL bInheritHandle;
-} REMSECURITY_ATTRIBUTES, *PREMSECURITY_ATTRIBUTES, *LPREMSECURITY_ATTRIBUTES;
-
-typedef struct _tagRemBINDINFO {
- ULONG cbSize;
- LPWSTR szExtraInfo;
- DWORD grfBindInfoF;
- DWORD dwBindVerb;
- LPWSTR szCustomVerb;
- DWORD cbstgmedData;
- DWORD dwOptions;
- DWORD dwOptionsFlags;
- DWORD dwCodePage;
- REMSECURITY_ATTRIBUTES securityAttributes;
- IID iid;
- IUnknown *pUnk;
- DWORD dwReserved;
-} RemBINDINFO;
-
-typedef struct tagRemFORMATETC {
- DWORD cfFormat;
- DWORD ptd;
- DWORD dwAspect;
- LONG lindex;
- DWORD tymed;
-} RemFORMATETC, *LPREMFORMATETC;
-
-typedef enum {
- BSCF_FIRSTDATANOTIFICATION = 0x1,
- BSCF_INTERMEDIATEDATANOTIFICATION = 0x2,
- BSCF_LASTDATANOTIFICATION = 0x4,
- BSCF_DATAFULLYAVAILABLE = 0x8,
- BSCF_AVAILABLEDATASIZEUNKNOWN = 0x10
-} BSCF;
-
-typedef enum BINDSTATUS {
- BINDSTATUS_FINDINGRESOURCE = 1,
- BINDSTATUS_CONNECTING,
- BINDSTATUS_REDIRECTING,
- BINDSTATUS_BEGINDOWNLOADDATA,
- BINDSTATUS_DOWNLOADINGDATA,
- BINDSTATUS_ENDDOWNLOADDATA,
- BINDSTATUS_BEGINDOWNLOADCOMPONENTS,
- BINDSTATUS_INSTALLINGCOMPONENTS,
- BINDSTATUS_ENDDOWNLOADCOMPONENTS,
- BINDSTATUS_USINGCACHEDCOPY,
- BINDSTATUS_SENDINGREQUEST,
- BINDSTATUS_CLASSIDAVAILABLE,
- BINDSTATUS_MIMETYPEAVAILABLE,
- BINDSTATUS_CACHEFILENAMEAVAILABLE,
- BINDSTATUS_BEGINSYNCOPERATION,
- BINDSTATUS_ENDSYNCOPERATION,
- BINDSTATUS_BEGINUPLOADDATA,
- BINDSTATUS_UPLOADINGDATA,
- BINDSTATUS_ENDUPLOADINGDATA,
- BINDSTATUS_PROTOCOLCLASSID,
- BINDSTATUS_ENCODING,
- BINDSTATUS_VERFIEDMIMETYPEAVAILABLE,
- BINDSTATUS_CLASSINSTALLLOCATION,
- BINDSTATUS_DECODING,
- BINDSTATUS_LOADINGMIMEHANDLER,
- BINDSTATUS_CONTENTDISPOSITIONATTACH,
- BINDSTATUS_FILTERREPORTMIMETYPE,
- BINDSTATUS_CLSIDCANINSTANTIATE,
- BINDSTATUS_IUNKNOWNAVAILABLE,
- BINDSTATUS_DIRECTBIND,
- BINDSTATUS_RAWMIMETYPE,
- BINDSTATUS_PROXYDETECTING,
- BINDSTATUS_ACCEPTRANGES,
- BINDSTATUS_COOKIE_SENT,
- BINDSTATUS_COMPACT_POLICY_RECEIVED,
- BINDSTATUS_COOKIE_SUPPRESSED,
- BINDSTATUS_COOKIE_STATE_UNKNOWN,
- BINDSTATUS_COOKIE_STATE_ACCEPT,
- BINDSTATUS_COOKIE_STATE_REJECT,
- BINDSTATUS_COOKIE_STATE_PROMPT,
- BINDSTATUS_COOKIE_STATE_LEASH,
- BINDSTATUS_COOKIE_STATE_DOWNGRADE,
- BINDSTATUS_POLICY_HREF,
- BINDSTATUS_P3P_HEADER,
- BINDSTATUS_SESSION_COOKIE_RECEIVED,
- BINDSTATUS_PERSISTENT_COOKIE_RECEIVED,
- BINDSTATUS_SESSION_COOKIES_ALLOWED,
- BINDSTATUS_CACHECONTROL
-} BINDSTATUS;
-
-/*****************************************************************************
- * IBindStatusCallback interface
- */
-#ifndef __IBindStatusCallback_INTERFACE_DEFINED__
-#define __IBindStatusCallback_INTERFACE_DEFINED__
-
-DEFINE_GUID(IID_IBindStatusCallback, 0x79eac9c1, 0xbaf9, 0x11ce, 0x8c,0x82, 0x00,0xaa,0x00,0x4b,0xa9,0x0b);
-#if defined(__cplusplus) && !defined(CINTERFACE)
-struct IBindStatusCallback : public IUnknown
-{
- virtual HRESULT STDMETHODCALLTYPE OnStartBinding(
- DWORD dwReserved,
- IBinding* pib) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE GetPriority(
- LONG* pnPriority) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE OnLowResource(
- DWORD reserved) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE OnProgress(
- ULONG ulProgress,
- ULONG ulProgressMax,
- ULONG ulStatusCode,
- LPCWSTR szStatusText) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE OnStopBinding(
- HRESULT hresult,
- LPCWSTR szError) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE GetBindInfo(
- DWORD* grfBINDF,
- BINDINFO* pbindinfo) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE OnDataAvailable(
- DWORD grfBSCF,
- DWORD dwSize,
- FORMATETC* pformatetc,
- STGMEDIUM* pstgmed) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE OnObjectAvailable(
- REFIID riid,
- IUnknown* punk) = 0;
-
-};
-#else
-typedef struct IBindStatusCallbackVtbl IBindStatusCallbackVtbl;
-struct IBindStatusCallback {
- const IBindStatusCallbackVtbl* lpVtbl;
-};
-struct IBindStatusCallbackVtbl {
- ICOM_MSVTABLE_COMPAT_FIELDS
-
- /*** IUnknown methods ***/
- HRESULT (STDMETHODCALLTYPE *QueryInterface)(
- IBindStatusCallback* This,
- REFIID riid,
- void** ppvObject);
-
- ULONG (STDMETHODCALLTYPE *AddRef)(
- IBindStatusCallback* This);
-
- ULONG (STDMETHODCALLTYPE *Release)(
- IBindStatusCallback* This);
-
- /*** IBindStatusCallback methods ***/
- HRESULT (STDMETHODCALLTYPE *OnStartBinding)(
- IBindStatusCallback* This,
- DWORD dwReserved,
- IBinding* pib);
-
- HRESULT (STDMETHODCALLTYPE *GetPriority)(
- IBindStatusCallback* This,
- LONG* pnPriority);
-
- HRESULT (STDMETHODCALLTYPE *OnLowResource)(
- IBindStatusCallback* This,
- DWORD reserved);
-
- HRESULT (STDMETHODCALLTYPE *OnProgress)(
- IBindStatusCallback* This,
- ULONG ulProgress,
- ULONG ulProgressMax,
- ULONG ulStatusCode,
- LPCWSTR szStatusText);
-
- HRESULT (STDMETHODCALLTYPE *OnStopBinding)(
- IBindStatusCallback* This,
- HRESULT hresult,
- LPCWSTR szError);
-
- HRESULT (STDMETHODCALLTYPE *GetBindInfo)(
- IBindStatusCallback* This,
- DWORD* grfBINDF,
- BINDINFO* pbindinfo);
-
- HRESULT (STDMETHODCALLTYPE *OnDataAvailable)(
- IBindStatusCallback* This,
- DWORD grfBSCF,
- DWORD dwSize,
- FORMATETC* pformatetc,
- STGMEDIUM* pstgmed);
-
- HRESULT (STDMETHODCALLTYPE *OnObjectAvailable)(
- IBindStatusCallback* This,
- REFIID riid,
- IUnknown* punk);
-
-};
-
-/*** IUnknown methods ***/
-#define IBindStatusCallback_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
-#define IBindStatusCallback_AddRef(p) (p)->lpVtbl->AddRef(p)
-#define IBindStatusCallback_Release(p) (p)->lpVtbl->Release(p)
-/*** IBindStatusCallback methods ***/
-#define IBindStatusCallback_OnStartBinding(p,a,b) (p)->lpVtbl->OnStartBinding(p,a,b)
-#define IBindStatusCallback_GetPriority(p,a) (p)->lpVtbl->GetPriority(p,a)
-#define IBindStatusCallback_OnLowResource(p,a) (p)->lpVtbl->OnLowResource(p,a)
-#define IBindStatusCallback_OnProgress(p,a,b,c,d) (p)->lpVtbl->OnProgress(p,a,b,c,d)
-#define IBindStatusCallback_OnStopBinding(p,a,b) (p)->lpVtbl->OnStopBinding(p,a,b)
-#define IBindStatusCallback_GetBindInfo(p,a,b) (p)->lpVtbl->GetBindInfo(p,a,b)
-#define IBindStatusCallback_OnDataAvailable(p,a,b,c,d) (p)->lpVtbl->OnDataAvailable(p,a,b,c,d)
-#define IBindStatusCallback_OnObjectAvailable(p,a,b) (p)->lpVtbl->OnObjectAvailable(p,a,b)
-
-#endif
-
-#define IBindStatusCallback_METHODS \
- ICOM_MSVTABLE_COMPAT_FIELDS \
- /*** IUnknown methods ***/ \
- STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; \
- STDMETHOD_(ULONG,AddRef)(THIS) PURE; \
- STDMETHOD_(ULONG,Release)(THIS) PURE; \
- /*** IBindStatusCallback methods ***/ \
- STDMETHOD_(HRESULT,OnStartBinding)(THIS_ DWORD dwReserved, IBinding* pib) PURE; \
- STDMETHOD_(HRESULT,GetPriority)(THIS_ LONG* pnPriority) PURE; \
- STDMETHOD_(HRESULT,OnLowResource)(THIS_ DWORD reserved) PURE; \
- STDMETHOD_(HRESULT,OnProgress)(THIS_ ULONG ulProgress, ULONG ulProgressMax, ULONG ulStatusCode, LPCWSTR szStatusText) PURE; \
- STDMETHOD_(HRESULT,OnStopBinding)(THIS_ HRESULT hresult, LPCWSTR szError) PURE; \
- STDMETHOD_(HRESULT,GetBindInfo)(THIS_ DWORD* grfBINDF, BINDINFO* pbindinfo) PURE; \
- STDMETHOD_(HRESULT,OnDataAvailable)(THIS_ DWORD grfBSCF, DWORD dwSize, FORMATETC* pformatetc, STGMEDIUM* pstgmed) PURE; \
- STDMETHOD_(HRESULT,OnObjectAvailable)(THIS_ REFIID riid, IUnknown* punk) PURE;
-
-HRESULT CALLBACK IBindStatusCallback_OnStartBinding_Proxy(
- IBindStatusCallback* This,
- DWORD dwReserved,
- IBinding* pib);
-void __RPC_STUB IBindStatusCallback_OnStartBinding_Stub(
- struct IRpcStubBuffer* This,
- struct IRpcChannelBuffer* pRpcChannelBuffer,
- PRPC_MESSAGE pRpcMessage,
- DWORD* pdwStubPhase);
-HRESULT CALLBACK IBindStatusCallback_GetPriority_Proxy(
- IBindStatusCallback* This,
- LONG* pnPriority);
-void __RPC_STUB IBindStatusCallback_GetPriority_Stub(
- struct IRpcStubBuffer* This,
- struct IRpcChannelBuffer* pRpcChannelBuffer,
- PRPC_MESSAGE pRpcMessage,
- DWORD* pdwStubPhase);
-HRESULT CALLBACK IBindStatusCallback_OnLowResource_Proxy(
- IBindStatusCallback* This,
- DWORD reserved);
-void __RPC_STUB IBindStatusCallback_OnLowResource_Stub(
- struct IRpcStubBuffer* This,
- struct IRpcChannelBuffer* pRpcChannelBuffer,
- PRPC_MESSAGE pRpcMessage,
- DWORD* pdwStubPhase);
-HRESULT CALLBACK IBindStatusCallback_OnProgress_Proxy(
- IBindStatusCallback* This,
- ULONG ulProgress,
- ULONG ulProgressMax,
- ULONG ulStatusCode,
- LPCWSTR szStatusText);
-void __RPC_STUB IBindStatusCallback_OnProgress_Stub(
- struct IRpcStubBuffer* This,
- struct IRpcChannelBuffer* pRpcChannelBuffer,
- PRPC_MESSAGE pRpcMessage,
- DWORD* pdwStubPhase);
-HRESULT CALLBACK IBindStatusCallback_OnStopBinding_Proxy(
- IBindStatusCallback* This,
- HRESULT hresult,
- LPCWSTR szError);
-void __RPC_STUB IBindStatusCallback_OnStopBinding_Stub(
- struct IRpcStubBuffer* This,
- struct IRpcChannelBuffer* pRpcChannelBuffer,
- PRPC_MESSAGE pRpcMessage,
- DWORD* pdwStubPhase);
-HRESULT CALLBACK IBindStatusCallback_RemoteGetBindInfo_Proxy(
- IBindStatusCallback* This,
- DWORD* grfBINDF,
- RemBINDINFO* pbindinfo,
- RemSTGMEDIUM* pstgmed);
-void __RPC_STUB IBindStatusCallback_RemoteGetBindInfo_Stub(
- struct IRpcStubBuffer* This,
- struct IRpcChannelBuffer* pRpcChannelBuffer,
- PRPC_MESSAGE pRpcMessage,
- DWORD* pdwStubPhase);
-HRESULT CALLBACK IBindStatusCallback_GetBindInfo_Proxy(
- IBindStatusCallback* This,
- DWORD* grfBINDF,
- BINDINFO* pbindinfo);
-HRESULT __RPC_STUB IBindStatusCallback_GetBindInfo_Stub(
- IBindStatusCallback* This,
- DWORD* grfBINDF,
- RemBINDINFO* pbindinfo,
- RemSTGMEDIUM* pstgmed);
-HRESULT CALLBACK IBindStatusCallback_RemoteOnDataAvailable_Proxy(
- IBindStatusCallback* This,
- DWORD grfBSCF,
- DWORD dwSize,
- RemFORMATETC* pformatetc,
- RemSTGMEDIUM* pstgmed);
-void __RPC_STUB IBindStatusCallback_RemoteOnDataAvailable_Stub(
- struct IRpcStubBuffer* This,
- struct IRpcChannelBuffer* pRpcChannelBuffer,
- PRPC_MESSAGE pRpcMessage,
- DWORD* pdwStubPhase);
-HRESULT CALLBACK IBindStatusCallback_OnDataAvailable_Proxy(
- IBindStatusCallback* This,
- DWORD grfBSCF,
- DWORD dwSize,
- FORMATETC* pformatetc,
- STGMEDIUM* pstgmed);
-HRESULT __RPC_STUB IBindStatusCallback_OnDataAvailable_Stub(
- IBindStatusCallback* This,
- DWORD grfBSCF,
- DWORD dwSize,
- RemFORMATETC* pformatetc,
- RemSTGMEDIUM* pstgmed);
-HRESULT CALLBACK IBindStatusCallback_OnObjectAvailable_Proxy(
- IBindStatusCallback* This,
- REFIID riid,
- IUnknown* punk);
-void __RPC_STUB IBindStatusCallback_OnObjectAvailable_Stub(
- struct IRpcStubBuffer* This,
- struct IRpcChannelBuffer* pRpcChannelBuffer,
- PRPC_MESSAGE pRpcMessage,
- DWORD* pdwStubPhase);
-
-#endif /* __IBindStatusCallback_INTERFACE_DEFINED__ */
-
-#define SID_IBindHost IID_IBindHost
-#define SID_SBindHost IID_IBindHost
-#ifndef __IBindHost_FWD_DEFINED__
-#define __IBindHost_FWD_DEFINED__
-typedef struct IBindHost IBindHost;
-#endif
-
-typedef IBindHost *LPBINDHOST;
-
-/*****************************************************************************
- * IBindHost interface
- */
-#ifndef __IBindHost_INTERFACE_DEFINED__
-#define __IBindHost_INTERFACE_DEFINED__
-
-DEFINE_GUID(IID_IBindHost, 0xfc4801a1, 0x2ba9, 0x11cf, 0xa2,0x29, 0x00,0xaa,0x00,0x3d,0x73,0x52);
-#if defined(__cplusplus) && !defined(CINTERFACE)
-struct IBindHost : public IUnknown
-{
- virtual HRESULT STDMETHODCALLTYPE CreateMoniker(
- LPOLESTR szName,
- IBindCtx* pBC,
- IMoniker** ppmk,
- DWORD dwReserved) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE MonikerBindToStorage(
- IMoniker* pMk,
- IBindCtx* pBC,
- IBindStatusCallback* pBSC,
- REFIID riid,
- void** ppvObj) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE MonikerBindToObject(
- IMoniker* pMk,
- IBindCtx* pBC,
- IBindStatusCallback* pBSC,
- REFIID riid,
- void** ppvObj) = 0;
-
-};
-#else
-typedef struct IBindHostVtbl IBindHostVtbl;
-struct IBindHost {
- const IBindHostVtbl* lpVtbl;
-};
-struct IBindHostVtbl {
- ICOM_MSVTABLE_COMPAT_FIELDS
-
- /*** IUnknown methods ***/
- HRESULT (STDMETHODCALLTYPE *QueryInterface)(
- IBindHost* This,
- REFIID riid,
- void** ppvObject);
-
- ULONG (STDMETHODCALLTYPE *AddRef)(
- IBindHost* This);
-
- ULONG (STDMETHODCALLTYPE *Release)(
- IBindHost* This);
-
- /*** IBindHost methods ***/
- HRESULT (STDMETHODCALLTYPE *CreateMoniker)(
- IBindHost* This,
- LPOLESTR szName,
- IBindCtx* pBC,
- IMoniker** ppmk,
- DWORD dwReserved);
-
- HRESULT (STDMETHODCALLTYPE *MonikerBindToStorage)(
- IBindHost* This,
- IMoniker* pMk,
- IBindCtx* pBC,
- IBindStatusCallback* pBSC,
- REFIID riid,
- void** ppvObj);
-
- HRESULT (STDMETHODCALLTYPE *MonikerBindToObject)(
- IBindHost* This,
- IMoniker* pMk,
- IBindCtx* pBC,
- IBindStatusCallback* pBSC,
- REFIID riid,
- void** ppvObj);
-
-};
-
-/*** IUnknown methods ***/
-#define IBindHost_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
-#define IBindHost_AddRef(p) (p)->lpVtbl->AddRef(p)
-#define IBindHost_Release(p) (p)->lpVtbl->Release(p)
-/*** IBindHost methods ***/
-#define IBindHost_CreateMoniker(p,a,b,c,d) (p)->lpVtbl->CreateMoniker(p,a,b,c,d)
-#define IBindHost_MonikerBindToStorage(p,a,b,c,d,e) (p)->lpVtbl->MonikerBindToStorage(p,a,b,c,d,e)
-#define IBindHost_MonikerBindToObject(p,a,b,c,d,e) (p)->lpVtbl->MonikerBindToObject(p,a,b,c,d,e)
-
-#endif
-
-#define IBindHost_METHODS \
- ICOM_MSVTABLE_COMPAT_FIELDS \
- /*** IUnknown methods ***/ \
- STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; \
- STDMETHOD_(ULONG,AddRef)(THIS) PURE; \
- STDMETHOD_(ULONG,Release)(THIS) PURE; \
- /*** IBindHost methods ***/ \
- STDMETHOD_(HRESULT,CreateMoniker)(THIS_ LPOLESTR szName, IBindCtx* pBC, IMoniker** ppmk, DWORD dwReserved) PURE; \
- STDMETHOD_(HRESULT,MonikerBindToStorage)(THIS_ IMoniker* pMk, IBindCtx* pBC, IBindStatusCallback* pBSC, REFIID riid, void** ppvObj) PURE; \
- STDMETHOD_(HRESULT,MonikerBindToObject)(THIS_ IMoniker* pMk, IBindCtx* pBC, IBindStatusCallback* pBSC, REFIID riid, void** ppvObj) PURE;
-
-HRESULT CALLBACK IBindHost_CreateMoniker_Proxy(
- IBindHost* This,
- LPOLESTR szName,
- IBindCtx* pBC,
- IMoniker** ppmk,
- DWORD dwReserved);
-void __RPC_STUB IBindHost_CreateMoniker_Stub(
- struct IRpcStubBuffer* This,
- struct IRpcChannelBuffer* pRpcChannelBuffer,
- PRPC_MESSAGE pRpcMessage,
- DWORD* pdwStubPhase);
-HRESULT CALLBACK IBindHost_RemoteMonikerBindToStorage_Proxy(
- IBindHost* This,
- IMoniker* pMk,
- IBindCtx* pBC,
- IBindStatusCallback* pBSC,
- REFIID riid,
- IUnknown** ppvObj);
-void __RPC_STUB IBindHost_RemoteMonikerBindToStorage_Stub(
- struct IRpcStubBuffer* This,
- struct IRpcChannelBuffer* pRpcChannelBuffer,
- PRPC_MESSAGE pRpcMessage,
- DWORD* pdwStubPhase);
-HRESULT CALLBACK IBindHost_MonikerBindToStorage_Proxy(
- IBindHost* This,
- IMoniker* pMk,
- IBindCtx* pBC,
- IBindStatusCallback* pBSC,
- REFIID riid,
- void** ppvObj);
-HRESULT __RPC_STUB IBindHost_MonikerBindToStorage_Stub(
- IBindHost* This,
- IMoniker* pMk,
- IBindCtx* pBC,
- IBindStatusCallback* pBSC,
- REFIID riid,
- IUnknown** ppvObj);
-HRESULT CALLBACK IBindHost_RemoteMonikerBindToObject_Proxy(
- IBindHost* This,
- IMoniker* pMk,
- IBindCtx* pBC,
- IBindStatusCallback* pBSC,
- REFIID riid,
- IUnknown** ppvObj);
-void __RPC_STUB IBindHost_RemoteMonikerBindToObject_Stub(
- struct IRpcStubBuffer* This,
- struct IRpcChannelBuffer* pRpcChannelBuffer,
- PRPC_MESSAGE pRpcMessage,
- DWORD* pdwStubPhase);
-HRESULT CALLBACK IBindHost_MonikerBindToObject_Proxy(
- IBindHost* This,
- IMoniker* pMk,
- IBindCtx* pBC,
- IBindStatusCallback* pBSC,
- REFIID riid,
- void** ppvObj);
-HRESULT __RPC_STUB IBindHost_MonikerBindToObject_Stub(
- IBindHost* This,
- IMoniker* pMk,
- IBindCtx* pBC,
- IBindStatusCallback* pBSC,
- REFIID riid,
- IUnknown** ppvObj);
-
-#endif /* __IBindHost_INTERFACE_DEFINED__ */
-
-#ifndef __IWinInetInfo_FWD_DEFINED__
-#define __IWinInetInfo_FWD_DEFINED__
-typedef struct IWinInetInfo IWinInetInfo;
-#endif
-
-typedef IWinInetInfo *LPWININETINFO;
-
-/*****************************************************************************
- * IWinInetInfo interface
- */
-#ifndef __IWinInetInfo_INTERFACE_DEFINED__
-#define __IWinInetInfo_INTERFACE_DEFINED__
-
-DEFINE_GUID(IID_IWinInetInfo, 0x79eac9d6, 0xbafa, 0x11ce, 0x8c,0x82, 0x00,0xaa,0x00,0x4b,0xa9,0x0b);
-#if defined(__cplusplus) && !defined(CINTERFACE)
-struct IWinInetInfo : public IUnknown
-{
- virtual HRESULT STDMETHODCALLTYPE QueryOption(
- DWORD dwOption,
- LPVOID pBuffer,
- DWORD* pcbBuf) = 0;
-
-};
-#else
-typedef struct IWinInetInfoVtbl IWinInetInfoVtbl;
-struct IWinInetInfo {
- const IWinInetInfoVtbl* lpVtbl;
-};
-struct IWinInetInfoVtbl {
- ICOM_MSVTABLE_COMPAT_FIELDS
-
- /*** IUnknown methods ***/
- HRESULT (STDMETHODCALLTYPE *QueryInterface)(
- IWinInetInfo* This,
- REFIID riid,
- void** ppvObject);
-
- ULONG (STDMETHODCALLTYPE *AddRef)(
- IWinInetInfo* This);
-
- ULONG (STDMETHODCALLTYPE *Release)(
- IWinInetInfo* This);
-
- /*** IWinInetInfo methods ***/
- HRESULT (STDMETHODCALLTYPE *QueryOption)(
- IWinInetInfo* This,
- DWORD dwOption,
- LPVOID pBuffer,
- DWORD* pcbBuf);
-
-};
-
-/*** IUnknown methods ***/
-#define IWinInetInfo_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
-#define IWinInetInfo_AddRef(p) (p)->lpVtbl->AddRef(p)
-#define IWinInetInfo_Release(p) (p)->lpVtbl->Release(p)
-/*** IWinInetInfo methods ***/
-#define IWinInetInfo_QueryOption(p,a,b,c) (p)->lpVtbl->QueryOption(p,a,b,c)
-
-#endif
-
-#define IWinInetInfo_METHODS \
- ICOM_MSVTABLE_COMPAT_FIELDS \
- /*** IUnknown methods ***/ \
- STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; \
- STDMETHOD_(ULONG,AddRef)(THIS) PURE; \
- STDMETHOD_(ULONG,Release)(THIS) PURE; \
- /*** IWinInetInfo methods ***/ \
- STDMETHOD_(HRESULT,QueryOption)(THIS_ DWORD dwOption, LPVOID pBuffer, DWORD* pcbBuf) PURE;
-
-HRESULT CALLBACK IWinInetInfo_RemoteQueryOption_Proxy(
- IWinInetInfo* This,
- DWORD dwOption,
- BYTE* pBuffer,
- DWORD* pcbBuf);
-void __RPC_STUB IWinInetInfo_RemoteQueryOption_Stub(
- struct IRpcStubBuffer* This,
- struct IRpcChannelBuffer* pRpcChannelBuffer,
- PRPC_MESSAGE pRpcMessage,
- DWORD* pdwStubPhase);
-HRESULT CALLBACK IWinInetInfo_QueryOption_Proxy(
- IWinInetInfo* This,
- DWORD dwOption,
- LPVOID pBuffer,
- DWORD* pcbBuf);
-HRESULT __RPC_STUB IWinInetInfo_QueryOption_Stub(
- IWinInetInfo* This,
- DWORD dwOption,
- BYTE* pBuffer,
- DWORD* pcbBuf);
-
-#endif /* __IWinInetInfo_INTERFACE_DEFINED__ */
-
-#ifndef __IWinInetHttpInfo_FWD_DEFINED__
-#define __IWinInetHttpInfo_FWD_DEFINED__
-typedef struct IWinInetHttpInfo IWinInetHttpInfo;
-#endif
-
-typedef IWinInetHttpInfo *LPWININETHTTPINFO;
-
-/*****************************************************************************
- * IWinInetHttpInfo interface
- */
-#ifndef __IWinInetHttpInfo_INTERFACE_DEFINED__
-#define __IWinInetHttpInfo_INTERFACE_DEFINED__
-
-DEFINE_GUID(IID_IWinInetHttpInfo, 0x79eac9d8, 0xbafa, 0x11ce, 0x8c,0x82, 0x00,0xaa,0x00,0x4b,0xa9,0x0b);
-#if defined(__cplusplus) && !defined(CINTERFACE)
-struct IWinInetHttpInfo : public IWinInetInfo
-{
- virtual HRESULT STDMETHODCALLTYPE QueryInfo(
- DWORD dwOption,
- LPVOID pBuffer,
- DWORD* pcbBuf,
- DWORD* pdwFlags,
- DWORD* pdwReserved) = 0;
-
-};
-#else
-typedef struct IWinInetHttpInfoVtbl IWinInetHttpInfoVtbl;
-struct IWinInetHttpInfo {
- const IWinInetHttpInfoVtbl* lpVtbl;
-};
-struct IWinInetHttpInfoVtbl {
- ICOM_MSVTABLE_COMPAT_FIELDS
-
- /*** IUnknown methods ***/
- HRESULT (STDMETHODCALLTYPE *QueryInterface)(
- IWinInetHttpInfo* This,
- REFIID riid,
- void** ppvObject);
-
- ULONG (STDMETHODCALLTYPE *AddRef)(
- IWinInetHttpInfo* This);
-
- ULONG (STDMETHODCALLTYPE *Release)(
- IWinInetHttpInfo* This);
-
- /*** IWinInetInfo methods ***/
- HRESULT (STDMETHODCALLTYPE *QueryOption)(
- IWinInetHttpInfo* This,
- DWORD dwOption,
- LPVOID pBuffer,
- DWORD* pcbBuf);
-
- /*** IWinInetHttpInfo methods ***/
- HRESULT (STDMETHODCALLTYPE *QueryInfo)(
- IWinInetHttpInfo* This,
- DWORD dwOption,
- LPVOID pBuffer,
- DWORD* pcbBuf,
- DWORD* pdwFlags,
- DWORD* pdwReserved);
-
-};
-
-/*** IUnknown methods ***/
-#define IWinInetHttpInfo_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
-#define IWinInetHttpInfo_AddRef(p) (p)->lpVtbl->AddRef(p)
-#define IWinInetHttpInfo_Release(p) (p)->lpVtbl->Release(p)
-/*** IWinInetInfo methods ***/
-#define IWinInetHttpInfo_QueryOption(p,a,b,c) (p)->lpVtbl->QueryOption(p,a,b,c)
-/*** IWinInetHttpInfo methods ***/
-#define IWinInetHttpInfo_QueryInfo(p,a,b,c,d,e) (p)->lpVtbl->QueryInfo(p,a,b,c,d,e)
-
-#endif
-
-#define IWinInetHttpInfo_METHODS \
- ICOM_MSVTABLE_COMPAT_FIELDS \
- /*** IUnknown methods ***/ \
- STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; \
- STDMETHOD_(ULONG,AddRef)(THIS) PURE; \
- STDMETHOD_(ULONG,Release)(THIS) PURE; \
- /*** IWinInetInfo methods ***/ \
- STDMETHOD_(HRESULT,QueryOption)(THIS_ DWORD dwOption, LPVOID pBuffer, DWORD* pcbBuf) PURE; \
- /*** IWinInetHttpInfo methods ***/ \
- STDMETHOD_(HRESULT,QueryInfo)(THIS_ DWORD dwOption, LPVOID pBuffer, DWORD* pcbBuf, DWORD* pdwFlags, DWORD* pdwReserved) PURE;
-
-HRESULT CALLBACK IWinInetHttpInfo_RemoteQueryInfo_Proxy(
- IWinInetHttpInfo* This,
- DWORD dwOption,
- BYTE* pBuffer,
- DWORD* pcbBuf,
- DWORD* pdwFlags,
- DWORD* pdwReserved);
-void __RPC_STUB IWinInetHttpInfo_RemoteQueryInfo_Stub(
- struct IRpcStubBuffer* This,
- struct IRpcChannelBuffer* pRpcChannelBuffer,
- PRPC_MESSAGE pRpcMessage,
- DWORD* pdwStubPhase);
-HRESULT CALLBACK IWinInetHttpInfo_QueryInfo_Proxy(
- IWinInetHttpInfo* This,
- DWORD dwOption,
- LPVOID pBuffer,
- DWORD* pcbBuf,
- DWORD* pdwFlags,
- DWORD* pdwReserved);
-HRESULT __RPC_STUB IWinInetHttpInfo_QueryInfo_Stub(
- IWinInetHttpInfo* This,
- DWORD dwOption,
- BYTE* pBuffer,
- DWORD* pcbBuf,
- DWORD* pdwFlags,
- DWORD* pdwReserved);
-
-#endif /* __IWinInetHttpInfo_INTERFACE_DEFINED__ */
-
-#ifndef __IPersistMoniker_FWD_DEFINED__
-#define __IPersistMoniker_FWD_DEFINED__
-typedef struct IPersistMoniker IPersistMoniker;
-#endif
-
-typedef IPersistMoniker *LPPERSISTMONIKER;
-
-/*****************************************************************************
- * IPersistMoniker interface
- */
-#ifndef __IPersistMoniker_INTERFACE_DEFINED__
-#define __IPersistMoniker_INTERFACE_DEFINED__
-
-DEFINE_GUID(IID_IPersistMoniker, 0x79eac9c9, 0xbaf9, 0x11ce, 0x8c,0x82, 0x00,0xaa,0x00,0x4b,0xa9,0x0b);
-#if defined(__cplusplus) && !defined(CINTERFACE)
-struct IPersistMoniker : public IUnknown
-{
- virtual HRESULT STDMETHODCALLTYPE GetClassID(
- CLSID* pClassID) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE IsDirty(
- ) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE Load(
- BOOL fFullyAvailable,
- IMoniker* pimkName,
- LPBC pibc,
- DWORD grfMode) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE Save(
- IMoniker* pimkName,
- LPBC pbc,
- BOOL fRemember) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE SaveCompleted(
- IMoniker* pimkName,
- LPBC pibc) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE GetCurMoniker(
- IMoniker** ppimkName) = 0;
-
-};
-#else
-typedef struct IPersistMonikerVtbl IPersistMonikerVtbl;
-struct IPersistMoniker {
[truncated at 1000 lines; 627 more skipped]
reactos/lib/user32
diff -u -r1.40.8.3 -r1.40.8.4
--- Makefile 13 Dec 2004 16:18:09 -0000 1.40.8.3
+++ Makefile 30 Dec 2004 04:36:46 -0000 1.40.8.4
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.40.8.3 2004/12/13 16:18:09 hyperion Exp $
+# $Id: Makefile,v 1.40.8.4 2004/12/30 04:36:46 hyperion Exp $
PATH_TO_TOP = ../..
reactos/lib/user32/controls
diff -u -r1.27.8.1 -r1.27.8.2
--- edit.c 8 Dec 2004 21:57:26 -0000 1.27.8.1
+++ edit.c 30 Dec 2004 04:36:46 -0000 1.27.8.2
@@ -824,16 +824,18 @@
case WM_GETDLGCODE:
result = DLGC_HASSETSEL | DLGC_WANTCHARS | DLGC_WANTARROWS;
+
+ if (es->style & ES_MULTILINE)
+ {
+ result |= DLGC_WANTALLKEYS;
+ break;
+ }
if (lParam && (((LPMSG)lParam)->message == WM_KEYDOWN))
{
int vk = (int)((LPMSG)lParam)->wParam;
- if (vk == VK_RETURN && (GetWindowLongW( hwnd, GWL_STYLE ) & ES_WANTRETURN))
- {
- result |= DLGC_WANTMESSAGE;
- }
- else if (es->hwndListBox && (vk == VK_RETURN || vk == VK_ESCAPE))
+ if (es->hwndListBox && (vk == VK_RETURN || vk == VK_ESCAPE))
{
if (SendMessageW(GetParent(hwnd), CB_GETDROPPEDSTATE, 0, 0))
result |= DLGC_WANTMESSAGE;
@@ -2907,6 +2909,8 @@
{
INT nyoff;
INT x_offset_in_pixels;
+ INT lines_per_page = (es->format_rect.bottom - es->format_rect.top) /
+ es->line_height;
if (es->style & ES_MULTILINE)
{
@@ -2923,8 +2927,8 @@
if (dx > es->text_width - x_offset_in_pixels)
dx = es->text_width - x_offset_in_pixels;
nyoff = max(0, es->y_offset + dy);
- if (nyoff >= es->line_count)
- nyoff = es->line_count - 1;
+ if (nyoff >= es->line_count - lines_per_page)
+ nyoff = es->line_count - lines_per_page;
dy = (es->y_offset - nyoff) * es->line_height;
if (dx || dy) {
RECT rc1;
@@ -3742,10 +3746,6 @@
{
BOOL control;
- /* Protect read-only edit control from modification */
- if(es->style & ES_READONLY)
- return;
-
control = GetKeyState(VK_CONTROL) & 0x8000;
switch (c) {
@@ -3787,10 +3787,12 @@
SendMessageW(es->hwndSelf, WM_COPY, 0, 0);
break;
case 0x16: /* ^V */
- SendMessageW(es->hwndSelf, WM_PASTE, 0, 0);
+ if (!(es->style & ES_READONLY))
+ SendMessageW(es->hwndSelf, WM_PASTE, 0, 0);
break;
case 0x18: /* ^X */
- SendMessageW(es->hwndSelf, WM_CUT, 0, 0);
+ if (!(es->style & ES_READONLY))
+ SendMessageW(es->hwndSelf, WM_CUT, 0, 0);
break;
default:
@@ -4553,7 +4555,6 @@
if (es->style & ES_RIGHT)
es->style &= ~ES_CENTER;
es->style &= ~WS_HSCROLL;
- es->style &= ~ES_AUTOHSCROLL;
}
/* FIXME: for now, all multi line controls are AUTOVSCROLL */
@@ -4564,8 +4565,6 @@
es->style &= ~ES_RIGHT;
es->style &= ~WS_HSCROLL;
es->style &= ~WS_VSCROLL;
- es->style &= ~ES_AUTOVSCROLL;
- es->style &= ~ES_WANTRETURN;
if (es->style & ES_PASSWORD)
es->password_char = '*';
@@ -4590,13 +4589,18 @@
/*
* In Win95 look and feel, the WS_BORDER style is replaced by the
* WS_EX_CLIENTEDGE style for the edit control. This gives the edit
- * control a non client area. Not always. This coordinates in some
- * way with the window creation code in dialog.c When making
- * modifications please ensure that the code still works for edit
- * controls created directly with style 0x50800000, exStyle 0 (
- * which should have a single pixel border)
+ * control a nonclient area so we don't need to draw the border.
+ * If WS_BORDER without WS_EX_CLIENTEDGE is specified we shouldn't have
+ * a nonclient area and we should handle painting the border ourselves.
+ *
+ * When making modifications please ensure that the code still works
+ * for edit controls created directly with style 0x50800000, exStyle 0
+ * (which should have a single pixel border)
*/
- es->style &= ~WS_BORDER;
+ if (lpcs->dwExStyle & WS_EX_CLIENTEDGE)
+ es->style &= ~WS_BORDER;
+ else if (es->style & WS_BORDER)
+ SetWindowLongW(hwnd, GWL_STYLE, es->style & ~WS_BORDER);
return TRUE;
}
reactos/lib/user32/controls
diff -u -r1.20 -r1.20.8.1
--- regcontrol.c 15 Aug 2004 21:36:26 -0000 1.20
+++ regcontrol.c 30 Dec 2004 04:36:46 -0000 1.20.8.1
@@ -1,4 +1,4 @@
-/* $Id: regcontrol.c,v 1.20 2004/08/15 21:36:26 chorns Exp $
+/* $Id: regcontrol.c,v 1.20.8.1 2004/12/30 04:36:46 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS User32
reactos/lib/user32/include
diff -u -r1.1 -r1.1.8.1
--- .cvsignore 15 Aug 2004 21:36:27 -0000 1.1
+++ .cvsignore 30 Dec 2004 04:36:46 -0000 1.1.8.1
@@ -1,2 +1,3 @@
*.o
*.gch
+*.d
reactos/lib/user32/include
diff -u -r1.31.6.1 -r1.31.6.2
--- user32.h 13 Dec 2004 09:39:02 -0000 1.31.6.1
+++ user32.h 30 Dec 2004 04:36:46 -0000 1.31.6.2
@@ -35,6 +35,12 @@
VOID DeleteFrameBrushes(VOID);
void DrawCaret(HWND hWnd, PTHRDCARETINFO CaretInfo);
+#define NtUserMsqSetWakeMask(dwWaitMask) \
+ (HANDLE)NtUserCallOneParam(dwWaitMask, ONEPARAM_ROUTINE_MSQSETWAKEMASK)
+
+#define NtUserMsqClearWakeMask() \
+ NtUserCallNoParam(NOPARAM_ROUTINE_MSQCLEARWAKEMASK)
+
LONG WINAPI RegCloseKey(HKEY);
LONG WINAPI RegOpenKeyExW(HKEY,LPCWSTR,DWORD,REGSAM,PHKEY);
LONG WINAPI RegQueryValueExW(HKEY,LPCWSTR,LPDWORD,LPDWORD,LPBYTE,LPDWORD);
reactos/lib/user32/misc
diff -u -r1.10 -r1.10.16.1
--- dde.c 31 May 2004 19:52:47 -0000 1.10
+++ dde.c 30 Dec 2004 04:36:46 -0000 1.10.16.1
@@ -262,7 +262,7 @@
*/
static void WDML_IncrementInstanceId(WDML_INSTANCE* pInstance)
{
- DWORD id = InterlockedIncrement(&WDML_MaxInstanceID);
+ DWORD id = InterlockedIncrement((PLONG)&WDML_MaxInstanceID);
pInstance->instanceID = id;
TRACE("New instance id %ld allocated\n", id);
reactos/lib/user32/misc
diff -u -r1.2 -r1.2.18.1
--- ddeclient.c 29 Apr 2004 21:13:16 -0000 1.2
+++ ddeclient.c 30 Dec 2004 04:36:47 -0000 1.2.18.1
@@ -597,7 +597,7 @@
if (hMem)
{
- LPBYTE pDst;
+ PCHAR pDst;
pDst = GlobalLock(hMem);
if (pDst)
reactos/lib/user32/misc
diff -u -r1.35 -r1.35.2.1
--- desktop.c 13 Nov 2004 01:14:42 -0000 1.35
+++ desktop.c 30 Dec 2004 04:36:47 -0000 1.35.2.1
@@ -1,4 +1,4 @@
-/* $Id: desktop.c,v 1.35 2004/11/13 01:14:42 rcampbell Exp $
+/* $Id: desktop.c,v 1.35.2.1 2004/12/30 04:36:47 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS user32.dll
@@ -171,7 +171,7 @@
L"Control Panel\\Desktop",
0, KEY_SET_VALUE, &hKey) == ERROR_SUCCESS)
{
- Ret = RegSetValueExA(hKey, "Wallpaper", 0, REG_SZ, (lpWallpaper != NULL ? lpWallpaper : ""),
+ Ret = RegSetValueExA(hKey, "Wallpaper", 0, REG_SZ, (LPBYTE)(lpWallpaper != NULL ? lpWallpaper : ""),
(lpWallpaper != NULL ? (lstrlenA(lpWallpaper) + 1) * sizeof(CHAR) : sizeof(CHAR)) == ERROR_SUCCESS);
RegCloseKey(hKey);
}
reactos/lib/user32/misc
diff -u -r1.13.2.2 -r1.13.2.3
--- display.c 13 Dec 2004 16:18:09 -0000 1.13.2.2
+++ display.c 30 Dec 2004 04:36:47 -0000 1.13.2.3
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: display.c,v 1.13.2.2 2004/12/13 16:18:09 hyperion Exp $
+/* $Id: display.c,v 1.13.2.3 2004/12/30 04:36:47 hyperion Exp $
*
* PROJECT: ReactOS user32.dll
* FILE: lib/user32/misc/dde.c
@@ -200,7 +200,6 @@
{
BOOL rc;
UNICODE_STRING DeviceName;
- DEVMODEW DevModeW;
if ( !RtlCreateUnicodeStringFromAsciiz ( &DeviceName, (PCSZ)lpszDeviceName ) )
{
@@ -208,12 +207,15 @@
return FALSE;
}
- RosRtlDevModeA2W ( &DevModeW, lpDevMode );
-
- rc = NtUserEnumDisplaySettings ( &DeviceName, iModeNum, &DevModeW, dwFlags );
+ /*
+ * NOTE: We don't need to convert between DEVMODEW and DEVMODEA because
+ * only dmBitsPerPel, dmPelsWidth, dmPelsHeight, dmDisplayFlags and
+ * dmDisplayFrequency fields are set.
+ */
+ rc = NtUserEnumDisplaySettings ( &DeviceName, iModeNum, (LPDEVMODEW)lpDevMode,
+ dwFlags );
RtlFreeUnicodeString ( &DeviceName );
- RosRtlDevModeW2A ( lpDevMode, &DevModeW );
return rc;
}
reactos/lib/user32/misc
diff -u -r1.9.2.3 -r1.9.2.4
--- misc.c 13 Dec 2004 16:18:09 -0000 1.9.2.3
+++ misc.c 30 Dec 2004 04:36:47 -0000 1.9.2.4
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: misc.c,v 1.9.2.3 2004/12/13 16:18:09 hyperion Exp $
+/* $Id: misc.c,v 1.9.2.4 2004/12/30 04:36:47 hyperion Exp $
*
* PROJECT: ReactOS user32.dll
* FILE: lib/user32/misc/misc.c
reactos/lib/user32/misc
diff -u -r1.68.2.2 -r1.68.2.3
--- stubs.c 13 Dec 2004 16:18:09 -0000 1.68.2.2
+++ stubs.c 30 Dec 2004 04:36:47 -0000 1.68.2.3
@@ -1,4 +1,4 @@
-/* $Id: stubs.c,v 1.68.2.2 2004/12/13 16:18:09 hyperion Exp $
+/* $Id: stubs.c,v 1.68.2.3 2004/12/30 04:36:47 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS user32.dll
@@ -7,7 +7,7 @@
* PROGRAMMER: Casper S. Hornstrup (chorns@users.sourceforge.net)
* NOTES: If you implement a function, remove it from this file
* UPDATE HISTORY:
- * 08-05-2001 CSH Created
+ * 08-F05-2001 CSH Created
*/
#include "user32.h"
@@ -112,40 +112,6 @@
/*
* @unimplemented
*/
-DWORD
-STDCALL
-MsgWaitForMultipleObjects(
- DWORD nCount,
- CONST HANDLE *pHandles,
- BOOL fWaitAll,
- DWORD dwMilliseconds,
- DWORD dwWakeMask)
-{
- UNIMPLEMENTED;
- return 0;
-}
-
-
-/*
- * @unimplemented
- */
-DWORD
-STDCALL
-RealMsgWaitForMultipleObjectsEx(
- DWORD nCount,
- LPHANDLE pHandles,
- DWORD dwMilliseconds,
- DWORD dwWakeMask,
- DWORD dwFlags)
-{
- UNIMPLEMENTED;
- return 0;
-}
-
-
-/*
- * @unimplemented
- */
BOOL
STDCALL
TrackMouseEvent(
@@ -223,15 +189,6 @@
return TRUE;
}
-/*
- * @unimplemented
- */
-VOID
-STDCALL
-SwitchToThisWindow ( HWND hwnd, BOOL fUnknown )
-{
- UNIMPLEMENTED;
-}
/*
* @unimplemented
reactos/lib/user32/windows
diff -u -r1.33 -r1.33.2.1
--- bitmap.c 5 Oct 2004 22:08:56 -0000 1.33
+++ bitmap.c 30 Dec 2004 04:36:47 -0000 1.33.2.1
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: bitmap.c,v 1.33 2004/10/05 22:08:56 gvg Exp $
+/* $Id: bitmap.c,v 1.33.2.1 2004/12/30 04:36:47 hyperion Exp $
*
* PROJECT: ReactOS user32.dll
* FILE: lib/user32/windows/input.c
@@ -582,7 +582,7 @@
}
RtlFreeHeap(GetProcessHeap(), 0, PrivateInfo);
- /*DeleteDC(hScreenDc);*/
+ DeleteDC(hScreenDc);
if (fuLoad & LR_LOADFROMFILE)
{
UnmapViewOfFile(BitmapInfo);
reactos/lib/user32/windows
diff -u -r1.51.8.3 -r1.51.8.4
--- class.c 13 Dec 2004 16:18:09 -0000 1.51.8.3
+++ class.c 30 Dec 2004 04:36:47 -0000 1.51.8.4
@@ -1,4 +1,4 @@
-/* $Id: class.c,v 1.51.8.3 2004/12/13 16:18:09 hyperion Exp $
+/* $Id: class.c,v 1.51.8.4 2004/12/30 04:36:47 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS user32.dll
@@ -86,6 +86,7 @@
if ( !str3.Buffer )
{
SetLastError (RtlNtStatusToDosError(STATUS_NO_MEMORY));
+ HEAP_free ( str2.Buffer );
if ( !IS_ATOM(str) )
HEAP_free ( str );
return FALSE;
@@ -170,7 +171,10 @@
}
retval = GetClassInfoExA(hInstance,lpClassName,&w);
- RtlCopyMemory ( lpWndClass, &w.style, sizeof(WNDCLASSA) );
+ if (retval)
+ {
+ RtlCopyMemory ( lpWndClass, &w.style, sizeof(WNDCLASSA) );
+ }
return retval;
}
@@ -435,7 +439,7 @@
RtlCopyMemory(&WndClass, lpwcx, sizeof(WNDCLASSEXW));
- if (IS_ATOM(lpwcx->lpszMenuName))
+ if (IS_ATOM(lpwcx->lpszMenuName) || lpwcx->lpszMenuName == 0)
{
MenuName.Length =
MenuName.MaximumLength = 0;
reactos/lib/user32/windows
diff -u -r1.147.2.2 -r1.147.2.3
--- defwnd.c 13 Dec 2004 16:18:09 -0000 1.147.2.2
+++ defwnd.c 30 Dec 2004 04:36:47 -0000 1.147.2.3
@@ -1,4 +1,4 @@
-/* $Id: defwnd.c,v 1.147.2.2 2004/12/13 16:18:09 hyperion Exp $
+/* $Id: defwnd.c,v 1.147.2.3 2004/12/30 04:36:47 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS user32.dll
@@ -41,9 +41,9 @@
/* GLOBALS *******************************************************************/
-static COLORREF SysColors[NUM_SYSCOLORS] = {0};
-static HPEN SysPens[NUM_SYSCOLORS] = {0};
-static HBRUSH SysBrushes[NUM_SYSCOLORS] = {0};
+COLORREF SysColors[NUM_SYSCOLORS] = {0};
+HPEN SysPens[NUM_SYSCOLORS] = {0};
+HBRUSH SysBrushes[NUM_SYSCOLORS] = {0};
/* Bits in the dwKeyData */
#define KEYDATA_ALT 0x2000
@@ -219,7 +219,7 @@
return(0);
}
- switch(LOWORD(lParam))
+ switch((INT_PTR) LOWORD(lParam))
{
case HTERROR:
{
reactos/lib/user32/windows
diff -u -r1.11.8.3 -r1.11.8.4
--- font.c 13 Dec 2004 16:18:10 -0000 1.11.8.3
+++ font.c 30 Dec 2004 04:36:49 -0000 1.11.8.4
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: font.c,v 1.11.8.3 2004/12/13 16:18:10 hyperion Exp $
+/* $Id: font.c,v 1.11.8.4 2004/12/30 04:36:49 hyperion Exp $
*
* PROJECT: ReactOS user32.dll
* FILE: lib/user32/windows/input.c
@@ -750,7 +750,7 @@
int num_fit;
int word_broken;
int line_fits;
- int j_in_seg;
+ unsigned int j_in_seg;
int ellipsified;
*pprefix_offset = -1;
@@ -826,7 +826,7 @@
if (!line_fits && (format & DT_WORDBREAK))
{
const WCHAR *s;
- int chars_used;
+ unsigned int chars_used;
TEXT_WordBreak (hdc, dest+seg_j, maxl-seg_j, &j_in_seg,
max_seg_width, format, num_fit, &chars_used, &size);
line_fits = (size.cx <= max_seg_width);
reactos/lib/user32/windows
diff -u -r1.25.8.2 -r1.25.8.3
--- input.c 13 Dec 2004 16:18:10 -0000 1.25.8.2
+++ input.c 30 Dec 2004 04:36:49 -0000 1.25.8.3
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: input.c,v 1.25.8.2 2004/12/13 16:18:10 hyperion Exp $
+/* $Id: input.c,v 1.25.8.3 2004/12/30 04:36:49 hyperion Exp $
*
* PROJECT: ReactOS user32.dll
* FILE: lib/user32/windows/input.c
@@ -392,7 +392,7 @@
/*
- * @unimplemented
+ * @implemented
*/
int STDCALL
ToAscii(UINT uVirtKey,
@@ -401,13 +401,12 @@
LPWORD lpChar,
UINT uFlags)
{
- UNIMPLEMENTED;
- return 0;
+ return ToAsciiEx(uVirtKey, uScanCode, lpKeyState, lpChar, uFlags, 0);
}
/*
- * @unimplemented
+ * @implemented
*/
int STDCALL
ToAsciiEx(UINT uVirtKey,
@@ -417,8 +416,14 @@
UINT uFlags,
HKL dwhkl)
{
- UNIMPLEMENTED;
- return 0;
+ WCHAR UniChars[2];
+ int Ret, CharCount;
+
+ Ret = ToUnicodeEx(uVirtKey, uScanCode, lpKeyState, UniChars, 2, uFlags, dwhkl);
+ CharCount = (Ret < 0 ? 1 : Ret);
+ WideCharToMultiByte(CP_ACP, 0, UniChars, CharCount, (LPSTR) lpChar, 2, NULL, NULL);
+
+ return Ret;
}
reactos/lib/user32/windows
diff -u -r1.71.6.3 -r1.71.6.4
--- menu.c 13 Dec 2004 16:18:10 -0000 1.71.6.3
+++ menu.c 30 Dec 2004 04:36:49 -0000 1.71.6.4
@@ -21,7 +21,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: menu.c,v 1.71.6.3 2004/12/13 16:18:10 hyperion Exp $
+/* $Id: menu.c,v 1.71.6.4 2004/12/30 04:36:49 hyperion Exp $
*
* PROJECT: ReactOS user32.dll
* FILE: lib/user32/windows/menu.c
@@ -199,92 +199,38 @@
*
* Get full information about a menu item
*/
-#define INITIAL_STRING_SIZE 32 /* in WCHARs */
static BOOL FASTCALL
MenuGetRosMenuItemInfo(HMENU Menu, UINT Index, PROSMENUITEMINFO ItemInfo)
{
- UNICODE_STRING Text = {0, 0, NULL};
-
- if (MF_STRING == MENU_ITEM_TYPE(ItemInfo->fType))
+ if (ItemInfo->dwTypeData != NULL)
{
- if (NULL != ItemInfo->dwTypeData)
- {
- /* There's already a buffer allocated */
- Text.Buffer = ItemInfo->dwTypeData;
- Text.Length = ItemInfo->cch * sizeof(WCHAR);
- Text.MaximumLength = (ItemInfo->cch < INITIAL_STRING_SIZE ? INITIAL_STRING_SIZE
- : ItemInfo->cch + 1) * sizeof(WCHAR);
- }
- else
- {
- Text.Buffer = HeapAlloc(GetProcessHeap(), 0, INITIAL_STRING_SIZE * sizeof(WCHAR));
- if (NULL == Text.Buffer)
- {
- return FALSE;
- }
- Text.Length = 0;
- Text.MaximumLength = INITIAL_STRING_SIZE * sizeof(WCHAR);
- ItemInfo->cch = INITIAL_STRING_SIZE - 1;
- }
+ HeapFree(GetProcessHeap(), 0, ItemInfo->dwTypeData);
}
- ItemInfo->dwTypeData = (LPWSTR) &Text;
ItemInfo->fMask = MIIM_BITMAP | MIIM_CHECKMARKS | MIIM_DATA | MIIM_FTYPE
| MIIM_ID | MIIM_STATE | MIIM_STRING | MIIM_SUBMENU | MIIM_TYPE;
+ ItemInfo->dwTypeData = NULL;
if (! NtUserMenuItemInfo(Menu, Index, TRUE, ItemInfo, FALSE))
{
- if (NULL != Text.Buffer)
- {
- HeapFree(GetProcessHeap(), 0, Text.Buffer);
- ItemInfo->dwTypeData = NULL;
- ItemInfo->cch = 0;
- }
ItemInfo->fType = 0;
return FALSE;
}
- if (MF_STRING == MENU_ITEM_TYPE(ItemInfo->fType))
+ if (MENU_ITEM_TYPE(ItemInfo->fType) == MF_STRING)
{
- /* We have a string... */
- if (Text.MaximumLength < (ItemInfo->cch + 1) * sizeof(WCHAR))
+ ItemInfo->cch++;
+ ItemInfo->dwTypeData = HeapAlloc(GetProcessHeap(), 0,
+ ItemInfo->cch * sizeof(WCHAR));
+ if (NULL == ItemInfo->dwTypeData)
{
- /* ...but we didn't allocate enough memory. Let's try again */
- HeapFree(GetProcessHeap(), 0, Text.Buffer);
- Text.Buffer = HeapAlloc(GetProcessHeap(), 0, (ItemInfo->cch + 1) * sizeof(WCHAR));
- if (NULL == Text.Buffer)
- {
- ItemInfo->dwTypeData = NULL;
- ItemInfo->cch = 0;
- return FALSE;
- }
- Text.Length = (ItemInfo->cch + 1) * sizeof(WCHAR);
- Text.MaximumLength = (ItemInfo->cch + 1) * sizeof(WCHAR);
- ItemInfo->cch++;
- if (! NtUserMenuItemInfo(Menu, Index, TRUE, ItemInfo, FALSE))
- {
- HeapFree(GetProcessHeap(), 0, Text.Buffer);
- ItemInfo->dwTypeData = NULL;
- ItemInfo->cch = 0;
- ItemInfo->fType = 0;
- }
+ return FALSE;
}
- }
- if (MF_STRING == MENU_ITEM_TYPE(ItemInfo->fType))
- {
- ItemInfo->dwTypeData = Text.Buffer;
- ItemInfo->cch = Text.Length / sizeof(WCHAR);
- Text.Buffer[ItemInfo->cch] = L'\0';
- }
- else
- {
- /* Not a string, clean up the buffer */
- if (NULL != Text.Buffer)
+ if (! NtUserMenuItemInfo(Menu, Index, TRUE, ItemInfo, FALSE))
{
- HeapFree(GetProcessHeap(), 0, Text.Buffer);
- ItemInfo->dwTypeData = NULL;
- ItemInfo->cch = 0;
+ ItemInfo->fType = 0;
+ return FALSE;
}
}
@@ -299,28 +245,19 @@
static BOOL FASTCALL
MenuSetRosMenuItemInfo(HMENU Menu, UINT Index, PROSMENUITEMINFO ItemInfo)
{
- UNICODE_STRING Text;
- BOOL StringVal;
BOOL Ret;
- StringVal = (MF_STRING == MENU_ITEM_TYPE(ItemInfo->fType) && NULL != ItemInfo->dwTypeData);
- if (StringVal)
- {
- Text.Buffer = ItemInfo->dwTypeData;
- Text.Length = wcslen(Text.Buffer) * sizeof(WCHAR);
- Text.MaximumLength = Text.Length + sizeof(WCHAR);
- ItemInfo->dwTypeData = (LPWSTR) &Text;
- }
+ if (MENU_ITEM_TYPE(ItemInfo->fType) == MF_STRING &&
+ ItemInfo->dwTypeData != NULL)
+ {
+ ItemInfo->cch = wcslen(ItemInfo->dwTypeData);
+ }
ItemInfo->fMask = MIIM_BITMAP | MIIM_CHECKMARKS | MIIM_DATA | MIIM_FTYPE
| MIIM_ID | MIIM_STATE | MIIM_STRING | MIIM_SUBMENU | MIIM_TYPE;
+
Ret = NtUserMenuItemInfo(Menu, Index, TRUE, ItemInfo, TRUE);
- if (StringVal)
- {
- ItemInfo->dwTypeData = Text.Buffer;
- }
-
return Ret;
}
@@ -332,11 +269,9 @@
static VOID FASTCALL
MenuCleanupRosMenuItemInfo(PROSMENUITEMINFO ItemInfo)
{
- if (MF_STRING == MENU_ITEM_TYPE(ItemInfo->fType) && NULL != ItemInfo->dwTypeData)
+ if (ItemInfo->dwTypeData != NULL)
{
HeapFree(GetProcessHeap(), 0, ItemInfo->dwTypeData);
- ItemInfo->dwTypeData = NULL;
- ItemInfo->cch = 0;
}
}
@@ -422,7 +357,7 @@
/* check if there is a magic menu item associated with this item */
if (0 != Id && IS_MAGIC_ITEM(Id))
{
- switch(LOWORD(Id))
+ switch((INT_PTR) LOWORD(Id))
{
case (INT_PTR) HBMMENU_SYSTEM:
if (0 != Data)
@@ -3747,8 +3682,15 @@
BOOL ByPosition,
LPMENUITEMINFOA mii)
{
- UNICODE_STRING Text;
- CHAR *AnsiString;
+ LPSTR AnsiBuffer;
+ MENUITEMINFOW miiW;
+
+ if (mii->cbSize != sizeof(MENUITEMINFOA) &&
+ mii->cbSize != sizeof(MENUITEMINFOA) - sizeof(HBITMAP))
+ {
+ SetLastError(ERROR_INVALID_PARAMETER);
+ return FALSE;
+ }
if ((mii->fMask & (MIIM_STRING | MIIM_TYPE)) == 0)
{
@@ -3756,31 +3698,35 @@
return NtUserMenuItemInfo(Menu, Item, ByPosition, (PROSMENUITEMINFO) mii, FALSE);
}
- Text.Length = 0;
- Text.MaximumLength = mii->cch * sizeof(WCHAR);
- Text.Buffer = RtlAllocateHeap(GetProcessHeap(), 0, mii->cch * sizeof(WCHAR));
- if (mii->dwTypeData == NULL)
- return FALSE;
- AnsiString = mii->dwTypeData;
- mii->dwTypeData = (LPSTR) &Text;
+ RtlCopyMemory(&miiW, mii, mii->cbSize);
+ AnsiBuffer = mii->dwTypeData;
+
+ if (AnsiBuffer != NULL)
+ {
+ miiW.dwTypeData = RtlAllocateHeap(GetProcessHeap(), 0,
+ miiW.cch * sizeof(WCHAR));
+ if (miiW.dwTypeData == NULL)
+ return FALSE;
+ }
- if (!NtUserMenuItemInfo(Menu, Item, ByPosition, (PROSMENUITEMINFO)mii, FALSE))
+ if (!NtUserMenuItemInfo(Menu, Item, ByPosition, (PROSMENUITEMINFO)&miiW, FALSE))
{
- HeapFree(GetProcessHeap(), 0, Text.Buffer);
- mii->dwTypeData = AnsiString;
+ HeapFree(GetProcessHeap(), 0, miiW.dwTypeData);
return FALSE;
}
- if (IS_STRING_ITEM(mii->fType))
+ if (AnsiBuffer != NULL)
{
- WideCharToMultiByte(CP_ACP, 0, Text.Buffer, mii->cch, AnsiString, mii->cch,
- NULL, NULL);
- if (Text.MaximumLength > Text.Length)
- AnsiString[mii->cch] = 0;
+ if (IS_STRING_ITEM(miiW.fType))
+ {
+ WideCharToMultiByte(CP_ACP, 0, miiW.dwTypeData, miiW.cch, AnsiBuffer,
+ mii->cch, NULL, NULL);
+ }
+ RtlFreeHeap(GetProcessHeap(), 0, miiW.dwTypeData);
}
- RtlFreeHeap(GetProcessHeap(), 0, Text.Buffer);
- mii->dwTypeData = AnsiString;
+ RtlCopyMemory(mii, &miiW, miiW.cbSize);
+ mii->dwTypeData = AnsiBuffer;
return TRUE;
}
@@ -3796,29 +3742,7 @@
BOOL ByPosition,
LPMENUITEMINFOW mii)
{
- UNICODE_STRING Text;
- WCHAR *UnicodeString;
-
- if ((mii->fMask & (MIIM_STRING | MIIM_TYPE)) == 0)
- {
- /* No text requested, just pass on */
- return NtUserMenuItemInfo(Menu, Item, ByPosition, (PROSMENUITEMINFO) mii, FALSE);
- }
-
- Text.Length = 0;
- Text.MaximumLength = mii->cch * sizeof(WCHAR);
- Text.Buffer = mii->dwTypeData;
- UnicodeString = mii->dwTypeData;
- mii->dwTypeData = (LPWSTR) &Text;
-
- if (!NtUserMenuItemInfo(Menu, Item, ByPosition, (PROSMENUITEMINFO)mii, FALSE))
- {
- mii->dwTypeData = UnicodeString;
- return FALSE;
- }
-
- mii->dwTypeData = UnicodeString;
- return TRUE;
+ return NtUserMenuItemInfo(Menu, Item, ByPosition, (PROSMENUITEMINFO) mii, FALSE);
}
@@ -3851,6 +3775,7 @@
mii.cbSize = sizeof(MENUITEMINFOW);
mii.fMask = MIIM_STATE | MIIM_TYPE | MIIM_SUBMENU;
+ mii.dwTypeData = NULL;
SetLastError(0);
if(NtUserMenuItemInfo(hMenu, uId, uFlags, &mii, FALSE))
@@ -4066,20 +3991,20 @@
if((mi.fMask & (MIIM_TYPE | MIIM_STRING)) &&
(MENU_ITEM_TYPE(mi.fType) == MF_STRING) && mi.dwTypeData)
{
- Status = HEAP_strdupAtoW ( &mi.dwTypeData, (LPCSTR)mi.dwTypeData, &mi.cch );
+ Status = RtlCreateUnicodeStringFromAsciiz(&MenuText, (LPSTR)mi.dwTypeData);
if (!NT_SUCCESS (Status))
{
SetLastError (RtlNtStatusToDosError(Status));
return FALSE;
}
- RtlInitUnicodeString(&MenuText, (PWSTR)mi.dwTypeData);
- mi.dwTypeData = (LPWSTR)&MenuText;
+ mi.dwTypeData = MenuText.Buffer;
+ mi.cch = MenuText.Length / sizeof(WCHAR);
CleanHeap = TRUE;
}
res = NtUserInsertMenuItem(hMenu, uItem, fByPosition, &mi);
- if ( CleanHeap ) HEAP_free ( MenuText.Buffer );
+ if ( CleanHeap ) RtlFreeUnicodeString ( &MenuText );
}
return res;
}
@@ -4112,14 +4037,12 @@
/* copy the text string */
if((mi.fMask & (MIIM_TYPE | MIIM_STRING)) &&
- (MENU_ITEM_TYPE(mi.fType) == MF_STRING) && mi.dwTypeData)
+ (MENU_ITEM_TYPE(mi.fType) == MF_STRING) &&
+ mi.dwTypeData != NULL)
{
- if(lpmii->cch > 0)
- {
- RtlInitUnicodeString(&MenuText, (PWSTR)lpmii->dwTypeData);
- mi.dwTypeData = (LPWSTR)&MenuText;
- mi.cch = MenuText.Length / sizeof(WCHAR);
- }
+ RtlInitUnicodeString(&MenuText, (PWSTR)lpmii->dwTypeData);
+ mi.dwTypeData = MenuText.Buffer;
+ mi.cch = MenuText.Length / sizeof(WCHAR);
};
res = NtUserInsertMenuItem(hMenu, uItem, fByPosition, &mi);
@@ -4441,11 +4364,12 @@
if ((MenuItemInfoW.fMask & (MIIM_TYPE | MIIM_STRING)) &&
(MENU_ITEM_TYPE(MenuItemInfoW.fType) == MF_STRING) &&
- MenuItemInfoW.dwTypeData)
+ MenuItemInfoW.dwTypeData != NULL)
{
RtlCreateUnicodeStringFromAsciiz(&UnicodeString,
(LPSTR)MenuItemInfoW.dwTypeData);
- MenuItemInfoW.dwTypeData = (LPWSTR)&UnicodeString;
+ MenuItemInfoW.dwTypeData = UnicodeString.Buffer;
+ MenuItemInfoW.cch = UnicodeString.Length / sizeof(WCHAR);
}
else
{
@@ -4476,17 +4400,9 @@
LPCMENUITEMINFOW lpmii)
{
MENUITEMINFOW MenuItemInfoW;
- UNICODE_STRING UnicodeString;
RtlCopyMemory(&MenuItemInfoW, lpmii, min(lpmii->cbSize, sizeof(MENUITEMINFOW)));
-
- if ((MenuItemInfoW.fMask & (MIIM_TYPE | MIIM_STRING)) &&
- (MENU_ITEM_TYPE(MenuItemInfoW.fType) == MF_STRING) &&
- MenuItemInfoW.dwTypeData)
- {
- RtlInitUnicodeString(&UnicodeString, MenuItemInfoW.dwTypeData);
- MenuItemInfoW.dwTypeData = (LPWSTR)&UnicodeString;
- }
+ MenuItemInfoW.cch = wcslen(MenuItemInfoW.dwTypeData);
return NtUserMenuItemInfo(hMenu, uItem, fByPosition,
(PROSMENUITEMINFO)&MenuItemInfoW, TRUE);
reactos/lib/user32/windows
diff -u -r1.43.6.3 -r1.43.6.4
--- message.c 13 Dec 2004 16:18:11 -0000 1.43.6.3
+++ message.c 30 Dec 2004 04:36:50 -0000 1.43.6.4
@@ -1,4 +1,4 @@
-/* $Id: message.c,v 1.43.6.3 2004/12/13 16:18:11 hyperion Exp $
+/* $Id: message.c,v 1.43.6.4 2004/12/30 04:36:50 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS user32.dll
@@ -190,6 +190,7 @@
KMMsg->lParam = (LPARAM) DdeLparam;
}
break;
+
case WM_DDE_EXECUTE:
{
SIZE_T Size;
@@ -217,6 +218,31 @@
GlobalUnlock((HGLOBAL) UMMsg->lParam);
}
break;
+
+ case WM_COPYDATA:
+ {
+ PCOPYDATASTRUCT pUMCopyData = (PCOPYDATASTRUCT)UMMsg->lParam;
+ PCOPYDATASTRUCT pKMCopyData;
+
+ pKMCopyData = HeapAlloc(GetProcessHeap(), 0,
+ sizeof(COPYDATASTRUCT) + pUMCopyData->cbData);
+ if (pKMCopyData == NULL)
+ {
+ SetLastError(ERROR_OUTOFMEMORY);
+ return FALSE;
+ }
+
+ pKMCopyData->dwData = pUMCopyData->dwData;
+ pKMCopyData->cbData = pUMCopyData->cbData;
+ pKMCopyData->lpData = pKMCopyData + 1;
+
+ RtlCopyMemory(pKMCopyData + 1, pUMCopyData->lpData,
+ pUMCopyData->cbData);
+
+ KMMsg->lParam = (LPARAM)pKMCopyData;
+ }
+ break;
+
default:
break;
}
@@ -231,6 +257,7 @@
{
case WM_DDE_ACK:
case WM_DDE_EXECUTE:
+ case WM_COPYDATA:
HeapFree(GetProcessHeap(), 0, (LPVOID) KMMsg->lParam);
break;
default:
@@ -322,6 +349,13 @@
}
break;
+ case WM_COPYDATA:
+ {
+ PCOPYDATASTRUCT pKMCopyData = (PCOPYDATASTRUCT)KMMsg->lParam;
+ pKMCopyData->lpData = pKMCopyData + 1;
+ }
+ break;
+
default:
break;
}
@@ -1885,6 +1919,8 @@
if(!gfMessagePumpHook)
return FALSE;
+ /* This code checks for WOW16. */
+#if 0
/* Since our TEB doesnt match that of real windows, testing this value is useless until we know what it does
PUCHAR NtTeb = (PUCHAR)NtCurrentTeb();
@@ -1893,6 +1929,7 @@
if(**(PLONG*)&NtTeb[0x708] <= 0)
return FALSE;*/
+#endif
return TRUE;
}
@@ -1934,7 +1971,7 @@
return FALSE;
}
if (!gcLoadMPH++) {
- InterlockedExchange(&gfMessagePumpHook, 1);
+ InterlockedExchange((PLONG)&gfMessagePumpHook, 1);
}
LeaveCriticalSection(&gcsMPH);
return TRUE;
@@ -1947,7 +1984,7 @@
if(NtUserCallNoParam(NOPARAM_ROUTINE_UNINIT_MESSAGE_PUMP)) {
gcLoadMPH--;
if(!gcLoadMPH) {
- InterlockedExchange(&gfMessagePumpHook, 0);
+ InterlockedExchange((PLONG)&gfMessagePumpHook, 0);
gpfnInitMPH(TRUE, NULL);
ResetMessagePumpHook(&gmph);
gpfnInitMPH = 0;
@@ -1965,11 +2002,109 @@
return IsInsideMessagePumpHook() ? gmph.RealGetQueueStatus(flags) : RealGetQueueStatus(flags);
}
-DWORD WINAPI MsgWaitForMultipleObjectsEx(DWORD nCount, CONST HANDLE *lpHandles, DWORD dwMilliseconds, DWORD dwWakeMask, DWORD dwFlags)
+/**
+ * @name RealMsgWaitForMultipleObjectsEx
+ *
+ * Wait either for either message arrival or for one of the passed events
+ * to be signalled.
+ *
+ * @param nCount
+ * Number of handles in the pHandles array.
+ * @param pHandles
+ * Handles of events to wait for.
+ * @param dwMilliseconds
+ * Timeout interval.
+ * @param dwWakeMask
+ * Mask specifying on which message events we should wakeup.
+ * @param dwFlags
+ * Wait type (see MWMO_* constants).
+ *
+ * @implemented
+ */
+
+DWORD STDCALL
+RealMsgWaitForMultipleObjectsEx(
+ DWORD nCount,
+ const HANDLE *pHandles,
+ DWORD dwMilliseconds,
+ DWORD dwWakeMask,
+ DWORD dwFlags)
+{
+ LPHANDLE RealHandles;
+ HANDLE MessageQueueHandle;
+ DWORD Result;
+
+ if (dwFlags & ~(MWMO_WAITALL | MWMO_ALERTABLE | MWMO_INPUTAVAILABLE))
+ {
+ SetLastError(ERROR_INVALID_PARAMETER);
+ return WAIT_FAILED;
+ }
+
+/*
+ if (dwFlags & MWMO_INPUTAVAILABLE)
+ {
+ RealGetQueueStatus(dwWakeMask);
+ }
+ */
+
+ MessageQueueHandle = NtUserMsqSetWakeMask(dwWakeMask);
+ if (MessageQueueHandle == NULL)
+ {
+ SetLastError(0); /* ? */
+ return WAIT_FAILED;
+ }
+
+ RealHandles = HeapAlloc(GetProcessHeap(), 0, (nCount + 1) * sizeof(HANDLE));
+ if (RealHandles == NULL)
+ {
+ NtUserMsqClearWakeMask();
+ SetLastError(ERROR_NOT_ENOUGH_MEMORY);
+ return WAIT_FAILED;
+ }
+
+ RtlCopyMemory(RealHandles, pHandles, nCount);
+ RealHandles[nCount] = MessageQueueHandle;
+
+ Result = WaitForMultipleObjectsEx(nCount + 1, RealHandles,
+ dwFlags & MWMO_WAITALL,
+ dwMilliseconds, dwFlags & MWMO_ALERTABLE);
+
+ HeapFree(GetProcessHeap(), 0, RealHandles);
+ NtUserMsqClearWakeMask();
+
+ return Result;
+}
+
+/*
+ * @implemented
+ */
+DWORD WINAPI
+MsgWaitForMultipleObjectsEx(
+ DWORD nCount,
+ CONST HANDLE *lpHandles,
+ DWORD dwMilliseconds,
+ DWORD dwWakeMask,
+ DWORD dwFlags)
{
- return IsInsideMessagePumpHook() ? gmph.RealMsgWaitForMultipleObjectsEx(nCount, lpHandles, dwMilliseconds, dwWakeMask, dwFlags) : RealMsgWaitForMultipleObjectsEx(nCount, lpHandles,dwMilliseconds, dwWakeMask, dwFlags);
+ return IsInsideMessagePumpHook() ? gmph.RealMsgWaitForMultipleObjectsEx(nCount, lpHandles, dwMilliseconds, dwWakeMask, dwFlags) : RealMsgWaitForMultipleObjectsEx(nCount, lpHandles,dwMilliseconds, dwWakeMask, dwFlags);
}
+/*
+ * @implemented
+ */
+DWORD STDCALL
+MsgWaitForMultipleObjects(
+ DWORD nCount,
+ CONST HANDLE *lpHandles,
+ BOOL fWaitAll,
+ DWORD dwMilliseconds,
+ DWORD dwWakeMask)
+{
+ return MsgWaitForMultipleObjectsEx(nCount, lpHandles, dwMilliseconds,
+ dwWakeMask, fWaitAll ? MWMO_WAITALL : 0);
+}
+
+
BOOL FASTCALL MessageInit()
{
InitializeCriticalSection(&DdeCrst);
reactos/lib/user32/windows
diff -u -r1.29.2.2 -r1.29.2.3
--- messagebox.c 13 Dec 2004 16:18:11 -0000 1.29.2.2
+++ messagebox.c 30 Dec 2004 04:36:50 -0000 1.29.2.3
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: messagebox.c,v 1.29.2.2 2004/12/13 16:18:11 hyperion Exp $
+/* $Id: messagebox.c,v 1.29.2.3 2004/12/30 04:36:50 hyperion Exp $
*
* PROJECT: ReactOS user32.dll
* FILE: lib/user32/windows/messagebox.c
reactos/lib/user32/windows
diff -u -r1.120 -r1.120.8.1
--- window.c 15 Aug 2004 21:36:30 -0000 1.120
+++ window.c 30 Dec 2004 04:36:50 -0000 1.120.8.1
@@ -1,4 +1,4 @@
-/* $Id: window.c,v 1.120 2004/08/15 21:36:30 chorns Exp $
+/* $Id: window.c,v 1.120.8.1 2004/12/30 04:36:50 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS user32.dll
@@ -82,13 +82,18 @@
/*
- * @unimplemented
+ * @implemented
*/
BOOL STDCALL
BringWindowToTop(HWND hWnd)
{
- UNIMPLEMENTED;
- return FALSE;
+ return NtUserSetWindowPos( hWnd,
+ HWND_TOP,
+ 0,
+ 0,
+ 0,
+ 0,
+ SWP_NOSIZE | SWP_NOMOVE );
}
@@ -108,6 +113,12 @@
}
*/
+VOID
+STDCALL
+SwitchToThisWindow ( HWND hwnd, BOOL fUnknown )
+{
+ ShowWindow ( hwnd, SW_SHOW );
+}
/*
* @implemented
reactos/lib/userenv
diff -u -r1.7 -r1.7.2.1
--- directory.c 9 Nov 2004 15:02:35 -0000 1.7
+++ directory.c 30 Dec 2004 04:36:50 -0000 1.7.2.1
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: directory.c,v 1.7 2004/11/09 15:02:35 ion Exp $
+/* $Id: directory.c,v 1.7.2.1 2004/12/30 04:36:50 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
@@ -30,6 +30,54 @@
/* FUNCTIONS ***************************************************************/
+BOOL STDCALL
+CopyProfileDirectoryA(LPCSTR lpSourcePath,
+ LPCSTR lpDestinationPath,
+ DWORD dwFlags)
+{
+ UNICODE_STRING SrcPath;
+ UNICODE_STRING DstPath;
+ NTSTATUS Status;
+ BOOL bResult;
+
+ Status = RtlCreateUnicodeStringFromAsciiz(&SrcPath,
+ (LPSTR)lpSourcePath);
+ if (!NT_SUCCESS(Status))
+ {
+ SetLastError (RtlNtStatusToDosError (Status));
+ return FALSE;
+ }
+
+ Status = RtlCreateUnicodeStringFromAsciiz(&DstPath,
+ (LPSTR)lpDestinationPath);
+ if (!NT_SUCCESS(Status))
+ {
+ RtlFreeUnicodeString(&SrcPath);
+ SetLastError (RtlNtStatusToDosError (Status));
+ return FALSE;
+ }
+
+ bResult = CopyProfileDirectoryW(SrcPath.Buffer,
+ DstPath.Buffer,
+ dwFlags);
+
+ RtlFreeUnicodeString(&DstPath);
+ RtlFreeUnicodeString(&SrcPath);
+
+ return bResult;
+}
+
+
+BOOL STDCALL
+CopyProfileDirectoryW(LPCWSTR lpSourcePath,
+ LPCWSTR lpDestinationPath,
+ DWORD dwFlags)
+{
+ /* FIXME: dwFlags are ignored! */
+ return CopyDirectory(lpDestinationPath, lpSourcePath);
+}
+
+
BOOL
CopyDirectory (LPCWSTR lpDestinationPath,
LPCWSTR lpSourcePath)
reactos/lib/userenv
diff -u -r1.8.2.3 -r1.8.2.4
--- environment.c 13 Dec 2004 16:18:11 -0000 1.8.2.3
+++ environment.c 30 Dec 2004 04:36:50 -0000 1.8.2.4
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: environment.c,v 1.8.2.3 2004/12/13 16:18:11 hyperion Exp $
+/* $Id: environment.c,v 1.8.2.4 2004/12/30 04:36:50 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
reactos/lib/userenv
diff -u -r1.11 -r1.11.18.1
--- userenv.def 5 May 2004 15:29:15 -0000 1.11
+++ userenv.def 30 Dec 2004 04:36:50 -0000 1.11.18.1
@@ -11,6 +11,8 @@
DeleteItemW@16 @108 NONAME
CreateUserProfileA@8 @109 NONAME
CreateUserProfileW@8 @110 NONAME
+CopyProfileDirectoryA@12 @111 NONAME
+CopyProfileDirectoryW@12 @112 NONAME
AddDesktopItemA@32 @113 NONAME
AddDesktopItemW@32 @114 NONAME
DeleteDesktopItemA@8 @115 NONAME
reactos/lib/uuid
diff -u -r1.2.6.1 -r1.2.6.2
--- uuid.c 8 Dec 2004 21:57:28 -0000 1.2.6.1
+++ uuid.c 30 Dec 2004 04:36:50 -0000 1.2.6.2
@@ -50,9 +50,7 @@
#include "shlobj.h"
#include "shldisp.h"
#include "comcat.h"
-#if 0 /* FIXME */
#include "urlmon.h"
-#endif
/* FIXME: cguids declares GUIDs but does not define their values */
reactos/lib/version
diff -u -r1.15.16.3 -r1.15.16.4
--- makefile 13 Dec 2004 16:18:11 -0000 1.15.16.3
+++ makefile 30 Dec 2004 04:36:50 -0000 1.15.16.4
@@ -1,4 +1,4 @@
-# $Id: makefile,v 1.15.16.3 2004/12/13 16:18:11 hyperion Exp $
+# $Id: makefile,v 1.15.16.4 2004/12/30 04:36:50 hyperion Exp $
PATH_TO_TOP = ../..
reactos/lib/wininet
diff -N wininet.rc
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ wininet.rc 30 Dec 2004 04:36:51 -0000 1.1.2.1
@@ -0,0 +1,39 @@
+#include <defines.h>
+#include <reactos/resource.h>
+
+
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 42,RES_UINT_FV_MINOR,RES_UINT_FV_REVISION,RES_UINT_FV_BUILD
+ PRODUCTVERSION RES_UINT_PV_MAJOR,RES_UINT_PV_MINOR,RES_UINT_PV_REVISION,RES_UINT_PV_BUILD
+ FILEFLAGSMASK 0x3fL
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x40004L
+ FILETYPE 0x2L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904b0"
+ BEGIN
+ VALUE "CompanyName", RES_STR_COMPANY_NAME
+ VALUE "FileDescription", "Internet access\0"
+ VALUE "FileVersion", RES_STR_FILE_VERSION
+ VALUE "InternalName", "wininet\0"
+ VALUE "LegalCopyright", RES_STR_LEGAL_COPYRIGHT
+ VALUE "OriginalFilename", "wininet.dll\0"
+ VALUE "ProductName", RES_STR_PRODUCT_NAME
+ VALUE "ProductVersion", RES_STR_PRODUCT_VERSION
+ VALUE "Build Date", RES_STR_BUILD_DATE
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
reactos/lib/wininet
diff -u -r1.2 -r1.2.8.1
--- stubs.c 13 Aug 2004 05:44:55 -0000 1.2
+++ stubs.c 30 Dec 2004 04:36:50 -0000 1.2.8.1
@@ -235,3 +235,37 @@
return FALSE;
}
+
+
+HINTERNET WINAPI
+InternetOpenUrlA(
+ HINTERNET hInternet,
+ LPCSTR Url,
+ LPCSTR Headers,
+ DWORD dwHeadersLength,
+ DWORD dwFlags,
+ DWORD_PTR dwContext
+)
+{
+ DPRINT1("InternetOpenUrlA not implemented\n");
+ SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+
+ return FALSE;
+}
+
+
+HINTERNET WINAPI
+InternetOpenUrlW(
+ HINTERNET hInternet,
+ LPCWSTR Url,
+ LPCWSTR Headers,
+ DWORD dwHeadersLength,
+ DWORD dwFlags,
+ DWORD_PTR dwContext
+)
+{
+ DPRINT1("InternetOpenUrlW not implemented\n");
+ SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+
+ return FALSE;
+}
reactos/lib/wininet
diff -u -r1.2 -r1.2.8.1
--- wininet.def 13 Aug 2004 05:44:55 -0000 1.2
+++ wininet.def 30 Dec 2004 04:36:51 -0000 1.2.8.1
@@ -1,4 +1,4 @@
-; $Id: wininet.def,v 1.2 2004/08/13 05:44:55 rcampbell Exp $
+; $Id: wininet.def,v 1.2.8.1 2004/12/30 04:36:51 hyperion Exp $
LIBRARY WININET.DLL
EXPORTS
InternetAutodial@8
@@ -18,4 +18,6 @@
InternetCrackUrlW@16
InternetCrackUrlA@16
InternetOpenW@20
-InternetOpenA@20
\ No newline at end of file
+InternetOpenA@20
+InternetOpenUrlA@24
+InternetOpenUrlW@24
reactos/lib/winmm
diff -u -r1.3.16.3 -r1.3.16.4
--- Makefile.ros-template 13 Dec 2004 16:18:11 -0000 1.3.16.3
+++ Makefile.ros-template 30 Dec 2004 04:36:51 -0000 1.3.16.4
@@ -1,4 +1,4 @@
-# $Id: Makefile.ros-template,v 1.3.16.3 2004/12/13 16:18:11 hyperion Exp $
+# $Id: Makefile.ros-template,v 1.3.16.4 2004/12/30 04:36:51 hyperion Exp $
TARGET_NAME = winmm
reactos/lib/winmm
diff -u -r1.2 -r1.2.20.1
--- joystick.c 25 Feb 2004 20:00:41 -0000 1.2
+++ joystick.c 30 Dec 2004 04:36:51 -0000 1.2.20.1
@@ -41,6 +41,7 @@
#include "wingdi.h"
#include "winuser.h"
#include "winnls.h"
+#include "winemm.h"
#include "mmddk.h"
reactos/lib/winmm
diff -u -r1.9.2.1 -r1.9.2.2
--- winehq2ros.patch 8 Dec 2004 21:57:29 -0000 1.9.2.1
+++ winehq2ros.patch 30 Dec 2004 04:36:51 -0000 1.9.2.2
@@ -108,3 +108,33 @@
#include "winmm_Nl.rc"
#include "winmm_Pt.rc"
#include "winmm_Ru.rc"
+Index: lib/winmm/joystick.c
+===================================================================
+RCS file: /CVS/ReactOS/reactos/lib/winmm/joystick.c,v
+retrieving revision 1.2
+diff -u -r1.2 joystick.c
+--- lib/winmm/joystick.c 25 Feb 2004 20:00:41 -0000 1.2
++++ lib/winmm/joystick.c 20 Dec 2004 02:00:40 -0000
+@@ -41,6 +41,7 @@
+ #include "wingdi.h"
+ #include "winuser.h"
+ #include "winnls.h"
++#include "winemm.h"
+
+ #include "mmddk.h"
+
+Index: lib/winmm/winemm.h
+===================================================================
+RCS file: /CVS/ReactOS/reactos/lib/winmm/winemm.h,v
+retrieving revision 1.6
+diff -u -r1.6 winemm.h
+--- lib/winmm/winemm.h 20 Oct 2004 17:42:11 -0000 1.6
++++ lib/winmm/winemm.h 20 Dec 2004 01:59:44 -0000
+@@ -222,6 +222,7 @@
+ typedef WINMM_MapType (*MMDRV_MAPFUNC)(UINT wMsg, LPDWORD lpdwUser, LPDWORD lpParam1, LPDWORD lpParam2);
+ typedef WINMM_MapType (*MMDRV_UNMAPFUNC)(UINT wMsg, LPDWORD lpdwUser, LPDWORD lpParam1, LPDWORD lpParam2, MMRESULT ret);
+
++HDRVR WINAPI OpenDriverA(LPCSTR lpDriverName, LPCSTR lpSectionName, LPARAM lParam2);
+ LPWINE_DRIVER DRIVER_FindFromHDrvr(HDRVR hDrvr);
+ BOOL DRIVER_GetLibName(LPCSTR keyName, LPCSTR sectName, LPSTR buf, int sz);
+ LPWINE_DRIVER DRIVER_TryOpenDriver32(LPCSTR fn, LPARAM lParam2);
reactos/lib/winmm
diff -u -r1.6 -r1.6.2.1
--- winemm.h 20 Oct 2004 17:42:11 -0000 1.6
+++ winemm.h 30 Dec 2004 04:36:51 -0000 1.6.2.1
@@ -222,6 +222,7 @@
typedef WINMM_MapType (*MMDRV_MAPFUNC)(UINT wMsg, LPDWORD lpdwUser, LPDWORD lpParam1, LPDWORD lpParam2);
typedef WINMM_MapType (*MMDRV_UNMAPFUNC)(UINT wMsg, LPDWORD lpdwUser, LPDWORD lpParam1, LPDWORD lpParam2, MMRESULT ret);
+HDRVR WINAPI OpenDriverA(LPCSTR lpDriverName, LPCSTR lpSectionName, LPARAM lParam2);
LPWINE_DRIVER DRIVER_FindFromHDrvr(HDRVR hDrvr);
BOOL DRIVER_GetLibName(LPCSTR keyName, LPCSTR sectName, LPSTR buf, int sz);
LPWINE_DRIVER DRIVER_TryOpenDriver32(LPCSTR fn, LPARAM lParam2);
reactos/lib/winmm/midimap
diff -u -r1.3.2.3 -r1.3.2.4
--- Makefile.ros-template 13 Dec 2004 16:18:11 -0000 1.3.2.3
+++ Makefile.ros-template 30 Dec 2004 04:36:51 -0000 1.3.2.4
@@ -1,4 +1,4 @@
-# $Id: Makefile.ros-template,v 1.3.2.3 2004/12/13 16:18:11 hyperion Exp $
+# $Id: Makefile.ros-template,v 1.3.2.4 2004/12/30 04:36:51 hyperion Exp $
TARGET_NAME = midimap
reactos/lib/winmm/wavemap
diff -u -r1.2.8.3 -r1.2.8.4
--- Makefile.ros-template 13 Dec 2004 16:18:11 -0000 1.2.8.3
+++ Makefile.ros-template 30 Dec 2004 04:36:51 -0000 1.2.8.4
@@ -1,4 +1,4 @@
-# $Id: Makefile.ros-template,v 1.2.8.3 2004/12/13 16:18:11 hyperion Exp $
+# $Id: Makefile.ros-template,v 1.2.8.4 2004/12/30 04:36:51 hyperion Exp $
TARGET_NAME = msacm
reactos/lib/ws2_32/include
diff -u -r1.1 -r1.1.8.1
--- .cvsignore 15 Aug 2004 18:53:07 -0000 1.1
+++ .cvsignore 30 Dec 2004 04:36:51 -0000 1.1.8.1
@@ -1,2 +1,3 @@
*.o
*.gch
+*.d
reactos/lib/ws2_32/include
diff -u -r1.1 -r1.1.36.1
--- upcall.h 17 Sep 2000 09:36:01 -0000 1.1
+++ upcall.h 30 Dec 2004 04:36:51 -0000 1.1.36.1
@@ -66,14 +66,6 @@
OUT LPWSATHREADID lpThreadId,
OUT LPINT lpErrno);
-BOOL
-WSPAPI
-WPUPostMessage(
- IN HWND hWnd,
- IN UINT Msg,
- IN WPARAM wParam,
- IN LPARAM lParam);
-
INT
WSPAPI
WPUQueryBlockingCallback(
reactos/lib/ws2_32
diff -u -r1.18.2.3 -r1.18.2.4
--- makefile 13 Dec 2004 16:18:11 -0000 1.18.2.3
+++ makefile 30 Dec 2004 04:36:51 -0000 1.18.2.4
@@ -1,4 +1,4 @@
-# $Id: makefile,v 1.18.2.3 2004/12/13 16:18:11 hyperion Exp $
+# $Id: makefile,v 1.18.2.4 2004/12/30 04:36:51 hyperion Exp $
PATH_TO_TOP = ../..
@@ -27,7 +27,7 @@
TARGET_LFLAGS = -nostartfiles -nostdlib
-TARGET_SDKLIBS = ntdll.a kernel32.a advapi32.a dnsapi.a
+TARGET_SDKLIBS = ntdll.a kernel32.a user32.a advapi32.a dnsapi.a
TARGET_OBJECTS = misc/bsd.o misc/catalog.o misc/dllmain.o \
misc/event.o misc/handle.o misc/ns.o \
reactos/lib/ws2_32/misc
diff -u -r1.13 -r1.13.8.1
--- catalog.c 15 Jul 2004 02:03:07 -0000 1.13
+++ catalog.c 30 Dec 2004 04:36:51 -0000 1.13.8.1
@@ -22,6 +22,8 @@
//EnterCriticalSection(&Provider->Lock);
Provider->ReferenceCount++;
//LeaveCriticalSection(&Provider->Lock);
+
+ WS_DbgPrint(MAX_TRACE, ("Leaving\n"));
}
reactos/lib/ws2_32/misc
diff -u -r1.18.2.1 -r1.18.2.2
--- dllmain.c 8 Dec 2004 21:57:31 -0000 1.18.2.1
+++ dllmain.c 30 Dec 2004 04:36:51 -0000 1.18.2.2
@@ -239,18 +239,25 @@
assert(Provider->ProcTable.lpWSPSocket);
+ WS_DbgPrint(MAX_TRACE,("About to call provider socket fn\n"));
+
Socket = Provider->ProcTable.lpWSPSocket(
- af,
- type,
- protocol,
- lpProtocolInfo,
- g,
- dwFlags,
- &Status);
- if (Status != NO_ERROR) {
- WSASetLastError(Status);
- return INVALID_SOCKET;
+ af,
+ type,
+ protocol,
+ lpProtocolInfo,
+ g,
+ dwFlags,
+ &Status);
+
+ WS_DbgPrint(MAX_TRACE,("Socket: %x, Status: %x\n", Socket, Status));
+
+ if (Status != NO_ERROR) {
+ WSASetLastError(Status);
+ return INVALID_SOCKET;
}
+
+ WS_DbgPrint(MAX_TRACE,("Status: %x\n", Status));
return Socket;
}
@@ -531,9 +538,14 @@
return SOCKET_ERROR;
}
+ WS_DbgPrint(MAX_TRACE,("Calling provider accept\n"));
+
Socket = Provider->ProcTable.lpWSPAccept(
s, addr, addrlen, lpfnCondition, dwCallbackData, &Errno);
+ WS_DbgPrint(MAX_TRACE,("Calling provider accept -> Socket %x, Errno %x\n",
+ Socket, Errno));
+
DereferenceProviderByPointer(Provider);
if (Socket == INVALID_SOCKET) {
@@ -698,7 +710,7 @@
UpcallTable.lpWPUFDIsSet = WPUFDIsSet;
UpcallTable.lpWPUGetProviderPath = WPUGetProviderPath;
UpcallTable.lpWPUModifyIFSHandle = WPUModifyIFSHandle;
- UpcallTable.lpWPUPostMessage = WPUPostMessage;
+ UpcallTable.lpWPUPostMessage = PostMessageW;
UpcallTable.lpWPUQueryBlockingCallback = WPUQueryBlockingCallback;
UpcallTable.lpWPUQuerySocketHandleContext = WPUQuerySocketHandleContext;
UpcallTable.lpWPUQueueApc = WPUQueueApc;
reactos/lib/ws2_32/misc
diff -u -r1.11 -r1.11.6.1
--- sndrcv.c 23 Sep 2004 08:16:16 -0000 1.11
+++ sndrcv.c 30 Dec 2004 04:36:51 -0000 1.11.6.1
@@ -8,6 +8,7 @@
* CSH 01/09-2000 Created
*/
+#include <roscfg.h>
#include <w32api.h>
#include <ws2_32.h>
#include <catalog.h>
@@ -93,7 +94,13 @@
Error = WSASend(s, &WSABuf, 1, &BytesSent, flags, NULL, NULL);
- if( Error ) return -1; else return BytesSent;
+ if( Error ) {
+ WS_DbgPrint(MAX_TRACE,("Reporting error %d\n", Error));
+ return -1;
+ } else {
+ WS_DbgPrint(MAX_TRACE,("Read %d bytes\n", BytesSent));
+ return BytesSent;
+ }
}
reactos/lib/ws2_32/misc
diff -u -r1.6 -r1.6.8.1
--- upcall.c 15 Jul 2004 02:03:07 -0000 1.6
+++ upcall.c 30 Dec 2004 04:36:51 -0000 1.6.8.1
@@ -7,6 +7,7 @@
* REVISIONS:
* CSH 01/09-2000 Created
*/
+#include <roscfg.h>
#include <ws2_32.h>
#include <catalog.h>
#include <handle.h>
@@ -138,7 +139,8 @@
if (!Provider) {
WS_DbgPrint(MIN_TRACE, ("Provider with catalog entry id (%d) was not found.\n",
dwCatalogEntryId));
- *lpErrno = WSAEINVAL;
+ if( lpErrno ) *lpErrno = WSAEINVAL;
+ WS_DbgPrint(MID_TRACE, ("Returning invalid socket\n"));
return INVALID_SOCKET;
}
@@ -146,8 +148,9 @@
(HANDLE)ProposedHandle,
Provider);
- *lpErrno = NO_ERROR;
+ if( lpErrno ) *lpErrno = NO_ERROR;
+ WS_DbgPrint(MID_TRACE, ("Socket: %x\n", Socket));
return Socket;
}
@@ -170,23 +173,6 @@
/*
* @unimplemented
*/
-BOOL
-WSPAPI
-WPUPostMessage(
- IN HWND hWnd,
- IN UINT Msg,
- IN WPARAM wParam,
- IN LPARAM lParam)
-{
- UNIMPLEMENTED
-
- return FALSE;
-}
-
-
-/*
- * @unimplemented
- */
INT
WSPAPI
WPUQueryBlockingCallback(
reactos/lib/wsock32
diff -u -r1.5 -r1.5.6.1
--- wsock32.def 16 Sep 2004 10:25:17 -0000 1.5
+++ wsock32.def 30 Dec 2004 04:36:51 -0000 1.5.6.1
@@ -7,7 +7,7 @@
connect=ws2_32.connect @4
getpeername=ws2_32.getpeername @5
getsockname=ws2_32.getsockname @6
-getsockopt@20 @ 7
+getsockopt@20=ws2_32.getsockopt @7
htonl=ws2_32.htonl @8
htons=ws2_32.htons @9
inet_addr=ws2_32.inet_addr @10
@@ -16,12 +16,12 @@
listen=ws2_32.listen @13
ntohl=ws2_32.ntohl @14
ntohs=ws2_32.ntohs @15
-recv@16 @16
-recvfrom@24 @17
+recv@16=ws2_32.recv @16
+recvfrom@24=ws2_32.recvfrom @17
select=ws2_32.select @18
send=ws2_32.send @19
sendto=ws2_32.sendto @20
-setsockopt@20 @21
+setsockopt@20=ws2_32.setsockopt @21
shutdown=ws2_32.shutdown @22
socket=ws2_32.socket @23
MigrateWinsockConfiguration=MSWSOCK.MigrateWinsockConfiguration @24
reactos/lib/zlib
diff -u -r1.1 -r1.1.34.1
--- inftrees.c 24 Mar 2003 01:28:36 -0000 1.1
+++ inftrees.c 30 Dec 2004 04:36:52 -0000 1.1.34.1
@@ -127,6 +127,8 @@
int y; /* number of dummy codes added */
uInt z; /* number of entries in current table */
+ /* Make GCC 4.0 happy. */
+ r.base = 0;
/* Generate counts for each bit length */
p = c;
reactos/ntoskrnl
diff -u -r1.156.2.4 -r1.156.2.5
--- Makefile 30 Dec 2004 01:59:59 -0000 1.156.2.4
+++ Makefile 30 Dec 2004 04:36:52 -0000 1.156.2.5
@@ -537,7 +537,8 @@
$(SDK_PATH_LIB)/librtl.a \
$(SDK_PATH_LIB)/libstring.a \
$(SDK_PATH_LIB)/librosrtl.a \
- $(SDK_PATH_LIB)/libpseh.a
+ $(SDK_PATH_LIB)/libpseh.a \
+ $(PATH_TO_TOP)/drivers/lib/csq/csq.o
TARGET_LFLAGS = \
-Wl,-T,ntoskrnl.lnk \
reactos/ntoskrnl
diff -u -r1.201.2.3 -r1.201.2.4
--- ntoskrnl.def 13 Dec 2004 16:18:14 -0000 1.201.2.3
+++ ntoskrnl.def 30 Dec 2004 04:36:52 -0000 1.201.2.4
@@ -1,4 +1,4 @@
-; $Id: ntoskrnl.def,v 1.201.2.3 2004/12/13 16:18:14 hyperion Exp $
+; $Id: ntoskrnl.def,v 1.201.2.4 2004/12/30 04:36:52 hyperion Exp $
;
; reactos/ntoskrnl/ntoskrnl.def
;
@@ -142,6 +142,7 @@
ExRosDumpPagedPoolByTag@4
ExRosQueryPoolTag@4
@ExRundownCompleted@4
+ExSemaphoreObjectType DATA
ExSetResourceOwnerPointer@8
ExSetTimerResolution@8
ExSystemExceptionFilter@0
@@ -360,6 +361,12 @@
IoCreateSymbolicLink@8
IoCreateSynchronizationEvent@8
IoCreateUnprotectedSymbolicLink@8
+IoCsqInitialize@28
+IoCsqInitializeEx@28
+IoCsqInsertIrp@12
+IoCsqInsertIrpEx@16
+IoCsqRemoveIrp@8
+IoCsqRemoveNextIrp@8
IoDeleteController@4
IoDeleteDevice@4
IoDeleteDriver@4
@@ -958,6 +965,7 @@
READ_REGISTER_BUFFER_USHORT@12
KeRosPrintAddress@4
KeRosDumpStackFrames@8
+KeRosGetStackFrames@8
RtlAbsoluteToSelfRelativeSD@12
RtlAddAccessAllowedAce@16
RtlAddAce@20
reactos/ntoskrnl
diff -u -r1.4 -r1.4.2.1
--- ntoskrnl.mc 5 Oct 2004 19:11:16 -0000 1.4
+++ ntoskrnl.mc 30 Dec 2004 04:36:52 -0000 1.4.2.1
@@ -979,6 +979,14 @@
SPIN_LOCK_INIT_FAILURE
.
+MessageId=0x96
+Severity=Success
+Facility=System
+SymbolicName=INVALID_WORK_QUEUE_ITEM
+Language=English
+INVALID_WORK_QUEUE_ITEM
+.
+
MessageId=0x9A
Severity=Informational
Facility=System
reactos/ntoskrnl/cm
diff -u -r1.51.8.1 -r1.51.8.2
--- cm.h 13 Dec 2004 09:39:08 -0000 1.51.8.1
+++ cm.h 30 Dec 2004 04:36:52 -0000 1.51.8.2
@@ -641,13 +641,13 @@
BOOLEAN
CmiComparePackedNames(IN PUNICODE_STRING Name,
- IN PCHAR NameBuffer,
+ IN PUCHAR NameBuffer,
IN USHORT NameBufferSize,
IN BOOLEAN NamePacked);
VOID
CmiCopyPackedName(PWCHAR NameBuffer,
- PCHAR PackedNameBuffer,
+ PUCHAR PackedNameBuffer,
ULONG PackedNameSize);
BOOLEAN
reactos/ntoskrnl/cm
diff -u -r1.30.8.2 -r1.30.8.3
--- import.c 13 Dec 2004 16:18:11 -0000 1.30.8.2
+++ import.c 30 Dec 2004 04:36:52 -0000 1.30.8.3
@@ -1,4 +1,4 @@
-/* $Id: import.c,v 1.30.8.2 2004/12/13 16:18:11 hyperion Exp $
+/* $Id: import.c,v 1.30.8.3 2004/12/30 04:36:52 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
reactos/ntoskrnl/cm
diff -u -r1.83.2.2 -r1.83.2.3
--- regfile.c 13 Dec 2004 09:39:09 -0000 1.83.2.2
+++ regfile.c 30 Dec 2004 04:36:52 -0000 1.83.2.3
@@ -3825,7 +3825,7 @@
BOOLEAN
CmiComparePackedNames(IN PUNICODE_STRING Name,
- IN PCHAR NameBuffer,
+ IN PUCHAR NameBuffer,
IN USHORT NameBufferSize,
IN BOOLEAN NamePacked)
{
@@ -3863,7 +3863,7 @@
VOID
CmiCopyPackedName(PWCHAR NameBuffer,
- PCHAR PackedNameBuffer,
+ PUCHAR PackedNameBuffer,
ULONG PackedNameSize)
{
ULONG i;
reactos/ntoskrnl/cm
diff -u -r1.128.2.2 -r1.128.2.3
--- registry.c 13 Dec 2004 16:18:11 -0000 1.128.2.2
+++ registry.c 30 Dec 2004 04:36:53 -0000 1.128.2.3
@@ -1,4 +1,4 @@
-/* $Id: registry.c,v 1.128.2.2 2004/12/13 16:18:11 hyperion Exp $
+/* $Id: registry.c,v 1.128.2.3 2004/12/30 04:36:53 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
reactos/ntoskrnl/dbg
diff -u -r1.35 -r1.35.2.1
--- kdb.c 18 Nov 2004 02:10:28 -0000 1.35
+++ kdb.c 30 Dec 2004 04:36:54 -0000 1.35.2.1
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: kdb.c,v 1.35 2004/11/18 02:10:28 arty Exp $
+/* $Id: kdb.c,v 1.35.2.1 2004/12/30 04:36:54 hyperion Exp $
*
* PROJECT: ReactOS kernel
* FILE: ntoskrnl/dbg/kdb.c
@@ -323,7 +323,7 @@
{
CHAR Key;
PCH Orig = Buffer;
- static UCHAR LastCommand[256] = "";
+ static CHAR LastCommand[256] = "";
ULONG ScanCode = 0;
static CHAR LastKey = '\0';
@@ -404,7 +404,7 @@
}
BOOLEAN STATIC
-KdbDecodeAddress(PUCHAR Buffer, PULONG Address)
+KdbDecodeAddress(PCHAR Buffer, PULONG Address)
{
while (isspace(*Buffer))
{
@@ -412,8 +412,8 @@
}
if (Buffer[0] == '<')
{
- PUCHAR ModuleName = Buffer + 1;
- PUCHAR AddressString = strpbrk(Buffer, ":");
+ PCHAR ModuleName = Buffer + 1;
+ PCHAR AddressString = strpbrk(Buffer, ":");
extern LIST_ENTRY ModuleTextListHead;
PLIST_ENTRY current_entry;
MODULE_TEXT_SECTION* current = NULL;
@@ -1656,17 +1656,24 @@
LONG BreakPointNr;
ULONG ExpNr = (ULONG)TrapFrame->DebugArgMark;
- DbgPrint( ":KDBG:Entered:%s:%s\n",
- PreviousMode==KernelMode ? "kmode" : "umode",
- AlwaysHandle ? "always" : "if-unhandled" );
+ if (ExpNr != 1 && ExpNr != 3)
+ {
+ DbgPrint(":KDBG:Entered:%s:%s\n",
+ PreviousMode==KernelMode ? "kmode" : "umode",
+ AlwaysHandle ? "always" : "if-unhandled");
+ }
/* If we aren't handling umode exceptions then return */
- if( PreviousMode == UserMode && !KdbHandleUmode && !AlwaysHandle )
+ if (PreviousMode == UserMode && !KdbHandleUmode && !AlwaysHandle)
+ {
return kdContinue;
+ }
/* If the exception would be unhandled (and we care) then handle it */
- if( PreviousMode == KernelMode && !KdbHandleHandled && !AlwaysHandle )
+ if (PreviousMode == KernelMode && !KdbHandleHandled && !AlwaysHandle)
+ {
return kdContinue;
+ }
/* Exception inside the debugger? Game over. */
if (KdbEntryCount > 0)
reactos/ntoskrnl/dbg
diff -u -r1.17 -r1.17.2.1
--- kdb_stabs.c 22 Oct 2004 20:16:46 -0000 1.17
+++ kdb_stabs.c 30 Dec 2004 04:36:54 -0000 1.17.2.1
@@ -79,40 +79,41 @@
StabEntry = StartEntry;
}
- for (; (ULONG_PTR)StabEntry < (ULONG_PTR)StabsEnd; StabEntry++)
+ if ( RelativeAddress != NULL )
+ {
+ for (; (ULONG_PTR)StabEntry < (ULONG_PTR)StabsEnd; StabEntry++)
{
ULONG_PTR SymbolRelativeAddress;
-
+
if (StabEntry->n_type != Type)
continue;
if (RelativeAddress != NULL)
- {
- if (StabEntry->n_value < (ULONG_PTR)SymbolInfo->ImageBase)
- continue;
- if (StabEntry->n_value >= ((ULONG_PTR)SymbolInfo->ImageBase + SymbolInfo->ImageSize))
- continue;
+ {
+ if (StabEntry->n_value >= SymbolInfo->ImageSize)
+ continue;
- SymbolRelativeAddress = StabEntry->n_value - (ULONG_PTR)SymbolInfo->ImageBase;
- if ((SymbolRelativeAddress <= (ULONG_PTR)RelativeAddress) &&
- (SymbolRelativeAddress > AddrFound))
- {
- AddrFound = SymbolRelativeAddress;
- BestStabEntry = StabEntry;
- }
- }
- else
+ SymbolRelativeAddress = StabEntry->n_value;
+ if ((SymbolRelativeAddress <= (ULONG_PTR)RelativeAddress) &&
+ (SymbolRelativeAddress > AddrFound))
{
+ AddrFound = SymbolRelativeAddress;
BestStabEntry = StabEntry;
- break;
}
+ }
}
+ }
+ else
+ BestStabEntry = StabEntry;
if (BestStabEntry == NULL)
+ {
DPRINT("StabEntry not found!\n");
+ }
else
+ {
DPRINT("StabEntry found!\n");
+ }
return BestStabEntry;
}
-
reactos/ntoskrnl/dbg
diff -u -r1.4 -r1.4.2.1
--- kdb_symbols.c 13 Nov 2004 23:00:14 -0000 1.4
+++ kdb_symbols.c 30 Dec 2004 04:36:54 -0000 1.4.2.1
@@ -136,7 +136,7 @@
}
current_entry = current_entry->Flink;
}
-
+
return FALSE;
}
@@ -158,7 +158,7 @@
INT Count = 0;
current_entry = ModuleTextListHead.Flink;
-
+
while (current_entry != &ModuleTextListHead &&
current_entry != NULL)
{
@@ -178,7 +178,7 @@
}
current_entry = current_entry->Flink;
}
-
+
return KdbpSymFindUserModule(Address, Name, Index-Count, pInfo);
}
@@ -241,16 +241,16 @@
/*! \brief Print address...
*
- * Tries to lookup line number, file name and function name for the given
+ * Tries to lookup line number, file name and function name for the given
* address and prints it.
* If no such information is found the address is printed in the format
- * <module: offset>, otherwise the format will be
+ * <module: offset>, otherwise the format will be
* <module: offset (filename:linenumber (functionname))>
*
* \retval TRUE Module containing \a Address was found, \a Address was printed.
* \retval FALSE No module containing \a Address was found, nothing was printed.
*/
-BOOLEAN
+BOOLEAN
KdbSymPrintAddress(IN PVOID Address)
{
KDB_MODULE_INFO Info;
@@ -335,14 +335,14 @@
{
DPRINT("No function stab entry found. RelativeAddress %p\n", RelativeAddress);
}
-
+
if (LineNumber != NULL && FunctionEntry != NULL)
{
/* find stab entry for line number */
- ULONG_PTR FunctionRelativeAddress = FunctionEntry->n_value - (ULONG_PTR)SymbolInfo->ImageBase;
+ ULONG_PTR FunctionRelativeAddress = RelativeAddress - FunctionEntry->n_value;
ULONG_PTR AddrFound = 0;
PSTAB_ENTRY NextLineEntry;
-
+
LineEntry = NextLineEntry = FunctionEntry;
while (NextLineEntry != NULL)
{
@@ -353,9 +353,9 @@
break;
if (NextLineEntry->n_type != N_SLINE)
continue;
-
- if (((NextLineEntry->n_value+FunctionRelativeAddress) <= RelativeAddress) &&
- (NextLineEntry->n_value > AddrFound))
+
+ if ( NextLineEntry->n_value <= FunctionRelativeAddress
+ && NextLineEntry->n_value >= AddrFound )
{
AddrFound = NextLineEntry->n_value;
LineEntry = NextLineEntry;
@@ -363,13 +363,13 @@
}
}
}
-
+
if (FileName != NULL)
{
/* find stab entry for file name */
PCHAR p;
INT Length;
-
+
FileEntry = KdbpStabFindEntry(SymbolInfo, N_SO, (PVOID)RelativeAddress, NULL);
if (FileEntry != NULL)
{
@@ -383,7 +383,7 @@
DPRINT("No filename stab entry found. RelativeAddress %p\n", RelativeAddress);
}
}
-
+
if (((LineNumber != NULL && LineEntry == NULL) || LineNumber == NULL) &&
((FileName != NULL && FileEntry == NULL) || FileName == NULL) &&
((FunctionName != NULL && FunctionEntry == NULL) || FunctionName == NULL))
@@ -443,10 +443,10 @@
PCHAR SymbolName, p;
CHAR Buffer[512] = "";
INT Length, FileNameLength, FuncNameLength = 0;
-
+
if (FuncName == NULL && LineNumber < 1)
return FALSE;
-
+
FileNameLength = strlen(FileName);
FuncNameLength = strlen(FuncName);
for (Entry = SymbolInfo->SymbolsBase;
@@ -467,7 +467,7 @@
}
strncat(Buffer, SymbolName, sizeof (Buffer) - 1);
Buffer[sizeof (Buffer) - 1] = '\0';
-
+
Length = strlen(Buffer);
if (strcmp(Buffer + Length - FileNameLength, FileName) != 0)
continue;
@@ -513,7 +513,7 @@
}
break;
}
-
+
return FALSE;
}
@@ -574,7 +574,7 @@
IN PIMAGE_SYMBOL_INFO SymbolInfo)
{
PIMAGE_SYMBOL_INFO_CACHE CacheEntry;
-
+
DPRINT("Adding symbol file: FileBuffer = %p, ImageBase = %p\n",
SymbolInfo->FileBuffer, SymbolInfo->ImageBase);
@@ -664,7 +664,7 @@
IO_STATUS_BLOCK IoStatusBlock;
PSYMBOLFILE_HEADER SymbolFileHeader;
PIMAGE_SYMBOL_INFO_CACHE CachedSymbolFile;
-
+
/* Get the path to the symbol store */
wcscpy(TmpFileName, L"\\SystemRoot\\symbols\\");
@@ -747,7 +747,7 @@
ZwClose(FileHandle);
return;
}
-
+
/* Load file into memory chunk */
Status = ZwReadFile(FileHandle,
0, 0, 0,
@@ -779,7 +779,7 @@
DPRINT("Installed stabs: %wZ (%08x-%08x,%08x)\n",
FileName,
- SymbolInfo->SymbolsBase,
+ SymbolInfo->SymbolsBase,
SymbolInfo->SymbolsLength + SymbolInfo->SymbolsBase,
SymbolInfo->SymbolStringsBase);
}
@@ -844,7 +844,7 @@
ASSERT(Peb->Ldr);
CurrentEntry = Peb->Ldr->InLoadOrderModuleList.Flink;
- while (CurrentEntry != &Peb->Ldr->InLoadOrderModuleList &&
+ while (CurrentEntry != &Peb->Ldr->InLoadOrderModuleList &&
CurrentEntry != NULL)
{
Current = CONTAINING_RECORD(CurrentEntry, LDR_MODULE, InLoadOrderModuleList);
@@ -871,11 +871,11 @@
{
/* Load symbols for the image if available */
DPRINT("Loading driver %wZ symbols (driver @ %08x)\n", Filename, Module->Base);
-
+
RtlZeroMemory(&Module->TextSection->SymbolInfo, sizeof (Module->TextSection->SymbolInfo));
Module->TextSection->SymbolInfo.ImageBase = Module->TextSection->Base;
Module->TextSection->SymbolInfo.ImageSize = Module->TextSection->Length;
-
+
KdbpSymLoadModuleSymbols(Filename, &Module->TextSection->SymbolInfo);
}
@@ -893,7 +893,7 @@
/*! \brief Called when a symbol file is loaded by the loader?
*
* Tries to find a driver (.sys) or executable (.exe) with the same base name
- * as the symbol file and sets the drivers/exes symbol info to the loaded
+ * as the symbol file and sets the drivers/exes symbol info to the loaded
* module.
* Used to load ntoskrnl and hal symbols before the SystemRoot is available to us.
*
@@ -925,13 +925,13 @@
{
*Extension = 0;
}
-
+
DPRINT("base: %s (Length %d)\n", TmpBaseName, Length);
-
+
strcpy(TmpFileName, TmpBaseName);
strcat(TmpFileName, ".sys");
RtlInitAnsiString(&AnsiString, TmpFileName);
-
+
RtlAnsiStringToUnicodeString(&ModuleName, &AnsiString, TRUE);
ModuleObject = LdrGetModuleObject(&ModuleName);
RtlFreeUnicodeString(&ModuleName);
@@ -951,7 +951,7 @@
{
KdbpSymRemoveCachedFile(SymbolInfo);
}
-
+
SymbolFileHeader = (PSYMBOLFILE_HEADER) ModuleLoadBase;
SymbolInfo->FileBuffer = ModuleLoadBase;
SymbolInfo->SymbolsBase = ModuleLoadBase + SymbolFileHeader->StabsOffset;
@@ -960,11 +960,12 @@
SymbolInfo->SymbolStringsLength = SymbolFileHeader->StabstrLength;
DPRINT("Installed stabs: %s@%08x-%08x (%08x-%08x,%08x)\n",
FileName,
- ModuleObject->Base, ModuleObject->Length + ModuleObject->Base,
- SymbolInfo->SymbolsBase,
+ ModuleObject->Base,
+ ModuleObject->Length + ModuleObject->Base,
+ SymbolInfo->SymbolsBase,
SymbolInfo->SymbolsLength + SymbolInfo->SymbolsBase,
SymbolInfo->SymbolStringsBase);
- }
+ }
}
/*! \brief Initializes the KDB symbols implementation.
reactos/ntoskrnl/dbg
diff -u -r1.20.8.2 -r1.20.8.3
--- print.c 13 Dec 2004 16:18:12 -0000 1.20.8.2
+++ print.c 30 Dec 2004 04:36:54 -0000 1.20.8.3
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: print.c,v 1.20.8.2 2004/12/13 16:18:12 hyperion Exp $
+/* $Id: print.c,v 1.20.8.3 2004/12/30 04:36:54 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
reactos/ntoskrnl/ex
diff -u -r1.22 -r1.22.2.1
--- fmutex.c 22 Oct 2004 20:18:35 -0000 1.22
+++ fmutex.c 30 Dec 2004 04:36:54 -0000 1.22.2.1
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: fmutex.c,v 1.22 2004/10/22 20:18:35 ekohl Exp $
+/* $Id: fmutex.c,v 1.22.2.1 2004/12/30 04:36:54 hyperion Exp $
*
* PROJECT: ReactOS kernel
* FILE: ntoskrnl/ex/fmutex.c
@@ -41,7 +41,7 @@
ExAcquireFastMutexUnsafe(PFAST_MUTEX FastMutex)
{
ASSERT(FastMutex->Owner != KeGetCurrentThread());
- InterlockedIncrement((LONG *)&FastMutex->Contention);
+ InterlockedIncrementUL(&FastMutex->Contention);
while (InterlockedExchange(&FastMutex->Count, 0) == 0)
{
KeWaitForSingleObject(&FastMutex->Event,
@@ -50,7 +50,7 @@
FALSE,
NULL);
}
- InterlockedDecrement((LONG *)&FastMutex->Contention);
+ InterlockedDecrementUL(&FastMutex->Contention);
FastMutex->Owner = KeGetCurrentThread();
}
reactos/ntoskrnl/ex
diff -u -r1.17 -r1.17.2.1
--- init.c 5 Nov 2004 17:42:20 -0000 1.17
+++ init.c 30 Dec 2004 04:36:54 -0000 1.17.2.1
@@ -45,6 +45,7 @@
{
ExInitializeWorkerThreads();
ExpWin32kInit();
+ ExpInitUuids();
}
reactos/ntoskrnl/ex
diff -u -r1.59.2.4 -r1.59.2.5
--- sysinfo.c 13 Dec 2004 16:18:12 -0000 1.59.2.4
+++ sysinfo.c 30 Dec 2004 04:36:54 -0000 1.59.2.5
@@ -1,4 +1,4 @@
-/* $Id: sysinfo.c,v 1.59.2.4 2004/12/13 16:18:12 hyperion Exp $
+/* $Id: sysinfo.c,v 1.59.2.5 2004/12/30 04:36:54 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -1513,8 +1513,8 @@
IN UINT NumberOfBytesToFlush
)
{
- UNIMPLEMENTED;
- return(STATUS_NOT_IMPLEMENTED);
+ __asm__("wbinvd\n");
+ return STATUS_SUCCESS;
}
reactos/ntoskrnl/ex
diff -u -r1.24.2.4 -r1.24.2.5
--- time.c 13 Dec 2004 16:18:12 -0000 1.24.2.4
+++ time.c 30 Dec 2004 04:36:54 -0000 1.24.2.5
@@ -1,4 +1,4 @@
-/* $Id: time.c,v 1.24.2.4 2004/12/13 16:18:12 hyperion Exp $
+/* $Id: time.c,v 1.24.2.5 2004/12/30 04:36:54 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
reactos/ntoskrnl/ex
diff -u -r1.1 -r1.1.2.1
--- uuid.c 12 Nov 2004 12:04:32 -0000 1.1
+++ uuid.c 30 Dec 2004 04:36:54 -0000 1.1.2.1
@@ -1,4 +1,4 @@
-/* $Id: uuid.c,v 1.1 2004/11/12 12:04:32 ekohl Exp $
+/* $Id: uuid.c,v 1.1.2.1 2004/12/30 04:36:54 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -12,8 +12,203 @@
#define NDEBUG
#include <internal/debug.h>
+#define SEED_BUFFER_SIZE 6
+
+/* Number of 100ns ticks per clock tick. To be safe, assume that the clock
+ resolution is at least 1000 * 100 * (1/1000000) = 1/10 of a second */
+#define TICKS_PER_CLOCK_TICK 1000
+#define SECSPERDAY 86400
+#define TICKSPERSEC 10000000
+
+/* UUID system time starts at October 15, 1582 */
+#define SECS_15_OCT_1582_TO_1601 ((17 + 30 + 31 + 365 * 18 + 5) * SECSPERDAY)
+#define TICKS_15_OCT_1582_TO_1601 ((ULONGLONG)SECS_15_OCT_1582_TO_1601 * TICKSPERSEC)
+
+
+/* GLOBALS ****************************************************************/
+
+static FAST_MUTEX UuidMutex;
+static LARGE_INTEGER UuidLastTime;
+static ULONG UuidSequence;
+static BOOLEAN UuidSequenceInitialized = FALSE;
+static BOOLEAN UuidSequenceChanged = FALSE;
+static UCHAR UuidSeed[SEED_BUFFER_SIZE];
+static ULONG UuidCount;
+
+
+
/* FUNCTIONS ****************************************************************/
+VOID INIT_FUNCTION
+ExpInitUuids(VOID)
+{
+ ExInitializeFastMutex(&UuidMutex);
+
+ KeQuerySystemTime((PLARGE_INTEGER)&UuidLastTime);
+ UuidLastTime.QuadPart += TICKS_15_OCT_1582_TO_1601;
+
+ UuidCount = TICKS_PER_CLOCK_TICK;
+ RtlZeroMemory(UuidSeed, SEED_BUFFER_SIZE);
+}
+
+
+#define VALUE_BUFFER_SIZE 256
+
+static NTSTATUS
+ExpLoadUuidSequence(PULONG Sequence)
+{
+ UCHAR ValueBuffer[VALUE_BUFFER_SIZE];
+ PKEY_VALUE_PARTIAL_INFORMATION ValueInfo;
+ OBJECT_ATTRIBUTES ObjectAttributes;
+ UNICODE_STRING Name;
+ HANDLE KeyHandle;
+ ULONG ValueLength;
+ NTSTATUS Status;
+
+ RtlInitUnicodeString(&Name,
+ L"\\Registry\\Machine\\Software\\Microsoft\\Rpc");
+ InitializeObjectAttributes(&ObjectAttributes,
+ &Name,
+ OBJ_CASE_INSENSITIVE,
+ NULL,
+ NULL);
+ Status = NtOpenKey(&KeyHandle,
+ KEY_QUERY_VALUE,
+ &ObjectAttributes);
+ if (!NT_SUCCESS(Status))
+ {
+ DPRINT("NtOpenKey() failed (Status %lx)\n", Status);
+ return Status;
+ }
+
+ RtlInitUnicodeString(&Name,
+ L"UuidSequenceNumber");
+
+ ValueInfo = (PKEY_VALUE_PARTIAL_INFORMATION)ValueBuffer;
+ Status = NtQueryValueKey(KeyHandle,
+ &Name,
+ KeyValuePartialInformation,
+ ValueBuffer,
+ VALUE_BUFFER_SIZE,
+ &ValueLength);
+ NtClose(KeyHandle);
+ if (!NT_SUCCESS(Status))
+ {
+ DPRINT("NtQueryValueKey() failed (Status %lx)\n", Status);
+ return Status;
+ }
+
+ *Sequence = *((PULONG)ValueInfo->Data);
+
+ DPRINT("Loaded sequence %lx\n", *Sequence);
+
+ return STATUS_SUCCESS;
+}
+#undef VALUE_BUFFER_SIZE
+
+
+static NTSTATUS
+ExpSaveUuidSequence(PULONG Sequence)
+{
+ OBJECT_ATTRIBUTES ObjectAttributes;
+ UNICODE_STRING Name;
+ HANDLE KeyHandle;
+ NTSTATUS Status;
+
+ RtlInitUnicodeString(&Name,
+ L"\\Registry\\Machine\\Software\\Microsoft\\Rpc");
+ InitializeObjectAttributes(&ObjectAttributes,
+ &Name,
+ OBJ_CASE_INSENSITIVE,
+ NULL,
+ NULL);
+ Status = NtOpenKey(&KeyHandle,
+ KEY_SET_VALUE,
+ &ObjectAttributes);
+ if (!NT_SUCCESS(Status))
+ {
+ DPRINT("NtOpenKey() failed (Status %lx)\n", Status);
+ return Status;
+ }
+
+ RtlInitUnicodeString(&Name,
+ L"UuidSequenceNumber");
+ Status = NtSetValueKey(KeyHandle,
+ &Name,
+ 0,
+ REG_DWORD,
+ Sequence,
+ sizeof(ULONG));
+ NtClose(KeyHandle);
+ if (!NT_SUCCESS(Status))
+ {
+ DPRINT("NtSetValueKey() failed (Status %lx)\n", Status);
+ }
+
+ return Status;
+}
+
+
+static VOID
+ExpGetRandomUuidSequence(PULONG Sequence)
+{
+ LARGE_INTEGER Counter;
+ LARGE_INTEGER Frequency;
+ ULONG Value;
+
+ Counter = KeQueryPerformanceCounter(&Frequency);
+ Value = Counter.u.LowPart ^ Counter.u.HighPart;
+
+ *Sequence = *Sequence ^ Value;
+
+ DPRINT("Sequence %lx\n", *Sequence);
+}
+
+
+static NTSTATUS
+ExpCreateUuids(PULARGE_INTEGER Time,
+ PULONG Range,
+ PULONG Sequence)
+{
+ /*
+ * Generate time element of the UUID. Account for going faster
+ * than our clock as well as the clock going backwards.
+ */
+ while (1)
+ {
+ KeQuerySystemTime((PLARGE_INTEGER)Time);
+ Time->QuadPart += TICKS_15_OCT_1582_TO_1601;
+
+ if (Time->QuadPart > UuidLastTime.QuadPart)
+ {
+ UuidCount = 0;
+ break;
+ }
+
+ if (Time->QuadPart < UuidLastTime.QuadPart)
+ {
+ (*Sequence)++;
+ UuidSequenceChanged = TRUE;
+ UuidCount = 0;
+ break;
+ }
+
+ if (UuidCount < TICKS_PER_CLOCK_TICK)
+ {
+ UuidCount++;
+ break;
+ }
+ }
+
+ UuidLastTime.QuadPart = Time->QuadPart;
+ Time->QuadPart += UuidCount;
+
+ *Range = 10000; /* What does this mean? Ticks per millisecond?*/
+
+ return STATUS_SUCCESS;
+}
+
+
/*
* @unimplemented
*/
@@ -23,19 +218,68 @@
OUT PULONG Sequence,
OUT PUCHAR Seed)
{
- UNIMPLEMENTED;
- return STATUS_NOT_IMPLEMENTED;
+ ULARGE_INTEGER IntTime;
+ ULONG IntRange;
+ NTSTATUS Status;
+
+ ExAcquireFastMutex(&UuidMutex);
+
+ if (!UuidSequenceInitialized)
+ {
+ Status = ExpLoadUuidSequence(&UuidSequence);
+ if (NT_SUCCESS(Status))
+ {
+ UuidSequence++;
+ }
+ else
+ {
+ ExpGetRandomUuidSequence(&UuidSequence);
+ }
+
+ UuidSequenceInitialized = TRUE;
+ UuidSequenceChanged = TRUE;
+ }
+
+ Status = ExpCreateUuids(&IntTime,
+ &IntRange,
+ &UuidSequence);
+ if (!NT_SUCCESS(Status))
+ {
+ ExReleaseFastMutex(&UuidMutex);
+ return Status;
+ }
+
+ if (UuidSequenceChanged)
+ {
+ Status = ExpSaveUuidSequence(&UuidSequence);
+ if (NT_SUCCESS(Status))
+ UuidSequenceChanged = FALSE;
+ }
+
+ ExReleaseFastMutex(&UuidMutex);
+
+ Time->QuadPart = IntTime.QuadPart;
+ *Range = IntRange;
+ *Sequence = UuidSequence;
+
+ RtlCopyMemory(Seed,
+ UuidSeed,
+ SEED_BUFFER_SIZE);
+
+ return STATUS_SUCCESS;
}
/*
- * @unimplemented
+ * @implemented
*/
NTSTATUS STDCALL
NtSetUuidSeed(IN PUCHAR Seed)
{
- UNIMPLEMENTED;
- return STATUS_NOT_IMPLEMENTED;
+ RtlCopyMemory(UuidSeed,
+ Seed,
+ SEED_BUFFER_SIZE);
+ return STATUS_SUCCESS;
}
/* EOF */
reactos/ntoskrnl/ex
diff -u -r1.23 -r1.23.2.1
--- work.c 21 Nov 2004 18:38:51 -0000 1.23
+++ work.c 30 Dec 2004 04:36:54 -0000 1.23.2.1
@@ -1,4 +1,4 @@
-/* $Id: work.c,v 1.23 2004/11/21 18:38:51 gdalsnes Exp $
+/* $Id: work.c,v 1.23.2.1 2004/12/30 04:36:54 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -53,6 +53,25 @@
while (TRUE)
{
current = KeRemoveQueue( (PKQUEUE)context, KernelMode, NULL );
+
+ /* can't happend since we do a KernelMode wait (and we're a system thread) */
+ ASSERT((NTSTATUS)current != STATUS_USER_APC);
+
+ /* this should never happend either, since we wait with NULL timeout,
+ * but there's a slight possibility that STATUS_TIMEOUT is returned
+ * at queue rundown in NT (unlikely) -Gunnar
+ */
+ ASSERT((NTSTATUS)current != STATUS_TIMEOUT);
+
+ /* based on INVALID_WORK_QUEUE_ITEM bugcheck desc. */
+ if (current->Flink == NULL || current->Blink == NULL)
+ {
+ KeBugCheck(INVALID_WORK_QUEUE_ITEM);
+ }
+
+ /* "reinitialize" item (same as done in ExInitializeWorkItem) */
+ current->Flink = NULL;
+
item = CONTAINING_RECORD( current, WORK_QUEUE_ITEM, List);
item->WorkerRoutine(item->Parameter);
@@ -126,7 +145,7 @@
{
ASSERT(WorkItem!=NULL);
ASSERT_IRQL(DISPATCH_LEVEL);
-
+ ASSERT(WorkItem->List.Flink == NULL);
/*
* Insert the item in the appropiate queue and wake up any thread
* waiting for something to do
reactos/ntoskrnl/ex/i386
diff -u -r1.9.6.2 -r1.9.6.3
--- interlck.c 13 Dec 2004 16:18:12 -0000 1.9.6.2
+++ interlck.c 30 Dec 2004 04:36:55 -0000 1.9.6.3
@@ -1,4 +1,4 @@
-/* $Id: interlck.c,v 1.9.6.2 2004/12/13 16:18:12 hyperion Exp $
+/* $Id: interlck.c,v 1.9.6.3 2004/12/30 04:36:55 hyperion Exp $
*
* reactos/ntoskrnl/ex/i386/interlck.c
*
reactos/ntoskrnl/fs
diff -u -r1.15 -r1.15.2.1
--- filelock.c 22 Oct 2004 20:19:58 -0000 1.15
+++ filelock.c 30 Dec 2004 04:36:55 -0000 1.15.2.1
@@ -1,4 +1,4 @@
-/* $Id: filelock.c,v 1.15 2004/10/22 20:19:58 ekohl Exp $
+/* $Id: filelock.c,v 1.15.2.1 2004/12/30 04:36:55 hyperion Exp $
*
* reactos/ntoskrnl/fs/filelock.c
*
@@ -538,14 +538,14 @@
//walk pending list, FIFO order, try 2 complete locks
PLIST_ENTRY EnumEntry;
PIRP Irp;
- PEXTENDED_IO_STACK_LOCATION Stack;
+ PIO_STACK_LOCATION Stack;
EnumEntry = LockToc->PendingListHead.Blink;
while (EnumEntry != &LockToc->PendingListHead)
{
Irp = CONTAINING_RECORD(EnumEntry,IRP, Tail.Overlay.ListEntry);
- Stack = (PEXTENDED_IO_STACK_LOCATION) IoGetCurrentIrpStackLocation(Irp);
+ Stack = IoGetCurrentIrpStackLocation(Irp);
if (FsRtlpAddLock(LockToc,
Stack->FileObject,
&Stack->Parameters.LockControl.ByteOffset,
@@ -732,7 +732,7 @@
PFILE_LOCK_GRANTED Granted;
PIRP Irp;
PLIST_ENTRY EnumEntry;
- PEXTENDED_IO_STACK_LOCATION Stack;
+ PIO_STACK_LOCATION Stack;
ASSERT(FileLock);
LockToc = FileLock->LockInformation;
@@ -772,7 +772,7 @@
{
Irp = CONTAINING_RECORD(EnumEntry, IRP , Tail.Overlay.ListEntry );
- Stack = (PEXTENDED_IO_STACK_LOCATION) IoGetCurrentIrpStackLocation(Irp);
+ Stack = IoGetCurrentIrpStackLocation(Irp);
DPRINT1("%s, start: %i, len: %i, end: %i, key: %i, proc: 0x%X, fob: 0x%X\n",
(Stack->Flags & SL_EXCLUSIVE_LOCK) ? "EXCL" : "SHRD",
@@ -1081,12 +1081,12 @@
IN PVOID Context OPTIONAL
)
{
- PEXTENDED_IO_STACK_LOCATION Stack;
+ PIO_STACK_LOCATION Stack;
NTSTATUS Status;
IO_STATUS_BLOCK LocalIoStatus;
ASSERT(FileLock);
- Stack = (PEXTENDED_IO_STACK_LOCATION) IoGetCurrentIrpStackLocation(Irp);
+ Stack = IoGetCurrentIrpStackLocation(Irp);
Irp->IoStatus.Information = 0;
switch(Stack->MinorFunction)
reactos/ntoskrnl/include
diff -u -r1.1 -r1.1.8.1
--- .cvsignore 15 Aug 2004 16:39:03 -0000 1.1
+++ .cvsignore 30 Dec 2004 04:36:55 -0000 1.1.8.1
@@ -1,2 +1,3 @@
*.gch
*.o
+*.d
reactos/ntoskrnl/include/internal
diff -u -r1.44.2.1 -r1.44.2.2
--- ex.h 8 Dec 2004 21:57:32 -0000 1.44.2.1
+++ ex.h 30 Dec 2004 04:36:55 -0000 1.44.2.2
@@ -34,7 +34,7 @@
HANDLE hbmWallpaper;
ULONG cxWallpaper, cyWallpaper;
WALLPAPER_MODE WallpaperMode;
-
+
ULONG Flags;
struct _DESKTOP_OBJECT* ActiveDesktop;
/* FIXME: Clipboard */
@@ -99,6 +99,8 @@
ExpInitLookasideLists(VOID);
VOID
ExpInitializeCallbacks(VOID);
+VOID
+ExpInitUuids(VOID);
/* OTHER FUNCTIONS **********************************************************/
@@ -118,5 +120,25 @@
NTSTATUS
ExpSetTimeZoneInformation(PTIME_ZONE_INFORMATION TimeZoneInformation);
+#define InterlockedDecrementUL(Addend) \
+ (ULONG)InterlockedDecrement((PLONG)(Addend))
+
+#define InterlockedIncrementUL(Addend) \
+ (ULONG)InterlockedIncrement((PLONG)(Addend))
+
+#define InterlockedExchangeUL(Target, Value) \
+ (ULONG)InterlockedExchange((PLONG)(Target), (LONG)(Value))
+
+#define InterlockedExchangeAddUL(Addend, Value) \
+ (ULONG)InterlockedExchangeAdd((PLONG)(Addend), (LONG)(Value))
+
+#define InterlockedCompareExchangeUL(Destination, Exchange, Comperand) \
+ (ULONG)InterlockedCompareExchange((PLONG)(Destination), (LONG)(Exchange), (LONG)(Comperand))
+
+#define ExfInterlockedCompareExchange64UL(Destination, Exchange, Comperand) \
+ (ULONGLONG)ExfInterlockedCompareExchange64((PLONGLONG)(Destination), (PLONGLONG)(Exchange), (PLONGLONG)(Comperand))
+
+#define ExfpInterlockedExchange64UL(Target, Value) \
+ (ULONGLONG)ExfpInterlockedExchange64((PLONGLONG)(Target), (PLONGLONG)(Value))
#endif /* __NTOSKRNL_INCLUDE_INTERNAL_EXECUTIVE_H */
reactos/ntoskrnl/include/internal
diff -u -r1.49.2.3 -r1.49.2.4
--- io.h 13 Dec 2004 16:18:12 -0000 1.49.2.3
+++ io.h 30 Dec 2004 04:36:55 -0000 1.49.2.4
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: io.h,v 1.49.2.3 2004/12/13 16:18:12 hyperion Exp $
+/* $Id: io.h,v 1.49.2.4 2004/12/30 04:36:55 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -523,6 +523,11 @@
IN PIO_TIMER Timer
);
+/* iocomp.c */
+VOID
+FASTCALL
+IopInitIoCompletionImplementation(VOID);
+
#define CM_RESOURCE_LIST_SIZE(ResList) \
(ResList->Count == 1) ? \
FIELD_OFFSET(CM_RESOURCE_LIST, List[0].PartialResourceList. \
reactos/ntoskrnl/include/internal
diff -u -r1.28.2.2 -r1.28.2.3
--- kd.h 13 Dec 2004 16:18:12 -0000 1.28.2.2
+++ kd.h 30 Dec 2004 04:36:55 -0000 1.28.2.3
@@ -1,4 +1,4 @@
-/* $Id: kd.h,v 1.28.2.2 2004/12/13 16:18:12 hyperion Exp $
+/* $Id: kd.h,v 1.28.2.3 2004/12/30 04:36:55 hyperion Exp $
*
* kernel debugger prototypes
*/
reactos/ntoskrnl/include/internal
diff -u -r1.75.2.3 -r1.75.2.4
--- ps.h 13 Dec 2004 16:18:12 -0000 1.75.2.3
+++ ps.h 30 Dec 2004 04:36:55 -0000 1.75.2.4
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: ps.h,v 1.75.2.3 2004/12/13 16:18:12 hyperion Exp $
+/* $Id: ps.h,v 1.75.2.4 2004/12/30 04:36:55 hyperion Exp $
*
* FILE: ntoskrnl/ke/kthread.c
* PURPOSE: Process manager definitions
reactos/ntoskrnl/include/internal
diff -u -r1.2 -r1.2.2.1
--- test.h 29 Oct 2004 16:48:10 -0000 1.2
+++ test.h 30 Dec 2004 04:36:55 -0000 1.2.2.1
@@ -37,4 +37,12 @@
PMmProbeAndLockPages pMmProbeAndLockPages,
PExFreePool pExFreePool);
+NTSTATUS FASTCALL
+MiQueryVirtualMemory (IN HANDLE ProcessHandle,
+ IN PVOID Address,
+ IN CINT VirtualMemoryInformationClass,
+ OUT PVOID VirtualMemoryInformation,
+ IN ULONG Length,
+ OUT PULONG ResultLength);
+
#endif /* __NTOSKRNL_INCLUDE_INTERNAL_TEST_H */
reactos/ntoskrnl/io
diff -u -r1.5.6.2 -r1.5.6.3
--- bootlog.c 13 Dec 2004 16:18:12 -0000 1.5.6.2
+++ bootlog.c 30 Dec 2004 04:36:55 -0000 1.5.6.3
@@ -1,4 +1,4 @@
-/* $Id: bootlog.c,v 1.5.6.2 2004/12/13 16:18:12 hyperion Exp $
+/* $Id: bootlog.c,v 1.5.6.3 2004/12/30 04:36:55 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
reactos/ntoskrnl/io
diff -u -r1.52 -r1.52.2.1
--- cleanup.c 12 Nov 2004 18:50:53 -0000 1.52
+++ cleanup.c 30 Dec 2004 04:36:55 -0000 1.52.2.1
@@ -26,9 +26,9 @@
if (IoStack->MajorFunction == IRP_MJ_FILE_SYSTEM_CONTROL)
{
IoControlCode =
- ((PEXTENDED_IO_STACK_LOCATION)IoStack)->Parameters.FileSystemControl.FsControlCode;
+ IoStack->Parameters.FileSystemControl.FsControlCode;
OutputBufferLength =
- ((PEXTENDED_IO_STACK_LOCATION)IoStack)->Parameters.FileSystemControl.OutputBufferLength;
+ IoStack->Parameters.FileSystemControl.OutputBufferLength;
}
else
{
@@ -300,5 +300,19 @@
}
+ if (NULL != IoStack->FileObject
+ && NULL != IoStack->FileObject->CompletionContext
+ && (0 != (Irp->Flags & IRP_SYNCHRONOUS_API)
+ || 0 == (IoStack->FileObject->Flags & FO_SYNCHRONOUS_IO)))
+ {
+ PFILE_OBJECT FileObject = IoStack->FileObject;
+ IoSetIoCompletion(FileObject->CompletionContext->Port,
+ FileObject->CompletionContext->Key,
+ Irp->Overlay.AsynchronousParameters.UserApcContext,
+ Irp->IoStatus.Status,
+ Irp->IoStatus.Information,
+ FALSE);
+ }
+
IoFreeIrp(Irp);
}
reactos/ntoskrnl/io
diff -u -r1.75 -r1.75.2.1
--- create.c 22 Oct 2004 20:25:52 -0000 1.75
+++ create.c 30 Dec 2004 04:36:55 -0000 1.75.2.1
@@ -1,4 +1,4 @@
-/* $Id: create.c,v 1.75 2004/10/22 20:25:52 ekohl Exp $
+/* $Id: create.c,v 1.75.2.1 2004/12/30 04:36:55 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -367,7 +367,7 @@
if (!NT_SUCCESS(Status))
{
DPRINT("ObCreateObject() failed! (Status %lx)\n", Status);
- return(Status);
+ return Status;
}
RtlMapGenericMask(&DesiredAccess,
@@ -383,7 +383,7 @@
{
DPRINT("ObInsertObject() failed! (Status %lx)\n", Status);
ObDereferenceObject (FileObject);
- return(Status);
+ return Status;
}
if (CreateOptions & FILE_SYNCHRONOUS_IO_ALERT)
@@ -395,7 +395,7 @@
FileObject->Flags |= FO_SYNCHRONOUS_IO;
}
- if( CreateOptions & FILE_NO_INTERMEDIATE_BUFFERING )
+ if (CreateOptions & FILE_NO_INTERMEDIATE_BUFFERING)
FileObject->Flags |= FO_NO_INTERMEDIATE_BUFFERING;
SecurityContext.SecurityQos = NULL; /* ?? */
@@ -417,7 +417,7 @@
if (Irp == NULL)
{
ZwClose(*FileHandle);
- return (STATUS_UNSUCCESSFUL);
+ return STATUS_UNSUCCESSFUL;
}
//trigger FileObject/Event dereferencing
@@ -425,7 +425,7 @@
Irp->RequestorMode = PreviousMode;
Irp->UserIosb = IoStatusBlock;
Irp->AssociatedIrp.SystemBuffer = EaBuffer;
- Irp->Tail.Overlay.AuxiliaryBuffer = (PCHAR)ExtraCreateParameters;
+ Irp->Tail.Overlay.AuxiliaryBuffer = NULL;
Irp->Tail.Overlay.Thread = PsGetCurrentThread();
Irp->UserEvent = &FileObject->Event;
if (AllocationSize)
@@ -438,35 +438,46 @@
* IRP and prepare it.
*/
StackLoc = IoGetNextIrpStackLocation(Irp);
+ StackLoc->MinorFunction = 0;
+ StackLoc->Flags = (UCHAR)Options;
+ StackLoc->Control = 0;
+ StackLoc->DeviceObject = FileObject->DeviceObject;
+ StackLoc->FileObject = FileObject;
+
switch (CreateFileType)
{
default:
case CreateFileTypeNone:
StackLoc->MajorFunction = IRP_MJ_CREATE;
+ StackLoc->Parameters.Create.SecurityContext = &SecurityContext;
+ StackLoc->Parameters.Create.Options = (CreateOptions & FILE_VALID_OPTION_FLAGS);
+ StackLoc->Parameters.Create.Options |= (CreateDisposition << 24);
+ StackLoc->Parameters.Create.FileAttributes = (USHORT)FileAttributes;
+ StackLoc->Parameters.Create.ShareAccess = (USHORT)ShareAccess;
+ StackLoc->Parameters.Create.EaLength = EaLength;
break;
case CreateFileTypeNamedPipe:
StackLoc->MajorFunction = IRP_MJ_CREATE_NAMED_PIPE;
+ StackLoc->Parameters.CreatePipe.SecurityContext = &SecurityContext;
+ StackLoc->Parameters.CreatePipe.Options = (CreateOptions & FILE_VALID_OPTION_FLAGS);
+ StackLoc->Parameters.CreatePipe.Options |= (CreateDisposition << 24);
+ StackLoc->Parameters.CreatePipe.ShareAccess = (USHORT)ShareAccess;
+ StackLoc->Parameters.CreatePipe.Parameters = ExtraCreateParameters;
break;
case CreateFileTypeMailslot:
StackLoc->MajorFunction = IRP_MJ_CREATE_MAILSLOT;
+ StackLoc->Parameters.CreateMailslot.SecurityContext = &SecurityContext;
+ StackLoc->Parameters.CreateMailslot.Options = (CreateOptions & FILE_VALID_OPTION_FLAGS);
+ StackLoc->Parameters.CreateMailslot.Options |= (CreateDisposition << 24);
+ StackLoc->Parameters.CreateMailslot.ShareAccess = (USHORT)ShareAccess;
+ StackLoc->Parameters.CreateMailslot.Parameters = ExtraCreateParameters;
break;
}
- StackLoc->MinorFunction = 0;
- StackLoc->Flags = (UCHAR)Options;
- StackLoc->Control = 0;
- StackLoc->DeviceObject = FileObject->DeviceObject;
- StackLoc->FileObject = FileObject;
- StackLoc->Parameters.Create.SecurityContext = &SecurityContext;
- StackLoc->Parameters.Create.Options = (CreateOptions & FILE_VALID_OPTION_FLAGS);
- StackLoc->Parameters.Create.Options |= (CreateDisposition << 24);
- StackLoc->Parameters.Create.FileAttributes = (USHORT)FileAttributes;
- StackLoc->Parameters.Create.ShareAccess = (USHORT)ShareAccess;
- StackLoc->Parameters.Create.EaLength = EaLength;
-
+
/*
- * Now call the driver and
+ * Now call the driver and
* possibly wait if it can
* not complete the request
* immediately.
@@ -495,7 +506,7 @@
DPRINT("Finished IoCreateFile() (*FileHandle) %x\n", (*FileHandle));
- return (Status);
+ return Status;
}
reactos/ntoskrnl/io
diff -u -r1.85 -r1.85.2.1
--- device.c 18 Nov 2004 11:46:07 -0000 1.85
+++ device.c 30 Dec 2004 04:36:56 -0000 1.85.2.1
@@ -1,4 +1,4 @@
-/* $Id: device.c,v 1.85 2004/11/18 11:46:07 ekohl Exp $
+/* $Id: device.c,v 1.85.2.1 2004/12/30 04:36:56 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -83,21 +83,9 @@
return Status;
}
- if (Fdo->DeviceType == FILE_DEVICE_BUS_EXTENDER)
- {
- DPRINT("Bus extender found\n");
-
- Status = IopInvalidateDeviceRelations(DeviceNode, BusRelations);
-
- if (!NT_SUCCESS(Status))
- {
- ObDereferenceObject(Fdo);
- return Status;
- }
- }
- else if (Fdo->DeviceType == FILE_DEVICE_ACPI)
- {
#ifdef ACPI
+ if (Fdo->DeviceType == FILE_DEVICE_ACPI)
+ {
static BOOLEAN SystemPowerDeviceNodeCreated = FALSE;
/* There can be only one system power device */
@@ -106,7 +94,20 @@
PopSystemPowerDeviceNode = DeviceNode;
SystemPowerDeviceNodeCreated = TRUE;
}
+ }
#endif /* ACPI */
+
+ if (Fdo->DeviceType == FILE_DEVICE_BUS_EXTENDER ||
+ Fdo->DeviceType == FILE_DEVICE_ACPI)
+ {
+ DPRINT("Bus extender found\n");
+
+ Status = IopInvalidateDeviceRelations(DeviceNode, BusRelations);
+ if (!NT_SUCCESS(Status))
+ {
+ ObDereferenceObject(Fdo);
+ return Status;
+ }
}
ObDereferenceObject(Fdo);
@@ -557,7 +558,7 @@
{
swprintf(AutoNameBuffer,
L"\\Device\\%08lx",
- InterlockedIncrement(&IopDeviceObjectNumber));
+ InterlockedIncrementUL(&IopDeviceObjectNumber));
RtlInitUnicodeString(&AutoName,
AutoNameBuffer);
DeviceName = &AutoName;
reactos/ntoskrnl/io
diff -u -r1.25 -r1.25.8.1
--- dir.c 24 Aug 2004 17:08:18 -0000 1.25
+++ dir.c 30 Dec 2004 04:36:56 -0000 1.25.8.1
@@ -1,4 +1,4 @@
-/* $Id: dir.c,v 1.25 2004/08/24 17:08:18 navaraf Exp $
+/* $Id: dir.c,v 1.25.8.1 2004/12/30 04:36:56 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -40,7 +40,7 @@
PDEVICE_OBJECT DeviceObject;
PFILE_OBJECT FileObject;
NTSTATUS Status;
- PEXTENDED_IO_STACK_LOCATION IoStack;
+ PIO_STACK_LOCATION IoStack;
KPROCESSOR_MODE PreviousMode;
DPRINT("NtNotifyChangeDirectoryFile()\n");
@@ -83,7 +83,7 @@
Irp->Overlay.AsynchronousParameters.UserApcRoutine = ApcRoutine;
Irp->Overlay.AsynchronousParameters.UserApcContext = ApcContext;
- IoStack = (PEXTENDED_IO_STACK_LOCATION) IoGetNextIrpStackLocation(Irp);
+ IoStack = IoGetNextIrpStackLocation(Irp);
IoStack->MajorFunction = IRP_MJ_DIRECTORY_CONTROL;
IoStack->MinorFunction = IRP_MN_NOTIFY_CHANGE_DIRECTORY;
@@ -104,7 +104,7 @@
/* FIXME: Should we wait here or not for synchronously opened files? */
- return(Status);
+ return Status;
}
@@ -157,7 +157,7 @@
PDEVICE_OBJECT DeviceObject;
PFILE_OBJECT FileObject;
NTSTATUS Status;
- PEXTENDED_IO_STACK_LOCATION IoStack;
+ PIO_STACK_LOCATION IoStack;
KPROCESSOR_MODE PreviousMode;
DPRINT("NtQueryDirectoryFile()\n");
@@ -195,7 +195,7 @@
Irp->Overlay.AsynchronousParameters.UserApcRoutine = ApcRoutine;
Irp->Overlay.AsynchronousParameters.UserApcContext = ApcContext;
- IoStack = (PEXTENDED_IO_STACK_LOCATION) IoGetNextIrpStackLocation(Irp);
+ IoStack = IoGetNextIrpStackLocation(Irp);
IoStack->MajorFunction = IRP_MJ_DIRECTORY_CONTROL;
IoStack->MinorFunction = IRP_MN_QUERY_DIRECTORY;
reactos/ntoskrnl/io
diff -u -r1.55.2.2 -r1.55.2.3
--- driver.c 13 Dec 2004 16:18:12 -0000 1.55.2.2
+++ driver.c 30 Dec 2004 04:36:56 -0000 1.55.2.3
@@ -1,4 +1,4 @@
-/* $Id: driver.c,v 1.55.2.2 2004/12/13 16:18:12 hyperion Exp $
+/* $Id: driver.c,v 1.55.2.3 2004/12/30 04:36:56 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -1126,12 +1126,12 @@
FileNameWithoutPath);
Status = LdrProcessModule(ModuleLoadBase, &DeviceNode->ServiceName,
&ModuleObject);
- if (ModuleObject == NULL)
+ if (!NT_SUCCESS(Status))
{
if (ModuleDeviceNode == NULL)
IopFreeDeviceNode(DeviceNode);
CPRINT("Driver load failed, status (%x)\n", Status);
- return STATUS_UNSUCCESSFUL;
+ return Status;
}
/*
reactos/ntoskrnl/io
diff -u -r1.45 -r1.45.2.1
--- fs.c 22 Oct 2004 20:25:53 -0000 1.45
+++ fs.c 30 Dec 2004 04:36:56 -0000 1.45.2.1
@@ -83,7 +83,7 @@
PFILE_OBJECT FileObject;
PDEVICE_OBJECT DeviceObject;
PIRP Irp;
- PEXTENDED_IO_STACK_LOCATION StackPtr;
+ PIO_STACK_LOCATION StackPtr;
PKEVENT ptrEvent;
KPROCESSOR_MODE PreviousMode;
@@ -148,7 +148,7 @@
Irp->Overlay.AsynchronousParameters.UserApcRoutine = ApcRoutine;
Irp->Overlay.AsynchronousParameters.UserApcContext = ApcContext;
- StackPtr = (PEXTENDED_IO_STACK_LOCATION) IoGetNextIrpStackLocation(Irp);
+ StackPtr = IoGetNextIrpStackLocation(Irp);
StackPtr->FileObject = FileObject;
StackPtr->DeviceObject = DeviceObject;
StackPtr->Parameters.FileSystemControl.InputBufferLength = InputBufferSize;
reactos/ntoskrnl/io
diff -u -r1.15.8.1 -r1.15.8.2
--- iocomp.c 8 Dec 2004 21:57:33 -0000 1.15.8.1
+++ iocomp.c 30 Dec 2004 04:36:56 -0000 1.15.8.2
@@ -82,7 +82,7 @@
}
/*
- * @unimplemented
+ * @implemented
*/
NTSTATUS
STDCALL
@@ -95,12 +95,28 @@
IN BOOLEAN Quota
)
{
- UNIMPLEMENTED;
- return STATUS_NOT_IMPLEMENTED;
+ PKQUEUE Queue = (PKQUEUE) IoCompletion;
+ PIO_COMPLETION_PACKET Packet;
+
+ Packet = ExAllocateFromNPagedLookasideList(&IoCompletionPacketLookaside);
+ if (NULL == Packet)
+ {
+ return STATUS_NO_MEMORY;
+ }
+
+ Packet->Key = KeyContext;
+ Packet->Context = ApcContext;
+ Packet->IoStatus.Status = IoStatus;
+ Packet->IoStatus.Information = IoStatusInformation;
+
+ KeInsertQueue(Queue, &Packet->ListEntry);
+
+ return STATUS_SUCCESS;
}
-VOID
-NtInitializeIoCompletionImplementation(VOID)
+VOID
+FASTCALL
+IopInitIoCompletionImplementation(VOID)
{
ExIoCompletionType = ExAllocatePool(NonPagedPool, sizeof(OBJECT_TYPE));
@@ -279,36 +295,54 @@
{
PKQUEUE Queue;
NTSTATUS Status;
-
+ PIO_COMPLETION_PACKET Packet;
+ PLIST_ENTRY ListEntry;
+
Status = ObReferenceObjectByHandle( IoCompletionHandle,
IO_COMPLETION_MODIFY_STATE,
ExIoCompletionType,
UserMode,
(PVOID*)&Queue,
NULL);
- if (NT_SUCCESS(Status))
+ if (!NT_SUCCESS(Status))
{
- PIO_COMPLETION_PACKET Packet;
- PLIST_ENTRY ListEntry;
+ return Status;
+ }
- /*
- Try 2 remove packet from queue. Wait (optionaly) if
- no packet in queue or max num of threads allready running.
- */
+ /*
+ Try 2 remove packet from queue. Wait (optionaly) if
+ no packet in queue or max num of threads allready running.
+ */
+
+ do {
+
ListEntry = KeRemoveQueue(Queue, UserMode, Timeout );
- ObDereferenceObject(Queue);
-
- Packet = CONTAINING_RECORD(ListEntry, IO_COMPLETION_PACKET, ListEntry);
+ /* Nebbets book says nothing about NtRemoveIoCompletion returning STATUS_USER_APC,
+ and the umode equivalent GetQueuedCompletionStatus says nothing about this either,
+ so my guess it we should restart the operation. Need further investigation. -Gunnar
+ */
- if (CompletionKey) *CompletionKey = Packet->Key;
- if (CompletionContext) *CompletionContext = Packet->Context;
- if (IoStatusBlock) *IoStatusBlock = Packet->IoStatus;
+ } while((NTSTATUS)ListEntry == STATUS_USER_APC);
- ExFreeToNPagedLookasideList(&IoCompletionPacketLookaside, Packet);
+ ObDereferenceObject(Queue);
+
+ if ((NTSTATUS)ListEntry == STATUS_TIMEOUT)
+ {
+ return STATUS_TIMEOUT;
}
+
+ ASSERT(ListEntry);
+
+ Packet = CONTAINING_RECORD(ListEntry, IO_COMPLETION_PACKET, ListEntry);
- return Status;
+ if (CompletionKey) *CompletionKey = Packet->Key;
+ if (CompletionContext) *CompletionContext = Packet->Context;
+ if (IoStatusBlock) *IoStatusBlock = Packet->IoStatus;
+
+ ExFreeToNPagedLookasideList(&IoCompletionPacketLookaside, Packet);
+
+ return STATUS_SUCCESS;
}
@@ -347,16 +381,8 @@
NULL);
if (NT_SUCCESS(Status))
{
- PIO_COMPLETION_PACKET Packet;
-
- Packet = ExAllocateFromNPagedLookasideList(&IoCompletionPacketLookaside);
-
- Packet->Key = CompletionKey;
- Packet->Context = CompletionContext;
- Packet->IoStatus.Status = CompletionStatus;
- Packet->IoStatus.Information = CompletionInformation;
-
- KeInsertQueue(Queue, &Packet->ListEntry);
+ Status = IoSetIoCompletion(Queue, CompletionKey, CompletionContext,
+ CompletionStatus, CompletionInformation, TRUE);
ObDereferenceObject(Queue);
}
reactos/ntoskrnl/io
diff -u -r1.54 -r1.54.2.1
--- iomgr.c 21 Nov 2004 21:53:07 -0000 1.54
+++ iomgr.c 30 Dec 2004 04:36:56 -0000 1.54.2.1
@@ -1,4 +1,4 @@
-/* $Id: iomgr.c,v 1.54 2004/11/21 21:53:07 ion Exp $
+/* $Id: iomgr.c,v 1.54.2.1 2004/12/30 04:36:56 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -535,6 +535,7 @@
IoInitShutdownNotification();
IopInitErrorLog();
IopInitTimerImplementation();
+ IopInitIoCompletionImplementation();
/*
* Create link from '\DosDevices' to '\??' directory
reactos/ntoskrnl/io
diff -u -r1.70 -r1.70.2.1
--- irp.c 10 Nov 2004 02:50:59 -0000 1.70
+++ irp.c 30 Dec 2004 04:36:56 -0000 1.70.2.1
@@ -1,4 +1,4 @@
-/* $Id: irp.c,v 1.70 2004/11/10 02:50:59 ion Exp $
+/* $Id: irp.c,v 1.70.2.1 2004/12/30 04:36:56 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
reactos/ntoskrnl/io
diff -u -r1.13 -r1.13.8.1
--- lock.c 15 Aug 2004 16:39:03 -0000 1.13
+++ lock.c 30 Dec 2004 04:36:56 -0000 1.13.8.1
@@ -53,7 +53,7 @@
PLARGE_INTEGER LocalLength = NULL;
PKEVENT Event = NULL;
PIRP Irp = NULL;
- PEXTENDED_IO_STACK_LOCATION StackPtr;
+ PIO_STACK_LOCATION StackPtr;
PDEVICE_OBJECT DeviceObject;
KPROCESSOR_MODE PreviousMode;
NTSTATUS Status;
@@ -118,7 +118,7 @@
Irp->UserIosb = IoStatusBlock;
Irp->Tail.Overlay.Thread = PsGetCurrentThread();
- StackPtr = (PEXTENDED_IO_STACK_LOCATION) IoGetNextIrpStackLocation(Irp);
+ StackPtr = IoGetNextIrpStackLocation(Irp);
StackPtr->MajorFunction = IRP_MJ_LOCK_CONTROL;
StackPtr->MinorFunction = IRP_MN_LOCK;
StackPtr->FileObject = FileObject;
@@ -209,7 +209,7 @@
PFILE_OBJECT FileObject = NULL;
PLARGE_INTEGER LocalLength = NULL;
PIRP Irp = NULL;
- PEXTENDED_IO_STACK_LOCATION StackPtr;
+ PIO_STACK_LOCATION StackPtr;
PDEVICE_OBJECT DeviceObject;
KPROCESSOR_MODE PreviousMode;
NTSTATUS Status;
@@ -254,7 +254,7 @@
Irp->UserIosb = IoStatusBlock;
Irp->Tail.Overlay.Thread = PsGetCurrentThread();
- StackPtr = (PEXTENDED_IO_STACK_LOCATION) IoGetNextIrpStackLocation(Irp);
+ StackPtr = IoGetNextIrpStackLocation(Irp);
StackPtr->MajorFunction = IRP_MJ_LOCK_CONTROL;
StackPtr->MinorFunction = IRP_MN_UNLOCK_SINGLE;
StackPtr->DeviceObject = DeviceObject;
reactos/ntoskrnl/io
diff -u -r1.18 -r1.18.2.1
--- npipe.c 31 Oct 2004 23:00:41 -0000 1.18
+++ npipe.c 30 Dec 2004 04:36:56 -0000 1.18.2.1
@@ -24,53 +24,53 @@
ULONG ShareAccess,
ULONG CreateDisposition,
ULONG CreateOptions,
- BOOLEAN NamedPipeType,
- BOOLEAN ReadMode,
- BOOLEAN CompletionMode,
+ ULONG NamedPipeType,
+ ULONG ReadMode,
+ ULONG CompletionMode,
ULONG MaximumInstances,
ULONG InboundQuota,
ULONG OutboundQuota,
PLARGE_INTEGER DefaultTimeout)
{
- NAMED_PIPE_CREATE_PARAMETERS Buffer;
-
- DPRINT("NtCreateNamedPipeFile(FileHandle %x, DesiredAccess %x, "
- "ObjectAttributes %x ObjectAttributes->ObjectName->Buffer %S)\n",
- FileHandle,DesiredAccess,ObjectAttributes,
- ObjectAttributes->ObjectName->Buffer);
-
- ASSERT_IRQL(PASSIVE_LEVEL);
-
- if (DefaultTimeout != NULL)
- {
- Buffer.DefaultTimeout.QuadPart = DefaultTimeout->QuadPart;
- Buffer.TimeoutSpecified = TRUE;
- }
- else
- {
- Buffer.TimeoutSpecified = FALSE;
- }
- Buffer.NamedPipeType = NamedPipeType;
- Buffer.ReadMode = ReadMode;
- Buffer.CompletionMode = CompletionMode;
- Buffer.MaximumInstances = MaximumInstances;
- Buffer.InboundQuota = InboundQuota;
- Buffer.OutboundQuota = OutboundQuota;
-
- return IoCreateFile(FileHandle,
- DesiredAccess,
- ObjectAttributes,
- IoStatusBlock,
- NULL,
- FILE_ATTRIBUTE_NORMAL,
- ShareAccess,
- CreateDisposition,
- CreateOptions,
- NULL,
- 0,
- CreateFileTypeNamedPipe,
- (PVOID)&Buffer,
- 0);
+ NAMED_PIPE_CREATE_PARAMETERS Buffer;
+
+ DPRINT("NtCreateNamedPipeFile(FileHandle %x, DesiredAccess %x, "
+ "ObjectAttributes %x ObjectAttributes->ObjectName->Buffer %S)\n",
+ FileHandle,DesiredAccess,ObjectAttributes,
+ ObjectAttributes->ObjectName->Buffer);
+
+ ASSERT_IRQL(PASSIVE_LEVEL);
+
+ if (DefaultTimeout != NULL)
+ {
+ Buffer.DefaultTimeout.QuadPart = DefaultTimeout->QuadPart;
+ Buffer.TimeoutSpecified = TRUE;
+ }
+ else
+ {
+ Buffer.TimeoutSpecified = FALSE;
+ }
+ Buffer.NamedPipeType = NamedPipeType;
+ Buffer.ReadMode = ReadMode;
+ Buffer.CompletionMode = CompletionMode;
+ Buffer.MaximumInstances = MaximumInstances;
+ Buffer.InboundQuota = InboundQuota;
+ Buffer.OutboundQuota = OutboundQuota;
+
+ return IoCreateFile(FileHandle,
+ DesiredAccess,
+ ObjectAttributes,
+ IoStatusBlock,
+ NULL,
+ FILE_ATTRIBUTE_NORMAL,
+ ShareAccess,
+ CreateDisposition,
+ CreateOptions,
+ NULL,
+ 0,
+ CreateFileTypeNamedPipe,
+ (PVOID)&Buffer,
+ 0);
}
/* EOF */
reactos/ntoskrnl/io
diff -u -r1.8.8.3 -r1.8.8.4
--- parttab.c 13 Dec 2004 16:18:12 -0000 1.8.8.3
+++ parttab.c 30 Dec 2004 04:36:56 -0000 1.8.8.4
@@ -1,4 +1,4 @@
-/* $Id: parttab.c,v 1.8.8.3 2004/12/13 16:18:12 hyperion Exp $
+/* $Id: parttab.c,v 1.8.8.4 2004/12/30 04:36:56 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
reactos/ntoskrnl/io
diff -u -r1.26 -r1.26.2.1
--- vpb.c 22 Oct 2004 20:25:54 -0000 1.26
+++ vpb.c 30 Dec 2004 04:36:56 -0000 1.26.2.1
@@ -1,4 +1,4 @@
-/* $Id: vpb.c,v 1.26 2004/10/22 20:25:54 ekohl Exp $
+/* $Id: vpb.c,v 1.26.2.1 2004/12/30 04:36:56 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -281,7 +281,7 @@
PDEVICE_OBJECT DeviceObject;
PIRP Irp;
NTSTATUS Status;
- PEXTENDED_IO_STACK_LOCATION StackPtr;
+ PIO_STACK_LOCATION StackPtr;
PVOID SystemBuffer;
KPROCESSOR_MODE PreviousMode;
@@ -333,7 +333,7 @@
Irp->UserIosb = IoStatusBlock;
Irp->Tail.Overlay.Thread = PsGetCurrentThread();
- StackPtr = (PEXTENDED_IO_STACK_LOCATION) IoGetNextIrpStackLocation(Irp);
+ StackPtr = IoGetNextIrpStackLocation(Irp);
StackPtr->MajorFunction = IRP_MJ_SET_VOLUME_INFORMATION;
StackPtr->MinorFunction = 0;
StackPtr->Flags = 0;
reactos/ntoskrnl/kd
diff -u -r1.26.2.1 -r1.26.2.2
--- gdbstub.c 8 Dec 2004 21:57:33 -0000 1.26.2.1
+++ gdbstub.c 30 Dec 2004 04:36:56 -0000 1.26.2.2
@@ -1428,7 +1428,7 @@
BOOLEAN DoBreakIn;
CONTEXT Context;
KIRQL OldIrql;
- CHAR Value;
+ UCHAR Value;
DPRINT ("Break In\n");
reactos/ntoskrnl/kd
diff -u -r1.56.2.2 -r1.56.2.3
--- kdebug.c 13 Dec 2004 16:18:12 -0000 1.56.2.2
+++ kdebug.c 30 Dec 2004 04:36:56 -0000 1.56.2.3
@@ -1,4 +1,4 @@
-/* $Id: kdebug.c,v 1.56.2.2 2004/12/13 16:18:12 hyperion Exp $
+/* $Id: kdebug.c,v 1.56.2.3 2004/12/30 04:36:56 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -127,7 +127,7 @@
KdDebuggerEnabled = TRUE;
KdDebugState |= KD_DEBUG_BOCHS;
}
- else if (!_strnicmp(p2, "GDB", 3) && BootPhase > 0)
+ else if (!_strnicmp(p2, "GDB", 3) && BootPhase == 0)
{
p2 += 3;
KdDebuggerEnabled = TRUE;
@@ -255,7 +255,7 @@
/* Perform any initialization nescessary */
if (KdDebuggerEnabled == TRUE)
{
- if (KdDebugState & KD_DEBUG_GDB && BootPhase > 0)
+ if (KdDebugState & KD_DEBUG_GDB && BootPhase == 0)
KdPortInitializeEx(&GdbPortInfo, 0, 0);
if (KdDebugState & KD_DEBUG_SERIAL && BootPhase == 0)
reactos/ntoskrnl/ke
diff -u -r1.47.2.2 -r1.47.2.3
--- bug.c 13 Dec 2004 16:18:13 -0000 1.47.2.2
+++ bug.c 30 Dec 2004 04:36:56 -0000 1.47.2.3
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: bug.c,v 1.47.2.2 2004/12/13 16:18:13 hyperion Exp $
+/* $Id: bug.c,v 1.47.2.3 2004/12/30 04:36:56 hyperion Exp $
*
* PROJECT: ReactOS kernel
* FILE: ntoskrnl/ke/bug.c
reactos/ntoskrnl/ke
diff -u -r1.55 -r1.55.2.1
--- catch.c 20 Nov 2004 17:45:15 -0000 1.55
+++ catch.c 30 Dec 2004 04:36:56 -0000 1.55.2.1
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: catch.c,v 1.55 2004/11/20 17:45:15 arty Exp $
+/* $Id: catch.c,v 1.55.2.1 2004/12/30 04:36:56 hyperion Exp $
*
* PROJECT: ReactOS kernel
* FILE: ntoskrnl/ke/catch.c
@@ -77,7 +77,10 @@
Action = KdEnterDebuggerException (ExceptionRecord, Context, Tf);
}
- if (Action == kdContinue) return;
+ if (Action == kdContinue)
+ {
+ return;
+ }
if (Action != kdDoNotHandleException)
{
@@ -167,8 +170,12 @@
DPRINT("ExceptionRecord->ExceptionAddress = 0x%x\n",
ExceptionRecord->ExceptionAddress );
#ifdef KDBG
- KdbEnterDebuggerException (ExceptionRecord, PreviousMode,
- Context, Tf, TRUE);
+ Action = KdbEnterDebuggerException (ExceptionRecord, PreviousMode,
+ Context, Tf, TRUE);
+ if (Action == kdContinue)
+ {
+ return;
+ }
#endif
KEBUGCHECKWITHTF(KMODE_EXCEPTION_NOT_HANDLED, 0, 0, 0, 0, Tf);
}
reactos/ntoskrnl/ke
diff -u -r1.48.2.3 -r1.48.2.4
--- dpc.c 13 Dec 2004 16:18:13 -0000 1.48.2.3
+++ dpc.c 30 Dec 2004 04:36:56 -0000 1.48.2.4
@@ -19,7 +19,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: dpc.c,v 1.48.2.3 2004/12/13 16:18:13 hyperion Exp $
+/* $Id: dpc.c,v 1.48.2.4 2004/12/30 04:36:56 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -209,7 +209,7 @@
#endif
/* Get the DPC Data */
- if (InterlockedCompareExchange((LONG*)&Dpc->DpcData, (LONG)&Pcr->PrcbData.DpcData[0].DpcLock, 0)) {
+ if (InterlockedCompareExchangeUL(&Dpc->DpcData, &Pcr->PrcbData.DpcData[0].DpcLock, 0)) {
DPRINT("DPC Already Inserted");
#ifdef MP
KiReleaseSpinLock(&Pcr->PrcbData.DpcData[0].DpcLock);
reactos/ntoskrnl/ke
diff -u -r1.3.2.3 -r1.3.2.4
--- ipi.c 13 Dec 2004 16:18:13 -0000 1.3.2.3
+++ ipi.c 30 Dec 2004 04:36:57 -0000 1.3.2.4
@@ -1,4 +1,4 @@
-/* $Id: ipi.c,v 1.3.2.3 2004/12/13 16:18:13 hyperion Exp $
+/* $Id: ipi.c,v 1.3.2.4 2004/12/30 04:36:57 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -76,13 +76,13 @@
if (Pcr->PrcbData.IpiFrozen & IPI_REQUEST_FUNCTIONCALL)
{
- InterlockedDecrement((PLONG)&Pcr->PrcbData.SignalDone->CurrentPacket[1]);
+ InterlockedDecrementUL(&Pcr->PrcbData.SignalDone->CurrentPacket[1]);
if (Pcr->PrcbData.SignalDone->CurrentPacket[2])
{
#ifdef DBG
StartTime = KeQueryPerformanceCounter(&Frequency);
#endif
- while (0 != InterlockedCompareExchange((PLONG)&Pcr->PrcbData.SignalDone->CurrentPacket[1], 0, 0))
+ while (0 != InterlockedCompareExchangeUL(&Pcr->PrcbData.SignalDone->CurrentPacket[1], 0, 0))
{
#ifdef DBG
CurrentTime = KeQueryPerformanceCounter(NULL);
@@ -99,13 +99,13 @@
{
Processor = 1 << KeGetCurrentProcessorNumber();
TargetSet = Pcr->PrcbData.SignalDone->TargetSet;
- } while (Processor & InterlockedCompareExchange(&Pcr->PrcbData.SignalDone->TargetSet, TargetSet & ~Processor, TargetSet));
+ } while (Processor & InterlockedCompareExchangeUL(&Pcr->PrcbData.SignalDone->TargetSet, TargetSet & ~Processor, TargetSet));
if (Pcr->PrcbData.SignalDone->CurrentPacket[2])
{
#ifdef DBG
StartTime = KeQueryPerformanceCounter(&Frequency);
#endif
- while (0 != InterlockedCompareExchange(&Pcr->PrcbData.SignalDone->TargetSet, 0, 0))
+ while (0 != InterlockedCompareExchangeUL(&Pcr->PrcbData.SignalDone->TargetSet, 0, 0))
{
#ifdef DBG
CurrentTime = KeQueryPerformanceCounter(NULL);
@@ -149,7 +149,7 @@
if (TargetSet & Processor)
{
Pcr = (PKPCR)(KPCR_BASE + i * PAGE_SIZE);
- while(0 != InterlockedCompareExchange((PLONG)&Pcr->PrcbData.SignalDone, (LONG)&CurrentPcr->PrcbData, 0));
+ while(0 != InterlockedCompareExchangeUL(&Pcr->PrcbData.SignalDone, (LONG)&CurrentPcr->PrcbData, 0));
Pcr->PrcbData.IpiFrozen |= IPI_REQUEST_FUNCTIONCALL;
if (Processor != CurrentProcessor)
{
reactos/ntoskrnl/ke
diff -u -r1.58.2.2 -r1.58.2.3
--- kthread.c 13 Dec 2004 16:18:13 -0000 1.58.2.2
+++ kthread.c 30 Dec 2004 04:36:57 -0000 1.58.2.3
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: kthread.c,v 1.58.2.2 2004/12/13 16:18:13 hyperion Exp $
+/* $Id: kthread.c,v 1.58.2.3 2004/12/30 04:36:57 hyperion Exp $
*
* FILE: ntoskrnl/ke/kthread.c
* PURPOSE: Microkernel thread support
reactos/ntoskrnl/ke
diff -u -r1.206.2.3 -r1.206.2.4
--- main.c 13 Dec 2004 16:18:13 -0000 1.206.2.3
+++ main.c 30 Dec 2004 04:36:57 -0000 1.206.2.4
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: main.c,v 1.206.2.3 2004/12/13 16:18:13 hyperion Exp $
+/* $Id: main.c,v 1.206.2.4 2004/12/30 04:36:57 hyperion Exp $
*
* PROJECT: ReactOS kernel
* FILE: ntoskrnl/ke/main.c
@@ -73,8 +73,8 @@
#endif /* __GNUC__ */
static LOADER_MODULE KeLoaderModules[64];
-static UCHAR KeLoaderModuleStrings[64][256];
-static UCHAR KeLoaderCommandLine[256];
+static CHAR KeLoaderModuleStrings[64][256];
+static CHAR KeLoaderCommandLine[256];
static ADDRESS_RANGE KeMemoryMap[64];
static ULONG KeMemoryMapRangeCount;
static ULONG FirstKrnlPhysAddr;
@@ -696,8 +696,8 @@
IoCreateArcNames();
/* Create the SystemRoot symbolic link */
- CPRINT("CommandLine: %s\n", (PUCHAR)KeLoaderBlock.CommandLine);
- Status = IoCreateSystemRootLink((PUCHAR)KeLoaderBlock.CommandLine);
+ CPRINT("CommandLine: %s\n", (PCHAR)KeLoaderBlock.CommandLine);
+ Status = IoCreateSystemRootLink((PCHAR)KeLoaderBlock.CommandLine);
if (!NT_SUCCESS(Status))
{
DbgPrint ( "IoCreateSystemRootLink FAILED: (0x%x) - ", Status );
@@ -745,7 +745,7 @@
* Initialize shared user page:
* - set dos system path, dos device map, etc.
*/
- InitSystemSharedUserPage ((PUCHAR)KeLoaderBlock.CommandLine);
+ InitSystemSharedUserPage ((PCHAR)KeLoaderBlock.CommandLine);
/* Create 'ReactOSInitDone' event */
RtlInitUnicodeString(&Name, L"\\ReactOSInitDone");
@@ -917,10 +917,10 @@
if (((PUCHAR)_LoaderBlock->CommandLine)[1] == 'h' &&
((PUCHAR)_LoaderBlock->CommandLine)[2] == 'd')
{
- DiskNumber = ((PUCHAR)_LoaderBlock->CommandLine)[3] - '0';
- PartNumber = ((PUCHAR)_LoaderBlock->CommandLine)[5] - '0';
+ DiskNumber = ((PCHAR)_LoaderBlock->CommandLine)[3] - '0';
+ PartNumber = ((PCHAR)_LoaderBlock->CommandLine)[5] - '0';
}
- strcpy(Temp, &((PUCHAR)_LoaderBlock->CommandLine)[7]);
+ strcpy(Temp, &((PCHAR)_LoaderBlock->CommandLine)[7]);
if ((options = strchr(Temp, ' ')) != NULL)
{
*options = 0;
@@ -955,7 +955,7 @@
}
else
{
- strcpy(KeLoaderCommandLine, (PUCHAR)_LoaderBlock->CommandLine);
+ strcpy(KeLoaderCommandLine, (PCHAR)_LoaderBlock->CommandLine);
}
KeLoaderBlock.CommandLine = (ULONG)KeLoaderCommandLine;
@@ -976,13 +976,13 @@
for (i = 1; i < KeLoaderBlock.ModsCount; i++)
{
CHAR* s;
- if ((s = strrchr((PUCHAR)KeLoaderModules[i].String, '/')) != 0)
+ if ((s = strrchr((PCHAR)KeLoaderModules[i].String, '/')) != 0)
{
strcpy(KeLoaderModuleStrings[i], s + 1);
}
else
{
- strcpy(KeLoaderModuleStrings[i], (PUCHAR)KeLoaderModules[i].String);
+ strcpy(KeLoaderModuleStrings[i], (PCHAR)KeLoaderModules[i].String);
}
/* TODO: Fix this hardcoded load address stuff... */
KeLoaderModules[i].ModStart -= 0x200000;
reactos/ntoskrnl/ke
diff -u -r1.31.2.3 -r1.31.2.4
--- process.c 13 Dec 2004 16:18:13 -0000 1.31.2.3
+++ process.c 30 Dec 2004 04:36:57 -0000 1.31.2.4
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: process.c,v 1.31.2.3 2004/12/13 16:18:13 hyperion Exp $
+/* $Id: process.c,v 1.31.2.4 2004/12/30 04:36:57 hyperion Exp $
*
* PROJECT: ReactOS kernel
* FILE: ntoskrnl/ke/process.c
reactos/ntoskrnl/ke
diff -u -r1.24 -r1.24.2.1
--- spinlock.c 22 Oct 2004 20:30:48 -0000 1.24
+++ spinlock.c 30 Dec 2004 04:36:57 -0000 1.24.2.1
@@ -1,4 +1,4 @@
-/* $Id: spinlock.c,v 1.24 2004/10/22 20:30:48 ekohl Exp $
+/* $Id: spinlock.c,v 1.24.2.1 2004/12/30 04:36:57 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -183,7 +183,7 @@
KEBUGCHECK(0);
}
- while ((i = InterlockedExchange((LONG *)SpinLock, 1)) == 1)
+ while ((i = InterlockedExchangeUL(SpinLock, 1)) == 1)
{
#ifndef MP
DbgPrint("Spinning on spinlock %x current value %x\n", SpinLock, i);
@@ -218,7 +218,7 @@
DbgPrint("Releasing unacquired spinlock %x\n", SpinLock);
KEBUGCHECK(0);
}
- (void)InterlockedExchange((LONG *)SpinLock, 0);
+ (void)InterlockedExchangeUL(SpinLock, 0);
}
/* EOF */
reactos/ntoskrnl/ke
diff -u -r1.90.2.3 -r1.90.2.4
--- timer.c 13 Dec 2004 16:18:13 -0000 1.90.2.3
+++ timer.c 30 Dec 2004 04:36:57 -0000 1.90.2.4
@@ -1,4 +1,4 @@
-/* $Id: timer.c,v 1.90.2.3 2004/12/13 16:18:13 hyperion Exp $
+/* $Id: timer.c,v 1.90.2.4 2004/12/30 04:36:57 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -712,8 +712,8 @@
if (TrapFrame->Cs & 0x1 ||
TrapFrame->Eflags & X86_EFLAGS_VM)
{
- InterlockedIncrement((PLONG)&CurrentThread->UserTime);
- InterlockedIncrement((PLONG)&CurrentProcess->UserTime);
+ InterlockedIncrementUL(&CurrentThread->UserTime);
+ InterlockedIncrementUL(&CurrentProcess->UserTime);
Pcr->PrcbData.UserTime++;
}
else
@@ -728,8 +728,8 @@
}
else
{
- InterlockedIncrement((PLONG)&CurrentThread->KernelTime);
- InterlockedIncrement((PLONG)&CurrentProcess->KernelTime);
+ InterlockedIncrementUL(&CurrentThread->KernelTime);
+ InterlockedIncrementUL(&CurrentProcess->KernelTime);
Pcr->PrcbData.KernelTime++;
}
}
reactos/ntoskrnl/ke
diff -u -r1.62.2.1 -r1.62.2.2
--- wait.c 13 Dec 2004 09:39:11 -0000 1.62.2.1
+++ wait.c 30 Dec 2004 04:36:57 -0000 1.62.2.2
@@ -29,7 +29,7 @@
#define KeDispatcherObjectWakeAll(hdr) KeDispatcherObjectWakeOneOrAll(hdr, TRUE)
extern POBJECT_TYPE EXPORTED ExMutantObjectType;
-extern POBJECT_TYPE EXPORTED ExSemaphoreType;
+extern POBJECT_TYPE EXPORTED ExSemaphoreObjectType;
extern POBJECT_TYPE EXPORTED ExTimerType;
/* FUNCTIONS *****************************************************************/
@@ -453,7 +453,7 @@
if (Header->ObjectType == ExEventObjectType ||
Header->ObjectType == ExIoCompletionType ||
Header->ObjectType == ExMutantObjectType ||
- Header->ObjectType == ExSemaphoreType ||
+ Header->ObjectType == ExSemaphoreObjectType ||
Header->ObjectType == ExTimerType ||
Header->ObjectType == PsProcessType ||
Header->ObjectType == PsThreadType ||
reactos/ntoskrnl/ke/i386
diff -u -r1.94.2.2 -r1.94.2.3
--- exp.c 13 Dec 2004 09:39:11 -0000 1.94.2.2
+++ exp.c 30 Dec 2004 04:36:57 -0000 1.94.2.3
@@ -30,6 +30,7 @@
/* INCLUDES *****************************************************************/
#include <ntoskrnl.h>
+#include <pseh.h>
#define NDEBUG
#include <internal/debug.h>
@@ -629,16 +630,46 @@
VOID
KeDumpStackFrames(PULONG Frame)
{
+ PULONG StackBase, StackEnd;
+ MEMORY_BASIC_INFORMATION mbi;
+ ULONG ResultLength = sizeof(mbi);
+ NTSTATUS Status;
+
DbgPrint("Frames: ");
- while ( MmIsAddressValid(Frame) )
+ _SEH_TRY
{
- if (!KeRosPrintAddress((PVOID)Frame[1]))
+ Status = MiQueryVirtualMemory (
+ (HANDLE)-1,
+ Frame,
+ MemoryBasicInformation,
+ &mbi,
+ sizeof(mbi),
+ &ResultLength );
+ if ( !NT_SUCCESS(Status) )
+ {
+ DPRINT1("Can't dump stack frames: NtQueryVirtualMemory() failed: %x\n", Status );
+ return;
+ }
+
+ StackBase = Frame;
+ StackEnd = mbi.BaseAddress + mbi.RegionSize;
+
+ while ( Frame >= StackBase && Frame < StackEnd )
{
- DbgPrint("<%X>", (PVOID)Frame[1]);
+ ULONG Addr = Frame[1];
+ if (!KeRosPrintAddress((PVOID)Addr))
+ DbgPrint("<%X>", Addr);
+ if ( Addr == 0 || Addr == 0xDEADBEEF )
+ break;
+ StackBase = Frame;
+ Frame = (PULONG)Frame[0];
+ DbgPrint(" ");
}
- Frame = (PULONG)Frame[0];
- DbgPrint(" ");
}
+ _SEH_HANDLE
+ {
+ }
+ _SEH_END;
DbgPrint("\n");
}
@@ -646,34 +677,108 @@
KeRosDumpStackFrames ( PULONG Frame, ULONG FrameCount )
{
ULONG i=0;
+ PULONG StackBase, StackEnd;
+ MEMORY_BASIC_INFORMATION mbi;
+ ULONG ResultLength = sizeof(mbi);
+ NTSTATUS Status;
DbgPrint("Frames: ");
- if ( !Frame )
+ _SEH_TRY
{
+ if ( !Frame )
+ {
#if defined __GNUC__
- __asm__("mov %%ebp, %%ebx" : "=b" (Frame) : );
+ __asm__("mov %%ebp, %%ebx" : "=b" (Frame) : );
#elif defined(_MSC_VER)
- __asm mov [Frame], ebp
+ __asm mov [Frame], ebp
#endif
- Frame = (PULONG)Frame[0]; // step out of KeRosDumpStackFrames
+ //Frame = (PULONG)Frame[0]; // step out of KeRosDumpStackFrames
+ }
+
+ Status = MiQueryVirtualMemory (
+ (HANDLE)-1,
+ Frame,
+ MemoryBasicInformation,
+ &mbi,
+ sizeof(mbi),
+ &ResultLength );
+ if ( !NT_SUCCESS(Status) )
+ {
+ DPRINT1("Can't dump stack frames: NtQueryVirtualMemory() failed: %x\n", Status );
+ return;
+ }
+
+ StackBase = Frame;
+ StackEnd = mbi.BaseAddress + mbi.RegionSize;
+
+ while ( Frame >= StackBase && Frame < StackEnd && i++ < FrameCount )
+ {
+ ULONG Addr = Frame[1];
+ if (!KeRosPrintAddress((PVOID)Addr))
+ DbgPrint("<%X>", Addr);
+ if ( Addr == 0 || Addr == 0xDEADBEEF )
+ break;
+ StackBase = Frame;
+ Frame = (PULONG)Frame[0];
+ DbgPrint(" ");
+ }
}
- while ( MmIsAddressValid(Frame) && i++ < FrameCount )
+ _SEH_HANDLE
{
- if (!KeRosPrintAddress((PVOID)Frame[1]))
+ }
+ _SEH_END;
+ DbgPrint("\n");
+}
+
+ULONG STDCALL
+KeRosGetStackFrames ( PULONG Frames, ULONG FrameCount )
+{
+ ULONG Count = 0;
+ PULONG StackBase, StackEnd, Frame;
+ MEMORY_BASIC_INFORMATION mbi;
+ ULONG ResultLength = sizeof(mbi);
+ NTSTATUS Status;
+
+ _SEH_TRY
+ {
+#if defined __GNUC__
+ __asm__("mov %%ebp, %%ebx" : "=b" (Frame) : );
+#elif defined(_MSC_VER)
+ __asm mov [Frame], ebp
+#endif
+
+ Status = MiQueryVirtualMemory (
+ (HANDLE)-1,
+ Frame,
+ MemoryBasicInformation,
+ &mbi,
+ sizeof(mbi),
+ &ResultLength );
+ if ( !NT_SUCCESS(Status) )
{
- DbgPrint("<%X>", (PVOID)Frame[1]);
+ DPRINT1("Can't get stack frames: NtQueryVirtualMemory() failed: %x\n", Status );
+ return 0;
}
- if (Frame[1] == 0xdeadbeef)
+
+ StackBase = Frame;
+ StackEnd = mbi.BaseAddress + mbi.RegionSize;
+
+ while ( Count < FrameCount && Frame >= StackBase && Frame < StackEnd )
{
- break;
+ Frames[Count++] = Frame[1];
+ StackBase = Frame;
+ Frame = (PULONG)Frame[0];
}
- Frame = (PULONG)Frame[0];
- DbgPrint(" ");
}
- DbgPrint("\n");
+ _SEH_HANDLE
+ {
+ }
+ _SEH_END;
+ return Count;
}
-static void set_system_call_gate(unsigned int sel, unsigned int func)
+static void
+set_system_call_gate(unsigned int sel, unsigned int func)
{
DPRINT("sel %x %d\n",sel,sel);
KiIdt[sel].a = (((int)func)&0xffff) +
reactos/ntoskrnl/ke/i386
diff -u -r1.17.2.3 -r1.17.2.4
--- fpu.c 13 Dec 2004 16:18:13 -0000 1.17.2.3
+++ fpu.c 30 Dec 2004 04:36:59 -0000 1.17.2.4
@@ -1,4 +1,4 @@
-/* $Id: fpu.c,v 1.17.2.3 2004/12/13 16:18:13 hyperion Exp $
+/* $Id: fpu.c,v 1.17.2.4 2004/12/30 04:36:59 hyperion Exp $
*
* ReactOS kernel
* Copyright (C) 1998, 1999, 2000, 2001 ReactOS Team
reactos/ntoskrnl/ke/i386
diff -u -r1.55.2.3 -r1.55.2.4
--- irq.c 13 Dec 2004 16:18:13 -0000 1.55.2.3
+++ irq.c 30 Dec 2004 04:36:59 -0000 1.55.2.4
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: irq.c,v 1.55.2.3 2004/12/13 16:18:13 hyperion Exp $
+/* $Id: irq.c,v 1.55.2.4 2004/12/30 04:36:59 hyperion Exp $
*
* PROJECT: ReactOS kernel
* FILE: ntoskrnl/ke/i386/irq.c
reactos/ntoskrnl/ke/i386
diff -u -r1.42.2.1 -r1.42.2.2
--- kernel.c 8 Dec 2004 21:57:36 -0000 1.42.2.1
+++ kernel.c 30 Dec 2004 04:36:59 -0000 1.42.2.2
@@ -175,7 +175,7 @@
}
- Offset = InterlockedIncrement(&PcrsAllocated) - 1;
+ Offset = InterlockedIncrementUL(&PcrsAllocated) - 1;
Pcr = (PKPCR)((ULONG_PTR)KPCR_BASE + Offset * PAGE_SIZE);
/*
@@ -296,7 +296,7 @@
* Make the detection of the noexecute feature more portable.
*/
if(KPCR->PrcbData.CpuType == 0xf &&
- 0 == strcmp("AuthenticAMD", KPCR->PrcbData.VendorString))
+ RtlCompareMemory("AuthenticAMD", KPCR->PrcbData.VendorString, 12) == 12)
{
if (NoExecute)
{
reactos/ntoskrnl/ldr
diff -u -r1.49.2.3 -r1.49.2.4
--- init.c 13 Dec 2004 16:18:13 -0000 1.49.2.3
+++ init.c 30 Dec 2004 04:36:59 -0000 1.49.2.4
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: init.c,v 1.49.2.3 2004/12/13 16:18:13 hyperion Exp $
+/* $Id: init.c,v 1.49.2.4 2004/12/30 04:36:59 hyperion Exp $
*
* PROJECT: ReactOS kernel
* FILE: ntoskrnl/ldr/init.c
reactos/ntoskrnl/ldr
diff -u -r1.151 -r1.151.2.1
--- loader.c 13 Nov 2004 13:09:07 -0000 1.151
+++ loader.c 30 Dec 2004 04:36:59 -0000 1.151.2.1
@@ -1,4 +1,4 @@
-/* $Id: loader.c,v 1.151 2004/11/13 13:09:07 weiden Exp $
+/* $Id: loader.c,v 1.151.2.1 2004/12/30 04:36:59 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -1157,7 +1157,7 @@
CPRINT("LdrPEFixupForward: failed to find module %s\n", NameBuffer);
return NULL;
}
- return LdrPEGetExportByName(ModuleObject->Base, p+1, 0xffff);
+ return LdrPEGetExportByName(ModuleObject->Base, (PUCHAR)(p+1), 0xffff);
}
static NTSTATUS
@@ -1377,7 +1377,7 @@
if (Hint < ExportDir->NumberOfNames)
{
ExName = RVA(BaseAddress, ExNames[Hint]);
- if (strcmp(ExName, SymbolName) == 0)
+ if (strcmp(ExName, (PCHAR)SymbolName) == 0)
{
Ordinal = ExOrdinals[Hint];
Function = RVA(BaseAddress, ExFunctions[Ordinal]);
@@ -1412,7 +1412,7 @@
mid = (minn + maxn) / 2;
ExName = RVA(BaseAddress, ExNames[mid]);
- res = strcmp(ExName, SymbolName);
+ res = strcmp(ExName, (PCHAR)SymbolName);
if (res == 0)
{
Ordinal = ExOrdinals[mid];
@@ -1455,7 +1455,7 @@
for (i = 0; i < ExportDir->NumberOfNames; i++)
{
ExName = RVA(BaseAddress, ExNames[i]);
- if (strcmp(ExName,SymbolName) == 0)
+ if (strcmp(ExName, (PCHAR)SymbolName) == 0)
{
Ordinal = ExOrdinals[i];
Function = RVA(BaseAddress, ExFunctions[Ordinal]);
reactos/ntoskrnl/lpc
diff -u -r1.23 -r1.23.2.1
--- reply.c 31 Oct 2004 20:27:08 -0000 1.23
+++ reply.c 30 Dec 2004 04:37:00 -0000 1.23.2.1
@@ -1,4 +1,4 @@
-/* $Id: reply.c,v 1.23 2004/10/31 20:27:08 ea Exp $
+/* $Id: reply.c,v 1.23.2.1 2004/12/30 04:37:00 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -56,7 +56,7 @@
MessageReply->Message.ClientId.UniqueProcess = PsGetCurrentProcessId();
MessageReply->Message.ClientId.UniqueThread = PsGetCurrentThreadId();
MessageReply->Message.MessageType = MessageType;
- MessageReply->Message.MessageId = InterlockedIncrement((LONG *)&LpcpNextMessageId);
+ MessageReply->Message.MessageId = InterlockedIncrementUL(&LpcpNextMessageId);
KeAcquireSpinLock(&Port->Lock, &oldIrql);
EiEnqueueMessagePort(Port, MessageReply);
reactos/ntoskrnl/mm
diff -N RPoolMgr.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ RPoolMgr.h 30 Dec 2004 04:37:01 -0000 1.4.2.1
@@ -0,0 +1,1013 @@
+/* $Id: RPoolMgr.h,v 1.4.2.1 2004/12/30 04:37:01 hyperion Exp $
+ *
+ * COPYRIGHT: See COPYING in the top level directory
+ * PROJECT: ReactOS kernel
+ * FILE: ntoskrnl/mm/RPoolMgr.h
+ * PURPOSE: A semi-generic reuseable Pool implementation
+ * PROGRAMMER: Royce Mitchell III
+ * UPDATE HISTORY:
+ */
+
+#ifndef RPOOLMGR_H
+#define RPOOLMGR_H
+
+typedef unsigned long rulong;
+
+#define R_IS_POOL_PTR(pool,ptr) (void*)(ptr) >= pool->UserBase && (char*)(ptr) < ((char*)pool->UserBase+pool->UserSize)
+#define R_ASSERT_PTR(pool,ptr) ASSERT( R_IS_POOL_PTR(pool,ptr) )
+#define R_ASSERT_SIZE(pool,sz) ASSERT( sz > (sizeof(R_USED)+2*R_RZ) && sz >= sizeof(R_FREE) && sz < pool->UserSize )
+
+#ifndef R_ROUND_UP
+#define R_ROUND_UP(x,s) ((PVOID)(((rulong)(x)+(s)-1) & ~((s)-1)))
+#endif//R_ROUND_UP
+
+#ifndef R_ROUND_DOWN
+#define R_ROUND_DOWN(x,s) ((PVOID)(((rulong)(x)) & ~((s)-1)))
+#endif//R_ROUND_DOWN
+
+#ifndef R_QUEMIN
+// R_QUEMIN is the minimum number of entries to keep in a que
+#define R_QUEMIN 0
+#endif//R_QUEMIN
+
+#ifndef R_QUECOUNT
+// 16, 32, 64, 128, 256, 512
+#define R_QUECOUNT 6
+#endif//R_QUECOUNT
+
+#ifndef R_RZ
+// R_RZ is the redzone size
+#define R_RZ 4
+#endif//R_RZ
+
+#ifndef R_RZ_LOVALUE
+#define R_RZ_LOVALUE 0x87
+#endif//R_RZ_LOVALUE
+
+#ifndef R_RZ_HIVALUE
+#define R_RZ_HIVALUE 0xA5
+#endif//R_RZ_HIVALUE
+
+#ifndef R_STACK
+// R_STACK is the number of stack entries to store in blocks for debug purposes
+#define R_STACK 3
+#endif//R_STACK
+
+#ifndef R_TAG
+// R_TAG do we keep track of tags on a per-memory block basis?
+#define R_TAG 0
+#endif//R_TAG
+
+#ifdef R_MAGIC
+# ifndef R_FREE_MAGIC
+# define R_FREE_MAGIC (rulong)(('F'<<0) + ('r'<<8) + ('E'<<16) + ('e'<<24))
+# endif//R_FREE_MAGIC
+# ifndef R_USED_MAGIC
+# define R_USED_MAGIC (rulong)(('u'<<0) + ('S'<<8) + ('e'<<16) + ('D'<<24))
+# endif//R_USED_MAGIC
+#endif//R_MAGIC
+
+// **IMPORTANT NOTE** Magic, PrevSize, Size and Status must be at same offset
+// in both the R_FREE and R_USED structures
+
+typedef struct _R_FREE
+{
+#ifdef R_MAGIC
+ rulong FreeMagic;
+#endif//R_MAGIC
+ rulong PrevSize : 30;
+ rulong Status : 2;
+ rulong Size;
+#if R_STACK
+ rulong LastOwnerStack[R_STACK];
+#endif//R_STACK
+ struct _R_FREE* NextFree;
+ struct _R_FREE* PrevFree;
+}
+R_FREE, *PR_FREE;
+
+typedef struct _R_USED
+{
+#ifdef R_MAGIC
+ rulong UsedMagic;
+#endif//R_MAGIC
+ rulong PrevSize : 30;
+ rulong Status : 2;
+ rulong Size;
+#if R_STACK
+ rulong LastOwnerStack[R_STACK];
+#endif//R_STACK
+ struct _R_USED* NextUsed;
+#if R_RZ
+ rulong UserSize; // how many bytes the user actually asked for...
+#endif//R_RZ
+ rulong Tag;
+}
+R_USED, *PR_USED;
+
+typedef struct _R_QUE
+{
+ rulong Count;
+ PR_USED First, Last;
+}
+R_QUE, *PR_QUE;
+
+typedef struct _R_POOL
+{
+ void* PoolBase;
+ rulong PoolSize;
+ void* UserBase;
+ rulong UserSize;
+ rulong Alignments[3];
+ PR_FREE FirstFree, LastFree;
+ R_QUE Que[R_QUECOUNT][3];
+ R_MUTEX Mutex;
+}
+R_POOL, *PR_POOL;
+
+#if !R_STACK
+#define RiPrintLastOwner(Block)
+#else
+static void
+RiPrintLastOwner ( PR_USED Block )
+{
+ int i;
+ for ( i = 0; i < R_STACK; i++ )
+ {
+ if ( Block->LastOwnerStack[i] != 0xDEADBEEF )
+ {
+ R_DEBUG(" ");
+ if (!R_PRINT_ADDRESS ((PVOID)Block->LastOwnerStack[i]) )
+ {
+ R_DEBUG("<%X>", Block->LastOwnerStack[i] );
+ }
+ }
+ }
+}
+#endif//R_STACK
+
+static int
+RQueWhich ( rulong size )
+{
+ rulong que, quesize;
+ for ( que=0, quesize=16; que < R_QUECOUNT; que++, quesize<<=1 )
+ {
+ if ( quesize >= size )
+ {
+ return que;
+ }
+ }
+ return -1;
+}
+
+static void
+RQueInit ( PR_QUE que )
+{
+ que->Count = 0;
+ que->First = NULL;
+ que->Last = NULL;
+}
+
+static void
+RQueAdd ( PR_QUE que, PR_USED Item )
+{
+ ASSERT(Item);
+ Item->Status = 2;
+ Item->NextUsed = NULL;
+ ++que->Count;
+ if ( !que->Last )
+ {
+ que->First = que->Last = Item;
+ return;
+ }
+ ASSERT(!que->Last->NextUsed);
+ que->Last->NextUsed = Item;
+ que->Last = Item;
+}
+
+static PR_USED
+RQueRemove ( PR_QUE que )
+{
+ PR_USED Item;
+#if R_QUEMIN
+ if ( que->count < R_QUEMIN )
+ return NULL;
+#endif
+ if ( !que->First )
+ return NULL;
+ Item = que->First;
+ que->First = Item->NextUsed;
+ if ( !--que->Count )
+ {
+ ASSERT ( !que->First );
+ que->Last = NULL;
+ }
+ Item->Status = 0;
+ return Item;
+}
+
+static void
+RPoolAddFree ( PR_POOL pool, PR_FREE Item )
+{
+ ASSERT(pool);
+ ASSERT(Item);
+ if ( !pool->FirstFree )
+ {
+ pool->FirstFree = pool->LastFree = Item;
+ Item->NextFree = NULL;
+ }
+ else
+ {
+ pool->FirstFree->PrevFree = Item;
+ Item->NextFree = pool->FirstFree;
+ pool->FirstFree = Item;
+ }
+ Item->PrevFree = NULL;
+}
+
+static void
+RPoolRemoveFree ( PR_POOL pool, PR_FREE Item )
+{
+ ASSERT(pool);
+ ASSERT(Item);
+ if ( Item->NextFree )
+ Item->NextFree->PrevFree = Item->PrevFree;
+ else
+ {
+ ASSERT ( pool->LastFree == Item );
+ pool->LastFree = Item->PrevFree;
+ }
+ if ( Item->PrevFree )
+ Item->PrevFree->NextFree = Item->NextFree;
+ else
+ {
+ ASSERT ( pool->FirstFree == Item );
+ pool->FirstFree = Item->NextFree;
+ }
+#if defined(DBG) || defined(KDBG)
+ Item->NextFree = Item->PrevFree = (PR_FREE)0xDEADBEEF;
+#endif//DBG || KDBG
+}
+
+static void
+RFreeFillStack ( PR_FREE free )
+{
+ int i;
+ ULONG stack[R_EXTRA_STACK_UP+3]; // need to skip 3 known levels of stack trace
+ memset ( stack, 0xCD, sizeof(stack) );
+ R_GET_STACK_FRAMES ( stack, R_EXTRA_STACK_UP+3 );
+ for ( i = 0; i < R_EXTRA_STACK_UP; i++ )
+ free->LastOwnerStack[i] = stack[i+3];
+}
+
+static void
+RUsedFillStack ( PR_USED used )
+{
+ int i;
+ ULONG stack[R_EXTRA_STACK_UP+2]; // need to skip 2 known levels of stack trace
+ memset ( stack, 0xCD, sizeof(stack) );
+ R_GET_STACK_FRAMES ( stack, R_EXTRA_STACK_UP+2 );
+ for ( i = 0; i < R_EXTRA_STACK_UP; i++ )
+ used->LastOwnerStack[i] = stack[i+2];
+}
+
+static PR_FREE
+RFreeInit ( void* memory )
+{
+ PR_FREE block = (PR_FREE)memory;
+#if R_FREEMAGIC
+ block->FreeMagic = R_FREE_MAGIC;
+#endif//R_FREEMAGIC
+ block->Status = 0;
+ RFreeFillStack ( block );
+#if defined(DBG) || defined(KDBG)
+ block->PrevFree = block->NextFree = (PR_FREE)0xDEADBEEF;
+#endif//DBG || KDBG
+ return block;
+}
+
+PR_POOL
+RPoolInit ( void* PoolBase, rulong PoolSize, int align1, int align2, int align3 )
+{
+ int align, que;
+ PR_POOL pool = (PR_POOL)PoolBase;
+
+ pool->PoolBase = PoolBase;
+ pool->PoolSize = PoolSize;
+ pool->UserBase = (char*)pool->PoolBase + sizeof(R_POOL);
+ pool->UserSize = PoolSize - sizeof(R_POOL);
+ pool->Alignments[0] = align1;
+ pool->Alignments[1] = align2;
+ pool->Alignments[2] = align3;
+ pool->FirstFree = pool->LastFree = NULL;
+
+ RPoolAddFree ( pool,
+ RFreeInit ( pool->UserBase ));
+
+ pool->FirstFree->PrevSize = 0;
+ pool->FirstFree->Size = pool->UserSize;
+
+ for ( que = 0; que < R_QUECOUNT; que++ )
+ {
+ for ( align = 0; align < 3; align++ )
+ {
+ RQueInit ( &pool->Que[que][align] );
+ }
+ }
+ return pool;
+}
+
+static const char*
+RFormatTag ( rulong Tag, char* buf )
+{
+ int i;
+ *(rulong*)&buf[0] = Tag;
+ buf[4] = 0;
+ for ( i = 0; i < 4; i++ )
+ {
+ if ( !buf[i] )
+ buf[i] = ' ';
+ }
+ return buf;
+}
+
+#if !R_RZ
+#define RUsedRedZoneCheck(pUsed,Addr,file,line)
+#else//R_RZ
+static void
+RiBadBlock ( PR_USED pUsed, char* Addr, const char* violation, const char* file, int line, int printzone )
+{
+ char tag[5];
+ int i;
+
+ R_DEBUG("%s(%i): %s detected for paged pool address 0x%x\n",
+ file, line, violation, Addr );
+
+#ifdef R_MAGIC
+ R_DEBUG ( "UsedMagic 0x%x, ", pUsed->UsedMagic );
+#endif//R_MAGIC
+ R_DEBUG ( "Tag %s(%X), Size %i, UserSize %i",
+ RFormatTag(pUsed->Tag,tag),
+ pUsed->Tag,
+ pUsed->Size,
+ pUsed->UserSize );
+
+ if ( printzone )
+ {
+ unsigned char* HiZone = (unsigned char*)Addr + pUsed->UserSize;
+ unsigned char* LoZone = (unsigned char*)Addr - R_RZ; // this is to simplify indexing below...
+ R_DEBUG ( ", LoZone " );
+ for ( i = 0; i < R_RZ; i++ )
+ R_DEBUG ( "%02x", LoZone[i] );
+ R_DEBUG ( ", HiZone " );
+ for ( i = 0; i < R_RZ; i++ )
+ R_DEBUG ( "%02x", HiZone[i] );
+ }
+ R_DEBUG ( "\n" );
+
+ R_DEBUG ( "First few Stack Frames:" );
+ RiPrintLastOwner ( pUsed );
+ R_DEBUG ( "\n" );
+
+ R_PANIC();
+}
+static void
+RUsedRedZoneCheck ( PR_POOL pool, PR_USED pUsed, char* Addr, const char* file, int line )
+{
+ int i;
+ unsigned char *LoZone, *HiZone;
+ int bLow = 1;
+ int bHigh = 1;
+
+ ASSERT ( Addr >= (char*)pool->UserBase && Addr < ((char*)pool->UserBase + pool->UserSize - 16) );
+#ifdef R_MAGIC
+ if ( pUsed->UsedMagic == MM_PPOOL_FREEMAGIC )
+ {
+ pUsed->UserSize = 0; // just to keep from confusion, MmpBadBlock() doesn't return...
+ RiBadBlock ( pUsed, Addr, "double-free", file, line, 0 );
+ }
+ if ( pUsed->UsedMagic != MM_PPOOL_USEDMAGIC )
+ {
+ RiBadBlock ( pUsed, Addr, "bad magic", file, line, 0 );
+ }
+#endif//R_MAGIC
+ switch ( pUsed->Status )
+ {
+ case 0: // freed into main pool
+ case 2: // in ques
+ RiBadBlock ( pUsed, Addr, "double-free", file, line, 0 );
+ // no need for break here - RiBadBlock doesn't return
+ case 1: // allocated - this is okay
+ break;
+ default:
+ RiBadBlock ( pUsed, Addr, "corrupt status", file, line, 0 );
+ }
+ if ( pUsed->Status != 1 )
+ {
+ RiBadBlock ( pUsed, Addr, "double-free", file, line, 0 );
+ }
+ if ( pUsed->Size > pool->PoolSize || pUsed->Size == 0 )
+ {
+ RiBadBlock ( pUsed, Addr, "invalid size", file, line, 0 );
+ }
+ if ( pUsed->UserSize > pool->PoolSize || pUsed->UserSize == 0 )
+ {
+ RiBadBlock ( pUsed, Addr, "invalid user size", file, line, 0 );
+ }
+ HiZone = (unsigned char*)Addr + pUsed->UserSize;
+ LoZone = (unsigned char*)Addr - R_RZ; // this is to simplify indexing below...
+ for ( i = 0; i < R_RZ && bLow && bHigh; i++ )
+ {
+ bLow = bLow && ( LoZone[i] == R_RZ_LOVALUE );
+ bHigh = bHigh && ( HiZone[i] == R_RZ_HIVALUE );
+ }
+ if ( !bLow || !bHigh )
+ {
+ const char* violation = "High and Low-side redzone";
+ if ( bHigh ) // high is okay, so it was just low failed
+ violation = "Low-side redzone";
+ else if ( bLow ) // low side is okay, so it was just high failed
+ violation = "High-side redzone";
+ RiBadBlock ( pUsed, Addr, violation, file, line, 1 );
+ }
+}
+#endif//R_RZ
+
+PR_FREE
+RPreviousBlock ( PR_FREE Block )
+{
+ if ( Block->PrevSize > 0 )
+ return (PR_FREE)( (char*)Block - Block->PrevSize );
+ return NULL;
+}
+
+PR_FREE
+RNextBlock ( PR_POOL pool, PR_FREE Block )
+{
+ PR_FREE NextBlock = (PR_FREE)( (char*)Block + Block->Size );
+ if ( (char*)NextBlock >= (char*)pool->UserBase + pool->UserSize )
+ NextBlock = NULL;
+ return NextBlock;
+}
+
+inline static void*
+RHdrToBody ( void* blk )
+/*
+ * FUNCTION: Translate a block header address to the corresponding block
+ * address (internal)
+ */
+{
+ return ( (void *) ((char*)blk + sizeof(R_USED) + R_RZ) );
+}
+
+inline static PR_USED
+RBodyToHdr ( void* addr )
+{
+ return (PR_USED)
+ ( ((char*)addr) - sizeof(R_USED) - R_RZ );
+}
+
+static int
+RiInFreeChain ( PR_POOL pool, PR_FREE Block )
+{
+ PR_FREE Free;
+ Free = pool->FirstFree;
+ if ( Free == Block )
+ return 1;
+ while ( Free != Block )
+ {
+ Free = Free->NextFree;
+ if ( !Free )
+ return 0;
+ }
+ return 1;
+}
+
+static void
+RPoolRedZoneCheck ( PR_POOL pool, const char* file, int line )
+{
+ {
+ PR_USED Block = (PR_USED)pool->UserBase;
+ PR_USED NextBlock;
+
+ for ( ;; )
+ {
+ switch ( Block->Status )
+ {
+ case 0: // block is in chain
+ ASSERT ( RiInFreeChain ( pool, (PR_FREE)Block ) );
+ break;
+ case 1: // block is allocated
+ RUsedRedZoneCheck ( pool, Block, RHdrToBody(Block), file, line );
+ break;
+ case 2: // block is in que
+ // nothing to verify here yet
+ break;
+ default:
+ ASSERT ( !"invalid status in memory block found in pool!" );
+ }
+ NextBlock = (PR_USED)RNextBlock(pool,(PR_FREE)Block);
+ if ( !NextBlock )
+ break;
+ ASSERT ( NextBlock->PrevSize == Block->Size );
+ Block = NextBlock;
+ }
+ }
+ {
+ // now let's step through the list of free pointers and verify
+ // each one can be found by size-jumping...
+ PR_FREE Free = (PR_FREE)pool->FirstFree;
+ while ( Free )
+ {
+ PR_FREE NextFree = (PR_FREE)pool->UserBase;
+ if ( Free != NextFree )
+ {
+ while ( NextFree != Free )
+ {
+ NextFree = RNextBlock ( pool, NextFree );
+ ASSERT(NextFree);
+ }
+ }
+ Free = Free->NextFree;
+ }
+ }
+}
+
+static void
+RSetSize ( PR_POOL pool, PR_FREE Block, rulong NewSize, PR_FREE NextBlock )
+{
+ R_ASSERT_PTR(pool,Block);
+ ASSERT ( NewSize < pool->UserSize );
+ ASSERT ( NewSize >= sizeof(R_FREE) );
+ Block->Size = NewSize;
+ if ( !NextBlock )
+ NextBlock = RNextBlock ( pool, Block );
+ if ( NextBlock )
+ NextBlock->PrevSize = NewSize;
+}
+
+static PR_FREE
+RFreeSplit ( PR_POOL pool, PR_FREE Block, rulong NewSize )
+{
+ PR_FREE NewBlock = (PR_FREE)((char*)Block + NewSize);
+ RSetSize ( pool, NewBlock, Block->Size - NewSize, NULL );
+ RSetSize ( pool, Block, NewSize, NewBlock );
+ RFreeInit ( NewBlock );
+ RPoolAddFree ( pool, NewBlock );
+ return NewBlock;
+}
+
+static void
+RFreeMerge ( PR_POOL pool, PR_FREE First, PR_FREE Second )
+{
+ ASSERT ( RPreviousBlock(Second) == First );
+ ASSERT ( First->Size == Second->PrevSize );
+ RPoolRemoveFree ( pool, Second );
+ RSetSize ( pool, First, First->Size + Second->Size, NULL );
+}
+
+static void
+RPoolReclaim ( PR_POOL pool, PR_FREE FreeBlock )
+{
+ PR_FREE NextBlock, PreviousBlock;
+
+ RFreeInit ( FreeBlock );
+ RPoolAddFree ( pool, FreeBlock );
+
+ // TODO FIXME - don't merge and always insert freed blocks at the end for debugging purposes...
+
+ /*
+ * If the next block is immediately adjacent to the newly freed one then
+ * merge them.
+ * PLEASE DO NOT WIPE OUT 'MAGIC' OR 'LASTOWNER' DATA FOR MERGED FREE BLOCKS
+ */
+ NextBlock = RNextBlock ( pool, FreeBlock );
+ if ( NextBlock != NULL && !NextBlock->Status )
+ {
+ RFreeMerge ( pool, FreeBlock, NextBlock );
+ }
+
+ /*
+ * If the previous block is adjacent to the newly freed one then
+ * merge them.
+ * PLEASE DO NOT WIPE OUT 'MAGIC' OR 'LASTOWNER' DATA FOR MERGED FREE BLOCKS
+ */
+ PreviousBlock = RPreviousBlock ( FreeBlock );
+ if ( PreviousBlock != NULL && !PreviousBlock->Status )
+ {
+ RFreeMerge ( pool, PreviousBlock, FreeBlock );
+ }
+}
+
+static void
+RiUsedInit ( PR_USED Block, rulong Tag )
+{
+ Block->Status = 1;
+ RUsedFillStack ( Block );
+#if R_MAGIC
+ Block->UsedMagic = R_USED_MAGIC;
+#endif//R_MAGIC
+ //ASSERT_SIZE ( Block->Size );
+
+ // now add the block to the used block list
+#if defined(DBG) || defined(KDBG)
+ Block->NextUsed = (PR_USED)0xDEADBEEF;
+#endif//R_USED_LIST
+
+ Block->Tag = Tag;
+}
+
+#if !R_RZ
+#define RiUsedInitRedZone(Block,UserSize)
+#else//R_RZ
+static void
+RiUsedInitRedZone ( PR_USED Block, rulong UserSize )
+{
+ // write out buffer-overrun detection bytes
+ char* Addr = (char*)RHdrToBody(Block);
+ Block->UserSize = UserSize;
+ memset ( Addr - R_RZ, R_RZ_LOVALUE, R_RZ );
+ memset ( Addr + Block->UserSize, R_RZ_HIVALUE, R_RZ );
+#if defined(DBG) || defined(KDBG)
+ memset ( Addr, 0xCD, UserSize );
+#endif//DBG || KDBG
+}
+#endif//R_RZ
+
+static void*
+RPoolAlloc ( PR_POOL pool, rulong NumberOfBytes, rulong Tag, rulong align )
+{
+ PR_USED NewBlock;
+ PR_FREE BestBlock,
+ NextBlock,
+ PreviousBlock,
+ BestPreviousBlock,
+ CurrentBlock;
+ void* BestAlignedAddr;
+ int que,
+ queBytes = NumberOfBytes;
+ rulong BlockSize,
+ Alignment;
+ int que_reclaimed = 0;
+
+ ASSERT ( pool );
+ ASSERT ( align < 3 );
+
+ R_ACQUIRE_MUTEX(pool);
+
+ if ( !NumberOfBytes )
+ {
+ R_DEBUG("0 bytes requested - initiating pool verification\n");
+ RPoolRedZoneCheck ( pool, __FILE__, __LINE__ );
+ R_RELEASE_MUTEX(pool);
+ return NULL;
+ }
+ if ( NumberOfBytes > pool->PoolSize )
+ {
+ if ( R_IS_POOL_PTR(pool,NumberOfBytes) )
+ {
+ R_DEBUG("red zone verification requested for block 0x%X\n", NumberOfBytes );
+ RUsedRedZoneCheck(pool,RBodyToHdr((void*)NumberOfBytes), (char*)NumberOfBytes, __FILE__, __LINE__ );
+ R_RELEASE_MUTEX(pool);
+ return NULL;
+ }
+ R_DEBUG("Invalid allocation request: %i bytes\n", NumberOfBytes );
+ R_RELEASE_MUTEX(pool);
+ return NULL;
+ }
+
+ que = RQueWhich ( NumberOfBytes );
+ if ( que >= 0 )
+ {
+ if ( (NewBlock = RQueRemove ( &pool->Que[que][align] )) )
+ {
+ R_RELEASE_MUTEX(pool);
+ RiUsedInit ( NewBlock, Tag );
+ RiUsedInitRedZone ( NewBlock, NumberOfBytes );
+ return RHdrToBody(NewBlock);
+ }
+ queBytes = 16 << que;
+ }
+
+ /*
+ * Calculate the total number of bytes we will need.
+ */
+ BlockSize = queBytes + sizeof(R_USED) + 2*R_RZ;
+ if (BlockSize < sizeof(R_FREE))
+ {
+ /* At least we need the size of the free block header. */
+ BlockSize = sizeof(R_FREE);
+ }
+
+try_again:
+ /*
+ * Find the best-fitting block.
+ */
+ BestBlock = NULL;
+ Alignment = pool->Alignments[align];
+ PreviousBlock = NULL;
+ BestPreviousBlock = NULL,
+ CurrentBlock = pool->FirstFree;
+ BestAlignedAddr = NULL;
+
+ while ( CurrentBlock != NULL )
+ {
+ PVOID Addr = RHdrToBody(CurrentBlock);
+ PVOID CurrentBlockEnd = (char*)CurrentBlock + CurrentBlock->Size;
+ /* calculate last size-aligned address available within this block */
+ PVOID AlignedAddr = R_ROUND_DOWN((char*)CurrentBlockEnd-queBytes-R_RZ, Alignment);
+ ASSERT ( (char*)AlignedAddr+queBytes+R_RZ <= (char*)CurrentBlockEnd );
+
+ /* special case, this address is already size-aligned, and the right size */
+ if ( Addr == AlignedAddr )
+ {
+ BestAlignedAddr = AlignedAddr;
+ BestPreviousBlock = PreviousBlock;
+ BestBlock = CurrentBlock;
+ break;
+ }
+ // if we carve out a size-aligned block... is it still past the end of this
+ // block's free header?
+ else if ( (char*)RBodyToHdr(AlignedAddr)
+ >= (char*)CurrentBlock+sizeof(R_FREE) )
+ {
+ /*
+ * there's enough room to allocate our size-aligned memory out
+ * of this block, see if it's a better choice than any previous
+ * finds
+ */
+ if ( BestBlock == NULL
+ || BestBlock->Size > CurrentBlock->Size )
+ {
+ BestAlignedAddr = AlignedAddr;
+ BestPreviousBlock = PreviousBlock;
+ BestBlock = CurrentBlock;
+ }
+ }
+
+ PreviousBlock = CurrentBlock;
+ CurrentBlock = CurrentBlock->NextFree;
+ }
+
+ /*
+ * We didn't find anything suitable at all.
+ */
+ if (BestBlock == NULL)
+ {
+ if ( !que_reclaimed )
+ {
+ // reclaim que
+ int i, j;
+ for ( i = 0; i < R_QUECOUNT; i++ )
+ {
+ for ( j = 0; j < 3; j++ )
+ {
+ while ( (BestBlock = (PR_FREE)RQueRemove ( &pool->Que[i][j] )) )
+ {
+ RPoolReclaim ( pool, BestBlock );
+ }
+ }
+ }
+
+ que_reclaimed = 1;
+ goto try_again;
+ }
+ /*DPRINT1("Trying to allocate %lu bytes from paged pool - nothing suitable found, returning NULL\n",
+ queBytes );*/
+ return NULL;
+ }
+ /*
+ * we found a best block. If Addr isn't already aligned, we've pre-qualified that
+ * there's room at the beginning of the block for a free block...
+ */
+ {
+ void* Addr = RHdrToBody(BestBlock);
+ if ( BestAlignedAddr != Addr )
+ {
+ PR_FREE NewFreeBlock = RFreeSplit (
+ pool,
+ BestBlock,
+ (char*)RBodyToHdr(BestAlignedAddr) - (char*)BestBlock );
+ ASSERT ( BestAlignedAddr > Addr );
+
+ //DPRINT ( "breaking off preceding bytes into their own block...\n" );
+ /*DPRINT ( "NewFreeBlock 0x%x Size %lu (Old Block's new size %lu) NextFree 0x%x\n",
+ NewFreeBlock, NewFreeBlock->Size, BestBlock->Size, BestBlock->NextFree );*/
+
+ /* we want the following code to use our size-aligned block */
+ BestPreviousBlock = BestBlock;
+ BestBlock = NewFreeBlock;
+
+ //VerifyPagedPool();
+ }
+ }
+ /*
+ * Is there enough space to create a second block from the unused portion.
+ */
+ if ( (BestBlock->Size - BlockSize) > sizeof(R_FREE) )
+ {
+ /*DPRINT("BestBlock 0x%x Size 0x%x BlockSize 0x%x NewSize 0x%x\n",
+ BestBlock, BestBlock->Size, BlockSize, NewSize );*/
+
+ /*
+ * Create the new free block.
+ */
+ NextBlock = RFreeSplit ( pool, BestBlock, BlockSize );
+ //ASSERT_SIZE ( NextBlock->Size );
+ }
+ /*
+ * Remove the selected block from the list of free blocks.
+ */
+ //DPRINT ( "Removing selected block from free block list\n" );
+ RPoolRemoveFree ( pool, BestBlock );
+ /*
+ * Create the new used block header.
+ */
+ NewBlock = (PR_USED)BestBlock;
+ RiUsedInit ( NewBlock, Tag );
+
+ R_RELEASE_MUTEX(pool);
+
+ /* RtlZeroMemory(RHdrToBody(NewBlock), NumberOfBytes);*/
+
+ RiUsedInitRedZone ( NewBlock, NumberOfBytes );
+
+ return RHdrToBody(NewBlock);
+}
+
+static void
+RPoolFree ( PR_POOL pool, void* Addr )
+{
+ PR_USED UsedBlock;
+ rulong UsedSize;
+ PR_FREE FreeBlock;
+ rulong UserSize;
+ int que;
+
+ ASSERT(pool);
+ if ( !Addr )
+ {
+ R_DEBUG("Attempt to free NULL ptr, initiating Red Zone Check\n" );
+ R_ACQUIRE_MUTEX(pool);
+ RPoolRedZoneCheck ( pool, __FILE__, __LINE__ );
+ R_RELEASE_MUTEX(pool);
+ return;
+ }
+ R_ASSERT_PTR(pool,Addr);
+
+ UsedBlock = RBodyToHdr(Addr);
+ UsedSize = UsedBlock->Size;
+ FreeBlock = (PR_FREE)UsedBlock;
+#if R_RZ
+ UserSize = UsedBlock->UserSize;
+#else
+ UserSize = UsedSize - sizeof(R_USED) - 2*R_RZ;
+#endif//R_RZ
+
+ RUsedRedZoneCheck ( pool, UsedBlock, Addr, __FILE__, __LINE__ );
+
+#if R_RZ
+ memset ( Addr, 0xCD, UsedBlock->UserSize );
+#endif
+
+ que = RQueWhich ( UserSize );
+ if ( que >= 0 )
+ {
+ int queBytes = 16 << que;
+ ASSERT( queBytes >= UserSize );
+ if ( que >= 0 )
+ {
+ int align = 0;
+ if ( R_ROUND_UP(Addr,pool->Alignments[2]) == Addr )
+ align = 2;
+ else if ( R_ROUND_UP(Addr,pool->Alignments[1]) == Addr )
+ align = 1;
+ R_ACQUIRE_MUTEX(pool);
+ RQueAdd ( &pool->Que[que][align], UsedBlock );
+ R_RELEASE_MUTEX(pool);
+ return;
+ }
+ }
+
+ R_ACQUIRE_MUTEX(pool);
+ RPoolReclaim ( pool, FreeBlock );
+ R_RELEASE_MUTEX(pool);
+}
+
+static void
+RPoolDumpByTag ( PR_POOL pool, rulong Tag )
+{
+ PR_USED Block = (PR_USED)pool->UserBase;
+ PR_USED NextBlock;
+ int count = 0;
+ char tag[5];
+
+ // TODO FIXME - should we validate params or ASSERT_IRQL?
+ R_DEBUG ( "PagedPool Dump by tag '%s'\n", RFormatTag(Tag,tag) );
+ R_DEBUG ( " -BLOCK-- --SIZE--\n" );
+
+ R_ACQUIRE_MUTEX(pool);
+ for ( ;; )
+ {
+ if ( Block->Status == 1 && Block->Tag == Tag )
+ {
+ R_DEBUG ( " %08X %08X\n", Block, Block->Size );
+ ++count;
+ }
+ NextBlock = (PR_USED)RNextBlock(pool,(PR_FREE)Block);
+ if ( !NextBlock )
+ break;
+ ASSERT ( NextBlock->PrevSize == Block->Size );
+ Block = NextBlock;
+ }
+ R_RELEASE_MUTEX(pool);
+
+ R_DEBUG ( "Entries found for tag '%s': %i\n", tag, count );
+}
+
+rulong
+RPoolQueryTag ( void* Addr )
+{
+ PR_USED Block = RBodyToHdr(Addr);
+ // TODO FIXME - should we validate params?
+#if R_MAGIC
+ if ( Block->UsedMagic != R_USED_MAGIC )
+ return 0xDEADBEEF;
+#endif//R_MAGIC
+ if ( Block->Status != 1 )
+ return 0xDEADBEEF;
+ return Block->Tag;
+}
+
+void
+RPoolStats ( PR_POOL pool )
+{
+ int free=0, used=0, qued=0;
+ PR_USED Block = (PR_USED)pool->UserBase;
+
+ R_ACQUIRE_MUTEX(pool);
+ while ( Block )
+ {
+ switch ( Block->Status )
+ {
+ case 0:
+ ++free;
+ break;
+ case 1:
+ ++used;
+ break;
+ case 2:
+ ++qued;
+ break;
+ default:
+ ASSERT ( !"Invalid Status for Block in pool!" );
+ }
+ Block = (PR_USED)RNextBlock(pool,(PR_FREE)Block);
+ }
+ R_RELEASE_MUTEX(pool);
+
+ R_DEBUG ( "Pool Stats: Free=%i, Used=%i, Qued=%i, Total=%i\n", free, used, qued, (free+used+qued) );
+}
+
+#ifdef R_LARGEST_ALLOC_POSSIBLE
+static rulong
+RPoolLargestAllocPossible ( PR_POOL pool, int align )
+{
+ int Alignment = pool->Alignments[align];
+ rulong LargestUserSize = 0;
+ PR_FREE Block = (PR_FREE)pool->UserBase;
+ while ( Block )
+ {
+ if ( Block->Status != 1 )
+ {
+ void* Addr, *AlignedAddr;
+ rulong BlockMaxUserSize;
+ int cue, cueBytes;
+
+ Addr = (char*)Block + sizeof(R_USED) + R_RZ;
+ AlignedAddr = R_ROUND_UP(Addr,Alignment);
+ if ( Addr != AlignedAddr )
+ Addr = R_ROUND_UP((char*)Block + sizeof(R_FREE) + sizeof(R_USED) + R_RZ, Alignment );
+ BlockMaxUserSize = (char*)Block + Block->Size - (char*)Addr - R_RZ;
+ cue = RQueWhich ( BlockMaxUserSize );
+ if ( cue >= 0 )
+ {
+ cueBytes = 16 << cue;
+ if ( cueBytes > BlockMaxUserSize );
[truncated at 1000 lines; 17 more skipped]
reactos/ntoskrnl/mm
diff -u -r1.33 -r1.33.6.1
--- anonmem.c 1 Oct 2004 20:26:04 -0000 1.33
+++ anonmem.c 30 Dec 2004 04:37:00 -0000 1.33.6.1
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: anonmem.c,v 1.33 2004/10/01 20:26:04 gvg Exp $
+/* $Id: anonmem.c,v 1.33.6.1 2004/12/30 04:37:00 hyperion Exp $
*
* PROJECT: ReactOS kernel
* FILE: ntoskrnl/mm/anonmem.c
@@ -814,7 +814,8 @@
{
case MEM_RELEASE:
/* We can only free a memory area in one step. */
- if (MemoryArea->BaseAddress != BaseAddress)
+ if (MemoryArea->BaseAddress != BaseAddress ||
+ MemoryArea->Type != MEMORY_AREA_VIRTUAL_MEMORY)
{
MmUnlockAddressSpace(AddressSpace);
ObDereferenceObject(Process);
reactos/ntoskrnl/mm
diff -u -r1.33 -r1.33.8.1
--- balance.c 15 Aug 2004 16:39:06 -0000 1.33
+++ balance.c 30 Dec 2004 04:37:00 -0000 1.33.8.1
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: balance.c,v 1.33 2004/08/15 16:39:06 chorns Exp $
+/* $Id: balance.c,v 1.33.8.1 2004/12/30 04:37:00 hyperion Exp $
*
* PROJECT: ReactOS kernel
* FILE: ntoskrnl/mm/balance.c
@@ -110,7 +110,7 @@
KeAcquireSpinLock(&AllocationListLock, &oldIrql);
if (MmGetReferenceCountPage(Page) == 1)
{
- InterlockedDecrement((LONG *)&MiMemoryConsumers[Consumer].PagesUsed);
+ InterlockedDecrementUL(&MiMemoryConsumers[Consumer].PagesUsed);
if (IsListEmpty(&AllocationListHead) || MmStats.NrFreePages < MiMinimumAvailablePages)
{
KeReleaseSpinLock(&AllocationListLock, oldIrql);
@@ -196,13 +196,13 @@
/*
* Make sure we don't exceed our individual target.
*/
- OldUsed = InterlockedIncrement((LONG *)&MiMemoryConsumers[Consumer].PagesUsed);
+ OldUsed = InterlockedIncrementUL(&MiMemoryConsumers[Consumer].PagesUsed);
if (OldUsed >= (MiMemoryConsumers[Consumer].PagesTarget - 1) &&
!MiIsBalancerThread())
{
if (!CanWait)
{
- InterlockedDecrement((LONG *)&MiMemoryConsumers[Consumer].PagesUsed);
+ InterlockedDecrementUL(&MiMemoryConsumers[Consumer].PagesUsed);
return(STATUS_NO_MEMORY);
}
MiTrimMemoryConsumer(Consumer);
@@ -236,7 +236,7 @@
if (!CanWait)
{
- InterlockedDecrement((LONG *)&MiMemoryConsumers[Consumer].PagesUsed);
+ InterlockedDecrementUL(&MiMemoryConsumers[Consumer].PagesUsed);
return(STATUS_NO_MEMORY);
}
@@ -244,7 +244,7 @@
Request.Page = 0;
KeInitializeEvent(&Request.Event, NotificationEvent, FALSE);
- InterlockedIncrement((LONG *)&MiPagesRequired);
+ InterlockedIncrementUL(&MiPagesRequired);
KeAcquireSpinLock(&AllocationListLock, &oldIrql);
@@ -268,7 +268,7 @@
}
MmTransferOwnershipPage(Page, Consumer);
*AllocatedPage = Page;
- InterlockedDecrement((LONG *)&MiPagesRequired);
+ InterlockedDecrementUL(&MiPagesRequired);
return(STATUS_SUCCESS);
}
reactos/ntoskrnl/mm
diff -u -r1.72 -r1.72.2.1
--- marea.c 13 Nov 2004 22:27:16 -0000 1.72
+++ marea.c 30 Dec 2004 04:37:00 -0000 1.72.2.1
@@ -498,55 +498,6 @@
return(STATUS_SUCCESS);
}
-PMEMORY_AREA MmSplitMemoryArea(PEPROCESS Process,
- PMADDRESS_SPACE AddressSpace,
- PMEMORY_AREA OriginalMemoryArea,
- PVOID BaseAddress,
- ULONG Length,
- ULONG NewType,
- ULONG NewAttributes)
-{
- PMEMORY_AREA Result;
- PMEMORY_AREA Split;
-
- Result = ExAllocatePoolWithTag(NonPagedPool, sizeof(MEMORY_AREA),
- TAG_MAREA);
- RtlZeroMemory(Result,sizeof(MEMORY_AREA));
- Result->Type = NewType;
- Result->BaseAddress = BaseAddress;
- Result->Length = Length;
- Result->Attributes = NewAttributes;
- Result->LockCount = 0;
- Result->Process = Process;
-
- if (BaseAddress == OriginalMemoryArea->BaseAddress)
- {
- OriginalMemoryArea->BaseAddress = (char*)BaseAddress + Length;
- OriginalMemoryArea->Length = OriginalMemoryArea->Length - Length;
- MmInsertMemoryArea(AddressSpace, Result);
- return(Result);
- }
- if (((char*)BaseAddress + Length) ==
- ((char*)OriginalMemoryArea->BaseAddress + OriginalMemoryArea->Length))
- {
- OriginalMemoryArea->Length = OriginalMemoryArea->Length - Length;
- MmInsertMemoryArea(AddressSpace, Result);
-
- return(Result);
- }
-
- Split = ExAllocatePoolWithTag(NonPagedPool, sizeof(MEMORY_AREA),
- TAG_MAREA);
- RtlCopyMemory(Split,OriginalMemoryArea,sizeof(MEMORY_AREA));
- Split->BaseAddress = (char*)BaseAddress + Length;
- Split->Length = OriginalMemoryArea->Length - (((ULONG)BaseAddress)
- + Length);
-
- OriginalMemoryArea->Length = (char*)BaseAddress - (char*)OriginalMemoryArea->BaseAddress;
-
- return(Split);
-}
-
NTSTATUS MmCreateMemoryArea(PEPROCESS Process,
PMADDRESS_SPACE AddressSpace,
ULONG Type,
reactos/ntoskrnl/mm
diff -u -r1.92.2.3 -r1.92.2.4
--- npool.c 13 Dec 2004 16:18:13 -0000 1.92.2.3
+++ npool.c 30 Dec 2004 04:37:00 -0000 1.92.2.4
@@ -1,4 +1,4 @@
-/* $Id: npool.c,v 1.92.2.3 2004/12/13 16:18:13 hyperion Exp $
+/* $Id: npool.c,v 1.92.2.4 2004/12/30 04:37:00 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
reactos/ntoskrnl/mm
diff -u -r1.21 -r1.21.8.1
--- pageop.c 15 Aug 2004 16:39:08 -0000 1.21
+++ pageop.c 30 Dec 2004 04:37:00 -0000 1.21.8.1
@@ -1,4 +1,4 @@
-/* $Id: pageop.c,v 1.21 2004/08/15 16:39:08 chorns Exp $
+/* $Id: pageop.c,v 1.21.8.1 2004/12/30 04:37:00 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -42,7 +42,7 @@
KeReleaseSpinLock(&MmPageOpHashTableLock, oldIrql);
return;
}
- InterlockedDecrement((LONG *)&PageOp->MArea->PageOpCount);
+ InterlockedDecrementUL(&PageOp->MArea->PageOpCount);
PrevPageOp = MmPageOpHashTable[PageOp->Hash];
if (PrevPageOp == PageOp)
{
@@ -230,7 +230,7 @@
PageOp->MArea = MArea;
KeInitializeEvent(&PageOp->CompletionEvent, NotificationEvent, FALSE);
MmPageOpHashTable[Hash] = PageOp;
- InterlockedIncrement((LONG *)&MArea->PageOpCount);
+ InterlockedIncrementUL(&MArea->PageOpCount);
KeReleaseSpinLock(&MmPageOpHashTableLock, oldIrql);
return(PageOp);
reactos/ntoskrnl/mm
diff -u -r1.35.6.2 -r1.35.6.3
--- pool.c 13 Dec 2004 16:18:14 -0000 1.35.6.2
+++ pool.c 30 Dec 2004 04:37:00 -0000 1.35.6.3
@@ -1,4 +1,4 @@
-/* $Id: pool.c,v 1.35.6.2 2004/12/13 16:18:14 hyperion Exp $
+/* $Id: pool.c,v 1.35.6.3 2004/12/30 04:37:00 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
reactos/ntoskrnl/mm
diff -u -r1.33.2.2 -r1.33.2.3
--- ppool.c 13 Dec 2004 16:18:14 -0000 1.33.2.2
+++ ppool.c 30 Dec 2004 04:37:00 -0000 1.33.2.3
@@ -1,4 +1,4 @@
-/* $Id: ppool.c,v 1.33.2.2 2004/12/13 16:18:14 hyperion Exp $
+/* $Id: ppool.c,v 1.33.2.3 2004/12/30 04:37:00 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -7,219 +7,60 @@
* PROGRAMMER: David Welch (welch@mcmail.com)
* UPDATE HISTORY:
* Created 22/05/98
+ * Complete Rewrite Dec 2004 by Royce Mitchell III
*/
/* INCLUDES *****************************************************************/
+#ifdef PPOOL_UMODE_TEST
+#include "ppool_umode.h"
+#else//PPOOL_UMODE_TEST
#include <ntoskrnl.h>
#define NDEBUG
#include <internal/debug.h>
-
-/* GLOBALS *******************************************************************/
-
-/* Define to enable strict checking of the paged pool on every allocation */
-/* #define ENABLE_VALIDATE_POOL */
+#endif//PPOOL_UMODE_TEST
#undef ASSERT
#define ASSERT(x) if (!(x)) {DbgPrint("Assertion "#x" failed at %s:%d\n", __FILE__,__LINE__); KeBugCheck(0); }
-#define ASSERT_SIZE(n) ASSERT ( (n) <= MmPagedPoolSize && (n) > 0 )
-#define IS_PPOOL_PTR(p) ((size_t)(p)) >= ((size_t)MmPagedPoolBase) && ((size_t)(p)) < ((size_t)((size_t)MmPagedPoolBase+MmPagedPoolSize))
-#define ASSERT_PTR(p) ASSERT ( IS_PPOOL_PTR(p) )
-
-// to disable buffer over/under-run detection, set the following macro to 0
-#if !defined(DBG) && !defined(KDBG)
-#define MM_PPOOL_REDZONE_BYTES 0
-#else
-#define MM_PPOOL_REDZONE_BYTES 4
-#define MM_PPOOL_REDZONE_LOVALUE 0x87
-#define MM_PPOOL_REDZONE_HIVALUE 0xA5
-#define MM_PPOOL_FREEMAGIC (ULONG)(('F'<<0) + ('r'<<8) + ('E'<<16) + ('e'<<24))
-#define MM_PPOOL_USEDMAGIC (ULONG)(('u'<<0) + ('S'<<8) + ('e'<<16) + ('D'<<24))
-#define MM_PPOOL_LASTOWNER_ENTRIES 3
-#endif
-typedef struct _MM_PPOOL_FREE_BLOCK_HEADER
-{
-#if MM_PPOOL_REDZONE_BYTES
- ULONG FreeMagic;
-#endif//MM_PPOOL_REDZONE_BYTES
- ULONG Size;
- struct _MM_PPOOL_FREE_BLOCK_HEADER* NextFree;
-#if MM_PPOOL_REDZONE_BYTES
- ULONG LastOwnerStack[MM_PPOOL_LASTOWNER_ENTRIES];
-#endif//MM_PPOOL_REDZONE_BYTES
-}
-MM_PPOOL_FREE_BLOCK_HEADER, *PMM_PPOOL_FREE_BLOCK_HEADER;
+// enable "magic"
+//#define R_MAGIC
+#define R_MUTEX FAST_MUTEX
+#define R_ACQUIRE_MUTEX(pool) /*DPRINT1("Acquiring PPool Mutex\n");*/ ExAcquireFastMutex(&pool->Mutex)
+#define R_RELEASE_MUTEX(pool) /*DPRINT1("Releasing PPool Mutex\n");*/ ExReleaseFastMutex(&pool->Mutex)
+#define R_PRINT_ADDRESS(addr) KeRosPrintAddress(addr)
+#define R_PANIC() KeBugCheck(0)
+#define R_DEBUG DbgPrint
+#define R_EXTRA_STACK_UP 2
+#define R_GET_STACK_FRAMES(ptr,cnt) KeRosGetStackFrames(ptr,cnt)
-typedef struct _MM_PPOOL_USED_BLOCK_HEADER
-{
-#if MM_PPOOL_REDZONE_BYTES
- ULONG UsedMagic;
-#endif//MM_PPOOL_REDZONE_BYTES
- ULONG Size;
-#if MM_PPOOL_REDZONE_BYTES
- ULONG UserSize; // how many bytes the user actually asked for...
-#endif//MM_PPOOL_REDZONE_BYTES
- struct _MM_PPOOL_USED_BLOCK_HEADER* NextUsed;
- ULONG Tag;
-}
-MM_PPOOL_USED_BLOCK_HEADER, *PMM_PPOOL_USED_BLOCK_HEADER;
+#include "RPoolMgr.h"
+
+/* GLOBALS *******************************************************************/
PVOID MmPagedPoolBase;
ULONG MmPagedPoolSize;
-ULONG MmTotalPagedPoolQuota = 0;
-static FAST_MUTEX MmPagedPoolLock;
-static PMM_PPOOL_FREE_BLOCK_HEADER MmPagedPoolFirstFreeBlock;
-static PMM_PPOOL_USED_BLOCK_HEADER MmPagedPoolFirstUsedBlock;
+ULONG MmTotalPagedPoolQuota = 0; // TODO FIXME commented out until we use it
+static PR_POOL MmPagedPool = NULL;
/* FUNCTIONS *****************************************************************/
-inline static void* block_to_address ( PVOID blk )
-/*
- * FUNCTION: Translate a block header address to the corresponding block
- * address (internal)
- */
-{
- return ( (void *) ((char*)blk + sizeof(MM_PPOOL_USED_BLOCK_HEADER) + MM_PPOOL_REDZONE_BYTES) );
-}
-
-inline static PMM_PPOOL_USED_BLOCK_HEADER address_to_block(PVOID addr)
-{
- return (PMM_PPOOL_USED_BLOCK_HEADER)
- ( ((char*)addr) - sizeof(MM_PPOOL_USED_BLOCK_HEADER) - MM_PPOOL_REDZONE_BYTES );
-}
-
VOID INIT_FUNCTION
-MmInitializePagedPool(VOID)
+MmInitializePagedPool()
{
- MmPagedPoolFirstFreeBlock = (PMM_PPOOL_FREE_BLOCK_HEADER)MmPagedPoolBase;
- /*
- * We are still at a high IRQL level at this point so explicitly commit
- * the first page of the paged pool before writing the first block header.
- */
- MmCommitPagedPoolAddress((PVOID)MmPagedPoolFirstFreeBlock, FALSE);
- MmPagedPoolFirstFreeBlock->Size = MmPagedPoolSize;
- MmPagedPoolFirstFreeBlock->NextFree = NULL;
-
-#if MM_PPOOL_REDZONE_BYTES
- MmPagedPoolFirstFreeBlock->FreeMagic = MM_PPOOL_FREEMAGIC;
- {
- int i;
- for ( i = 0; i < MM_PPOOL_LASTOWNER_ENTRIES; i++ )
- MmPagedPoolFirstFreeBlock->LastOwnerStack[i] = 0;
- }
+ /*
+ * We are still at a high IRQL level at this point so explicitly commit
+ * the first page of the paged pool before writing the first block header.
+ */
+ MmCommitPagedPoolAddress ( (PVOID)MmPagedPoolBase, FALSE );
+
+ MmPagedPool = RPoolInit ( MmPagedPoolBase,
+ MmPagedPoolSize,
+ MM_POOL_ALIGNMENT,
+ MM_CACHE_LINE_SIZE,
+ PAGE_SIZE );
- MmPagedPoolFirstUsedBlock = NULL;
-#endif//MM_PPOOL_REDZONE_BYTES
-
- ExInitializeFastMutex(&MmPagedPoolLock);
-}
-
-#ifdef ENABLE_VALIDATE_POOL
-static void VerifyPagedPool ( int line )
-{
- PMM_PPOOL_FREE_BLOCK_HEADER p = MmPagedPoolFirstFreeBlock;
- int count = 0;
- DPRINT ( "VerifyPagedPool(%i):\n", line );
- while ( p )
- {
- DPRINT ( " 0x%x: %lu bytes (next 0x%x)\n", p, p->Size, p->NextFree );
-#if MM_PPOOL_REDZONE_BYTES
- ASSERT ( p->FreeMagic == MM_PPOOL_FREEMAGIC );
-#endif//MM_PPOOL_REDZONE_BYTES
- ASSERT_PTR(p);
- ASSERT_SIZE(p->Size);
- count++;
- p = p->NextFree;
- }
- DPRINT ( "VerifyPagedPool(%i): (%lu blocks)\n", line, count );
-}
-#define VerifyPagedPool() VerifyPagedPool(__LINE__)
-#else
-#define VerifyPagedPool()
-#endif
-
-BOOLEAN STDCALL
-KeRosPrintAddress(PVOID address);
-
-#if !MM_PPOOL_REDZONE_BYTES
-#define MmpRedZoneCheck(pUsed,Addr,file,line)
-#else//MM_PPOOL_REDZONE_BYTES
-static VOID FASTCALL
-MmpRedZoneCheck ( PMM_PPOOL_USED_BLOCK_HEADER pUsed, PUCHAR Addr, const char* file, int line )
-{
- int i;
- PUCHAR AddrEnd = Addr + pUsed->UserSize;
- BOOL bLow = TRUE;
- BOOL bHigh = TRUE;
-
- ASSERT_PTR(Addr);
- if ( pUsed->UsedMagic == MM_PPOOL_FREEMAGIC )
- {
- PMM_PPOOL_FREE_BLOCK_HEADER pFree = (PMM_PPOOL_FREE_BLOCK_HEADER)pUsed;
- DPRINT1 ( "Double-free detected for Block 0x%x (kthread=0x%x)!\n", Addr, KeGetCurrentThread() );
- DbgPrint ( "First Free Stack Frames:" );
- for ( i = 0; i < MM_PPOOL_LASTOWNER_ENTRIES; i++ )
- {
- if ( pFree->LastOwnerStack[i] != 0xDEADBEEF )
- {
- DbgPrint(" ");
- if (!KeRosPrintAddress ((PVOID)pFree->LastOwnerStack[i]) )
- {
- DbgPrint("<%X>", pFree->LastOwnerStack[i] );
- }
- }
- }
- DbgPrint ( "\n" );
- KEBUGCHECK(BAD_POOL_HEADER);
- }
- if ( pUsed->UsedMagic != MM_PPOOL_USEDMAGIC )
- {
- DPRINT1 ( "Bad magic in Block 0x%x!\n", Addr );
- KEBUGCHECK(BAD_POOL_HEADER);
- }
- ASSERT_SIZE(pUsed->Size);
- ASSERT_SIZE(pUsed->UserSize);
- ASSERT_PTR(AddrEnd);
- Addr -= MM_PPOOL_REDZONE_BYTES; // this is to simplify indexing below...
- for ( i = 0; i < MM_PPOOL_REDZONE_BYTES && bLow && bHigh; i++ )
- {
- bLow = bLow && ( Addr[i] == MM_PPOOL_REDZONE_LOVALUE );
- bHigh = bHigh && ( AddrEnd[i] == MM_PPOOL_REDZONE_HIVALUE );
- }
- if ( !bLow || !bHigh )
- {
- const char* violation = "High and Low-side";
- if ( bHigh ) // high is okay, so it was just low failed
- violation = "Low-side";
- else if ( bLow ) // low side is okay, so it was just high failed
- violation = "High-side";
- DbgPrint("%s(%i): %s redzone violation detected for paged pool address 0x%x\n",
- file, line, violation, Addr );
- DbgPrint ( "UsedMagic 0x%x, LoZone ", pUsed->UsedMagic );
- for ( i = 0; i < MM_PPOOL_REDZONE_BYTES; i++ )
- DbgPrint ( "%02x", Addr[i] );
- DbgPrint ( ", HiZone " );
- for ( i = 0; i < MM_PPOOL_REDZONE_BYTES; i++ )
- DbgPrint ( "%02x", AddrEnd[i] );
- DbgPrint ( "\n" );
- KEBUGCHECK(BAD_POOL_HEADER);
- }
-}
-#endif//MM_PPOOL_REDZONE_BYTES
-
-VOID STDCALL
-MmDbgPagedPoolRedZoneCheck ( const char* file, int line )
-{
-#if MM_PPOOL_REDZONE_BYTES
- PMM_PPOOL_USED_BLOCK_HEADER pUsed = MmPagedPoolFirstUsedBlock;
-
- while ( pUsed )
- {
- MmpRedZoneCheck ( pUsed, block_to_address(pUsed), __FILE__, __LINE__ );
- pUsed = pUsed->NextUsed;
- }
-#endif//MM_PPOOL_REDZONE_BYTES
+ ExInitializeFastMutex(&MmPagedPool->Mutex);
}
/**********************************************************************
@@ -237,420 +78,170 @@
IN ULONG NumberOfBytes,
IN ULONG Tag)
{
- PMM_PPOOL_FREE_BLOCK_HEADER BestBlock;
- PMM_PPOOL_FREE_BLOCK_HEADER CurrentBlock;
- ULONG BlockSize;
- PMM_PPOOL_USED_BLOCK_HEADER NewBlock;
- PMM_PPOOL_FREE_BLOCK_HEADER NextBlock;
- PMM_PPOOL_FREE_BLOCK_HEADER PreviousBlock;
- PMM_PPOOL_FREE_BLOCK_HEADER BestPreviousBlock;
- PVOID BlockAddress;
- ULONG Alignment;
-
- ASSERT_IRQL(APC_LEVEL);
-
- ExAcquireFastMutex(&MmPagedPoolLock);
-
- /*
- * Don't bother allocating anything for a zero-byte block.
- */
- if (NumberOfBytes == 0)
- {
- MmDbgPagedPoolRedZoneCheck(__FILE__,__LINE__);
- ExReleaseFastMutex(&MmPagedPoolLock);
- return(NULL);
- }
-
- DPRINT ( "ExAllocatePagedPoolWithTag(%i,%lu,%lu)\n", PoolType, NumberOfBytes, Tag );
- VerifyPagedPool();
-
- if (NumberOfBytes >= PAGE_SIZE)
- {
- Alignment = PAGE_SIZE;
- }
- else if (PoolType == PagedPoolCacheAligned)
- {
- Alignment = MM_CACHE_LINE_SIZE;
- }
- else
- {
- Alignment = MM_POOL_ALIGNMENT;
- }
-
- /*
- * Calculate the total number of bytes we will need.
- */
- BlockSize = NumberOfBytes + sizeof(MM_PPOOL_USED_BLOCK_HEADER) + 2*MM_PPOOL_REDZONE_BYTES;
- if (BlockSize < sizeof(MM_PPOOL_FREE_BLOCK_HEADER))
- {
- /* At least we need the size of the free block header. */
- BlockSize = sizeof(MM_PPOOL_FREE_BLOCK_HEADER);
- }
-
-
- /*
- * Find the best-fitting block.
- */
- PreviousBlock = NULL;
- BestPreviousBlock = BestBlock = NULL;
- CurrentBlock = MmPagedPoolFirstFreeBlock;
- if ( Alignment > 0 )
- {
- PVOID BestAlignedAddr = NULL;
- while ( CurrentBlock != NULL )
- {
- PVOID Addr = block_to_address(CurrentBlock);
- PVOID CurrentBlockEnd = (char*)CurrentBlock + CurrentBlock->Size;
- /* calculate last size-aligned address available within this block */
- PVOID AlignedAddr = MM_ROUND_DOWN((char*)CurrentBlockEnd-NumberOfBytes-MM_PPOOL_REDZONE_BYTES, Alignment);
- ASSERT ( (char*)AlignedAddr+NumberOfBytes+MM_PPOOL_REDZONE_BYTES <= (char*)CurrentBlockEnd );
-
- /* special case, this address is already size-aligned, and the right size */
- if ( Addr == AlignedAddr )
- {
- BestAlignedAddr = AlignedAddr;
- BestPreviousBlock = PreviousBlock;
- BestBlock = CurrentBlock;
- break;
- }
- else if ( Addr < (PVOID)address_to_block(AlignedAddr) )
- {
- /*
- * there's enough room to allocate our size-aligned memory out
- * of this block, see if it's a better choice than any previous
- * finds
- */
- if ( BestBlock == NULL || BestBlock->Size > CurrentBlock->Size )
- {
- BestAlignedAddr = AlignedAddr;
- BestPreviousBlock = PreviousBlock;
- BestBlock = CurrentBlock;
- }
- }
-
- PreviousBlock = CurrentBlock;
- CurrentBlock = CurrentBlock->NextFree;
- }
-
- /*
- * we found a best block can/should we chop a few bytes off the beginning
- * into a separate memory block?
- */
- if ( BestBlock != NULL )
- {
- PVOID Addr = block_to_address(BestBlock);
- if ( BestAlignedAddr != Addr )
- {
- PMM_PPOOL_FREE_BLOCK_HEADER NewFreeBlock =
- (PMM_PPOOL_FREE_BLOCK_HEADER)address_to_block(BestAlignedAddr);
- ASSERT ( BestAlignedAddr > Addr );
- NewFreeBlock->Size = (char*)Addr + BestBlock->Size - (char*)BestAlignedAddr;
-#if MM_PPOOL_REDZONE_BYTES
- NewFreeBlock->FreeMagic = MM_PPOOL_FREEMAGIC;
-#endif//MM_PPOOL_REDZONE_BYTES
- ASSERT_SIZE(NewFreeBlock->Size);
- BestBlock->Size = (size_t)NewFreeBlock - (size_t)Addr;
- ASSERT_SIZE(BestBlock->Size);
-
- DPRINT ( "breaking off preceding bytes into their own block...\n" );
- DPRINT ( "NewFreeBlock 0x%x Size %lu (Old Block's new size %lu) NextFree 0x%x\n",
- NewFreeBlock, NewFreeBlock->Size, BestBlock->Size, BestBlock->NextFree );
-
- /* insert the new block into the chain */
- NewFreeBlock->NextFree = BestBlock->NextFree;
- BestBlock->NextFree = NewFreeBlock;
-
- /* we want the following code to use our size-aligned block */
- BestPreviousBlock = BestBlock;
- BestBlock = NewFreeBlock;
-
- //VerifyPagedPool();
- }
- }
- }
- /*
- * non-size-aligned block search
- */
- else
- while ( CurrentBlock != NULL )
- {
- if ( CurrentBlock->Size >= BlockSize
- && ( BestBlock == NULL || BestBlock->Size > CurrentBlock->Size )
- )
- {
- BestPreviousBlock = PreviousBlock;
- BestBlock = CurrentBlock;
- }
-
- PreviousBlock = CurrentBlock;
- CurrentBlock = CurrentBlock->NextFree;
- }
-
- /*
- * We didn't find anything suitable at all.
- */
- if (BestBlock == NULL)
- {
- DPRINT1("Trying to allocate %lu bytes from paged pool - nothing suitable found, returning NULL\n",
- NumberOfBytes );
- ExReleaseFastMutex(&MmPagedPoolLock);
- return(NULL);
- }
-
- DPRINT("BestBlock 0x%x NextFree 0x%x\n", BestBlock, BestBlock->NextFree );
-
- //VerifyPagedPool();
-
- /*
- * Is there enough space to create a second block from the unused portion.
- */
- if ( BestBlock->Size > BlockSize
- && (BestBlock->Size - BlockSize) > sizeof(MM_PPOOL_FREE_BLOCK_HEADER)
- )
- {
- ULONG NewSize = BestBlock->Size - BlockSize;
- ASSERT_SIZE ( NewSize );
-
- //DPRINT("creating 2nd block from unused portion\n");
- DPRINT("BestBlock 0x%x Size 0x%x BlockSize 0x%x NewSize 0x%x\n",
- BestBlock, BestBlock->Size, BlockSize, NewSize );
-
- /*
- * Create the new free block.
- */
- //DPRINT("creating the new free block");
- NextBlock = (PMM_PPOOL_FREE_BLOCK_HEADER)((char*)BestBlock + BlockSize);
- //DPRINT(".");
- NextBlock->Size = NewSize;
-#if MM_PPOOL_REDZONE_BYTES
- NextBlock->FreeMagic = MM_PPOOL_FREEMAGIC;
-#endif//MM_PPOOL_REDZONE_BYTES
- ASSERT_SIZE ( NextBlock->Size );
- //DPRINT(".");
- NextBlock->NextFree = BestBlock->NextFree;
- //DPRINT(".\n");
-
- /*
- * Replace the old free block with it.
- */
- //DPRINT("replacing old free block with it");
- if (BestPreviousBlock == NULL)
- {
- //DPRINT("(from beginning)");
- MmPagedPoolFirstFreeBlock = NextBlock;
- }
- else
- {
- //DPRINT("(from previous)");
- BestPreviousBlock->NextFree = NextBlock;
- }
- //DPRINT(".\n");
-
- /*
- * Create the new used block header.
- */
- //DPRINT("create new used block header");
- NewBlock = (PMM_PPOOL_USED_BLOCK_HEADER)BestBlock;
- //DPRINT(".");
- NewBlock->Size = BlockSize;
-#if MM_PPOOL_REDZONE_BYTES
- NewBlock->UsedMagic = MM_PPOOL_USEDMAGIC;
-#endif//MM_PPOOL_REDZONE_BYTES
- ASSERT_SIZE ( NewBlock->Size );
- //DPRINT(".\n");
- }
- else
- {
- ULONG NewSize = BestBlock->Size;
-
- /*
- * Remove the selected block from the list of free blocks.
- */
- //DPRINT ( "Removing selected block from free block list\n" );
- if (BestPreviousBlock == NULL)
- {
- MmPagedPoolFirstFreeBlock = BestBlock->NextFree;
- }
- else
- {
- BestPreviousBlock->NextFree = BestBlock->NextFree;
- }
-
- /*
- * Set up the header of the new block
- */
- NewBlock = (PMM_PPOOL_USED_BLOCK_HEADER)BestBlock;
- NewBlock->Size = NewSize;
-#if MM_PPOOL_REDZONE_BYTES
- NewBlock->UsedMagic = MM_PPOOL_USEDMAGIC;
-#endif//MM_PPOOL_REDZONE_BYTES
- ASSERT_SIZE ( NewBlock->Size );
- }
-
- // now add the block to the used block list
- NewBlock->NextUsed = MmPagedPoolFirstUsedBlock;
- MmPagedPoolFirstUsedBlock = NewBlock;
-
- NewBlock->Tag = Tag;
-
- VerifyPagedPool();
-
- ExReleaseFastMutex(&MmPagedPoolLock);
-
- BlockAddress = block_to_address ( NewBlock );
- /* RtlZeroMemory(BlockAddress, NumberOfBytes);*/
-
-#if MM_PPOOL_REDZONE_BYTES
-
- NewBlock->UserSize = NumberOfBytes;
- // write out buffer-overrun detection bytes
- {
- PUCHAR Addr = (PUCHAR)BlockAddress;
- //DbgPrint ( "writing buffer-overrun detection bytes" );
- memset ( Addr - MM_PPOOL_REDZONE_BYTES,
- MM_PPOOL_REDZONE_LOVALUE, MM_PPOOL_REDZONE_BYTES );
- memset ( Addr + NewBlock->UserSize, MM_PPOOL_REDZONE_HIVALUE,
- MM_PPOOL_REDZONE_BYTES );
- }
+ int align;
+
+ if ( NumberOfBytes >= PAGE_SIZE )
+ align = 2;
+ else if ( PoolType == PagedPoolCacheAligned )
+ align = 1;
+ else
+ align = 0;
-#endif//MM_PPOOL_REDZONE_BYTES
+ ASSERT_IRQL(APC_LEVEL);
- return(BlockAddress);
+ return RPoolAlloc ( MmPagedPool, NumberOfBytes, Tag, align );
}
VOID STDCALL
ExFreePagedPool(IN PVOID Block)
{
- PMM_PPOOL_FREE_BLOCK_HEADER PreviousBlock;
- PMM_PPOOL_USED_BLOCK_HEADER UsedBlock = address_to_block(Block);
- ULONG UsedSize = UsedBlock->Size;
- PMM_PPOOL_FREE_BLOCK_HEADER FreeBlock =
- (PMM_PPOOL_FREE_BLOCK_HEADER)UsedBlock;
- PMM_PPOOL_FREE_BLOCK_HEADER NextBlock;
- PMM_PPOOL_FREE_BLOCK_HEADER NextNextBlock;
-
- ASSERT_IRQL(APC_LEVEL);
-
- MmpRedZoneCheck ( UsedBlock, Block, __FILE__, __LINE__ );
-
-#if MM_PPOOL_REDZONE_BYTES
- memset ( Block, 0xCD, UsedBlock->UserSize );
-#endif
-
- ExAcquireFastMutex(&MmPagedPoolLock);
-
- // remove from used list...
- {
- PMM_PPOOL_USED_BLOCK_HEADER pPrev = MmPagedPoolFirstUsedBlock;
- if ( pPrev == UsedBlock )
- {
- // special-case, our freeing block is first in list...
- MmPagedPoolFirstUsedBlock = pPrev->NextUsed;
- }
- else
- {
- while ( pPrev && pPrev->NextUsed != UsedBlock )
- pPrev = pPrev->NextUsed;
- // if this assert fails - memory has been corrupted
- // ( or I have a logic error...! )
- ASSERT ( pPrev->NextUsed == UsedBlock );
- pPrev->NextUsed = UsedBlock->NextUsed;
- }
- }
-
- /*
- * Begin setting up the newly freed block's header.
- */
- FreeBlock->Size = UsedSize;
-#if MM_PPOOL_REDZONE_BYTES
- FreeBlock->FreeMagic = MM_PPOOL_FREEMAGIC;
- {
- PULONG Frame;
- int i;
-#if defined __GNUC__
- __asm__("mov %%ebp, %%ebx" : "=b" (Frame) : );
-#elif defined(_MSC_VER)
- __asm mov [Frame], ebp
-#endif
- //DbgPrint ( "Stack Frames for Free Block 0x%x:", Block );
- Frame = (PULONG)Frame[0]; // step out of ExFreePagedPool
- for ( i = 0; i < MM_PPOOL_LASTOWNER_ENTRIES; i++ )
- {
- if ( Frame == 0 || (ULONG)Frame == 0xDEADBEEF )
- FreeBlock->LastOwnerStack[i] = 0xDEADBEEF;
- else
- {
- //DbgPrint ( " 0x%x", Frame[1] );
- FreeBlock->LastOwnerStack[i] = Frame[1];
- Frame = (PULONG)Frame[0];
- }
- }
- //DbgPrint ( "\n" );
- //KeRosDumpStackFrames ( NULL, 4 );
- }
-#endif//MM_PPOOL_REDZONE_BYTES
- ASSERT_SIZE ( FreeBlock->Size );
-
- /*
- * Find the blocks immediately before and after the newly freed block on the free list.
- */
- PreviousBlock = NULL;
- NextBlock = MmPagedPoolFirstFreeBlock;
- while (NextBlock != NULL && NextBlock < FreeBlock)
- {
- PreviousBlock = NextBlock;
- NextBlock = NextBlock->NextFree;
- }
-
- /*
- * Insert the freed block on the free list.
- */
- if (PreviousBlock == NULL)
- {
- FreeBlock->NextFree = MmPagedPoolFirstFreeBlock;
- MmPagedPoolFirstFreeBlock = FreeBlock;
- }
- else
- {
- PreviousBlock->NextFree = FreeBlock;
- FreeBlock->NextFree = NextBlock;
- }
-
- /*
- * If the next block is immediately adjacent to the newly freed one then
- * merge them.
- * PLEASE DO NOT WIPE OUT 'MAGIC' OR 'LASTOWNER' DATA FOR MERGED FREE BLOCKS
- */
- if (NextBlock != NULL &&
- ((char*)FreeBlock + FreeBlock->Size) == (char*)NextBlock)
- {
- FreeBlock->Size = FreeBlock->Size + NextBlock->Size;
- ASSERT_SIZE ( FreeBlock->Size );
- FreeBlock->NextFree = NextBlock->NextFree;
- NextNextBlock = NextBlock->NextFree;
- }
- else
- {
- NextNextBlock = NextBlock;
- }
-
- /*
- * If the previous block is adjacent to the newly freed one then
- * merge them.
- * PLEASE DO NOT WIPE OUT 'MAGIC' OR 'LASTOWNER' DATA FOR MERGED FREE BLOCKS
- */
- if (PreviousBlock != NULL &&
- ((char*)PreviousBlock + PreviousBlock->Size) == (char*)FreeBlock)
- {
- PreviousBlock->Size = PreviousBlock->Size + FreeBlock->Size;
- ASSERT_SIZE ( PreviousBlock->Size );
- PreviousBlock->NextFree = NextNextBlock;
- }
+ ASSERT_IRQL(APC_LEVEL);
+ RPoolFree ( MmPagedPool, Block );
+}
+
+VOID STDCALL
+ExRosDumpPagedPoolByTag ( ULONG Tag )
+{
+ // TODO FIXME - should we ASSERT_IRQL?
+ RPoolDumpByTag ( MmPagedPool, Tag );
+}
+
+ULONG STDCALL
+ExRosQueryPagedPoolTag ( PVOID Addr )
+{
+ // TODO FIXME - should we ASSERT_IRQL?
+ return RPoolQueryTag ( Addr );
+}
+
+#ifdef PPOOL_UMODE_TEST
+
+PVOID TestAlloc ( ULONG Bytes )
+{
+ PVOID ret;
+
+ //printf ( "Allocating block: " ); RPoolStats ( MmPagedPool );
+ //RPoolRedZoneCheck ( MmPagedPool, __FILE__, __LINE__ );
+
+ ret = ExAllocatePagedPoolWithTag ( PagedPool, Bytes, 0 );
+
+ //printf ( "Block %x allocated: ", ret ); RPoolStats ( MmPagedPool );
+ //RPoolRedZoneCheck ( MmPagedPool, __FILE__, __LINE__ );
+
+ return ret;
+}
+
+void TestFree ( PVOID ptr )
+{
+ //printf ( "Freeing block %x: ", ptr ); RPoolStats ( MmPagedPool );
+ //RPoolRedZoneCheck ( MmPagedPool, __FILE__, __LINE__ );
+ ExFreePagedPool(ptr);
+ //printf ( "Block %x freed: ", ptr ); RPoolStats ( MmPagedPool );
+ //RPoolRedZoneCheck ( MmPagedPool, __FILE__, __LINE__ );
+}
+
+int main()
+{
+#define COUNT 100
+ int i, j;
+ char* keepers[COUNT];
+ char* trash[COUNT];
+ int AllocSize[] = { 15, 31, 63, 127, 255, 511, 1023, 2047 };
+ const int ALLOCS = sizeof(AllocSize) / sizeof(0[AllocSize]);
+ DWORD dwStart;
+
+ MmPagedPoolSize = 1*1024*1024;
+ MmPagedPoolBase = malloc ( MmPagedPoolSize );
+ MmInitializePagedPool();
+
+ dwStart = GetTickCount();
+
+ printf ( "test #1 phase #1\n" );
+ for ( i = 0; i < COUNT; i++ )
+ {
+ //printf ( "keeper %i) ", i );
+ keepers[i] = TestAlloc ( AllocSize[i%ALLOCS] );
+ if ( !keepers[i] ) printf ( "allocation failed\n" );
+ //printf ( "trash %i) ", i );
+ trash[i] = TestAlloc ( AllocSize[i%ALLOCS] );
+ if ( !trash[i] ) printf ( "allocation failed\n" );
+ }
+
+ printf ( "test #1 phase #2\n" );
+ for ( i = 0; i < COUNT; i++ )
+ {
+ if ( i == 6 )
+ i = i;
+ //printf ( "%i) ", i );
+ TestFree ( trash[i] );
+ }
+
+ printf ( "test #1 phase #3\n" );
+ for ( i = 0; i < 4; i++ )
+ {
+ //printf ( "%i) ", i );
+ keepers[i] = TestAlloc ( 4096 );
+ if ( !keepers[i] ) printf ( "allocation failed\n" );
+ }
+
+ printf ( "test #1 phase #4\n" );
+ for ( i = 0; i < 4; i++ )
+ {
+ //printf ( "%i) ", i );
+ TestFree ( keepers[i] );
+ }
+
+ printf ( "test #1 phase #5\n" );
+ srand(1);
+ for ( i = 0; i < COUNT; i++ )
+ {
+ //printf ( "%i) ", i );
+ trash[i] = TestAlloc ( rand()%1024+1 );
+ if ( !trash[i] ) printf ( "allocation failed\n" );
+ }
+ printf ( "test #1 phase #6\n" );
+ for ( i = 0; i < 10000; i++ )
+ {
+ TestFree ( trash[i%COUNT] );
+ trash[i%COUNT] = TestAlloc ( rand()%1024+1 );
+ if ( !trash[i%COUNT] ) printf ( "allocation failed\n" );
+ }
+ printf ( "test #1 phase #7\n" );
+ j = 0;
+ for ( i = 0; i < COUNT; i++ )
+ {
+ if ( trash[i] )
+ {
+ TestFree ( trash[i] );
+ ++j;
+ }
+ }
+ printf ( "test #1 phase #8 ( freed %i of %i trash )\n", j, COUNT );
+ if ( !TestAlloc ( 2048 ) )
+ printf ( "Couldn't allocate 2048 bytes after freeing up a whole bunch of blocks\n" );
+
+ free ( MmPagedPoolBase );
+
+ printf ( "test time: %lu\n", GetTickCount() - dwStart );
+
+ printf ( "test #2\n" );
+
+ MmPagedPoolSize = 1024;
+ MmPagedPoolBase = malloc ( MmPagedPoolSize );
+ MmInitializePagedPool();
+
+ TestAlloc ( 512 );
+ i = RPoolLargestAllocPossible ( MmPagedPool, 0 );
+ if ( !TestAlloc ( i ) )
+ {
+ printf ( "allocating last available block failed\n" );
+ }
- VerifyPagedPool();
+ free ( MmPagedPoolBase );
- ExReleaseFastMutex(&MmPagedPoolLock);
+ printf ( "done!\n" );
+ return 0;
}
+#endif//PPOOL_UMODE_TEST
VOID STDCALL
ExRosDumpPagedPoolByTag ( ULONG Tag )
reactos/ntoskrnl/mm
diff -u -r1.31 -r1.31.6.1
--- rmap.c 2 Oct 2004 10:16:10 -0000 1.31
+++ rmap.c 30 Dec 2004 04:37:00 -0000 1.31.6.1
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: rmap.c,v 1.31 2004/10/02 10:16:10 hbirr Exp $
+/* $Id: rmap.c,v 1.31.6.1 2004/12/30 04:37:00 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top directory
* PROJECT: ReactOS kernel
@@ -423,7 +423,7 @@
}
if (Process)
{
- PrevSize = InterlockedExchangeAdd(&Process->Vm.WorkingSetSize, PAGE_SIZE);
+ PrevSize = InterlockedExchangeAddUL(&Process->Vm.WorkingSetSize, PAGE_SIZE);
if (PrevSize >= Process->Vm.PeakWorkingSetSize)
{
Process->Vm.PeakWorkingSetSize = PrevSize + PAGE_SIZE;
@@ -465,7 +465,7 @@
}
if (Process)
{
- InterlockedExchangeAdd(&Process->Vm.WorkingSetSize, -PAGE_SIZE);
+ InterlockedExchangeAddUL(&Process->Vm.WorkingSetSize, -PAGE_SIZE);
}
}
ExReleaseFastMutex(&RmapListLock);
@@ -501,7 +501,7 @@
}
if (Process)
{
- InterlockedExchangeAdd(&Process->Vm.WorkingSetSize, -PAGE_SIZE);
+ InterlockedExchangeAddUL(&Process->Vm.WorkingSetSize, -PAGE_SIZE);
}
return;
}
reactos/ntoskrnl/mm
diff -u -r1.166.2.5 -r1.166.2.6
--- section.c 30 Dec 2004 01:59:59 -0000 1.166.2.5
+++ section.c 30 Dec 2004 04:37:00 -0000 1.166.2.6
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: section.c,v 1.166.2.5 2004/12/30 01:59:59 hyperion Exp $
+/* $Id: section.c,v 1.166.2.6 2004/12/30 04:37:00 hyperion Exp $
*
* PROJECT: ReactOS kernel
* FILE: ntoskrnl/mm/section.c
@@ -3261,6 +3261,116 @@
return(Status);
}
+ /*
+ * allocate the section segments to describe the mapping
+ */
+ NrSegments = PEHeader.FileHeader.NumberOfSections + 1;
+ Size = sizeof(MM_IMAGE_SECTION_OBJECT) + sizeof(MM_SECTION_SEGMENT) * NrSegments;
+ ImageSectionObject = ExAllocatePoolWithTag(NonPagedPool, Size, TAG_MM_SECTION_SEGMENT);
+ if (ImageSectionObject == NULL)
+ {
+ KeSetEvent((PVOID)&FileObject->Lock, IO_NO_INCREMENT, FALSE);
+ ObDereferenceObject(Section);
+ ObDereferenceObject(FileObject);
+ ExFreePool(ImageSections);
+ return(STATUS_NO_MEMORY);
+ }
+ Section->ImageSection = ImageSectionObject;
+ ImageSectionObject->NrSegments = NrSegments;
+ ImageSectionObject->ImageBase = (PVOID)PEHeader.OptionalHeader.ImageBase;
+ ImageSectionObject->EntryPoint = (PVOID)PEHeader.OptionalHeader.AddressOfEntryPoint;
+ ImageSectionObject->StackReserve = PEHeader.OptionalHeader.SizeOfStackReserve;
+ ImageSectionObject->StackCommit = PEHeader.OptionalHeader.SizeOfStackCommit;
+ ImageSectionObject->Subsystem = PEHeader.OptionalHeader.Subsystem;
+ ImageSectionObject->MinorSubsystemVersion = PEHeader.OptionalHeader.MinorSubsystemVersion;
+ ImageSectionObject->MajorSubsystemVersion = PEHeader.OptionalHeader.MajorSubsystemVersion;
+ ImageSectionObject->ImageCharacteristics = PEHeader.FileHeader.Characteristics;
+ ImageSectionObject->Machine = PEHeader.FileHeader.Machine;
+ ImageSectionObject->Executable = (PEHeader.OptionalHeader.SizeOfCode != 0);
+
+ SectionSegments = ImageSectionObject->Segments;
+ SectionSegments[0].FileOffset = 0;
+ SectionSegments[0].Characteristics = IMAGE_SECTION_CHAR_DATA;
+ SectionSegments[0].Protection = PAGE_READONLY;
+ SectionSegments[0].RawLength = PAGE_SIZE;
+ SectionSegments[0].Length = PAGE_SIZE;
+ SectionSegments[0].Flags = 0;
+ SectionSegments[0].ReferenceCount = 1;
+ SectionSegments[0].VirtualAddress = 0;
+ SectionSegments[0].WriteCopy = TRUE;
+ SectionSegments[0].Attributes = 0;
+ ExInitializeFastMutex(&SectionSegments[0].Lock);
+ RtlZeroMemory(&SectionSegments[0].PageDirectory, sizeof(SECTION_PAGE_DIRECTORY));
+ for (i = 1; i < NrSegments; i++)
+ {
+ SectionSegments[i].FileOffset = ImageSections[i-1].PointerToRawData;
+ SectionSegments[i].Characteristics = ImageSections[i-1].Characteristics;
+
+ /*
+ * Set up the protection and write copy variables.
+ */
+ Characteristics = ImageSections[i - 1].Characteristics;
+ if (Characteristics & (IMAGE_SECTION_CHAR_READABLE|IMAGE_SECTION_CHAR_WRITABLE|IMAGE_SECTION_CHAR_EXECUTABLE))
+ {
+ SectionSegments[i].Protection = SectionCharacteristicsToProtect[Characteristics >> 28];
+ SectionSegments[i].WriteCopy = !(Characteristics & IMAGE_SECTION_CHAR_SHARED);
+ }
+ else if (Characteristics & IMAGE_SECTION_CHAR_CODE)
+ {
+ SectionSegments[i].Protection = PAGE_EXECUTE_READ;
+ SectionSegments[i].WriteCopy = TRUE;
+ }
+ else if (Characteristics & IMAGE_SECTION_CHAR_DATA)
+ {
+ SectionSegments[i].Protection = PAGE_READWRITE;
+ SectionSegments[i].WriteCopy = TRUE;
+ }
+ else if (Characteristics & IMAGE_SECTION_CHAR_BSS)
+ {
+ SectionSegments[i].Protection = PAGE_READWRITE;
+ SectionSegments[i].WriteCopy = TRUE;
+ }
+ else
+ {
+ SectionSegments[i].Protection = PAGE_NOACCESS;
+ SectionSegments[i].WriteCopy = TRUE;
+ }
+
+ /*
+ * Set up the attributes.
+ */
+ if (Characteristics & IMAGE_SECTION_CHAR_CODE)
+ {
+ SectionSegments[i].Attributes = 0;
+ }
+ else if (Characteristics & IMAGE_SECTION_CHAR_DATA)
+ {
+ SectionSegments[i].Attributes = 0;
+ }
+ else if (Characteristics & IMAGE_SECTION_CHAR_BSS)
+ {
+ SectionSegments[i].Attributes = MM_SECTION_SEGMENT_BSS;
+ }
+ else
+ {
+ SectionSegments[i].Attributes = 0;
+ }
+
+ SectionSegments[i].RawLength = ImageSections[i-1].SizeOfRawData;
+ if (ImageSections[i-1].Misc.VirtualSize != 0)
+ {
+ SectionSegments[i].Length = ImageSections[i-1].Misc.VirtualSize;
+ }
+ else
+ {
+ SectionSegments[i].Length = ImageSections[i-1].SizeOfRawData;
+ }
+ SectionSegments[i].Flags = 0;
+ SectionSegments[i].ReferenceCount = 1;
+ SectionSegments[i].VirtualAddress = (PVOID)ImageSections[i-1].VirtualAddress;
+ ExInitializeFastMutex(&SectionSegments[i].Lock);
+ RtlZeroMemory(&SectionSegments[i].PageDirectory, sizeof(SECTION_PAGE_DIRECTORY));
+ }
if (0 != InterlockedCompareExchangeUL(&FileObject->SectionObjectPointer->ImageSectionObject,
ImageSectionObject, 0))
{
reactos/ntoskrnl/mm
diff -u -r1.85 -r1.85.2.1
--- virtual.c 13 Nov 2004 22:27:16 -0000 1.85
+++ virtual.c 30 Dec 2004 04:37:01 -0000 1.85.2.1
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: virtual.c,v 1.85 2004/11/13 22:27:16 hbirr Exp $
+/* $Id: virtual.c,v 1.85.2.1 2004/12/30 04:37:01 hyperion Exp $
*
* PROJECT: ReactOS kernel
* FILE: ntoskrnl/mm/virtual.c
@@ -41,12 +41,12 @@
/*
* FUNCTION: Flushes virtual memory to file
* ARGUMENTS:
- * ProcessHandle = Points to the process that allocated the virtual
+ * ProcessHandle = Points to the process that allocated the virtual
* memory
* BaseAddress = Points to the memory address
* NumberOfBytesToFlush = Limits the range to flush,
* NumberOfBytesFlushed = Actual number of bytes flushed
- * RETURNS: Status
+ * RETURNS: Status
*/
{
UNIMPLEMENTED;
@@ -125,43 +125,18 @@
}
-/* (tMk 2004.II.4)
- * FUNCTION:
- * Called from VirtualQueryEx (lib\kernel32\mem\virtual.c)
- *
- */
-NTSTATUS STDCALL
-NtQueryVirtualMemory (IN HANDLE ProcessHandle,
+NTSTATUS FASTCALL
+MiQueryVirtualMemory (IN HANDLE ProcessHandle,
IN PVOID Address,
IN CINT VirtualMemoryInformationClass,
OUT PVOID VirtualMemoryInformation,
IN ULONG Length,
- OUT PULONG UnsafeResultLength)
+ OUT PULONG ResultLength)
{
NTSTATUS Status;
PEPROCESS Process;
MEMORY_AREA* MemoryArea;
- ULONG ResultLength = 0;
PMADDRESS_SPACE AddressSpace;
- KPROCESSOR_MODE PrevMode;
- union
- {
- MEMORY_BASIC_INFORMATION BasicInfo;
- }
- VirtualMemoryInfo;
-
- DPRINT("NtQueryVirtualMemory(ProcessHandle %x, Address %x, "
- "VirtualMemoryInformationClass %d, VirtualMemoryInformation %x, "
- "Length %lu ResultLength %x)\n",ProcessHandle,Address,
- VirtualMemoryInformationClass,VirtualMemoryInformation,
- Length,ResultLength);
-
- PrevMode = ExGetPreviousMode();
-
- if (PrevMode == UserMode && Address >= (PVOID)KERNEL_BASE)
- {
- return STATUS_INVALID_PARAMETER;
- }
if (Address < (PVOID)KERNEL_BASE)
{
@@ -190,14 +165,15 @@
{
case MemoryBasicInformation:
{
- PMEMORY_BASIC_INFORMATION Info = &VirtualMemoryInfo.BasicInfo;
+ PMEMORY_BASIC_INFORMATION Info =
+ (PMEMORY_BASIC_INFORMATION)VirtualMemoryInformation;
if (Length != sizeof(MEMORY_BASIC_INFORMATION))
{
MmUnlockAddressSpace(AddressSpace);
ObDereferenceObject(Process);
return(STATUS_INFO_LENGTH_MISMATCH);
}
-
+
if (MemoryArea == NULL)
{
Info->Type = 0;
@@ -208,19 +184,19 @@
Info->AllocationBase = NULL;
Info->RegionSize = MmFindGapAtAddress(AddressSpace, Info->BaseAddress);
Status = STATUS_SUCCESS;
- ResultLength = sizeof(MEMORY_BASIC_INFORMATION);
+ *ResultLength = sizeof(MEMORY_BASIC_INFORMATION);
}
- else
+ else
{
switch(MemoryArea->Type)
{
case MEMORY_AREA_VIRTUAL_MEMORY:
Status = MmQueryAnonMem(MemoryArea, Address, Info,
- &ResultLength);
+ ResultLength);
break;
case MEMORY_AREA_SECTION_VIEW:
Status = MmQuerySectionView(MemoryArea, Address, Info,
- &ResultLength);
+ ResultLength);
break;
case MEMORY_AREA_NO_ACCESS:
Info->Type = 0;
@@ -231,7 +207,7 @@
Info->AllocationBase = MemoryArea->BaseAddress;
Info->RegionSize = MemoryArea->Length;
Status = STATUS_SUCCESS;
- ResultLength = sizeof(MEMORY_BASIC_INFORMATION);
+ *ResultLength = sizeof(MEMORY_BASIC_INFORMATION);
break;
case MEMORY_AREA_SHARED_DATA:
Info->Type = 0;
@@ -242,11 +218,52 @@
Info->AllocationBase = MemoryArea->BaseAddress;
Info->RegionSize = MemoryArea->Length;
Status = STATUS_SUCCESS;
- ResultLength = sizeof(MEMORY_BASIC_INFORMATION);
+ *ResultLength = sizeof(MEMORY_BASIC_INFORMATION);
+ break;
+ case MEMORY_AREA_SYSTEM:
+ {
+ static int warned = 0;
+ if ( !warned )
+ {
+ DPRINT1("FIXME: MEMORY_AREA_SYSTEM case incomplete (or possibly wrong) for NtQueryVirtualMemory()\n");
+ warned = 1;
+ }
+ }
+ /* FIXME - don't have a clue if this is right, but it's better than nothing */
+ Info->Type = 0;
+ Info->State = MEM_COMMIT;
+ Info->Protect = MemoryArea->Attributes;
+ Info->AllocationProtect = MemoryArea->Attributes;
+ Info->BaseAddress = MemoryArea->BaseAddress;
+ Info->AllocationBase = MemoryArea->BaseAddress;
+ Info->RegionSize = MemoryArea->Length;
+ Status = STATUS_SUCCESS;
+ *ResultLength = sizeof(MEMORY_BASIC_INFORMATION);
+ break;
+ case MEMORY_AREA_KERNEL_STACK:
+ {
+ static int warned = 0;
+ if ( !warned )
+ {
+ DPRINT1("FIXME: MEMORY_AREA_KERNEL_STACK case incomplete (or possibly wrong) for NtQueryVirtualMemory()\n");
+ warned = 1;
+ }
+ }
+ /* FIXME - don't have a clue if this is right, but it's better than nothing */
+ Info->Type = 0;
+ Info->State = MEM_COMMIT;
+ Info->Protect = MemoryArea->Attributes;
+ Info->AllocationProtect = MemoryArea->Attributes;
+ Info->BaseAddress = MemoryArea->BaseAddress;
+ Info->AllocationBase = MemoryArea->BaseAddress;
+ Info->RegionSize = MemoryArea->Length;
+ Status = STATUS_SUCCESS;
+ *ResultLength = sizeof(MEMORY_BASIC_INFORMATION);
break;
default:
+ DPRINT1("unhandled memory area type: 0x%x\n", MemoryArea->Type);
Status = STATUS_UNSUCCESSFUL;
- ResultLength = 0;
+ *ResultLength = 0;
}
}
break;
@@ -255,7 +272,7 @@
default:
{
Status = STATUS_INVALID_INFO_CLASS;
- ResultLength = 0;
+ *ResultLength = 0;
break;
}
}
@@ -266,6 +283,52 @@
ObDereferenceObject(Process);
}
+ return Status;
+}
+
+/* (tMk 2004.II.4)
+ * FUNCTION:
+ * Called from VirtualQueryEx (lib\kernel32\mem\virtual.c)
+ *
+ */
+NTSTATUS STDCALL
+NtQueryVirtualMemory (IN HANDLE ProcessHandle,
+ IN PVOID Address,
+ IN CINT VirtualMemoryInformationClass,
+ OUT PVOID VirtualMemoryInformation,
+ IN ULONG Length,
+ OUT PULONG UnsafeResultLength)
+{
+ NTSTATUS Status;
+ ULONG ResultLength = 0;
+ KPROCESSOR_MODE PrevMode;
+ union
+ {
+ MEMORY_BASIC_INFORMATION BasicInfo;
+ }
+ VirtualMemoryInfo;
+
+ DPRINT("NtQueryVirtualMemory(ProcessHandle %x, Address %x, "
+ "VirtualMemoryInformationClass %d, VirtualMemoryInformation %x, "
+ "Length %lu ResultLength %x)\n",ProcessHandle,Address,
+ VirtualMemoryInformationClass,VirtualMemoryInformation,
+ Length,ResultLength);
+
+ PrevMode = ExGetPreviousMode();
+
+ if (PrevMode == UserMode && Address >= (PVOID)KERNEL_BASE)
+ {
+ DPRINT1("Invalid parameter\n");
+ return STATUS_INVALID_PARAMETER;
+ }
+
+ Status = MiQueryVirtualMemory ( ProcessHandle,
+ Address,
+ VirtualMemoryInformationClass,
+ &VirtualMemoryInfo,
+ Length,
+ &ResultLength );
+
if (NT_SUCCESS(Status) && ResultLength > 0)
{
Status = MmCopyToCaller(VirtualMemoryInformation, &VirtualMemoryInfo, ResultLength);
@@ -274,7 +337,7 @@
ResultLength = 0;
}
}
-
+
if (UnsafeResultLength != NULL)
{
MmCopyToCaller(UnsafeResultLength, &ResultLength, sizeof(ULONG));
@@ -284,7 +347,7 @@
/* (tMk 2004.II.5)
- * FUNCTION:
+ * FUNCTION:
* Called from VirtualProtectEx (lib\kernel32\mem\virtual.c)
*
*/
@@ -310,13 +373,13 @@
if (!NT_SUCCESS(Status))
return Status;
- // (tMk 2004.II.5) in Microsoft SDK I read:
+ // (tMk 2004.II.5) in Microsoft SDK I read:
// 'if this parameter is NULL or does not point to a valid variable, the function fails'
- if(UnsafeOldAccessProtection == NULL)
+ if(UnsafeOldAccessProtection == NULL)
{
return(STATUS_INVALID_PARAMETER);
}
-
+
NumberOfBytesToProtect =
PAGE_ROUND_UP(BaseAddress + NumberOfBytesToProtect) -
PAGE_ROUND_DOWN(BaseAddress);
@@ -372,7 +435,7 @@
/* (tMk 2004.II.05)
- * FUNCTION:
+ * FUNCTION:
* Called from ReadProcessMemory (lib\kernel32\mem\procmem.c) and KlInitPeb(lib\kernel32\process\create.c)
*
* NOTE: This function will be correct if MmProbeAndLockPages() would be fully IMPLEMENTED.
@@ -416,7 +479,7 @@
Mdl = MmCreateMdl(NULL,
Buffer,
NumberOfBytesToRead);
- if(Mdl == NULL)
+ if(Mdl == NULL)
{
ObDereferenceObject(Process);
return(STATUS_NO_MEMORY);
@@ -482,7 +545,7 @@
Mdl = MmCreateMdl(NULL,
BaseAddress,
NumberOfBytesToUnlock);
- if(Mdl == NULL)
+ if(Mdl == NULL)
{
ObDereferenceObject(Process);
return(STATUS_NO_MEMORY);
@@ -506,7 +569,7 @@
/* (tMk 2004.II.05)
* FUNCTION:
* Called from WriteProcessMemory (lib\kernel32\mem\procmem.c) and KlInitPeb(lib\kernel32\process\create.c)
- *
+ *
* NOTE: This function will be correct if MmProbeAndLockPages() would be fully IMPLEMENTED.
*/
NTSTATUS STDCALL
reactos/ntoskrnl/mm/i386
diff -u -r1.77.2.5 -r1.77.2.6
--- page.c 30 Dec 2004 01:59:59 -0000 1.77.2.5
+++ page.c 30 Dec 2004 04:37:01 -0000 1.77.2.6
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: page.c,v 1.77.2.5 2004/12/30 01:59:59 hyperion Exp $
+/* $Id: page.c,v 1.77.2.6 2004/12/30 04:37:01 hyperion Exp $
*
* PROJECT: ReactOS kernel
* FILE: ntoskrnl/mm/i386/page.c
reactos/ntoskrnl/nt
diff -u -r1.23 -r1.23.2.1
--- ntsem.c 24 Oct 2004 16:49:49 -0000 1.23
+++ ntsem.c 30 Dec 2004 04:37:01 -0000 1.23.2.1
@@ -1,4 +1,4 @@
-/* $Id: ntsem.c,v 1.23 2004/10/24 16:49:49 weiden Exp $
+/* $Id: ntsem.c,v 1.23.2.1 2004/12/30 04:37:01 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -17,7 +17,7 @@
/* GLOBALS ******************************************************************/
-POBJECT_TYPE ExSemaphoreType;
+POBJECT_TYPE ExSemaphoreObjectType;
static GENERIC_MAPPING ExSemaphoreMapping = {
STANDARD_RIGHTS_READ | SEMAPHORE_QUERY_STATE,
@@ -47,30 +47,30 @@
VOID INIT_FUNCTION
NtInitializeSemaphoreImplementation(VOID)
{
- ExSemaphoreType = ExAllocatePool(NonPagedPool, sizeof(OBJECT_TYPE));
+ ExSemaphoreObjectType = ExAllocatePool(NonPagedPool, sizeof(OBJECT_TYPE));
- RtlCreateUnicodeString(&ExSemaphoreType->TypeName, L"Semaphore");
+ RtlCreateUnicodeString(&ExSemaphoreObjectType->TypeName, L"Semaphore");
- ExSemaphoreType->Tag = TAG('S', 'E', 'M', 'T');
- ExSemaphoreType->MaxObjects = ULONG_MAX;
- ExSemaphoreType->MaxHandles = ULONG_MAX;
- ExSemaphoreType->TotalObjects = 0;
- ExSemaphoreType->TotalHandles = 0;
- ExSemaphoreType->PagedPoolCharge = 0;
- ExSemaphoreType->NonpagedPoolCharge = sizeof(KSEMAPHORE);
- ExSemaphoreType->Mapping = &ExSemaphoreMapping;
- ExSemaphoreType->Dump = NULL;
- ExSemaphoreType->Open = NULL;
- ExSemaphoreType->Close = NULL;
- ExSemaphoreType->Delete = NULL;
- ExSemaphoreType->Parse = NULL;
- ExSemaphoreType->Security = NULL;
- ExSemaphoreType->QueryName = NULL;
- ExSemaphoreType->OkayToClose = NULL;
- ExSemaphoreType->Create = NtpCreateSemaphore;
- ExSemaphoreType->DuplicationNotify = NULL;
+ ExSemaphoreObjectType->Tag = TAG('S', 'E', 'M', 'T');
+ ExSemaphoreObjectType->MaxObjects = ULONG_MAX;
+ ExSemaphoreObjectType->MaxHandles = ULONG_MAX;
+ ExSemaphoreObjectType->TotalObjects = 0;
+ ExSemaphoreObjectType->TotalHandles = 0;
+ ExSemaphoreObjectType->PagedPoolCharge = 0;
+ ExSemaphoreObjectType->NonpagedPoolCharge = sizeof(KSEMAPHORE);
+ ExSemaphoreObjectType->Mapping = &ExSemaphoreMapping;
+ ExSemaphoreObjectType->Dump = NULL;
+ ExSemaphoreObjectType->Open = NULL;
+ ExSemaphoreObjectType->Close = NULL;
+ ExSemaphoreObjectType->Delete = NULL;
+ ExSemaphoreObjectType->Parse = NULL;
+ ExSemaphoreObjectType->Security = NULL;
+ ExSemaphoreObjectType->QueryName = NULL;
+ ExSemaphoreObjectType->OkayToClose = NULL;
+ ExSemaphoreObjectType->Create = NtpCreateSemaphore;
+ ExSemaphoreObjectType->DuplicationNotify = NULL;
- ObpCreateTypeObject(ExSemaphoreType);
+ ObpCreateTypeObject(ExSemaphoreObjectType);
}
NTSTATUS STDCALL
@@ -84,7 +84,7 @@
NTSTATUS Status;
Status = ObCreateObject(ExGetPreviousMode(),
- ExSemaphoreType,
+ ExSemaphoreObjectType,
ObjectAttributes,
ExGetPreviousMode(),
NULL,
@@ -122,7 +122,7 @@
NTSTATUS Status;
Status = ObOpenObjectByName(ObjectAttributes,
- ExSemaphoreType,
+ ExSemaphoreObjectType,
NULL,
UserMode,
DesiredAccess,
@@ -154,7 +154,7 @@
Status = ObReferenceObjectByHandle(SemaphoreHandle,
SEMAPHORE_QUERY_STATE,
- ExSemaphoreType,
+ ExSemaphoreObjectType,
UserMode,
(PVOID*)&Semaphore,
NULL);
@@ -182,7 +182,7 @@
Status = ObReferenceObjectByHandle(SemaphoreHandle,
SEMAPHORE_MODIFY_STATE,
- ExSemaphoreType,
+ ExSemaphoreObjectType,
UserMode,
(PVOID*)&Semaphore,
NULL);
reactos/ntoskrnl/ps
diff -u -r1.2.2.3 -r1.2.2.4
--- cid.c 13 Dec 2004 16:18:14 -0000 1.2.2.3
+++ cid.c 30 Dec 2004 04:37:02 -0000 1.2.2.4
@@ -1,4 +1,4 @@
-/* $Id: cid.c,v 1.2.2.3 2004/12/13 16:18:14 hyperion Exp $
+/* $Id: cid.c,v 1.2.2.4 2004/12/30 04:37:02 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
reactos/ntoskrnl/ps
diff -u -r1.86.2.2 -r1.86.2.3
--- create.c 13 Dec 2004 16:18:14 -0000 1.86.2.2
+++ create.c 30 Dec 2004 04:37:02 -0000 1.86.2.3
@@ -1,4 +1,4 @@
-/* $Id: create.c,v 1.86.2.2 2004/12/13 16:18:14 hyperion Exp $
+/* $Id: create.c,v 1.86.2.3 2004/12/30 04:37:02 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -649,6 +649,7 @@
PTEB TebBase;
NTSTATUS Status;
PKAPC LdrInitApc;
+ KIRQL oldIrql;
DPRINT("NtCreateThread(ThreadHandle %x, PCONTEXT %x)\n",
ThreadHandle,ThreadContext);
@@ -735,10 +736,13 @@
* We must do this manually. Do NOT attempt to set the Thread to Alertable before the call,
* doing so is a blatant and erronous hack.
*/
- Thread->Tcb.ApcState.UserApcPending = TRUE;
- Thread->Tcb.Alerted[KernelMode] = TRUE;
+ Thread->Tcb.ApcState.UserApcPending = TRUE;
+ Thread->Tcb.Alerted[KernelMode] = TRUE;
+ oldIrql = KeAcquireDispatcherDatabaseLock ();
PsUnblockThread(Thread, NULL);
+ KeReleaseDispatcherDatabaseLock(oldIrql);
+
return(STATUS_SUCCESS);
}
@@ -774,6 +778,7 @@
{
PETHREAD Thread;
NTSTATUS Status;
+ KIRQL oldIrql;
DPRINT("PsCreateSystemThread(ThreadHandle %x, ProcessHandle %x)\n",
ThreadHandle,ProcessHandle);
@@ -801,7 +806,9 @@
*ClientId=Thread->Cid;
}
- PsUnblockThread(Thread, NULL);
+ oldIrql = KeAcquireDispatcherDatabaseLock ();
+ PsUnblockThread(Thread, NULL);
+ KeReleaseDispatcherDatabaseLock(oldIrql);
return(STATUS_SUCCESS);
}
reactos/ntoskrnl/ps
diff -u -r1.10 -r1.10.2.1
--- job.c 5 Nov 2004 13:30:18 -0000 1.10
+++ job.c 30 Dec 2004 04:37:02 -0000 1.10.2.1
@@ -265,7 +265,7 @@
ULONG UIRestrictionsClass)
{
ASSERT(Job);
- InterlockedExchange((LONG*)&Job->UIRestrictionsClass, (LONG)UIRestrictionsClass);
+ InterlockedExchangeUL(&Job->UIRestrictionsClass, UIRestrictionsClass);
/* FIXME - walk through the job process list and update the restrictions? */
}
reactos/ntoskrnl/ps
diff -u -r1.86.2.3 -r1.86.2.4
--- kill.c 13 Dec 2004 16:18:15 -0000 1.86.2.3
+++ kill.c 30 Dec 2004 04:37:02 -0000 1.86.2.4
@@ -1,4 +1,4 @@
-/* $Id: kill.c,v 1.86.2.3 2004/12/13 16:18:15 hyperion Exp $
+/* $Id: kill.c,v 1.86.2.4 2004/12/30 04:37:02 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -300,8 +300,8 @@
ObGetObjectHandleCount(Process));
ObReferenceObject(Process);
- if (InterlockedExchange((PLONG)&Process->Pcb.State,
- PROCESS_STATE_TERMINATED) ==
+ if (InterlockedExchangeUL(&Process->Pcb.State,
+ PROCESS_STATE_TERMINATED) ==
PROCESS_STATE_TERMINATED)
{
ObDereferenceObject(Process);
reactos/ntoskrnl/ps
diff -u -r1.157.2.3 -r1.157.2.4
--- process.c 13 Dec 2004 16:18:16 -0000 1.157.2.3
+++ process.c 30 Dec 2004 04:37:02 -0000 1.157.2.4
@@ -1,4 +1,4 @@
-/* $Id: process.c,v 1.157.2.3 2004/12/13 16:18:16 hyperion Exp $
+/* $Id: process.c,v 1.157.2.4 2004/12/30 04:37:02 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -333,7 +333,7 @@
#endif
PsInitialSystemProcess->UniqueProcessId =
- InterlockedIncrement((LONG *)&PiNextProcessUniqueId); /* TODO */
+ InterlockedIncrementUL(&PiNextProcessUniqueId); /* TODO */
PsInitialSystemProcess->Win32WindowStation = (HANDLE)0;
KeAcquireSpinLock(&PsProcessListLock, &oldIrql);
@@ -499,7 +499,7 @@
Peb->OSMajorVersion = 4;
Peb->OSMinorVersion = 0;
- Peb->OSBuildNumber = 0;
+ Peb->OSBuildNumber = 1381;
Peb->OSPlatformId = 2; //VER_PLATFORM_WIN32_NT;
Peb->SPMajorVersion = 6;
@@ -714,7 +714,7 @@
KProcess->AutoAlignment = 0;
MmInitializeAddressSpace(Process,
&Process->AddressSpace);
- Process->UniqueProcessId = InterlockedIncrement((LONG *)&PiNextProcessUniqueId); /* TODO */
+ Process->UniqueProcessId = InterlockedIncrementUL(&PiNextProcessUniqueId); /* TODO */
Process->InheritedFromUniqueProcessId =
(HANDLE)pParentProcess->UniqueProcessId;
ObCreateHandleTable(pParentProcess,
@@ -2251,12 +2251,12 @@
return STATUS_PROCESS_IS_TERMINATING;
}
- /* FIXME - why don't we have InterlockedCompareExchangePointer in ntoskrnl?! */
- PrevLockOwner = (PKTHREAD)InterlockedCompareExchange((LONG*)&Process->LockOwner, (LONG)CallingThread, (LONG)NULL);
+ PrevLockOwner = (PKTHREAD)InterlockedCompareExchangePointer(
+ &Process->LockOwner, CallingThread, NULL);
if(PrevLockOwner == NULL || PrevLockOwner == CallingThread)
{
/* we got the lock or already locked it */
- if(InterlockedIncrement((LONG*)&Process->LockCount) == 1)
+ if(InterlockedIncrementUL(&Process->LockCount) == 1)
{
KeClearEvent(&Process->LockEvent);
}
@@ -2293,10 +2293,9 @@
{
ASSERT(Process->LockOwner == KeGetCurrentThread());
- if(InterlockedDecrement((LONG*)&Process->LockCount) == 0)
+ if(InterlockedDecrementUL(&Process->LockCount) == 0)
{
- /* FIXME - why don't we have InterlockedExchangePointer in ntoskrnl?! */
- InterlockedExchange((LONG*)&Process->LockOwner, (LONG)NULL);
+ InterlockedExchangePointer(&Process->LockOwner, NULL);
KeSetEvent(&Process->LockEvent, IO_NO_INCREMENT, FALSE);
}
reactos/ntoskrnl/ps
diff -u -r1.138.2.3 -r1.138.2.4
--- thread.c 13 Dec 2004 16:18:16 -0000 1.138.2.3
+++ thread.c 30 Dec 2004 04:37:02 -0000 1.138.2.4
@@ -1,4 +1,4 @@
-/* $Id: thread.c,v 1.138.2.3 2004/12/13 16:18:16 hyperion Exp $
+/* $Id: thread.c,v 1.138.2.4 2004/12/30 04:37:02 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
reactos/ntoskrnl/ps
diff -u -r1.18.2.3 -r1.18.2.4
--- w32call.c 13 Dec 2004 16:18:16 -0000 1.18.2.3
+++ w32call.c 30 Dec 2004 04:37:02 -0000 1.18.2.4
@@ -1,4 +1,4 @@
-/* $Id: w32call.c,v 1.18.2.3 2004/12/13 16:18:16 hyperion Exp $
+/* $Id: w32call.c,v 1.18.2.4 2004/12/30 04:37:02 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
reactos/ntoskrnl/se
diff -u -r1.21.2.2 -r1.21.2.3
--- acl.c 13 Dec 2004 16:18:16 -0000 1.21.2.2
+++ acl.c 30 Dec 2004 04:37:04 -0000 1.21.2.3
@@ -1,4 +1,4 @@
-/* $Id: acl.c,v 1.21.2.2 2004/12/13 16:18:16 hyperion Exp $
+/* $Id: acl.c,v 1.21.2.3 2004/12/30 04:37:04 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
reactos/ntoskrnl/se
diff -u -r1.42.2.2 -r1.42.2.3
--- token.c 13 Dec 2004 16:18:16 -0000 1.42.2.2
+++ token.c 30 Dec 2004 04:37:04 -0000 1.42.2.3
@@ -1,4 +1,4 @@
-/* $Id: token.c,v 1.42.2.2 2004/12/13 16:18:16 hyperion Exp $
+/* $Id: token.c,v 1.42.2.3 2004/12/30 04:37:04 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -913,8 +913,16 @@
NeededAccess = TOKEN_ADJUST_DEFAULT;
break;
+ case TokenDefaultDacl:
+ if (TokenInformationLength < sizeof(TOKEN_DEFAULT_DACL))
+ return STATUS_BUFFER_TOO_SMALL;
+ NeededAccess = TOKEN_ADJUST_DEFAULT;
+ break;
+
default:
- return STATUS_NOT_IMPLEMENTED;
+ DPRINT1("NtSetInformationToken: lying about success (stub) - %x\n", TokenInformationClass);
+ return STATUS_SUCCESS;
+
}
Status = ObReferenceObjectByHandle(TokenHandle,
@@ -952,6 +960,55 @@
"Token->PrimaryGroup = 0x%08x\n", Token->PrimaryGroup);
break;
+ case TokenDefaultDacl:
+ {
+ TOKEN_DEFAULT_DACL TokenDefaultDacl = { 0 };
+ ACL OldAcl;
+ PACL NewAcl;
+
+ Status = MmCopyFromCaller( &TokenDefaultDacl, TokenInformation,
+ sizeof(TOKEN_DEFAULT_DACL) );
+ if (!NT_SUCCESS(Status))
+ {
+ Status = STATUS_INVALID_PARAMETER;
+ break;
+ }
+
+ Status = MmCopyFromCaller( &OldAcl, TokenDefaultDacl.DefaultDacl,
+ sizeof(ACL) );
+ if (!NT_SUCCESS(Status))
+ {
+ Status = STATUS_INVALID_PARAMETER;
+ break;
+ }
+
+ NewAcl = ExAllocatePool(NonPagedPool, sizeof(ACL));
+ if (NewAcl == NULL)
+ {
+ Status = STATUS_INSUFFICIENT_RESOURCES;
+ break;
+ }
+
+ Status = MmCopyFromCaller( NewAcl, TokenDefaultDacl.DefaultDacl,
+ OldAcl.AclSize );
+ if (!NT_SUCCESS(Status))
+ {
+ Status = STATUS_INVALID_PARAMETER;
+ ExFreePool(NewAcl);
+ break;
+ }
+
+ if (Token->DefaultDacl)
+ {
+ ExFreePool(Token->DefaultDacl);
+ }
+
+ Token->DefaultDacl = NewAcl;
+
+ Status = STATUS_SUCCESS;
+ break;
+ }
+
default:
Status = STATUS_NOT_IMPLEMENTED;
break;
@@ -965,12 +1022,16 @@
/*
* @implemented
+ *
+ * NOTE: Some sources claim 4th param is ImpersonationLevel, but on W2K
+ * this is certainly NOT true, thou i can't say for sure that EffectiveOnly
+ * is correct either. -Gunnar
*/
NTSTATUS STDCALL
NtDuplicateToken(IN HANDLE ExistingTokenHandle,
IN ACCESS_MASK DesiredAccess,
- IN POBJECT_ATTRIBUTES ObjectAttributes,
- IN BOOLEAN EffectiveOnly,
+ IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL /*is it really optional?*/,
+ IN BOOLEAN EffectiveOnly,
IN TOKEN_TYPE TokenType,
OUT PHANDLE NewTokenHandle)
{
@@ -996,7 +1057,9 @@
ObjectAttributes,
EffectiveOnly,
TokenType,
- ObjectAttributes->SecurityQualityOfService->ImpersonationLevel,
+ ObjectAttributes->SecurityQualityOfService ?
+ ObjectAttributes->SecurityQualityOfService->ImpersonationLevel :
+ 0 /*SecurityAnonymous*/,
PreviousMode,
&NewToken);
reactos/regtests/shared
diff -u -r1.12.2.1 -r1.12.2.2
--- regtests.h 8 Dec 2004 21:57:38 -0000 1.12.2.1
+++ regtests.h 30 Dec 2004 04:37:04 -0000 1.12.2.2
@@ -147,8 +147,6 @@
TestRoutine Routine;
} ROS_TEST, *PROS_TEST;
-extern LIST_ENTRY AllTests;
-
extern VOID InitializeTests();
extern VOID RegisterTests();
extern VOID PerformTests(TestOutputRoutine OutputRoutine, LPSTR TestName);
reactos/subsys/csrss/api
diff -u -r1.36 -r1.36.2.1
--- process.c 14 Nov 2004 18:47:10 -0000 1.36
+++ process.c 30 Dec 2004 04:37:04 -0000 1.36.2.1
@@ -1,4 +1,4 @@
-/* $Id: process.c,v 1.36 2004/11/14 18:47:10 hbirr Exp $
+/* $Id: process.c,v 1.36.2.1 2004/12/30 04:37:04 hyperion Exp $
*
* reactos/subsys/csrss/api/process.c
*
@@ -204,6 +204,7 @@
Reply->Status = ApiReply.Status;
if (! NT_SUCCESS(Reply->Status))
{
+ CsrFreeProcessData(Request->Data.CreateProcessRequest.NewProcessId);
return Reply->Status;
}
Reply->Data.CreateProcessReply.InputHandle = ApiReply.Data.AllocConsoleReply.InputHandle;
@@ -259,8 +260,6 @@
CSR_API(CsrTerminateProcess)
{
- NTSTATUS Status;
-
Reply->Header.MessageSize = sizeof(CSRSS_API_REPLY) - LPC_MESSAGE_BASE_SIZE;
Reply->Header.DataSize = sizeof(CSRSS_API_REPLY);
@@ -269,10 +268,8 @@
return(Reply->Status = STATUS_INVALID_PARAMETER);
}
- Status = CsrFreeProcessData(ProcessData->ProcessId);
-
- Reply->Status = Status;
- return Status;
+ Reply->Status = STATUS_SUCCESS;
+ return STATUS_SUCCESS;
}
CSR_API(CsrConnectProcess)
reactos/subsys/csrss/include
diff -u -r1.2 -r1.2.24.1
--- desktopbg.h 11 Jan 2004 17:31:15 -0000 1.2
+++ desktopbg.h 30 Dec 2004 04:37:04 -0000 1.2.24.1
@@ -1,4 +1,4 @@
-/* $Id: desktopbg.h,v 1.2 2004/01/11 17:31:15 gvg Exp $
+/* $Id: desktopbg.h,v 1.2.24.1 2004/12/30 04:37:04 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
@@ -15,6 +15,7 @@
CSR_API(CsrCreateDesktop);
CSR_API(CsrShowDesktop);
CSR_API(CsrHideDesktop);
+CSR_API(CsrRegisterSystemClasses);
BOOL FASTCALL DtbgIsDesktopVisible(VOID);
reactos/subsys/csrss/win32csr
diff -u -r1.17 -r1.17.2.1
--- conio.c 14 Nov 2004 18:47:10 -0000 1.17
+++ conio.c 30 Dec 2004 04:37:04 -0000 1.17.2.1
@@ -1,4 +1,4 @@
-/* $Id: conio.c,v 1.17 2004/11/14 18:47:10 hbirr Exp $
+/* $Id: conio.c,v 1.17.2.1 2004/12/30 04:37:04 hyperion Exp $
*
* reactos/subsys/csrss/win32csr/conio.c
*
@@ -219,6 +219,7 @@
NewBuffer = HeapAlloc(Win32CsrApiHeap, 0, sizeof(CSRSS_SCREEN_BUFFER));
if (NULL == NewBuffer)
{
+ ConioCleanupConsole(Console);
RtlFreeUnicodeString(&Console->Title);
RtlDeleteCriticalSection(&Console->Header.Lock);
CloseHandle(Console->ActiveEvent);
@@ -227,6 +228,7 @@
Status = CsrInitConsoleScreenBuffer(Console, NewBuffer);
if (! NT_SUCCESS(Status))
{
+ ConioCleanupConsole(Console);
RtlFreeUnicodeString(&Console->Title);
RtlDeleteCriticalSection(&Console->Header.Lock);
CloseHandle(Console->ActiveEvent);
@@ -530,7 +532,7 @@
{
PLIST_ENTRY CurrentEntry;
ConsoleInput *Input;
- PCHAR Buffer;
+ PUCHAR Buffer;
PWCHAR UnicodeBuffer;
int i;
ULONG nNumberOfCharsToRead, CharSize;
@@ -892,7 +894,7 @@
CSR_API(CsrWriteConsole)
{
NTSTATUS Status;
- BYTE *Buffer = Request->Data.WriteConsoleRequest.Buffer;
+ PCHAR Buffer = (PCHAR)Request->Data.WriteConsoleRequest.Buffer;
PCSRSS_SCREEN_BUFFER Buff;
PCSRSS_CONSOLE Console;
ULONG CharSize = (Request->Data.WriteConsoleRequest.Unicode ? sizeof(WCHAR) : sizeof(CHAR));
@@ -1502,7 +1504,7 @@
CSR_API(CsrWriteConsoleOutputChar)
{
NTSTATUS Status;
- PBYTE String = Request->Data.WriteConsoleOutputCharRequest.String;
+ PCHAR String = (PCHAR)Request->Data.WriteConsoleOutputCharRequest.String;
PBYTE Buffer;
PCSRSS_CONSOLE Console;
PCSRSS_SCREEN_BUFFER Buff;
@@ -1593,7 +1595,7 @@
PCSRSS_CONSOLE Console;
PCSRSS_SCREEN_BUFFER Buff;
DWORD X, Y, Length, Written = 0;
- BYTE Char;
+ CHAR Char;
PBYTE Buffer;
RECT UpdateRect;
@@ -1781,7 +1783,7 @@
Y = (Request->Data.WriteConsoleOutputAttribRequest.Coord.Y + Buff->ShowY) % Buff->MaxY;
Length = Request->Data.WriteConsoleOutputAttribRequest.Length;
Buffer = &Buff->Buffer[2 * (Y * Buff->MaxX + X) + 1];
- Attribute = Request->Data.WriteConsoleOutputAttribRequest.String;
+ Attribute = (PUCHAR)Request->Data.WriteConsoleOutputAttribRequest.String;
while (Length--)
{
*Buffer = *Attribute++;
@@ -1820,7 +1822,7 @@
CSR_API(CsrFillOutputAttrib)
{
PCSRSS_SCREEN_BUFFER Buff;
- PCHAR Buffer;
+ PUCHAR Buffer;
NTSTATUS Status;
int X, Y, Length;
UCHAR Attr;
@@ -2522,7 +2524,7 @@
PCSRSS_CONSOLE Console;
PCSRSS_SCREEN_BUFFER Buff;
DWORD Xpos, Ypos;
- BYTE* ReadBuffer;
+ PCHAR ReadBuffer;
DWORD i;
ULONG CharSize;
CHAR Char;
@@ -2836,7 +2838,7 @@
if (Request->Data.ReadConsoleOutputRequest.Unicode)
{
MultiByteToWideChar(CodePage, 0,
- &GET_CELL_BUFFER(Buff, Offset), 1,
+ (PCHAR)&GET_CELL_BUFFER(Buff, Offset), 1,
&CurCharInfo->Char.UnicodeChar, 1);
}
else
reactos/subsys/csrss/win32csr
diff -u -r1.11.2.3 -r1.11.2.4
--- desktopbg.c 13 Dec 2004 16:18:16 -0000 1.11.2.3
+++ desktopbg.c 30 Dec 2004 04:37:05 -0000 1.11.2.4
@@ -1,4 +1,4 @@
-/* $Id: desktopbg.c,v 1.11.2.3 2004/12/13 16:18:16 hyperion Exp $
+/* $Id: desktopbg.c,v 1.11.2.4 2004/12/30 04:37:05 hyperion Exp $
*
* reactos/subsys/csrss/win32csr/desktopbg.c
*
reactos/subsys/csrss/win32csr
diff -u -r1.7 -r1.7.8.1
--- dllmain.c 22 Aug 2004 20:52:28 -0000 1.7
+++ dllmain.c 30 Dec 2004 04:37:05 -0000 1.7.8.1
@@ -1,4 +1,4 @@
-/* $Id: dllmain.c,v 1.7 2004/08/22 20:52:28 navaraf Exp $
+/* $Id: dllmain.c,v 1.7.8.1 2004/12/30 04:37:05 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
reactos/subsys/csrss/win32csr
diff -u -r1.22.2.3 -r1.22.2.4
--- guiconsole.c 13 Dec 2004 16:18:16 -0000 1.22.2.3
+++ guiconsole.c 30 Dec 2004 04:37:05 -0000 1.22.2.4
@@ -1,4 +1,4 @@
-/* $Id: guiconsole.c,v 1.22.2.3 2004/12/13 16:18:16 hyperion Exp $
+/* $Id: guiconsole.c,v 1.22.2.4 2004/12/30 04:37:05 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
@@ -317,7 +317,7 @@
LastAttribute = Attribute;
}
}
- MultiByteToWideChar(Console->OutputCodePage, 0, From, 1, To, 1);
+ MultiByteToWideChar(Console->OutputCodePage, 0, (PCHAR)From, 1, To, 1);
To++;
From += 2;
}
@@ -793,6 +793,7 @@
{
HWND NewWindow;
LONG WindowCount;
+ MSG Msg;
PCSRSS_CONSOLE Console = (PCSRSS_CONSOLE) lParam;
switch(msg)
@@ -820,6 +821,14 @@
}
return (LRESULT) NewWindow;
case PM_DESTROY_CONSOLE:
+ /* Window creation is done using a PostMessage(), so it's possible that the
+ * window that we want to destroy doesn't exist yet. So first empty the message
+ * queue */
+ while(PeekMessageW(&Msg, NULL, 0, 0, PM_REMOVE))
+ {
+ TranslateMessage(&Msg);
+ DispatchMessageW(&Msg);
+ }
DestroyWindow(Console->hWindow);
Console->hWindow = NULL;
WindowCount = GetWindowLongW(hWnd, GWL_USERDATA);
reactos/subsys/csrss/win32csr
diff -u -r1.2 -r1.2.8.1
--- tuiconsole.c 20 Jul 2004 11:06:47 -0000 1.2
+++ tuiconsole.c 30 Dec 2004 04:37:05 -0000 1.2.8.1
@@ -1,4 +1,4 @@
-/* $Id: tuiconsole.c,v 1.2 2004/07/20 11:06:47 navaraf Exp $
+/* $Id: tuiconsole.c,v 1.2.8.1 2004/12/30 04:37:05 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
@@ -61,7 +61,7 @@
TuiCopyRect(char *Dest, PCSRSS_SCREEN_BUFFER Buff, RECT *Region)
{
UINT SrcDelta, DestDelta, i;
- char *Src, *SrcEnd;
+ PBYTE Src, SrcEnd;
Src = Buff->Buffer + (((Region->top + Buff->ShowY) % Buff->MaxY) * Buff->MaxX
+ Region->left + Buff->ShowX) * 2;
reactos/subsys/system/calc
diff -u -r1.1 -r1.1.2.1
--- makefile 21 Nov 2004 21:02:03 -0000 1.1
+++ makefile 30 Dec 2004 04:37:05 -0000 1.1.2.1
@@ -6,6 +6,8 @@
TARGET_NAME = calc
+TARGET_INSTALLDIR = system32
+
TARGET_CFLAGS = -D__USE_W32API -D_WIN32_IE=0x0501
TARGET_RCFLAGS = -D__USE_W32API -D_WIN32_IE=0x0501
reactos/subsys/system/cmd
diff -u -r1.12 -r1.12.2.1
--- dir.c 8 Nov 2004 02:16:06 -0000 1.12
+++ dir.c 30 Dec 2004 04:37:05 -0000 1.12.2.1
@@ -1,4 +1,4 @@
-/* $Id: dir.c,v 1.12 2004/11/08 02:16:06 weiden Exp $
+/* $Id: dir.c,v 1.12.2.1 2004/12/30 04:37:05 hyperion Exp $
*
* DIR.C - dir internal command.
*
@@ -855,7 +855,7 @@
ULONG filecount = 0;
ULONG dircount = 0;
INT count = 0;
- USHORT screenwidth;
+ SHORT screenwidth;
INT longestfname = 0;
bytecount.QuadPart = 0;
reactos/subsys/system/cmd
diff -u -r1.6 -r1.6.2.1
--- filecomp.c 8 Nov 2004 02:16:06 -0000 1.6
+++ filecomp.c 30 Dec 2004 04:37:05 -0000 1.6.2.1
@@ -32,7 +32,8 @@
INT curplace = 0;
INT start;
INT count;
- INT step, c;
+ INT step;
+ INT c = 0;
BOOL found_dot = FALSE;
BOOL perfectmatch = TRUE;
TCHAR path[MAX_PATH];
reactos/subsys/system/cmd
diff -u -r1.5 -r1.5.2.1
--- ver.c 8 Nov 2004 02:16:06 -0000 1.5
+++ ver.c 30 Dec 2004 04:37:05 -0000 1.5.2.1
@@ -27,17 +27,27 @@
VOID ShortVersion (VOID)
{
OSVERSIONINFO VersionInfo;
+ unsigned RosVersionLen;
+ LPTSTR RosVersion;
ConOutPuts (_T("\n"
SHELLINFO));
VersionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
- if (GetVersionEx(&VersionInfo) && 0 == _tcsnicmp(VersionInfo.szCSDVersion, _T("ReactOS"), 7))
- {
- ConOutPrintf(_T("%S running on %s"), SHELLVER, VersionInfo.szCSDVersion);
- }
- else
- {
+#ifdef _UNICODE
ConOutPrintf(_T("%S"), SHELLVER);
+#else
+ ConOutPrintf(_T("%s"), SHELLVER);
+#endif /* _UNICODE */
+ memset(VersionInfo.szCSDVersion, 0, sizeof(VersionInfo.szCSDVersion));
+ if (GetVersionEx(&VersionInfo))
+ {
+ RosVersion = VersionInfo.szCSDVersion + _tcslen(VersionInfo.szCSDVersion) + 1;
+ RosVersionLen = sizeof(VersionInfo.szCSDVersion) / sizeof(VersionInfo.szCSDVersion[0]) -
+ (RosVersion - VersionInfo.szCSDVersion);
+ if (7 <= RosVersionLen && 0 == _tcsnicmp(RosVersion, _T("ReactOS"), 7))
+ {
+ ConOutPrintf(_T(" running on %s"), RosVersion);
+ }
}
ConOutPuts (_T("\n"));
}
reactos/subsys/system/expand
diff -u -r1.2 -r1.2.28.1
--- makefile 16 Nov 2003 21:45:50 -0000 1.2
+++ makefile 30 Dec 2004 04:37:05 -0000 1.2.28.1
@@ -10,6 +10,8 @@
TARGET_NAME = expand
+TARGET_INSTALLDIR = system32
+
TARGET_CFLAGS = -D__USE_W32API
TARGET_SDKLIBS = lz32.a
reactos/subsys/system/explorer/taskbar
diff -u -r1.95 -r1.95.8.1
--- startmenu.cpp 4 Aug 2004 18:19:01 -0000 1.95
+++ startmenu.cpp 30 Dec 2004 04:37:05 -0000 1.95.8.1
@@ -2113,8 +2113,11 @@
Bookmark& bookmark = *node._pbookmark;
String url = bookmark._url;
+ HWND hparent = GetParent(_hwnd);
+
CloseStartMenu(id);
- launch_file(GetParent(_hwnd), url, SW_SHOWNORMAL);
+
+ launch_file(hparent, url, SW_SHOWNORMAL);
}
return 0;
reactos/subsys/system/format
diff -u -r1.2 -r1.2.28.1
--- makefile 14 Nov 2003 17:13:32 -0000 1.2
+++ makefile 30 Dec 2004 04:37:05 -0000 1.2.28.1
@@ -1,4 +1,4 @@
-# $Id: makefile,v 1.2 2003/11/14 17:13:32 weiden Exp $
+# $Id: makefile,v 1.2.28.1 2004/12/30 04:37:05 hyperion Exp $
PATH_TO_TOP = ../../..
@@ -12,6 +12,8 @@
TARGET_NAME = format
+TARGET_INSTALLDIR = system32
+
TARGET_CFLAGS = -Werror -Wall -Wno-format
TARGET_OBJECTS = \
reactos/subsys/system/regedit
diff -u -r1.5 -r1.5.8.1
--- makefile 18 Aug 2004 02:16:00 -0000 1.5
+++ makefile 30 Dec 2004 04:37:05 -0000 1.5.8.1
@@ -12,6 +12,8 @@
TARGET_NAME = regedit
+TARGET_INSTALLDIR = .
+
TARGET_CFLAGS = -D_WIN32_IE=0x0501 -D_WIN32_WINNT=0x0501 -D__USE_W32API
TARGET_SDKLIBS = kernel32.a advapi32.a user32.a gdi32.a wine_uuid.a ole32.a \
reactos/subsys/system/regedt32
diff -u -r1.1 -r1.1.2.1
--- Makefile 21 Nov 2004 21:02:04 -0000 1.1
+++ Makefile 30 Dec 2004 04:37:06 -0000 1.1.2.1
@@ -6,6 +6,8 @@
TARGET_NAME = regedt32
+TARGET_INSTALLDIR = system32
+
TARGET_CFLAGS = -DGCC \
-D__USE_W32API \
-D__REACTOS__ \
reactos/subsys/system/setup
diff -u -r1.4 -r1.4.8.1
--- makefile 18 Aug 2004 02:16:00 -0000 1.4
+++ makefile 30 Dec 2004 04:37:06 -0000 1.4.8.1
@@ -1,4 +1,4 @@
-# $Id: makefile,v 1.4 2004/08/18 02:16:00 navaraf Exp $
+# $Id: makefile,v 1.4.8.1 2004/12/30 04:37:06 hyperion Exp $
PATH_TO_TOP = ../../..
@@ -10,9 +10,7 @@
TARGET_INSTALLDIR = system32
-TARGET_SDKLIBS = kernel32.a ole32.a shell32.a shlwapi.a
-
-TARGET_GCCLIBS = uuid
+TARGET_SDKLIBS = kernel32.a
TARGET_CFLAGS = -Wall -Werror -D__USE_W32API -D_WIN32_IE=0x0400
reactos/subsys/system/setup
diff -u -r1.2 -r1.2.24.1
--- setup.c 14 Jan 2004 23:17:50 -0000 1.2
+++ setup.c 30 Dec 2004 04:37:06 -0000 1.2.24.1
@@ -26,27 +26,23 @@
#include <windows.h>
#include <tchar.h>
-
#include <syssetup.h>
-#include <shlobj.h>
-#include <objidl.h>
-#include <shlwapi.h>
+#define NDEBUG
+#include <debug.h>
-#define DEBUG
typedef DWORD STDCALL (*PINSTALL_REACTOS)(HINSTANCE hInstance);
/* FUNCTIONS ****************************************************************/
-
LPTSTR lstrchr(LPCTSTR s, TCHAR c)
{
while (*s)
{
if (*s == c)
- return (LPTSTR)s;
+ return (LPTSTR)s;
s++;
}
@@ -57,74 +53,6 @@
}
-HRESULT CreateShellLink(LPCSTR linkPath, LPCSTR cmd, LPCSTR arg, LPCSTR dir, LPCSTR iconPath, int icon_nr, LPCSTR comment)
-{
- IShellLinkA* psl;
- IPersistFile* ppf;
- WCHAR buffer[MAX_PATH];
-
- HRESULT hr = CoCreateInstance(&CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, &IID_IShellLink, (LPVOID*)&psl);
-
- if (SUCCEEDED(hr))
- {
- hr = psl->lpVtbl->SetPath(psl, cmd);
-
- if (arg)
- {
- hr = psl->lpVtbl->SetArguments(psl, arg);
- }
-
- if (dir)
- {
- hr = psl->lpVtbl->SetWorkingDirectory(psl, dir);
- }
-
- if (iconPath)
- {
- hr = psl->lpVtbl->SetIconLocation(psl, iconPath, icon_nr);
- }
-
- if (comment)
- {
- hr = psl->lpVtbl->SetDescription(psl, comment);
- }
-
- hr = psl->lpVtbl->QueryInterface(psl, &IID_IPersistFile, (LPVOID*)&ppf);
-
- if (SUCCEEDED(hr))
- {
- MultiByteToWideChar(CP_ACP, 0, linkPath, -1, buffer, MAX_PATH);
-
- hr = ppf->lpVtbl->Save(ppf, buffer, TRUE);
-
- ppf->lpVtbl->Release(ppf);
- }
-
- psl->lpVtbl->Release(psl);
- }
-
- return hr;
-}
-
-
-static VOID
-CreateCmdLink()
-{
- char path[MAX_PATH];
- LPSTR p;
-
- CoInitialize(NULL);
-
- SHGetSpecialFolderPathA(0, path, CSIDL_DESKTOP, TRUE);
- p = PathAddBackslashA(path);
-
- strcpy(p, "Command Prompt.lnk");
- CreateShellLink(path, "cmd.exe", "", NULL, NULL, 0, "Open command prompt");
-
- CoUninitialize();
-}
-
-
static VOID
RunNewSetup (HINSTANCE hInstance)
{
@@ -134,22 +62,16 @@
hDll = LoadLibrary (TEXT("syssetup"));
if (hDll == NULL)
{
-#ifdef DEBUG
- OutputDebugString (TEXT("Failed to load 'syssetup'!\n"));
-#endif
+ DPRINT("Failed to load 'syssetup'!\n");
return;
}
-#ifdef DEBUG
- OutputDebugString (TEXT("Loaded 'syssetup'!\n"));
-#endif
+ DPRINT("Loaded 'syssetup'!\n");
InstallReactOS = (PINSTALL_REACTOS)GetProcAddress (hDll, "InstallReactOS");
if (InstallReactOS == NULL)
{
-#ifdef DEBUG
- OutputDebugString (TEXT("Failed to get address for 'InstallReactOS()'!\n"));
-#endif
+ DPRINT("Failed to get address for 'InstallReactOS()'!\n");
FreeLibrary (hDll);
return;
}
@@ -157,8 +79,6 @@
InstallReactOS (hInstance);
FreeLibrary (hDll);
-
- CreateCmdLink();
}
@@ -173,11 +93,7 @@
CmdLine = GetCommandLine ();
-#ifdef DEBUG
- OutputDebugString (TEXT("CmdLine: <"));
- OutputDebugString (CmdLine);
- OutputDebugString (TEXT(">\n"));
-#endif
+ DPRINT("CmdLine: <%s>\n",CmdLine);
p = lstrchr (CmdLine, TEXT('-'));
if (p == NULL)
reactos/subsys/system/taskmgr
diff -u -r1.3 -r1.3.4.1
--- dbgchnl.c 11 Oct 2004 21:08:05 -0000 1.3
+++ dbgchnl.c 30 Dec 2004 04:37:06 -0000 1.3.4.1
@@ -249,7 +249,7 @@
struct dll_option_layout dol;
int i, j, ret = 1;
void* buf_addr;
- unsigned char buffer[32];
+ char buffer[32];
void* addr;
const char** cache = NULL;
unsigned num_cache, used_cache;
reactos/subsys/system/taskmgr
diff -u -r1.4 -r1.4.8.1
--- makefile 15 Aug 2004 22:40:34 -0000 1.4
+++ makefile 30 Dec 2004 04:37:06 -0000 1.4.8.1
@@ -12,6 +12,8 @@
TARGET_NAME = taskmgr
+TARGET_INSTALLDIR = system32
+
TARGET_PCH = precomp.h
TARGET_CFLAGS = -Werror -Wall -DDBG -D_WIN32_IE=0x0501 -D_WIN32_WINNT=0x0501 -D__USE_W32API
reactos/subsys/system/userinit
diff -u -r1.5 -r1.5.8.1
--- userinit.c 17 Aug 2004 21:49:51 -0000 1.5
+++ userinit.c 30 Dec 2004 04:37:06 -0000 1.5.8.1
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: userinit.c,v 1.5 2004/08/17 21:49:51 weiden Exp $
+/* $Id: userinit.c,v 1.5.8.1 2004/12/30 04:37:06 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS Userinit Logon Application
@@ -97,6 +97,7 @@
&si,
&pi))
{
+ WaitForSingleObject(pi.hProcess, INFINITE);
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
}
reactos/subsys/system/usetup
diff -u -r1.15 -r1.15.8.1
--- bootsup.c 15 Aug 2004 22:29:50 -0000 1.15
+++ bootsup.c 30 Dec 2004 04:37:06 -0000 1.15.8.1
@@ -173,6 +173,13 @@
INSERT_LAST,
L"SelectedColor",
L"Gray");
+
+ /* TimeOut=5 */
+ IniCacheInsertKey(IniSection,
+ NULL,
+ INSERT_LAST,
+ L"TimeOut",
+ L"5");
}
reactos/subsys/system/welcome
diff -N En.rc
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ En.rc 30 Dec 2004 04:37:06 -0000 1.1.2.1
@@ -0,0 +1,62 @@
+/* $Id: En.rc,v 1.1.2.1 2004/12/30 04:37:06 hyperion Exp $ */
+
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+
+/* String Tables */
+
+/* Default settings */
+STRINGTABLE DISCARDABLE
+BEGIN
+ IDS_APPTITLE "ReactOS - Welcome"
+ IDS_DEFAULTTOPICTITLE "ReactOS"
+ IDS_DEFAULTTOPICDESC "Welcome to React Operating System.\n\nClick a topic on the left."
+// IDS_CHECKTEXT "Show this dialog again"
+// IDS_CLOSETEXT "Exit"
+END
+
+/* Topic buttons */
+STRINGTABLE DISCARDABLE
+BEGIN
+ IDS_TOPICBUTTON0 "Install ReactOS"
+ IDS_TOPICBUTTON1 "Browse this CD"
+ IDS_TOPICBUTTON2 "Exit"
+// IDS_TOPICBUTTON3 "Empty Topic 3"
+// IDS_TOPICBUTTON4 "Empty Topic 4"
+// IDS_TOPICBUTTON5 "Empty Topic 5"
+// IDS_TOPICBUTTON6 "Empty Topic 6"
+// IDS_TOPICBUTTON7 "Empty Topic 7"
+// IDS_TOPICBUTTON8 "Empty Topic 8"
+// IDS_TOPICBUTTON9 "Empty Topic 9"
+END
+
+/* Topic titles */
+STRINGTABLE DISCARDABLE
+BEGIN
+ IDS_TOPICTITLE0 "Install ReactOS"
+ IDS_TOPICTITLE1 "Browse this CD"
+ IDS_TOPICTITLE2 "Exit"
+// IDS_TOPICTITLE3 "Empty Topic Title 3"
+// IDS_TOPICTITLE4 "Empty Topic Title 4"
+// IDS_TOPICTITLE5 "Empty Topic Title 5"
+// IDS_TOPICTITLE6 "Empty Topic Title 6"
+// IDS_TOPICTITLE7 "Empty Topic Title 7"
+// IDS_TOPICTITLE8 "Empty Topic Title 8"
+// IDS_TOPICTITLE9 "Empty Topic Title 9"
+END
+
+/* Topic descriptions */
+STRINGTABLE DISCARDABLE
+BEGIN
+ IDS_TOPICDESC0 "Create a new ReactOS installation on your computer or upgrade an existing installation."
+ IDS_TOPICDESC1 "Browse the CD."
+ IDS_TOPICDESC2 "Click to exit this application."
+// IDS_TOPICDESC3 "Topic description 3.\n\nDescribe topic 3 here."
+// IDS_TOPICDESC4 "Topic description 4.\n\nDescribe topic 4 here."
+// IDS_TOPICDESC5 "Topic description 5.\n\nDescribe topic 5 here."
+// IDS_TOPICDESC6 "Topic description 6.\n\nDescribe topic 6 here."
+// IDS_TOPICDESC7 "Topic description 7.\n\nDescribe topic 7 here."
+// IDS_TOPICDESC8 "Topic description 8.\n\nDescribe topic 8 here."
+// IDS_TOPICDESC9 "Topic description 9.\n\nDescribe topic 9 here."
+END
+
+/* EOF */
reactos/subsys/system/welcome
diff -u -r1.2 -r1.2.34.1
--- .cvsignore 24 Sep 2003 19:55:18 -0000 1.2
+++ .cvsignore 30 Dec 2004 04:37:06 -0000 1.2.34.1
@@ -1,3 +1,4 @@
+*.a
*.o
*.d
*.exe
reactos/subsys/system/welcome
diff -u -r1.2 -r1.2.4.1
--- De.rc 16 Oct 2004 20:27:42 -0000 1.2
+++ De.rc 30 Dec 2004 04:37:06 -0000 1.2.4.1
@@ -1,27 +1,10 @@
-#include <defines.h>
-#include <reactos/resource.h>
-#include "resource.h"
+/* $Id: De.rc,v 1.2.4.1 2004/12/30 04:37:06 hyperion Exp $ */
-LANGUAGE LANG_GERMAN, SUBLANG_GERMAN
-
-/* Icons */
-IDI_MAIN ICON "res/welcome.ico"
-
-/* Bitmaps */
-IDB_TITLEBITMAP BITMAP DISCARDABLE "res/title.bmp"
-//IDB_DEFAULTTOPICBITMAP BITMAP DISCARDABLE "res/default.bmp"
-
-//IDB_TOPICBITMAP0 BITMAP DISCARDABLE "res/topic0.bmp"
-//IDB_TOPICBITMAP1 BITMAP DISCARDABLE "res/topic1.bmp"
-//IDB_TOPICBITMAP2 BITMAP DISCARDABLE "res/topic2.bmp"
-//IDB_TOPICBITMAP3 BITMAP DISCARDABLE "res/topic3.bmp"
-//IDB_TOPICBITMAP4 BITMAP DISCARDABLE "res/topic4.bmp"
-//IDB_TOPICBITMAP5 BITMAP DISCARDABLE "res/topic5.bmp"
-//IDB_TOPICBITMAP6 BITMAP DISCARDABLE "res/topic6.bmp"
-//IDB_TOPICBITMAP7 BITMAP DISCARDABLE "res/topic7.bmp"
-//IDB_TOPICBITMAP8 BITMAP DISCARDABLE "res/topic8.bmp"
-//IDB_TOPICBITMAP9 BITMAP DISCARDABLE "res/topic9.bmp"
+/*
+ * German (Austria) resources by Klemens Friedl (frik85 at hotmail dot com)
+ */
+LANGUAGE LANG_GERMAN, SUBLANG_GERMAN
/* String Tables */
@@ -30,7 +13,7 @@
BEGIN
IDS_APPTITLE "ReactOS - Willkommen"
IDS_DEFAULTTOPICTITLE "ReactOS"
- IDS_DEFAULTTOPICDESC "Willkommen in ReactOS.\n\nKlicken Sie auf ein Thema links."
+ IDS_DEFAULTTOPICDESC "Willkommen in ReactOS.\n\nKlicken Sie auf ein Thema auf der linken Seite."
// IDS_CHECKTEXT "Dialog beim n�chsen Start wieder anzeigen"
// IDS_CLOSETEXT "Beenden"
END
@@ -68,7 +51,7 @@
/* Topic descriptions */
STRINGTABLE DISCARDABLE
BEGIN
- IDS_TOPICDESC0 "Erstellt eine neue ReactOS Installation auf ihrem PC oder aktualisiert eine bestehende Installation."
+ IDS_TOPICDESC0 "Installiert ReactOS auf ihrem Computer oder aktualisiert eine bestehende Installation."
IDS_TOPICDESC1 "Die ReactOS-CD durchsuchen."
IDS_TOPICDESC2 "Klicken Sie um dieses Programm zu beenden."
// IDS_TOPICDESC3 "Topic description 3.\n\nDescribe topic 3 here."
@@ -80,21 +63,5 @@
// IDS_TOPICDESC9 "Topic description 9.\n\nDescribe topic 9 here."
END
-/* Topic actions */
-STRINGTABLE DISCARDABLE
-BEGIN
- IDS_TOPICACTION0 "setup.exe"
- IDS_TOPICACTION1 "explorer.exe"
- IDS_TOPICACTION2 "<exit>" /* this quits the app */
-// IDS_TOPICACTION3 "..."
-// IDS_TOPICACTION4 "..."
-// IDS_TOPICACTION5 "..."
-// IDS_TOPICACTION6 "..."
-// IDS_TOPICACTION7 "..."
-// IDS_TOPICACTION8 "..."
-// IDS_TOPICACTION9 "..."
-END
-
-// German (Austria) resources by Klemens Friedl (frik85 at hotmail dot com)
/* EOF */
reactos/subsys/system/welcome
diff -u -r1.2 -r1.2.4.1
--- Es.rc 16 Oct 2004 20:27:42 -0000 1.2
+++ Es.rc 30 Dec 2004 04:37:06 -0000 1.2.4.1
@@ -1,28 +1,7 @@
-#include <defines.h>
-#include <reactos/resource.h>
-#include "resource.h"
+/* $Id: Es.rc,v 1.2.4.1 2004/12/30 04:37:06 hyperion Exp $ */
LANGUAGE LANG_SPANISH, SUBLANG_SPANISH
-/* Icons */
-IDI_MAIN ICON "res/welcome.ico"
-
-/* Bitmaps */
-IDB_TITLEBITMAP BITMAP DISCARDABLE "res/title.bmp"
-//IDB_DEFAULTTOPICBITMAP BITMAP DISCARDABLE "res/default.bmp"
-
-//IDB_TOPICBITMAP0 BITMAP DISCARDABLE "res/topic0.bmp"
-//IDB_TOPICBITMAP1 BITMAP DISCARDABLE "res/topic1.bmp"
-//IDB_TOPICBITMAP2 BITMAP DISCARDABLE "res/topic2.bmp"
-//IDB_TOPICBITMAP3 BITMAP DISCARDABLE "res/topic3.bmp"
-//IDB_TOPICBITMAP4 BITMAP DISCARDABLE "res/topic4.bmp"
-//IDB_TOPICBITMAP5 BITMAP DISCARDABLE "res/topic5.bmp"
-//IDB_TOPICBITMAP6 BITMAP DISCARDABLE "res/topic6.bmp"
-//IDB_TOPICBITMAP7 BITMAP DISCARDABLE "res/topic7.bmp"
-//IDB_TOPICBITMAP8 BITMAP DISCARDABLE "res/topic8.bmp"
-//IDB_TOPICBITMAP9 BITMAP DISCARDABLE "res/topic9.bmp"
-
-
/* String Tables */
/* Default settings */
@@ -80,20 +59,5 @@
// IDS_TOPICDESC9 "Topic description 9.\n\nDescribe topic 9 here."
END
-/* Topic actions */
-STRINGTABLE DISCARDABLE
-BEGIN
- IDS_TOPICACTION0 "setup.exe"
- IDS_TOPICACTION1 "explorer.exe"
- IDS_TOPICACTION2 "<exit>" /* this quits the app */
-// IDS_TOPICACTION3 "..."
-// IDS_TOPICACTION4 "..."
-// IDS_TOPICACTION5 "..."
-// IDS_TOPICACTION6 "..."
-// IDS_TOPICACTION7 "..."
-// IDS_TOPICACTION8 "..."
-// IDS_TOPICACTION9 "..."
-END
-
/* EOF */
reactos/subsys/system/welcome
diff -u -r1.6 -r1.6.4.1
--- welcome.rc 16 Oct 2004 20:27:42 -0000 1.6
+++ welcome.rc 30 Dec 2004 04:37:06 -0000 1.6.4.1
@@ -1,4 +1,4 @@
-/* $Id: welcome.rc,v 1.6 2004/10/16 20:27:42 gvg Exp $ */
+/* $Id: welcome.rc,v 1.6.4.1 2004/12/30 04:37:06 hyperion Exp $ */
#include <defines.h>
#include "resource.h"
@@ -8,10 +8,8 @@
#define REACTOS_STR_ORIGINAL_FILENAME "welcome.exe\0"
#include <reactos/version.rc>
-#include "De.rc"
-#include "Es.rc"
-LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
/* Icons */
IDI_MAIN ICON "res/welcome.ico"
@@ -32,67 +30,10 @@
//IDB_TOPICBITMAP9 BITMAP DISCARDABLE "res/topic9.bmp"
-/* String Tables */
-
-/* Default settings */
-STRINGTABLE DISCARDABLE
-BEGIN
- IDS_APPTITLE "ReactOS - Welcome"
- IDS_DEFAULTTOPICTITLE "ReactOS"
- IDS_DEFAULTTOPICDESC "Welcome to React Operating System.\n\nClick a topic on the left."
-// IDS_CHECKTEXT "Show this dialog again"
-// IDS_CLOSETEXT "Exit"
-END
-
-/* Topic buttons */
-STRINGTABLE DISCARDABLE
-BEGIN
- IDS_TOPICBUTTON0 "Install ReactOS"
- IDS_TOPICBUTTON1 "Browse this CD"
- IDS_TOPICBUTTON2 "Exit"
-// IDS_TOPICBUTTON3 "Empty Topic 3"
-// IDS_TOPICBUTTON4 "Empty Topic 4"
-// IDS_TOPICBUTTON5 "Empty Topic 5"
-// IDS_TOPICBUTTON6 "Empty Topic 6"
-// IDS_TOPICBUTTON7 "Empty Topic 7"
-// IDS_TOPICBUTTON8 "Empty Topic 8"
-// IDS_TOPICBUTTON9 "Empty Topic 9"
-END
-
-/* Topic titles */
-STRINGTABLE DISCARDABLE
-BEGIN
- IDS_TOPICTITLE0 "Install ReactOS"
- IDS_TOPICTITLE1 "Browse this CD"
- IDS_TOPICTITLE2 "Exit"
-// IDS_TOPICTITLE3 "Empty Topic Title 3"
-// IDS_TOPICTITLE4 "Empty Topic Title 4"
-// IDS_TOPICTITLE5 "Empty Topic Title 5"
-// IDS_TOPICTITLE6 "Empty Topic Title 6"
-// IDS_TOPICTITLE7 "Empty Topic Title 7"
-// IDS_TOPICTITLE8 "Empty Topic Title 8"
-// IDS_TOPICTITLE9 "Empty Topic Title 9"
-END
-
-/* Topic descriptions */
-STRINGTABLE DISCARDABLE
-BEGIN
- IDS_TOPICDESC0 "Create a new ReactOS installation on your computer or upgrade an existing installation."
- IDS_TOPICDESC1 "Browse the CD."
- IDS_TOPICDESC2 "Click to exit this application."
-// IDS_TOPICDESC3 "Topic description 3.\n\nDescribe topic 3 here."
-// IDS_TOPICDESC4 "Topic description 4.\n\nDescribe topic 4 here."
-// IDS_TOPICDESC5 "Topic description 5.\n\nDescribe topic 5 here."
-// IDS_TOPICDESC6 "Topic description 6.\n\nDescribe topic 6 here."
-// IDS_TOPICDESC7 "Topic description 7.\n\nDescribe topic 7 here."
-// IDS_TOPICDESC8 "Topic description 8.\n\nDescribe topic 8 here."
-// IDS_TOPICDESC9 "Topic description 9.\n\nDescribe topic 9 here."
-END
-
/* Topic actions */
STRINGTABLE DISCARDABLE
BEGIN
- IDS_TOPICACTION0 "setup.exe"
+ IDS_TOPICACTION0 "reactos.exe"
IDS_TOPICACTION1 "explorer.exe"
IDS_TOPICACTION2 "<exit>" /* this quits the app */
// IDS_TOPICACTION3 "..."
@@ -103,4 +44,11 @@
// IDS_TOPICACTION8 "..."
// IDS_TOPICACTION9 "..."
END
+
+
+/* Language-specific resources */
+#include "De.rc"
+#include "En.rc"
+#include "Es.rc"
+
/* EOF */
reactos/subsys/system/winlogon
diff -u -r1.37 -r1.37.2.1
--- winlogon.c 20 Nov 2004 16:46:05 -0000 1.37
+++ winlogon.c 30 Dec 2004 04:37:06 -0000 1.37.2.1
@@ -1,4 +1,4 @@
-/* $Id: winlogon.c,v 1.37 2004/11/20 16:46:05 weiden Exp $
+/* $Id: winlogon.c,v 1.37.2.1 2004/12/30 04:37:06 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -364,7 +364,7 @@
static PWCHAR
-GetShell (WCHAR *CommandLine)
+GetUserInit (WCHAR *CommandLine)
{
HKEY WinLogonKey;
BOOL GotCommandLine;
@@ -377,7 +377,7 @@
{
Size = MAX_PATH;
if (ERROR_SUCCESS == RegQueryValueEx(WinLogonKey,
- L"Shell",
+ L"UserInit",
NULL,
&Type,
(LPBYTE) Shell,
@@ -399,8 +399,8 @@
if (! GotCommandLine)
{
- GetWindowsDirectory(CommandLine, MAX_PATH - 15);
- wcscat(CommandLine, L"\\explorer.exe");
+ GetSystemDirectory(CommandLine, MAX_PATH - 15);
+ wcscat(CommandLine, L"\\userinit.exe");
}
return CommandLine;
@@ -479,7 +479,7 @@
Result = CreateProcessAsUserW (hToken,
NULL,
- GetShell (CommandLine),
+ GetUserInit (CommandLine),
NULL,
NULL,
FALSE,
reactos/subsys/system/winlogon
diff -u -r1.4.8.3 -r1.4.8.4
--- winlogon.h 13 Dec 2004 16:18:16 -0000 1.4.8.3
+++ winlogon.h 30 Dec 2004 04:37:06 -0000 1.4.8.4
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: winlogon.h,v 1.4.8.3 2004/12/13 16:18:16 hyperion Exp $
+/* $Id: winlogon.h,v 1.4.8.4 2004/12/30 04:37:06 hyperion Exp $
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS winlogon
* FILE: subsys/system/winlogon/winlogon.h
reactos/subsys/win32k/eng
diff -u -r1.58.10.2 -r1.58.10.3
--- bitblt.c 13 Dec 2004 16:18:16 -0000 1.58.10.2
+++ bitblt.c 30 Dec 2004 04:37:06 -0000 1.58.10.3
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: bitblt.c,v 1.58.10.2 2004/12/13 16:18:16 hyperion Exp $
+/* $Id: bitblt.c,v 1.58.10.3 2004/12/30 04:37:06 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -496,10 +496,14 @@
RECTL OutputRect;
POINTL InputPoint;
BOOLEAN UsesSource;
- SURFOBJ *DestSurf = &DestObj->SurfObj;
+ SURFOBJ *DestSurf;
SURFOBJ *SourceSurf = SourceObj ? &SourceObj->SurfObj : NULL;
SURFOBJ *MaskSurf = MaskObj ? &MaskObj->SurfObj : NULL;
+ ASSERT(DestObj);
+ DestSurf = &DestObj->SurfObj;
+ ASSERT(DestSurf);
+
InputClippedRect = *DestRect;
if (InputClippedRect.right < InputClippedRect.left)
{
@@ -514,7 +518,7 @@
UsesSource = ((Rop4 & 0xCC0000) >> 2) != (Rop4 & 0x330000);
if (UsesSource)
{
- if (NULL == SourcePoint || NULL == SourceObj)
+ if (NULL == SourcePoint || NULL == SourceSurf)
{
return FALSE;
}
@@ -742,23 +746,29 @@
BOOLEAN ret;
COLORADJUSTMENT ca;
POINT MaskOrigin;
- SURFOBJ *DestSurf = &DestObj->SurfObj;
+ SURFOBJ *DestSurf;
SURFOBJ *SourceSurf = SourceObj ? &SourceObj->SurfObj : NULL;
SURFOBJ *MaskSurf = MaskObj ? &MaskObj->SurfObj : NULL;
+ ASSERT(DestObj);
+ DestSurf = &DestObj->SurfObj;
+ ASSERT(DestSurf);
+
if (pMaskOrigin != NULL)
{
MaskOrigin.x = pMaskOrigin->x; MaskOrigin.y = pMaskOrigin->y;
}
- if (NULL != SourceObj)
+ if (NULL != SourceSurf)
{
+ ASSERT(SourceRect);
MouseSafetyOnDrawStart(SourceSurf, SourceRect->left, SourceRect->top,
SourceRect->right, SourceRect->bottom);
}
/* No success yet */
ret = FALSE;
+ ASSERT(DestRect);
MouseSafetyOnDrawStart(DestSurf, DestRect->left, DestRect->top,
DestRect->right, DestRect->bottom);
@@ -891,6 +901,8 @@
ULONG Direction;
POINTL AdjustedBrushOrigin;
+ ASSERT ( Mask );
+
if (NULL != SourcePoint)
{
InputRect.left = SourcePoint->x;
@@ -1082,6 +1094,8 @@
RECTL OutputRect;
POINTL InputPoint;
+ ASSERT(Mask);
+
if (NULL != SourcePoint)
{
InputPoint = *SourcePoint;
@@ -1105,6 +1119,7 @@
/* No success yet */
ret = FALSE;
+ ASSERT(DestObj);
MouseSafetyOnDrawStart(DestObj, OutputRect.left, OutputRect.top,
OutputRect.right, OutputRect.bottom);
reactos/subsys/win32k/eng
diff -u -r1.22.18.2 -r1.22.18.3
--- clip.c 13 Dec 2004 16:18:16 -0000 1.22.18.2
+++ clip.c 30 Dec 2004 04:37:07 -0000 1.22.18.3
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: clip.c,v 1.22.18.2 2004/12/13 16:18:16 hyperion Exp $
+/* $Id: clip.c,v 1.22.18.3 2004/12/30 04:37:07 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
reactos/subsys/win32k/eng
diff -u -r1.26 -r1.26.10.1
--- copybits.c 14 Jul 2004 20:48:57 -0000 1.26
+++ copybits.c 30 Dec 2004 04:37:07 -0000 1.26.10.1
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: copybits.c,v 1.26 2004/07/14 20:48:57 navaraf Exp $
+/* $Id: copybits.c,v 1.26.10.1 2004/12/30 04:37:07 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -45,6 +45,8 @@
BOOL EnumMore;
BLTINFO BltInfo;
+ ASSERT(Dest != NULL && Source != NULL && DestRect != NULL && SourcePoint != NULL);
+
MouseSafetyOnDrawStart(Source, SourcePoint->x, SourcePoint->y,
(SourcePoint->x + abs(DestRect->right - DestRect->left)),
(SourcePoint->y + abs(DestRect->bottom - DestRect->top)));
reactos/subsys/win32k/eng
diff -u -r1.11.2.2 -r1.11.2.3
--- gradient.c 13 Dec 2004 16:18:16 -0000 1.11.2.2
+++ gradient.c 30 Dec 2004 04:37:07 -0000 1.11.2.3
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: gradient.c,v 1.11.2.2 2004/12/13 16:18:16 hyperion Exp $
+/* $Id: gradient.c,v 1.11.2.3 2004/12/30 04:37:07 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -528,7 +528,11 @@
IN ULONG ulMode)
{
BOOL Ret;
- SURFOBJ *psoDest = &pboDest->SurfObj;
+ SURFOBJ *psoDest;
+ ASSERT(pboDest);
+ ASSERT(pco);
+
+ psoDest = &pboDest->SurfObj;
ASSERT(psoDest);
MouseSafetyOnDrawStart(
reactos/subsys/win32k/eng
diff -u -r1.35 -r1.35.10.1
--- lineto.c 14 Jul 2004 20:48:57 -0000 1.35
+++ lineto.c 30 Dec 2004 04:37:07 -0000 1.35.10.1
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: lineto.c,v 1.35 2004/07/14 20:48:57 navaraf Exp $
+ * $Id: lineto.c,v 1.35.10.1 2004/12/30 04:37:07 hyperion Exp $
*/
#include <w32k.h>
@@ -491,14 +491,20 @@
MIX mix)
{
BOOLEAN ret;
- SURFOBJ *DestSurf = &DestObj->SurfObj;
+ SURFOBJ *DestSurf;
PGDIBRUSHINST GdiBrush;
RECTL b;
+ ASSERT(DestObj);
+ DestSurf = &DestObj->SurfObj;
+ ASSERT(DestSurf);
+
GdiBrush = CONTAINING_RECORD(
Brush,
GDIBRUSHINST,
BrushObject);
+ ASSERT(GdiBrush);
+ ASSERT(GdiBrush->GdiBrushObject);
if (GdiBrush->GdiBrushObject->flAttrs & GDIBRUSH_IS_NULL)
return TRUE;
reactos/subsys/win32k/eng
diff -u -r1.77.8.2 -r1.77.8.3
--- mouse.c 13 Dec 2004 16:18:16 -0000 1.77.8.2
+++ mouse.c 30 Dec 2004 04:37:07 -0000 1.77.8.3
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: mouse.c,v 1.77.8.2 2004/12/13 16:18:16 hyperion Exp $
+/* $Id: mouse.c,v 1.77.8.3 2004/12/30 04:37:07 hyperion Exp $
*
* PROJECT: ReactOS kernel
* PURPOSE: Mouse
reactos/subsys/win32k/eng
diff -u -r1.32.12.2 -r1.32.12.3
--- objects.h 13 Dec 2004 16:18:16 -0000 1.32.12.2
+++ objects.h 30 Dec 2004 04:37:07 -0000 1.32.12.3
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: objects.h,v 1.32.12.2 2004/12/13 16:18:16 hyperion Exp $
+/* $Id: objects.h,v 1.32.12.3 2004/12/30 04:37:07 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
reactos/subsys/win32k/eng
diff -u -r1.20 -r1.20.12.1
--- paint.c 3 Jul 2004 13:55:35 -0000 1.20
+++ paint.c 30 Dec 2004 04:37:07 -0000 1.20.12.1
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: paint.c,v 1.20 2004/07/03 13:55:35 navaraf Exp $
+/* $Id: paint.c,v 1.20.12.1 2004/12/30 04:37:07 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -34,6 +34,8 @@
LONG y;
ULONG LineWidth;
+ ASSERT ( Surface );
+ ASSERT ( pRect );
MouseSafetyOnDrawStart(Surface, pRect->left, pRect->top, pRect->right, pRect->bottom);
LineWidth = pRect->right - pRect->left;
DPRINT(" LineWidth: %d, top: %d, bottom: %d\n", LineWidth, pRect->top, pRect->bottom);
@@ -55,6 +57,9 @@
BOOL EnumMore;
ULONG i;
+ ASSERT(Surface);
+ ASSERT(ClipRegion);
+
DPRINT("ClipRegion->iMode:%d, ClipRegion->iDComplexity: %d\n Color: %d", ClipRegion->iMode, ClipRegion->iDComplexity, iColor);
switch(ClipRegion->iMode) {
reactos/subsys/win32k/eng
diff -u -r1.44.12.2 -r1.44.12.3
--- surface.c 13 Dec 2004 16:18:16 -0000 1.44.12.2
+++ surface.c 30 Dec 2004 04:37:07 -0000 1.44.12.3
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: surface.c,v 1.44.12.2 2004/12/13 16:18:16 hyperion Exp $
+/* $Id: surface.c,v 1.44.12.3 2004/12/30 04:37:07 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -60,6 +60,7 @@
switch(Compression)
{
case BI_RGB:
+ case BI_BITFIELDS:
switch(Bits)
{
case 1: return BMF_1BPP;
@@ -332,6 +333,9 @@
HBITMAP NewBitmap;
NewBitmap = IntCreateBitmap(Size, Width, Format, Flags, Bits);
+ if ( !NewBitmap )
+ return 0;
+
GDIOBJ_SetOwnership(NewBitmap, NULL);
return NewBitmap;
@@ -472,6 +476,8 @@
RECTL *Rect,
ULONG iColor)
{
+ ASSERT(Surface);
+ ASSERT(Rect);
return FillSolid(Surface, Rect, iColor);
}
reactos/subsys/win32k/eng
diff -u -r1.21 -r1.21.12.1
--- transblt.c 3 Jul 2004 17:40:25 -0000 1.21
+++ transblt.c 30 Dec 2004 04:37:07 -0000 1.21.12.1
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: transblt.c,v 1.21 2004/07/03 17:40:25 navaraf Exp $
+/* $Id: transblt.c,v 1.21.12.1 2004/12/30 04:37:07 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -204,9 +204,19 @@
{
BOOL Ret;
RECTL OutputRect, InputClippedRect;
- SURFOBJ *DestSurf = &DestObj->SurfObj;
- SURFOBJ *SourceSurf = &SourceObj->SurfObj;
+ SURFOBJ *DestSurf;
+ SURFOBJ *SourceSurf;
+ ASSERT(DestObj);
+ ASSERT(SourceObj);
+ ASSERT(DestRect);
+
+ DestSurf = &DestObj->SurfObj;
+ SourceSurf = &SourceObj->SurfObj;
+
+ ASSERT(DestSurf);
+ ASSERT(SourceSurf);
+
InputClippedRect = *DestRect;
if(InputClippedRect.right < InputClippedRect.left)
{
@@ -240,8 +250,7 @@
if(SourceSurf != DestSurf)
{
MouseSafetyOnDrawStart(SourceSurf, SourceRect->left, SourceRect->top,
- (SourceRect->left + abs(SourceRect->right - SourceRect->left)),
- (SourceRect->top + abs(SourceRect->bottom - SourceRect->top)));
+ SourceRect->right, SourceRect->bottom);
}
MouseSafetyOnDrawStart(DestSurf, OutputRect.left, OutputRect.top,
OutputRect.right, OutputRect.bottom);
reactos/subsys/win32k/eng
diff -u -r1.42.8.2 -r1.42.8.3
--- xlate.c 13 Dec 2004 16:18:16 -0000 1.42.8.2
+++ xlate.c 30 Dec 2004 04:37:07 -0000 1.42.8.3
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: xlate.c,v 1.42.8.2 2004/12/13 16:18:16 hyperion Exp $
+/* $Id: xlate.c,v 1.42.8.3 2004/12/30 04:37:07 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
reactos/subsys/win32k/include
diff -u -r1.14.24.1 -r1.14.24.2
--- dce.h 13 Dec 2004 09:39:17 -0000 1.14.24.1
+++ dce.h 30 Dec 2004 04:37:09 -0000 1.14.24.2
@@ -53,6 +53,6 @@
PDCE FASTCALL DceFreeDCE(PDCE dce, BOOLEAN Force);
void FASTCALL DceFreeWindowDCE(PWINDOW_OBJECT Window);
void FASTCALL DceEmptyCache(void);
-VOID FASTCALL DceResetActiveDCEs(PWINDOW_OBJECT Window, int DeltaX, int DeltaY);
+VOID FASTCALL DceResetActiveDCEs(PWINDOW_OBJECT Window);
#endif /* _WIN32K_DCE_H */
reactos/subsys/win32k/include
diff -u -r1.41.8.1 -r1.41.8.2
--- msgqueue.h 13 Dec 2004 09:39:17 -0000 1.41.8.1
+++ msgqueue.h 30 Dec 2004 04:37:09 -0000 1.41.8.2
@@ -40,6 +40,16 @@
LIST_ENTRY ListEntry;
} USER_SENT_MESSAGE_NOTIFY, *PUSER_SENT_MESSAGE_NOTIFY;
+typedef struct _TIMER_ENTRY{
+ LIST_ENTRY ListEntry;
+ LARGE_INTEGER ExpiryTime;
+ HWND Wnd;
+ UINT_PTR IDEvent;
+ UINT Period;
+ TIMERPROC TimerFunc;
+ UINT Msg;
+} TIMER_ENTRY, *PTIMER_ENTRY;
+
typedef struct _USER_MESSAGE_QUEUE
{
/* Reference counter, only access this variable with interlocked functions! */
@@ -55,6 +65,8 @@
LIST_ENTRY NotifyMessagesListHead;
/* Queue for hardware messages for the queue. */
LIST_ENTRY HardwareMessagesListHead;
+ /* List of timers, sorted on expiry time (earliest first) */
+ LIST_ENTRY TimerListHead;
/* Lock for the hardware message list. */
KMUTEX HardwareLock;
/* Lock for the queue. */
@@ -65,8 +77,10 @@
BOOLEAN QuitPosted;
/* The quit exit code. */
ULONG QuitExitCode;
- /* Set if there are new messages in any of the queues. */
- KEVENT NewMessages;
+ /* Set if there are new messages specified by WakeMask in any of the queues. */
+ PKEVENT NewMessages;
+ /* Handle for the above event (in the context of the process owning the queue). */
+ HANDLE NewMessagesHandle;
/* Last time PeekMessage() was called. */
ULONG LastMsgRead;
/* Current window with focus (ie. receives keyboard input) for this queue. */
@@ -92,10 +106,9 @@
PHOOKTABLE Hooks;
/* queue state tracking */
- WORD WakeBits;
WORD WakeMask;
+ WORD QueueBits;
WORD ChangedBits;
- WORD ChangedMask;
/* extra message information */
LPARAM ExtraInfo;
@@ -121,7 +134,7 @@
MsqDestroyMessage(PUSER_MESSAGE Message);
VOID FASTCALL
MsqPostMessage(PUSER_MESSAGE_QUEUE MessageQueue,
- MSG* Msg, BOOLEAN FreeLParam);
+ MSG* Msg, BOOLEAN FreeLParam, DWORD MessageBits);
VOID FASTCALL
MsqPostQuitMessage(PUSER_MESSAGE_QUEUE MessageQueue, ULONG ExitCode);
BOOLEAN STDCALL
@@ -132,7 +145,7 @@
IN UINT MsgFilterLow,
IN UINT MsgFilterHigh,
OUT PUSER_MESSAGE* Message);
-VOID FASTCALL
+BOOLEAN FASTCALL
MsqInitializeMessageQueue(struct _ETHREAD *Thread, PUSER_MESSAGE_QUEUE MessageQueue);
VOID FASTCALL
MsqCleanupMessageQueue(PUSER_MESSAGE_QUEUE MessageQueue);
@@ -143,13 +156,12 @@
PUSER_MESSAGE_QUEUE FASTCALL
MsqGetHardwareMessageQueue(VOID);
NTSTATUS FASTCALL
-MsqWaitForNewMessage(PUSER_MESSAGE_QUEUE MessageQueue);
-NTSTATUS FASTCALL
MsqInitializeImpl(VOID);
BOOLEAN FASTCALL
MsqDispatchOneSentMessage(PUSER_MESSAGE_QUEUE MessageQueue);
NTSTATUS FASTCALL
-MsqWaitForNewMessages(PUSER_MESSAGE_QUEUE MessageQueue);
+MsqWaitForNewMessages(PUSER_MESSAGE_QUEUE MessageQueue, HWND WndFilter,
+ UINT MsgFilterMin, UINT MsgFilterMax);
VOID FASTCALL
MsqSendNotifyMessage(PUSER_MESSAGE_QUEUE MessageQueue,
PUSER_SENT_MESSAGE_NOTIFY NotifyMessage);
@@ -225,14 +237,12 @@
if(InterlockedDecrement(&(MsgQueue)->References) == 0) \
{ \
DPRINT("Free message queue 0x%x\n", (MsgQueue)); \
+ if ((MsgQueue)->NewMessagesHandle != NULL) \
+ ZwClose((MsgQueue)->NewMessagesHandle); \
ExFreePool((MsgQueue)); \
} \
} while(0)
-/* check the queue status */
-#define MsqIsSignaled(MsgQueue) \
- (((MsgQueue)->WakeBits & (MsgQueue)->WakeMask) || ((MsgQueue)->ChangedBits & (MsgQueue)->ChangedMask))
-
#define IS_BTN_MESSAGE(message,code) \
((message) == WM_LBUTTON##code || \
(message) == WM_MBUTTON##code || \
@@ -243,6 +253,30 @@
(message) == WM_NCRBUTTON##code || \
(message) == WM_NCXBUTTON##code )
+HANDLE FASTCALL
+IntMsqSetWakeMask(DWORD WakeMask);
+
+BOOL FASTCALL
+IntMsqClearWakeMask(VOID);
+
+BOOLEAN FASTCALL
+MsqSetTimer(PUSER_MESSAGE_QUEUE MessageQueue, HWND Wnd,
+ UINT_PTR IDEvent, UINT Period, TIMERPROC TimerFunc,
+ UINT Msg);
+BOOLEAN FASTCALL
+MsqKillTimer(PUSER_MESSAGE_QUEUE MessageQueue, HWND Wnd,
+ UINT_PTR IDEvent, UINT Msg);
+BOOLEAN FASTCALL
+MsqGetTimerMessage(PUSER_MESSAGE_QUEUE MessageQueue,
+ HWND WndFilter, UINT MsgFilterMin, UINT MsgFilterMax,
+ MSG *Msg, BOOLEAN Restart);
+BOOLEAN FASTCALL
+MsqGetFirstTimerExpiry(PUSER_MESSAGE_QUEUE MessageQueue,
+ HWND WndFilter, UINT MsgFilterMin, UINT MsgFilterMax,
+ PLARGE_INTEGER FirstTimerExpiry);
+VOID FASTCALL
+MsqRemoveTimersWindow(PUSER_MESSAGE_QUEUE MessageQueue, HWND Wnd);
+
#endif /* _WIN32K_MSGQUEUE_H */
/* EOF */
reactos/subsys/win32k/include
diff -u -r1.7 -r1.7.8.1
--- timer.h 4 Aug 2004 22:31:17 -0000 1.7
+++ timer.h 30 Dec 2004 04:37:09 -0000 1.7.8.1
@@ -1,18 +1,8 @@
#ifndef _WIN32K_TIMER_H
#define _WIN32K_TIMER_H
-typedef struct _MSG_TIMER_ENTRY{
- LIST_ENTRY ListEntry;
- LARGE_INTEGER Timeout;
- HANDLE ThreadID;
- UINT Period;
- MSG Msg;
-} MSG_TIMER_ENTRY, *PMSG_TIMER_ENTRY;
-
NTSTATUS FASTCALL InitTimerImpl(VOID);
-VOID FASTCALL RemoveTimersThread(HANDLE ThreadID);
-VOID FASTCALL RemoveTimersWindow(HWND hWnd);
-PMSG_TIMER_ENTRY FASTCALL IntRemoveTimer(HWND hWnd, UINT_PTR IDEvent, HANDLE ThreadID, BOOL SysTimer);
-UINT_PTR FASTCALL IntSetTimer(HWND hWnd, UINT_PTR nIDEvent, UINT uElapse, TIMERPROC lpTimerFunc, BOOL SystemTimer);
+BOOL FASTCALL IntKillTimer(HWND Wnd, UINT_PTR IDEvent, BOOL SystemTimer);
+UINT_PTR FASTCALL IntSetTimer(HWND Wnd, UINT_PTR IDEvent, UINT Elapse, TIMERPROC TimerFunc, BOOL SystemTimer);
#endif /* _WIN32K_TIMER_H */
reactos/subsys/win32k/main
diff -u -r1.82.2.2 -r1.82.2.3
--- dllmain.c 13 Dec 2004 16:18:17 -0000 1.82.2.2
+++ dllmain.c 30 Dec 2004 04:37:09 -0000 1.82.2.3
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: dllmain.c,v 1.82.2.2 2004/12/13 16:18:17 hyperion Exp $
+/* $Id: dllmain.c,v 1.82.2.3 2004/12/30 04:37:09 hyperion Exp $
*
* Entry Point for win32k.sys
*/
@@ -184,7 +184,6 @@
Win32Thread->IsExiting = TRUE;
HOOK_DestroyThreadHooks(Thread);
- RemoveTimersThread(Win32Thread->MessageQueue);
UnregisterThreadHotKeys(Thread);
DestroyThreadWindows(Thread);
IntBlockInput(Win32Thread, FALSE);
reactos/subsys/win32k
diff -u -r1.105.2.3 -r1.105.2.4
--- makefile 13 Dec 2004 16:18:17 -0000 1.105.2.3
+++ makefile 30 Dec 2004 04:37:10 -0000 1.105.2.4
@@ -1,4 +1,4 @@
-# $Id: makefile,v 1.105.2.3 2004/12/13 16:18:17 hyperion Exp $
+# $Id: makefile,v 1.105.2.4 2004/12/30 04:37:10 hyperion Exp $
PATH_TO_TOP = ../..
@@ -14,6 +14,9 @@
TARGET_DDKLIBS = freetype.a
+TARGET_LIBS = \
+ $(SDK_PATH_LIB)/libpseh.a
+
TARGET_REGTESTS = yes
FREETYPE_DIR = $(PATH_TO_TOP)/lib/freetype
reactos/subsys/win32k/misc
diff -u -r1.12.16.2 -r1.12.16.3
--- object.c 13 Dec 2004 16:18:17 -0000 1.12.16.2
+++ object.c 30 Dec 2004 04:37:10 -0000 1.12.16.3
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: object.c,v 1.12.16.2 2004/12/13 16:18:17 hyperion Exp $
+/* $Id: object.c,v 1.12.16.3 2004/12/30 04:37:10 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
reactos/subsys/win32k/ntuser
diff -u -r1.25 -r1.25.16.1
--- callback.c 20 Jun 2004 12:34:20 -0000 1.25
+++ callback.c 30 Dec 2004 04:37:10 -0000 1.25.16.1
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: callback.c,v 1.25 2004/06/20 12:34:20 navaraf Exp $
+/* $Id: callback.c,v 1.25.16.1 2004/12/30 04:37:10 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -334,6 +334,7 @@
Extra = (PCHAR) (CbtCreatewndExtra + 1);
RtlCopyMemory(Extra, WindowName->Buffer, WindowName->Length);
CbtCreatewndExtra->Cs.lpszName = (LPCWSTR) (Extra - (PCHAR) CbtCreatewndExtra);
+ CbtCreatewndExtra->Cs.lpszClass = ClassName->Buffer;
Extra += WindowName->Length;
*((WCHAR *) Extra) = L'\0';
Extra += sizeof(WCHAR);
reactos/subsys/win32k/ntuser
diff -u -r1.15 -r1.15.2.1
--- caret.c 20 Nov 2004 16:46:06 -0000 1.15
+++ caret.c 30 Dec 2004 04:37:10 -0000 1.15.2.1
@@ -1,4 +1,4 @@
-/* $Id: caret.c,v 1.15 2004/11/20 16:46:06 weiden Exp $
+/* $Id: caret.c,v 1.15.2.1 2004/12/30 04:37:10 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -240,7 +240,7 @@
return FALSE;
}
- IntRemoveTimer(hWnd, IDCARETTIMER, PsGetCurrentThreadId(), TRUE);
+ IntKillTimer(hWnd, IDCARETTIMER, TRUE);
ThreadQueue = (PUSER_MESSAGE_QUEUE)PsGetWin32Thread()->MessageQueue;
@@ -315,7 +315,7 @@
}
ThreadQueue = (PUSER_MESSAGE_QUEUE)PsGetWin32Thread()->MessageQueue;
-
+
if(ThreadQueue->CaretInfo->hWnd != hWnd)
{
IntReleaseWindowObject(WindowObject);
@@ -325,7 +325,7 @@
if(ThreadQueue->CaretInfo->Visible)
{
- IntRemoveTimer(hWnd, IDCARETTIMER, PsGetCurrentThreadId(), TRUE);
+ IntKillTimer(hWnd, IDCARETTIMER, TRUE);
IntHideCaret(ThreadQueue->CaretInfo);
ThreadQueue->CaretInfo->Visible = 0;
reactos/subsys/win32k/ntuser
diff -u -r1.60.2.2 -r1.60.2.3
--- class.c 13 Dec 2004 16:18:17 -0000 1.60.2.2
+++ class.c 30 Dec 2004 04:37:10 -0000 1.60.2.3
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: class.c,v 1.60.2.2 2004/12/13 16:18:17 hyperion Exp $
+/* $Id: class.c,v 1.60.2.3 2004/12/30 04:37:10 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -66,14 +66,14 @@
{
PWNDCLASS_OBJECT Current, BestMatch = NULL;
PLIST_ENTRY CurrentEntry;
-
- /* HACK!! */
- IntLockGlobalClassList();
- CurrentEntry = GlobalClassListHead.Flink;
- while (CurrentEntry != &GlobalClassListHead)
+ PW32PROCESS Process = PsGetWin32Process();
+
+ IntLockProcessClasses(Process);
+ CurrentEntry = Process->ClassListHead.Flink;
+ while (CurrentEntry != &Process->ClassListHead)
{
- Current = CONTAINING_RECORD(CurrentEntry, WNDCLASS_OBJECT, GlobalListEntry);
-
+ Current = CONTAINING_RECORD(CurrentEntry, WNDCLASS_OBJECT, ListEntry);
+
if (Current->Atom == Atom && (hInstance == NULL || Current->hInstance == hInstance))
{
*Class = Current;
@@ -95,7 +95,7 @@
ObmReferenceObject(BestMatch);
return TRUE;
}
-
+
return FALSE;
}
@@ -169,7 +169,7 @@
return 0;
}
- lpWndClassEx->cbSize = sizeof(LPWNDCLASSEXW);
+ lpWndClassEx->cbSize = sizeof(WNDCLASSEXW);
lpWndClassEx->style = Class->style;
if (Ansi)
lpWndClassEx->lpfnWndProc = Class->lpfnWndProcA;
@@ -458,10 +458,6 @@
InsertTailList(&PsGetWin32Process()->ClassListHead, &ClassObject->ListEntry);
IntUnLockProcessClasses(PsGetWin32Process());
- /* HACK!!! */
- IntLockGlobalClassList();
- InsertTailList(&GlobalClassListHead, &ClassObject->GlobalListEntry);
- IntUnlockGlobalClassList();
return(Atom);
}
reactos/subsys/win32k/ntuser
diff -u -r1.2.2.1 -r1.2.2.2
--- cursoricon.c 13 Dec 2004 09:39:20 -0000 1.2.2.1
+++ cursoricon.c 30 Dec 2004 04:37:10 -0000 1.2.2.2
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: cursoricon.c,v 1.2.2.1 2004/12/13 09:39:20 hyperion Exp $ */
+/* $Id: cursoricon.c,v 1.2.2.2 2004/12/30 04:37:10 hyperion Exp $ */
#include <w32k.h>
PCURICON_OBJECT FASTCALL
@@ -81,8 +81,10 @@
DC_UnlockDc(Screen);
BitmapObj = BITMAPOBJ_LockBitmap(dcbmp);
- /* FIXME - BitmapObj can be NULL!!!!! */
+ if ( !BitmapObj )
+ return (HCURSOR)0;
SurfObj = &BitmapObj->SurfObj;
+ ASSERT(SurfObj);
}
if (!NewCursor && (CurInfo->CurrentCursorObject || ForceChange))
@@ -164,7 +166,12 @@
MaskBmpObj->SurfObj.sizlBitmap, abs(MaskBmpObj->SurfObj.lDelta),
MaskBmpObj->SurfObj.iBitmapFormat, BMF_TOPDOWN,
NULL);
- ASSERT(hMask);
+ if ( !hMask )
+ {
+ BITMAPOBJ_UnlockBitmap(NewCursor->IconInfo.hbmMask);
+ BITMAPOBJ_UnlockBitmap(dcbmp);
+ return (HCURSOR)0;
+ }
soMask = EngLockSurface((HSURF)hMask);
EngCopyBits(soMask, &MaskBmpObj->SurfObj, NULL, NULL,
&DestRect, &SourcePoint);
@@ -412,7 +419,7 @@
{
return (HANDLE)0;
}
-
+
CurIconObject = IntCreateCurIconHandle(WinStaObject);
if(CurIconObject)
{
@@ -436,16 +443,13 @@
BITMAPOBJ_UnlockBitmap(CurIconObject->IconInfo.hbmColor);
GDIOBJ_SetOwnership(CurIconObject->IconInfo.hbmColor, NULL);
}
- else
+ if(CurIconObject->IconInfo.hbmMask &&
+ (bmp = BITMAPOBJ_LockBitmap(CurIconObject->IconInfo.hbmMask)))
{
- if(CurIconObject->IconInfo.hbmMask &&
- (bmp = BITMAPOBJ_LockBitmap(CurIconObject->IconInfo.hbmMask)))
- {
- CurIconObject->Size.cx = bmp->SurfObj.sizlBitmap.cx;
- CurIconObject->Size.cy = bmp->SurfObj.sizlBitmap.cy / 2;
- BITMAPOBJ_UnlockBitmap(CurIconObject->IconInfo.hbmMask);
- GDIOBJ_SetOwnership(CurIconObject->IconInfo.hbmMask, NULL);
- }
+ CurIconObject->Size.cx = bmp->SurfObj.sizlBitmap.cx;
+ CurIconObject->Size.cy = bmp->SurfObj.sizlBitmap.cy / 2;
+ BITMAPOBJ_UnlockBitmap(CurIconObject->IconInfo.hbmMask);
+ GDIOBJ_SetOwnership(CurIconObject->IconInfo.hbmMask, NULL);
}
}
else
reactos/subsys/win32k/ntuser
diff -u -r1.24.2.3 -r1.24.2.4
--- desktop.c 13 Dec 2004 16:18:17 -0000 1.24.2.3
+++ desktop.c 30 Dec 2004 04:37:10 -0000 1.24.2.4
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: desktop.c,v 1.24.2.3 2004/12/13 16:18:17 hyperion Exp $
+ * $Id: desktop.c,v 1.24.2.4 2004/12/30 04:37:10 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
reactos/subsys/win32k/ntuser
diff -u -r1.25.2.3 -r1.25.2.4
--- focus.c 13 Dec 2004 16:18:17 -0000 1.25.2.3
+++ focus.c 30 Dec 2004 04:37:10 -0000 1.25.2.4
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: focus.c,v 1.25.2.3 2004/12/13 16:18:17 hyperion Exp $
+ * $Id: focus.c,v 1.25.2.4 2004/12/30 04:37:10 hyperion Exp $
*/
#include <w32k.h>
@@ -238,12 +238,18 @@
if (Top != Window->Self)
{
TopWindow = IntGetWindowObject(Top);
+ if (TopWindow == NULL)
+ {
+ SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE);
+ return FALSE;
+ }
}
else
{
TopWindow = Window;
}
+ /* TMN: Check return valud from this function? */
IntSetForegroundAndFocusWindow(TopWindow, Window, TRUE);
if (Top != Window->Self)
reactos/subsys/win32k/ntuser
diff -u -r1.20 -r1.20.8.1
--- guicheck.c 8 Aug 2004 17:57:34 -0000 1.20
+++ guicheck.c 30 Dec 2004 04:37:10 -0000 1.20.8.1
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: guicheck.c,v 1.20 2004/08/08 17:57:34 weiden Exp $
+/* $Id: guicheck.c,v 1.20.8.1 2004/12/30 04:37:10 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
reactos/subsys/win32k/ntuser
diff -u -r1.38.6.2 -r1.38.6.3
--- input.c 13 Dec 2004 16:18:17 -0000 1.38.6.2
+++ input.c 30 Dec 2004 04:37:10 -0000 1.38.6.3
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: input.c,v 1.38.6.2 2004/12/13 16:18:17 hyperion Exp $
+/* $Id: input.c,v 1.38.6.3 2004/12/30 04:37:10 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -324,6 +324,12 @@
/* Context mode. 1 if ALT if pressed while the key is pressed */
lParam |= (1 << 29);
}
+
+ if (! KeyEvent.bKeyDown)
+ {
+ /* Transition state. 1 for KEY_UP etc, 0 for KEY_DOWN */
+ lParam |= (1 << 31);
+ }
if (GetHotKey(InputWindowStation,
fsModifiers,
reactos/subsys/win32k/ntuser
diff -u -r1.33 -r1.33.2.1
--- keyboard.c 15 Nov 2004 16:36:28 -0000 1.33
+++ keyboard.c 30 Dec 2004 04:37:10 -0000 1.33.2.1
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: keyboard.c,v 1.33 2004/11/15 16:36:28 ekohl Exp $
+/* $Id: keyboard.c,v 1.33.2.1 2004/12/30 04:37:10 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -342,16 +342,23 @@
HKL dwhkl ) {
int ToUnicodeResult = 0;
- IntLockQueueState;
- ToUnicodeResult = ToUnicodeInner( wVirtKey,
- wScanCode,
- lpKeyState,
- pwszBuff,
- cchBuff,
- wFlags,
- PsGetWin32Thread() ?
- PsGetWin32Thread()->KeyboardLayout : 0 );
- IntUnLockQueueState;
+ if (0 == (lpKeyState[wVirtKey] & KS_DOWN_BIT))
+ {
+ ToUnicodeResult = 0;
+ }
+ else
+ {
+ IntLockQueueState;
+ ToUnicodeResult = ToUnicodeInner( wVirtKey,
+ wScanCode,
+ lpKeyState,
+ pwszBuff,
+ cchBuff,
+ wFlags,
+ PsGetWin32Thread() ?
+ PsGetWin32Thread()->KeyboardLayout : 0 );
+ IntUnLockQueueState;
+ }
return ToUnicodeResult;
}
@@ -660,14 +667,14 @@
NewMsg.wParam = dead_char;
NewMsg.lParam = lpMsg->lParam;
dead_char = 0;
- MsqPostMessage(PsGetWin32Thread()->MessageQueue, &NewMsg, FALSE);
+ MsqPostMessage(PsGetWin32Thread()->MessageQueue, &NewMsg, FALSE, QS_KEY);
}
NewMsg.hwnd = lpMsg->hwnd;
NewMsg.wParam = wp[0];
NewMsg.lParam = lpMsg->lParam;
DPRINT( "CHAR='%c' %04x %08x\n", wp[0], wp[0], lpMsg->lParam );
- MsqPostMessage(PsGetWin32Thread()->MessageQueue, &NewMsg, FALSE);
+ MsqPostMessage(PsGetWin32Thread()->MessageQueue, &NewMsg, FALSE, QS_KEY);
Result = TRUE;
}
else if (UState == -1)
@@ -678,7 +685,7 @@
NewMsg.wParam = wp[0];
NewMsg.lParam = lpMsg->lParam;
dead_char = wp[0];
- MsqPostMessage(PsGetWin32Thread()->MessageQueue, &NewMsg, FALSE);
+ MsqPostMessage(PsGetWin32Thread()->MessageQueue, &NewMsg, FALSE, QS_KEY);
Result = TRUE;
}
reactos/subsys/win32k/ntuser
diff -u -r1.56 -r1.56.2.1
--- menu.c 20 Nov 2004 16:46:06 -0000 1.56
+++ menu.c 30 Dec 2004 04:37:10 -0000 1.56.2.1
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: menu.c,v 1.56 2004/11/20 16:46:06 weiden Exp $
+/* $Id: menu.c,v 1.56.2.1 2004/12/30 04:37:10 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -631,11 +631,8 @@
BOOL FASTCALL
IntGetMenuItemInfo(PMENU_OBJECT MenuObject, PMENU_ITEM MenuItem, PROSMENUITEMINFO lpmii)
{
- UNICODE_STRING Text;
NTSTATUS Status;
- lpmii->cch = MenuItem->Text.Length / sizeof(WCHAR);
-
if(lpmii->fMask & MIIM_BITMAP)
{
lpmii->hbmpItem = MenuItem->hbmpItem;
@@ -665,31 +662,23 @@
{
lpmii->hSubMenu = MenuItem->hSubMenu;
}
- if (0 != (lpmii->fMask & MIIM_STRING) ||
- 0 != (lpmii->fMask & MIIM_TYPE))
+ if (lpmii->fMask & (MIIM_STRING | MIIM_TYPE))
{
- Status = MmCopyFromCaller(&Text, lpmii->dwTypeData, sizeof(UNICODE_STRING));
- if (! NT_SUCCESS(Status))
+ if (lpmii->dwTypeData == NULL)
{
- SetLastNtError(Status);
- return FALSE;
+ lpmii->cch = MenuItem->Text.Length / sizeof(WCHAR);
}
- Text.Length = min(Text.MaximumLength, MenuItem->Text.Length);
- if (0 != Text.Length)
+ else
{
- Status = MmCopyToCaller(Text.Buffer, MenuItem->Text.Buffer, Text.Length);
+ Status = MmCopyToCaller(lpmii->dwTypeData, MenuItem->Text.Buffer,
+ min(lpmii->cch * sizeof(WCHAR),
+ MenuItem->Text.MaximumLength));
if (! NT_SUCCESS(Status))
{
SetLastNtError(Status);
return FALSE;
}
}
- Status = MmCopyToCaller(lpmii->dwTypeData, &Text, sizeof(UNICODE_STRING));
- if (! NT_SUCCESS(Status))
- {
- SetLastNtError(Status);
- return FALSE;
- }
}
if (sizeof(ROSMENUITEMINFO) == lpmii->cbSize)
@@ -704,8 +693,6 @@
BOOL FASTCALL
IntSetMenuItemInfo(PMENU_OBJECT MenuObject, PMENU_ITEM MenuItem, PROSMENUITEMINFO lpmii)
{
- PUNICODE_STRING Source;
- UINT copylen = 0;
PMENU_OBJECT SubMenuObject;
if(!MenuItem || !MenuObject || !lpmii)
@@ -730,6 +717,16 @@
}
if(lpmii->fMask & (MIIM_FTYPE | MIIM_TYPE))
{
+ /*
+ * Delete the menu item type when changing type from
+ * MF_STRING.
+ */
+ if (MenuItem->fType != lpmii->fType &&
+ MENU_ITEM_TYPE(MenuItem->fType) == MF_STRING)
+ {
+ FreeMenuText(MenuItem);
+ RtlInitUnicodeString(&MenuItem->Text, NULL);
+ }
MenuItem->fType = lpmii->fType;
}
if(lpmii->fMask & MIIM_ID)
@@ -750,36 +747,50 @@
{
MenuItem->hSubMenu = lpmii->hSubMenu;
/* Make sure the submenu is marked as a popup menu */
- if (0 != (MenuItem->fType & MF_POPUP))
+ if (MenuItem->hSubMenu)
{
SubMenuObject = IntGetMenuObject(MenuItem->hSubMenu);
- if (NULL != SubMenuObject)
+ if (SubMenuObject != NULL)
{
SubMenuObject->MenuInfo.Flags |= MF_POPUP;
+ MenuItem->fType |= MF_POPUP;
IntReleaseMenuObject(SubMenuObject);
}
+ else
+ {
+ MenuItem->fType &= ~MF_POPUP;
+ }
+ }
+ else
+ {
+ MenuItem->fType &= ~MF_POPUP;
}
}
- if((lpmii->fMask & (MIIM_TYPE | MIIM_STRING)) &&
- (MENU_ITEM_TYPE(lpmii->fType) == MF_STRING))
+ if ((lpmii->fMask & (MIIM_TYPE | MIIM_STRING)) &&
+ (MENU_ITEM_TYPE(lpmii->fType) == MF_STRING))
{
+ FreeMenuText(MenuItem);
+
if(lpmii->dwTypeData && lpmii->cch)
{
- Source = (PUNICODE_STRING)lpmii->dwTypeData;
- FreeMenuText(MenuItem);
- copylen = min((UINT)Source->MaximumLength, (lpmii->cch + 1) * sizeof(WCHAR));
- MenuItem->Text.Buffer = (PWSTR)ExAllocatePoolWithTag(PagedPool, copylen, TAG_STRING);
- if(MenuItem->Text.Buffer)
+ UNICODE_STRING Source;
+
+ Source.Length =
+ Source.MaximumLength = lpmii->cch * sizeof(WCHAR);
+ Source.Buffer = lpmii->dwTypeData;
+
+ MenuItem->Text.Buffer = (PWSTR)ExAllocatePoolWithTag(
+ PagedPool, Source.Length + sizeof(WCHAR), TAG_STRING);
+ if(MenuItem->Text.Buffer != NULL)
{
MenuItem->Text.Length = 0;
- MenuItem->Text.MaximumLength = copylen;
- RtlCopyUnicodeString(&MenuItem->Text, Source);
+ MenuItem->Text.MaximumLength = Source.Length + sizeof(WCHAR);
+ RtlCopyUnicodeString(&MenuItem->Text, &Source);
+ MenuItem->Text.Buffer[MenuItem->Text.Length / sizeof(WCHAR)] = 0;
}
else
{
- MenuItem->Text.Length = 0;
- MenuItem->Text.MaximumLength = 0;
- MenuItem->Text.Buffer = NULL;
+ RtlInitUnicodeString(&MenuItem->Text, NULL);
}
}
else
@@ -788,10 +799,6 @@
RtlInitUnicodeString(&MenuItem->Text, NULL);
}
}
- else
- {
- RtlInitUnicodeString(&MenuItem->Text, NULL);
- }
if (sizeof(ROSMENUITEMINFO) == lpmii->cbSize)
{
reactos/subsys/win32k/ntuser
diff -u -r1.75.2.2 -r1.75.2.3
--- message.c 13 Dec 2004 16:18:17 -0000 1.75.2.2
+++ message.c 30 Dec 2004 04:37:10 -0000 1.75.2.3
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: message.c,v 1.75.2.2 2004/12/13 16:18:17 hyperion Exp $
+/* $Id: message.c,v 1.75.2.3 2004/12/30 04:37:10 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -81,6 +81,7 @@
{ WM_SETTEXT, MMS_SIZE_LPARAMSZ, MMS_FLAG_READ },
{ WM_STYLECHANGED, sizeof(STYLESTRUCT), MMS_FLAG_READ },
{ WM_STYLECHANGING, sizeof(STYLESTRUCT), MMS_FLAG_READWRITE },
+ { WM_COPYDATA, MMS_SIZE_SPECIAL, MMS_FLAG_READ },
{ WM_WINDOWPOSCHANGED, sizeof(WINDOWPOS), MMS_FLAG_READ },
{ WM_WINDOWPOSCHANGING, sizeof(WINDOWPOS), MMS_FLAG_READWRITE },
};
@@ -149,6 +150,9 @@
return wParam ? sizeof(NCCALCSIZE_PARAMS) + sizeof(WINDOWPOS) : sizeof(RECT);
break;
+ case WM_COPYDATA:
+ return sizeof(COPYDATASTRUCT) + ((PCOPYDATASTRUCT)lParam)->cbData;
+
default:
assert(FALSE);
return 0;
@@ -521,7 +525,9 @@
Msg->hwnd = Wnd->Self;
if(!(Wnd->Status & WINDOWSTATUS_DESTROYING))
{
- MsqPostMessage(Wnd->MessageQueue, Msg, FALSE);
+ MsqPostMessage(Wnd->MessageQueue, Msg, FALSE,
+ Msg->message == WM_MOUSEMOVE ? QS_MOUSEMOVE :
+ QS_MOUSEBUTTON);
}
/* eat the message */
@@ -684,7 +690,14 @@
return TRUE;
}
- /* FIXME - get WM_(SYS)TIMER messages */
+ /* Check for WM_(SYS)TIMER messages */
+ Present = MsqGetTimerMessage(ThreadQueue, Wnd, MsgFilterMin, MsgFilterMax,
+ &Msg->Msg, RemoveMessages);
+ if (Present)
+ {
+ Msg->FreeLParam = FALSE;
+ goto MessageFound;
+ }
if(Present)
{
@@ -839,8 +852,8 @@
static BOOL FASTCALL
IntWaitMessage(HWND Wnd,
- UINT MsgFilterMin,
- UINT MsgFilterMax)
+ UINT MsgFilterMin,
+ UINT MsgFilterMax)
{
PUSER_MESSAGE_QUEUE ThreadQueue;
NTSTATUS Status;
@@ -856,9 +869,9 @@
}
/* Nothing found. Wait for new messages. */
- Status = MsqWaitForNewMessages(ThreadQueue);
+ Status = MsqWaitForNewMessages(ThreadQueue, Wnd, MsgFilterMin, MsgFilterMax);
}
- while (STATUS_WAIT_0 <= Status && Status <= STATUS_WAIT_63);
+ while ((STATUS_WAIT_0 <= Status && Status <= STATUS_WAIT_63) || STATUS_TIMEOUT == Status);
SetLastNtError(Status);
@@ -1142,7 +1155,8 @@
KeQueryTickCount(&LargeTickCount);
KernelModeMsg.time = LargeTickCount.u.LowPart;
MsqPostMessage(Window->MessageQueue, &KernelModeMsg,
- NULL != MsgMemoryEntry && 0 != KernelModeMsg.lParam);
+ NULL != MsgMemoryEntry && 0 != KernelModeMsg.lParam,
+ QS_POSTMESSAGE);
IntReleaseWindowObject(Window);
}
@@ -1184,7 +1198,8 @@
return FALSE;
}
MsqPostMessage(pThread->MessageQueue, &KernelModeMsg,
- NULL != MsgMemoryEntry && 0 != KernelModeMsg.lParam);
+ NULL != MsgMemoryEntry && 0 != KernelModeMsg.lParam,
+ QS_POSTMESSAGE);
ObDereferenceObject( peThread );
return TRUE;
} else {
@@ -1610,7 +1625,7 @@
IntLockMessageQueue(Queue);
- Result = MAKELONG(Queue->ChangedBits, Queue->WakeBits);
+ Result = MAKELONG(Queue->QueueBits, Queue->ChangedBits);
if (ClearChanges)
{
Queue->ChangedBits = 0;
reactos/subsys/win32k/ntuser
diff -u -r1.88.2.3 -r1.88.2.4
--- misc.c 13 Dec 2004 16:18:17 -0000 1.88.2.3
+++ misc.c 30 Dec 2004 04:37:11 -0000 1.88.2.4
@@ -1,4 +1,4 @@
-/* $Id: misc.c,v 1.88.2.3 2004/12/13 16:18:17 hyperion Exp $
+/* $Id: misc.c,v 1.88.2.4 2004/12/30 04:37:11 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -135,6 +135,9 @@
Result = (DWORD)GDI_MapHandleTable(NtCurrentProcess());
break;
+ case NOPARAM_ROUTINE_MSQCLEARWAKEMASK:
+ return (DWORD)IntMsqClearWakeMask();
+
default:
DPRINT1("Calling invalid routine number 0x%x in NtUserCallNoParam\n", Routine);
SetLastWin32Error(ERROR_INVALID_PARAMETER);
@@ -333,6 +336,9 @@
return FALSE;
}
+
+ case ONEPARAM_ROUTINE_MSQSETWAKEMASK:
+ return (DWORD)IntMsqSetWakeMask(Param);
}
DPRINT1("Calling invalid routine number 0x%x in NtUserCallOneParam(), Param=0x%x\n",
Routine, Param);
reactos/subsys/win32k/ntuser
diff -u -r1.2 -r1.2.2.1
--- monitor.c 20 Nov 2004 16:46:06 -0000 1.2
+++ monitor.c 30 Dec 2004 04:37:11 -0000 1.2.2.1
@@ -878,6 +878,23 @@
IN HWND hWnd,
IN DWORD dwFlags)
{
- UNIMPLEMENTED;
- return (HMONITOR)NULL;
+ PWINDOW_OBJECT Window;
+ HMONITOR hMonitor = NULL;
+ RECT Rect;
+
+ Window = IntGetWindowObject(hWnd);
+ if (Window == NULL)
+ {
+ SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE);
+ return (HMONITOR)NULL;
+ }
+
+ Rect.left = Rect.right = Window->WindowRect.left;
+ Rect.top = Rect.bottom = Window->WindowRect.bottom;
+
+ IntGetMonitorsFromRect(&Rect, &hMonitor, NULL, 1, dwFlags);
+
+ IntReleaseWindowObject(Window);
+
+ return hMonitor;
}
reactos/subsys/win32k/ntuser
diff -u -r1.108.2.2 -r1.108.2.3
--- msgqueue.c 13 Dec 2004 16:18:17 -0000 1.108.2.2
+++ msgqueue.c 30 Dec 2004 04:37:11 -0000 1.108.2.3
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: msgqueue.c,v 1.108.2.2 2004/12/13 16:18:17 hyperion Exp $
+/* $Id: msgqueue.c,v 1.108.2.3 2004/12/30 04:37:11 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -53,6 +53,7 @@
static KEVENT HardwareMessageEvent;
static PAGED_LOOKASIDE_LIST MessageLookasideList;
+static PAGED_LOOKASIDE_LIST TimerLookasideList;
#define IntLockSystemMessageQueue(OldIrql) \
KeAcquireSpinLock(&SystemMessageQueueLock, &OldIrql)
@@ -65,19 +66,42 @@
/* FUNCTIONS *****************************************************************/
-/* set some queue bits */
-inline VOID MsqSetQueueBits( PUSER_MESSAGE_QUEUE Queue, WORD Bits )
+HANDLE FASTCALL
+IntMsqSetWakeMask(DWORD WakeMask)
{
- Queue->WakeBits |= Bits;
- Queue->ChangedBits |= Bits;
- if (MsqIsSignaled( Queue )) KeSetEvent(&Queue->NewMessages, IO_NO_INCREMENT, FALSE);
+ PW32THREAD Win32Thread;
+ PUSER_MESSAGE_QUEUE MessageQueue;
+ HANDLE MessageEventHandle;
+
+ Win32Thread = PsGetWin32Thread();
+ if (Win32Thread == NULL || Win32Thread->MessageQueue == NULL)
+ return 0;
+
+ MessageQueue = Win32Thread->MessageQueue;
+ IntLockMessageQueue(MessageQueue);
+ MessageQueue->WakeMask = WakeMask;
+ MessageEventHandle = MessageQueue->NewMessagesHandle;
+ IntUnLockMessageQueue(MessageQueue);
+
+ return MessageEventHandle;
}
-/* clear some queue bits */
-inline VOID MsqClearQueueBits( PUSER_MESSAGE_QUEUE Queue, WORD Bits )
+BOOL FASTCALL
+IntMsqClearWakeMask(VOID)
{
- Queue->WakeBits &= ~Bits;
- Queue->ChangedBits &= ~Bits;
+ PW32THREAD Win32Thread;
+ PUSER_MESSAGE_QUEUE MessageQueue;
+
+ Win32Thread = PsGetWin32Thread();
+ if (Win32Thread == NULL || Win32Thread->MessageQueue == NULL)
+ return FALSE;
+
+ MessageQueue = Win32Thread->MessageQueue;
+ IntLockMessageQueue(MessageQueue);
+ MessageQueue->WakeMask = ~0;
+ IntUnLockMessageQueue(MessageQueue);
+
+ return TRUE;
}
VOID FASTCALL
@@ -86,7 +110,10 @@
IntLockMessageQueue(Queue);
Queue->PaintCount++;
Queue->PaintPosted = TRUE;
- KeSetEvent(&Queue->NewMessages, IO_NO_INCREMENT, FALSE);
+ Queue->QueueBits |= QS_PAINT;
+ Queue->ChangedBits |= QS_PAINT;
+ if (Queue->WakeMask & QS_PAINT)
+ KeSetEvent(Queue->NewMessages, IO_NO_INCREMENT, FALSE);
IntUnLockMessageQueue(Queue);
}
@@ -119,6 +146,13 @@
sizeof(USER_MESSAGE),
0,
256);
+ ExInitializePagedLookasideList(&TimerLookasideList,
+ NULL,
+ NULL,
+ 0,
+ sizeof(TIMER_ENTRY),
+ 0,
+ 64);
return(STATUS_SUCCESS);
}
@@ -305,10 +339,21 @@
}
/* save the pointer to the WM_MOUSEMOVE message in the new queue */
Window->MessageQueue->MouseMoveMsg = Message;
+
+ Window->MessageQueue->QueueBits |= QS_MOUSEMOVE;
+ Window->MessageQueue->ChangedBits |= QS_MOUSEMOVE;
+ if (Window->MessageQueue->WakeMask & QS_MOUSEMOVE)
+ KeSetEvent(Window->MessageQueue->NewMessages, IO_NO_INCREMENT, FALSE);
+ }
+ else
+ {
+ Window->MessageQueue->QueueBits |= QS_MOUSEBUTTON;
+ Window->MessageQueue->ChangedBits |= QS_MOUSEBUTTON;
+ if (Window->MessageQueue->WakeMask & QS_MOUSEBUTTON)
+ KeSetEvent(Window->MessageQueue->NewMessages, IO_NO_INCREMENT, FALSE);
}
IntUnLockHardwareMessageQueue(Window->MessageQueue);
- KeSetEvent(&Window->MessageQueue->NewMessages, IO_NO_INCREMENT, FALSE);
*Freed = FALSE;
IntReleaseWindowObject(Window);
return(FALSE);
@@ -416,7 +461,7 @@
return FALSE;
}
- WaitObjects[1] = &MessageQueue->NewMessages;
+ WaitObjects[1] = MessageQueue->NewMessages;
WaitObjects[0] = &HardwareMessageQueueLock;
do
{
@@ -585,7 +630,7 @@
FocusMessageQueue = IntGetFocusMessageQueue();
if( !IntGetScreenDC() ) {
if( W32kGetPrimitiveMessageQueue() ) {
- MsqPostMessage(W32kGetPrimitiveMessageQueue(), &Msg, FALSE);
+ MsqPostMessage(W32kGetPrimitiveMessageQueue(), &Msg, FALSE, QS_KEY);
}
} else {
if (FocusMessageQueue == NULL)
@@ -598,7 +643,7 @@
{
Msg.hwnd = FocusMessageQueue->FocusWindow;
DPRINT("Msg.hwnd = %x\n", Msg.hwnd);
- MsqPostMessage(FocusMessageQueue, &Msg, FALSE);
+ MsqPostMessage(FocusMessageQueue, &Msg, FALSE, QS_KEY);
}
else
{
@@ -647,14 +692,14 @@
// Mesg.pt.y = PsGetWin32Process()->WindowStation->SystemCursor.y;
// KeQueryTickCount(&LargeTickCount);
// Mesg.time = LargeTickCount.u.LowPart;
- MsqPostMessage(Window->MessageQueue, &Mesg, FALSE);
+ MsqPostMessage(Window->MessageQueue, &Mesg, FALSE, QS_HOTKEY);
ObmDereferenceObject(Window);
ObDereferenceObject (Thread);
// IntLockMessageQueue(pThread->MessageQueue);
// InsertHeadList(&pThread->MessageQueue->PostedMessagesListHead,
// &Message->ListEntry);
-// KeSetEvent(&pThread->MessageQueue->NewMessages, IO_NO_INCREMENT, FALSE);
+// KeSetEvent(pThread->MessageQueue->NewMessages, IO_NO_INCREMENT, FALSE);
// IntUnLockMessageQueue(pThread->MessageQueue);
}
@@ -894,7 +939,10 @@
IntLockMessageQueue(MessageQueue);
InsertTailList(&MessageQueue->NotifyMessagesListHead,
&NotifyMessage->ListEntry);
- KeSetEvent(&MessageQueue->NewMessages, IO_NO_INCREMENT, FALSE);
+ MessageQueue->QueueBits |= QS_SENDMESSAGE;
+ MessageQueue->ChangedBits |= QS_SENDMESSAGE;
+ if (MessageQueue->WakeMask & QS_SENDMESSAGE)
+ KeSetEvent(MessageQueue->NewMessages, IO_NO_INCREMENT, FALSE);
IntUnLockMessageQueue(MessageQueue);
}
@@ -949,7 +997,10 @@
InsertTailList(&MessageQueue->SentMessagesListHead, &Message->ListEntry);
IntUnLockMessageQueue(MessageQueue);
- KeSetEvent(&MessageQueue->NewMessages, IO_NO_INCREMENT, FALSE);
+ MessageQueue->QueueBits |= QS_SENDMESSAGE;
+ MessageQueue->ChangedBits |= QS_SENDMESSAGE;
+ if (MessageQueue->WakeMask & QS_SENDMESSAGE)
+ KeSetEvent(MessageQueue->NewMessages, IO_NO_INCREMENT, FALSE);
/* we can't access the Message anymore since it could have already been deleted! */
@@ -1010,7 +1061,7 @@
PVOID WaitObjects[2];
WaitObjects[0] = &CompletionEvent;
- WaitObjects[1] = &ThreadQueue->NewMessages;
+ WaitObjects[1] = ThreadQueue->NewMessages;
do
{
WaitStatus = KeWaitForMultipleObjects(2, WaitObjects, WaitAny, UserRequest,
@@ -1073,7 +1124,8 @@
}
VOID FASTCALL
-MsqPostMessage(PUSER_MESSAGE_QUEUE MessageQueue, MSG* Msg, BOOLEAN FreeLParam)
+MsqPostMessage(PUSER_MESSAGE_QUEUE MessageQueue, MSG* Msg, BOOLEAN FreeLParam,
+ DWORD MessageBits)
{
PUSER_MESSAGE Message;
@@ -1084,7 +1136,10 @@
IntLockMessageQueue(MessageQueue);
InsertTailList(&MessageQueue->PostedMessagesListHead,
&Message->ListEntry);
- KeSetEvent(&MessageQueue->NewMessages, IO_NO_INCREMENT, FALSE);
+ MessageQueue->QueueBits |= MessageBits;
+ MessageQueue->ChangedBits |= MessageBits;
+ if (MessageQueue->WakeMask & MessageBits)
+ KeSetEvent(MessageQueue->NewMessages, IO_NO_INCREMENT, FALSE);
IntUnLockMessageQueue(MessageQueue);
}
@@ -1094,7 +1149,10 @@
IntLockMessageQueue(MessageQueue);
MessageQueue->QuitPosted = TRUE;
MessageQueue->QuitExitCode = ExitCode;
- KeSetEvent(&MessageQueue->NewMessages, IO_NO_INCREMENT, FALSE);
+ MessageQueue->QueueBits |= QS_POSTMESSAGE;
+ MessageQueue->ChangedBits |= QS_POSTMESSAGE;
+ if (MessageQueue->WakeMask & QS_POSTMESSAGE)
+ KeSetEvent(MessageQueue->NewMessages, IO_NO_INCREMENT, FALSE);
IntUnLockMessageQueue(MessageQueue);
}
@@ -1145,16 +1203,29 @@
}
NTSTATUS FASTCALL
-MsqWaitForNewMessages(PUSER_MESSAGE_QUEUE MessageQueue)
+MsqWaitForNewMessages(PUSER_MESSAGE_QUEUE MessageQueue, HWND WndFilter,
+ UINT MsgFilterMin, UINT MsgFilterMax)
{
- PVOID WaitObjects[2] = {&MessageQueue->NewMessages, &HardwareMessageEvent};
+ PVOID WaitObjects[2] = {MessageQueue->NewMessages, &HardwareMessageEvent};
+ LARGE_INTEGER TimerExpiry;
+ PLARGE_INTEGER Timeout;
+
+ if (MsqGetFirstTimerExpiry(MessageQueue, WndFilter, MsgFilterMin, MsgFilterMax, &TimerExpiry))
+ {
+ Timeout = &TimerExpiry;
+ }
+ else
+ {
+ Timeout = NULL;
+ }
+
return(KeWaitForMultipleObjects(2,
WaitObjects,
WaitAny,
Executive,
UserMode,
FALSE,
- NULL,
+ Timeout,
NULL));
}
@@ -1167,28 +1238,50 @@
return ((LargeTickCount.u.LowPart - MessageQueue->LastMsgRead) > MSQ_HUNG);
}
-VOID FASTCALL
+BOOLEAN FASTCALL
MsqInitializeMessageQueue(struct _ETHREAD *Thread, PUSER_MESSAGE_QUEUE MessageQueue)
{
LARGE_INTEGER LargeTickCount;
+ NTSTATUS Status;
MessageQueue->Thread = Thread;
MessageQueue->CaretInfo = (PTHRDCARETINFO)(MessageQueue + 1);
InitializeListHead(&MessageQueue->PostedMessagesListHead);
InitializeListHead(&MessageQueue->SentMessagesListHead);
InitializeListHead(&MessageQueue->HardwareMessagesListHead);
+ InitializeListHead(&MessageQueue->TimerListHead);
InitializeListHead(&MessageQueue->DispatchingMessagesHead);
InitializeListHead(&MessageQueue->LocalDispatchingMessagesHead);
KeInitializeMutex(&MessageQueue->HardwareLock, 0);
ExInitializeFastMutex(&MessageQueue->Lock);
MessageQueue->QuitPosted = FALSE;
MessageQueue->QuitExitCode = 0;
- KeInitializeEvent(&MessageQueue->NewMessages, SynchronizationEvent, FALSE);
KeQueryTickCount(&LargeTickCount);
MessageQueue->LastMsgRead = LargeTickCount.u.LowPart;
MessageQueue->FocusWindow = NULL;
MessageQueue->PaintPosted = FALSE;
MessageQueue->PaintCount = 0;
+ MessageQueue->WakeMask = ~0;
+ MessageQueue->NewMessagesHandle = NULL;
+
+ Status = ZwCreateEvent(&MessageQueue->NewMessagesHandle, EVENT_ALL_ACCESS,
+ NULL, SynchronizationEvent, FALSE);
+ if (!NT_SUCCESS(Status))
+ {
+ return FALSE;
+ }
+
+ Status = ObReferenceObjectByHandle(MessageQueue->NewMessagesHandle, 0,
+ ExEventObjectType, KernelMode,
+ (PVOID*)&MessageQueue->NewMessages, NULL);
+ if (!NT_SUCCESS(Status))
+ {
+ ZwClose(MessageQueue->NewMessagesHandle);
+ MessageQueue->NewMessagesHandle = NULL;
+ return FALSE;
+ }
+
+ return TRUE;
}
VOID FASTCALL
@@ -1196,6 +1289,7 @@
{
PLIST_ENTRY CurrentEntry;
PUSER_MESSAGE CurrentMessage;
+ PTIMER_ENTRY CurrentTimer;
PUSER_SENT_MESSAGE CurrentSentMessage;
IntLockMessageQueue(MessageQueue);
@@ -1240,6 +1334,14 @@
ExFreePool(CurrentSentMessage);
}
+ /* cleanup timers */
+ while (! IsListEmpty(&MessageQueue->TimerListHead))
+ {
+ CurrentEntry = RemoveHeadList(&MessageQueue->TimerListHead);
+ CurrentTimer = CONTAINING_RECORD(CurrentEntry, TIMER_ENTRY, ListEntry);
+ ExFreeToPagedLookasideList(&TimerLookasideList, CurrentTimer);
+ }
+
/* notify senders of dispatching messages. This needs to be cleaned up if e.g.
ExitThread() was called in a SendMessage() umode callback */
while (!IsListEmpty(&MessageQueue->LocalDispatchingMessagesHead))
@@ -1298,7 +1400,11 @@
/* hold at least one reference until it'll be destroyed */
IntReferenceMessageQueue(MessageQueue);
/* initialize the queue */
- MsqInitializeMessageQueue(Thread, MessageQueue);
+ if (!MsqInitializeMessageQueue(Thread, MessageQueue))
+ {
+ IntDereferenceMessageQueue(MessageQueue);
+ return NULL;
+ }
return MessageQueue;
}
@@ -1401,4 +1507,300 @@
return NULL;
}
+#ifndef NDEBUG
+static VOID FASTCALL
+DumpTimerList(PUSER_MESSAGE_QUEUE MessageQueue)
+{
+ PLIST_ENTRY Current;
+ PTIMER_ENTRY Timer;
+
+ Current = MessageQueue->TimerListHead.Flink;
+ if (Current == &MessageQueue->TimerListHead)
+ {
+ DPRINT("timer list is empty for queue %p\n", MessageQueue);
+ }
+ while (Current != &MessageQueue->TimerListHead)
+ {
+ Timer = CONTAINING_RECORD(Current, TIMER_ENTRY, ListEntry);
+ DPRINT("queue %p timer %p expiry %I64d wnd %x id %p period %u timerproc %p msg %u\n",
+ MessageQueue, Timer, Timer->ExpiryTime.QuadPart, Timer->Wnd, Timer->IDEvent,
+ Timer->Period, Timer->TimerFunc, Timer->Msg);
+ Current = Current->Flink;
+ }
+}
+#endif /* ! defined(NDEBUG) */
+
+/* Must have the message queue locked while calling this */
+static VOID FASTCALL
+InsertTimer(PUSER_MESSAGE_QUEUE MessageQueue, PTIMER_ENTRY NewTimer)
+{
+ PLIST_ENTRY Current;
+
+ Current = MessageQueue->TimerListHead.Flink;
+ while (Current != &MessageQueue->TimerListHead)
+ {
+ if (NewTimer->ExpiryTime.QuadPart <
+ CONTAINING_RECORD(Current, TIMER_ENTRY, ListEntry)->ExpiryTime.QuadPart)
+ {
+ break;
+ }
+ Current = Current->Flink;
+ }
+
+ InsertTailList(Current, &NewTimer->ListEntry);
+}
+
+/* Must have the message queue locked while calling this */
+static PTIMER_ENTRY FASTCALL
+RemoveTimer(PUSER_MESSAGE_QUEUE MessageQueue, HWND Wnd, UINT_PTR IDEvent, UINT Msg)
+{
+ PTIMER_ENTRY Timer;
+ PLIST_ENTRY EnumEntry;
+
+ /* Remove timer if already in the queue */
+ EnumEntry = MessageQueue->TimerListHead.Flink;
+ while (EnumEntry != &MessageQueue->TimerListHead)
+ {
+ Timer = CONTAINING_RECORD(EnumEntry, TIMER_ENTRY, ListEntry);
+ EnumEntry = EnumEntry->Flink;
+
+ if (Timer->Wnd == Wnd &&
+ Timer->IDEvent == IDEvent &&
+ Timer->Msg == Msg)
+ {
+ RemoveEntryList(&Timer->ListEntry);
+ return Timer;
+ }
+ }
+
+ return NULL;
+}
+
+BOOLEAN FASTCALL
+MsqSetTimer(PUSER_MESSAGE_QUEUE MessageQueue, HWND Wnd,
+ UINT_PTR IDEvent, UINT Period, TIMERPROC TimerFunc,
+ UINT Msg)
+{
+ PTIMER_ENTRY Timer;
+ LARGE_INTEGER CurrentTime;
+
+ DPRINT("MsqSetTimer queue %p wnd %x id %p period %u timerproc %p msg %d\n",
+ MessageQueue, Wnd, IDEvent, Period, TimerFunc, Msg);
+
+ IntLockMessageQueue(MessageQueue);
+ Timer = RemoveTimer(MessageQueue, Wnd, IDEvent, Msg);
+ if (NULL == Timer)
+ {
+ Timer = ExAllocateFromPagedLookasideList(&TimerLookasideList);
+ if (NULL == Timer)
+ {
+ IntUnLockMessageQueue(MessageQueue);
+ DPRINT1("Failed to allocate timer entry\n");
+ return FALSE;
+ }
+ DPRINT("Allocated new timer entry %p\n", Timer);
+ Timer->Wnd = Wnd;
+ Timer->IDEvent = IDEvent;
+ Timer->Msg = Msg;
+ }
+ else
+ {
+ DPRINT("Updating existing timer entry %p\n", Timer);
+ }
+
+ KeQuerySystemTime(&CurrentTime);
+ Timer->ExpiryTime.QuadPart = CurrentTime.QuadPart +
+ (ULONGLONG) Period * (ULONGLONG) 10000;
+ Timer->Period = Period;
+ Timer->TimerFunc = TimerFunc;
+ DPRINT("Insert timer now %I64d expiry %I64d\n", CurrentTime.QuadPart,
+ Timer->ExpiryTime.QuadPart);
+
+ InsertTimer(MessageQueue, Timer);
+
+#ifndef NDEBUG
+ DumpTimerList(MessageQueue);
+#endif /* ! defined(NDEBUG) */
+
+ IntUnLockMessageQueue(MessageQueue);
+
+ return TRUE;
+}
+
+BOOLEAN FASTCALL
+MsqKillTimer(PUSER_MESSAGE_QUEUE MessageQueue, HWND Wnd,
+ UINT_PTR IDEvent, UINT Msg)
+{
+ PTIMER_ENTRY Timer;
+
+ DPRINT("MsqKillTimer queue %p wnd %x id %p msg %d\n",
+ MessageQueue, Wnd, IDEvent, Msg);
+
+ IntLockMessageQueue(MessageQueue);
+ Timer = RemoveTimer(MessageQueue, Wnd, IDEvent, Msg);
+
+ if (NULL == Timer)
+ {
+ DPRINT("Failed to remove timer from list, not found\n");
+ }
+ else
+ {
+ ExFreeToPagedLookasideList(&TimerLookasideList, Timer);
+ }
+
+#ifndef NDEBUG
+ DumpTimerList(MessageQueue);
+#endif /* ! defined(NDEBUG) */
+
+ IntUnLockMessageQueue(MessageQueue);
+
+ return NULL != Timer;
+}
+
+BOOLEAN FASTCALL
+MsqGetTimerMessage(PUSER_MESSAGE_QUEUE MessageQueue,
+ HWND WndFilter, UINT MsgFilterMin, UINT MsgFilterMax,
+ MSG *Msg, BOOLEAN Restart)
+{
+ PTIMER_ENTRY Timer;
+ LARGE_INTEGER CurrentTime;
+ PLIST_ENTRY EnumEntry;
+ BOOLEAN GotMessage;
+
+ DPRINT("MsqGetTimerMessage queue %p msg %p restart %s\n",
+ MessageQueue, Msg, Restart ? "TRUE" : "FALSE");
+
+ IntLockMessageQueue(MessageQueue);
+ KeQuerySystemTime(&CurrentTime);
+ DPRINT("Current time %I64d\n", CurrentTime.QuadPart);
+ EnumEntry = MessageQueue->TimerListHead.Flink;
+ GotMessage = FALSE;
+ while (EnumEntry != &MessageQueue->TimerListHead)
+ {
+ Timer = CONTAINING_RECORD(MessageQueue->TimerListHead.Flink,
+ TIMER_ENTRY, ListEntry);
+ DPRINT("Checking timer %p wnd %x expiry %I64d\n", Timer, Timer->wnd,
+ Timer->ExpiryTime.QuadPart);
+ EnumEntry = EnumEntry->Flink;
+ if ((NULL == WndFilter || Timer->Wnd == WndFilter) &&
+ ((MsgFilterMin == 0 && MsgFilterMax == 0) ||
+ (MsgFilterMin <= Timer->Msg &&
+ Timer->Msg <= MsgFilterMax)))
+ {
+ if (Timer->ExpiryTime.QuadPart <= CurrentTime.QuadPart)
+ {
+ DPRINT("Timer is expired\n");
+ GotMessage = TRUE;
+ break;
+ }
+ else
+ {
+ DPRINT("No need to check later timers\n");
+ break;
+ }
+ }
+ else
+ {
+ DPRINT("timer %p (wnd %x msg %d) failed filter wnd %x msgmin %d msgmax %d\n",
+ Timer, Timer->Wnd, Timer->Msg, WndFilter, MsgFilterMin, MsgFilterMax);
+ }
+ }
+
+ if (! GotMessage)
+ {
+ DPRINT("No timer pending\n");
+ IntUnLockMessageQueue(MessageQueue);
+ return FALSE;
+ }
+
+ Msg->hwnd = Timer->Wnd;
+ Msg->message = Timer->Msg;
+ Msg->wParam = (WPARAM) Timer->IDEvent;
+ Msg->lParam = (LPARAM) Timer->TimerFunc;
+
+ if (Restart)
+ {
+ RemoveEntryList(&Timer->ListEntry);
+ Timer->ExpiryTime.QuadPart = CurrentTime.QuadPart +
+ (ULONGLONG) Timer->Period * (ULONGLONG) 10000;
+ DPRINT("Restarting timer %p expires %I64d\n", Timer, Timer->ExpiryTime.QuadPart);
+ InsertTimer(MessageQueue, Timer);
+
+#ifndef NDEBUG
+ DumpTimerList(MessageQueue);
+#endif /* ! defined(NDEBUG) */
+ }
+
+ IntUnLockMessageQueue(MessageQueue);
+
+ DPRINT("Created message wnd %x msg %d wParam %u lParam %u\n", Msg->hwnd, Msg->message,
+ Msg->wParam, Msg->lParam);
+
+ return TRUE;
+}
+
+VOID FASTCALL
+MsqRemoveTimersWindow(PUSER_MESSAGE_QUEUE MessageQueue, HWND Wnd)
+{
+ PTIMER_ENTRY Timer;
+ PLIST_ENTRY EnumEntry;
+
+ DPRINT("MsqRemoveTimersWindow queue %p wnd %x\n", MessageQueue, Wnd);
+
+ IntLockMessageQueue(MessageQueue);
+ EnumEntry = MessageQueue->TimerListHead.Flink;
+ while (EnumEntry != &MessageQueue->TimerListHead)
+ {
+ Timer = CONTAINING_RECORD(EnumEntry, TIMER_ENTRY, ListEntry);
+ EnumEntry = EnumEntry->Flink;
+ if (Timer->Wnd == Wnd)
+ {
+ DPRINT("Removing timer %p because its window is going away\n", Timer);
+ RemoveEntryList(&Timer->ListEntry);
+ ExFreeToPagedLookasideList(&TimerLookasideList, Timer);
+ }
+ }
+
+#ifndef NDEBUG
+ DumpTimerList(MessageQueue);
+#endif /* ! defined(NDEBUG) */
+
+ IntUnLockMessageQueue(MessageQueue);
+}
+
+BOOLEAN FASTCALL
+MsqGetFirstTimerExpiry(PUSER_MESSAGE_QUEUE MessageQueue,
+ HWND WndFilter, UINT MsgFilterMin, UINT MsgFilterMax,
+ PLARGE_INTEGER FirstTimerExpiry)
+{
+ PTIMER_ENTRY Timer;
+ PLIST_ENTRY EnumEntry;
+
+ DPRINT("MsqGetFirstTimerExpiry queue %p wndfilter %x msgfiltermin %d msgfiltermax %d expiry %p\n",
+ MessageQueue, WndFilter, MsgFilterMin, MsgFilterMax, FirstTimerExpiry);
+
+ IntLockMessageQueue(MessageQueue);
+ EnumEntry = MessageQueue->TimerListHead.Flink;
+ while (EnumEntry != &MessageQueue->TimerListHead)
+ {
+ Timer = CONTAINING_RECORD(MessageQueue->TimerListHead.Flink,
+ TIMER_ENTRY, ListEntry);
+ EnumEntry = EnumEntry->Flink;
+ if ((NULL == WndFilter || Timer->Wnd == WndFilter) &&
+ ((MsgFilterMin == 0 && MsgFilterMax == 0) ||
+ (MsgFilterMin <= Timer->Msg &&
+ Timer->Msg <= MsgFilterMax)))
+ {
+ *FirstTimerExpiry = Timer->ExpiryTime;
+ DPRINT("First timer expires %I64d\n", Timer->ExpiryTime);
+ IntUnLockMessageQueue(MessageQueue);
+ return TRUE;
+ }
+ }
+
+ IntUnLockMessageQueue(MessageQueue);
+
+ return FALSE;
+}
+
/* EOF */
reactos/subsys/win32k/ntuser
diff -u -r1.87.2.3 -r1.87.2.4
--- painting.c 13 Dec 2004 16:18:17 -0000 1.87.2.3
+++ painting.c 30 Dec 2004 04:37:11 -0000 1.87.2.4
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: painting.c,v 1.87.2.3 2004/12/13 16:18:17 hyperion Exp $
+ * $Id: painting.c,v 1.87.2.4 2004/12/30 04:37:11 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
reactos/subsys/win32k/ntuser
diff -u -r1.47.2.3 -r1.47.2.4
--- stubs.c 13 Dec 2004 16:18:18 -0000 1.47.2.3
+++ stubs.c 30 Dec 2004 04:37:11 -0000 1.47.2.4
@@ -1,4 +1,4 @@
-/* $Id: stubs.c,v 1.47.2.3 2004/12/13 16:18:18 hyperion Exp $
+/* $Id: stubs.c,v 1.47.2.4 2004/12/30 04:37:11 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -108,9 +108,9 @@
DWORD dwflags,
LPVOID lParam)
{
- UNIMPLEMENTED
-
- return 0;
+ // UNIMPLEMENTED
+ DbgPrint("(%s:%i) WIN32K: %s UNIMPLEMENTED\n", __FILE__, __LINE__, __FUNCTION__ );
+ return DISP_CHANGE_BADMODE;
}
DWORD
reactos/subsys/win32k/ntuser
diff -u -r1.36 -r1.36.6.1
--- timer.c 28 Sep 2004 15:02:30 -0000 1.36
+++ timer.c 30 Dec 2004 04:37:11 -0000 1.36.6.1
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: timer.c,v 1.36 2004/09/28 15:02:30 weiden Exp $
+/* $Id: timer.c,v 1.36.6.1 2004/12/30 04:37:11 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -32,445 +32,165 @@
#include <w32k.h>
-#define NDEBUG
+#undef NDEBUG
#include <debug.h>
/* GLOBALS *******************************************************************/
-//windows 2000 has room for 32768 window-less timers
+/* Windows 2000 has room for 32768 window-less timers */
#define NUM_WINDOW_LESS_TIMERS 1024
static FAST_MUTEX Mutex;
-static LIST_ENTRY TimerListHead;
-static KTIMER Timer;
static RTL_BITMAP WindowLessTimersBitMap;
static PVOID WindowLessTimersBitMapBuffer;
static ULONG HintIndex = 0;
-static HANDLE MsgTimerThreadHandle;
-static CLIENT_ID MsgTimerThreadId;
-#define IntLockTimerList() \
+#define IntLockWindowlessTimerBitmap() \
ExAcquireFastMutex(&Mutex)
-#define IntUnLockTimerList() \
+#define IntUnlockWindowlessTimerBitmap() \
ExReleaseFastMutex(&Mutex)
/* FUNCTIONS *****************************************************************/
-//return true if the new timer became the first entry
-//must hold mutex while calling this
-BOOL FASTCALL
-IntInsertTimerAscendingOrder(PMSG_TIMER_ENTRY NewTimer)
-{
- PLIST_ENTRY current;
-
- current = TimerListHead.Flink;
- while (current != &TimerListHead)
- {
- if (CONTAINING_RECORD(current, MSG_TIMER_ENTRY, ListEntry)->Timeout.QuadPart >=\
- NewTimer->Timeout.QuadPart)
- {
- break;
- }
- current = current->Flink;
- }
-
- InsertTailList(current, &NewTimer->ListEntry);
-
- return TimerListHead.Flink == &NewTimer->ListEntry;
-}
-
-
-//must hold mutex while calling this
-PMSG_TIMER_ENTRY FASTCALL
-IntRemoveTimer(HWND hWnd, UINT_PTR IDEvent, HANDLE ThreadID, BOOL SysTimer)
+UINT_PTR FASTCALL
+IntSetTimer(HWND Wnd, UINT_PTR IDEvent, UINT Elapse, TIMERPROC TimerFunc, BOOL SystemTimer)
{
- PMSG_TIMER_ENTRY MsgTimer;
- PLIST_ENTRY EnumEntry;
-
- //remove timer if already in the queue
- EnumEntry = TimerListHead.Flink;
- while (EnumEntry != &TimerListHead)
- {
- MsgTimer = CONTAINING_RECORD(EnumEntry, MSG_TIMER_ENTRY, ListEntry);
- EnumEntry = EnumEntry->Flink;
-
- if (MsgTimer->Msg.hwnd == hWnd &&
- MsgTimer->Msg.wParam == (WPARAM)IDEvent &&
- MsgTimer->ThreadID == ThreadID &&
- (MsgTimer->Msg.message == WM_SYSTIMER) == SysTimer)
- {
- RemoveEntryList(&MsgTimer->ListEntry);
- return MsgTimer;
- }
- }
-
- return NULL;
-}
-
+ PWINDOW_OBJECT WindowObject;
+ UINT_PTR Ret = 0;
-/*
- * NOTE: It doesn't kill the timer. It just removes them from the list.
- */
-VOID FASTCALL
-RemoveTimersThread(HANDLE ThreadID)
-{
- PMSG_TIMER_ENTRY MsgTimer;
- PLIST_ENTRY EnumEntry;
-
- IntLockTimerList();
+ DPRINT("IntSetTimer wnd %x id %p elapse %u timerproc %p systemtimer %s\n",
+ Wnd, IDEvent, Elapse, TimerFunc, SystemTimer ? "TRUE" : "FALSE");
- EnumEntry = TimerListHead.Flink;
- while (EnumEntry != &TimerListHead)
- {
- MsgTimer = CONTAINING_RECORD(EnumEntry, MSG_TIMER_ENTRY, ListEntry);
- EnumEntry = EnumEntry->Flink;
-
- if (MsgTimer->ThreadID == ThreadID)
+ if ((Wnd == NULL) && ! SystemTimer)
{
- if (MsgTimer->Msg.hwnd == NULL)
- {
- RtlClearBits(&WindowLessTimersBitMap, ((UINT_PTR)MsgTimer->Msg.wParam) - 1, 1);
- }
-
- RemoveEntryList(&MsgTimer->ListEntry);
- ExFreePool(MsgTimer);
- }
- }
-
- IntUnLockTimerList();
-}
-
-
-/*
- * NOTE: It doesn't kill the timer. It just removes them from the list.
- */
-VOID FASTCALL
-RemoveTimersWindow(HWND Wnd)
-{
- PMSG_TIMER_ENTRY MsgTimer;
- PLIST_ENTRY EnumEntry;
-
- IntLockTimerList();
-
- EnumEntry = TimerListHead.Flink;
- while (EnumEntry != &TimerListHead)
- {
- MsgTimer = CONTAINING_RECORD(EnumEntry, MSG_TIMER_ENTRY, ListEntry);
- EnumEntry = EnumEntry->Flink;
+ DPRINT("Window-less timer\n");
+ /* find a free, window-less timer id */
+ IntLockWindowlessTimerBitmap();
+ IDEvent = RtlFindClearBitsAndSet(&WindowLessTimersBitMap, 1, HintIndex);
- if (MsgTimer->Msg.hwnd == Wnd)
- {
- RemoveEntryList(&MsgTimer->ListEntry);
- ExFreePool(MsgTimer);
- }
- }
-
- IntUnLockTimerList();
-}
-
-
-UINT_PTR FASTCALL
-IntSetTimer(HWND hWnd, UINT_PTR nIDEvent, UINT uElapse, TIMERPROC lpTimerFunc, BOOL SystemTimer)
-{
- PMSG_TIMER_ENTRY MsgTimer = NULL;
- PMSG_TIMER_ENTRY NewTimer;
- LARGE_INTEGER CurrentTime;
- PWINDOW_OBJECT WindowObject;
- HANDLE ThreadID;
- UINT_PTR Ret = 0;
-
- ThreadID = PsGetCurrentThreadId();
- KeQuerySystemTime(&CurrentTime);
- IntLockTimerList();
-
- if((hWnd == NULL) && !SystemTimer)
- {
- /* find a free, window-less timer id */
- nIDEvent = RtlFindClearBitsAndSet(&WindowLessTimersBitMap, 1, HintIndex);
+ if (IDEvent == (UINT_PTR) -1)
+ {
+ IntUnlockWindowlessTimerBitmap();
+ DPRINT1("Unable to find a free window-less timer id\n");
+ SetLastWin32Error(ERROR_NO_SYSTEM_RESOURCES);
+ return 0;
+ }
- if(nIDEvent == (UINT_PTR) -1)
- {
- IntUnLockTimerList();
- return 0;
+ HintIndex = ++IDEvent;
+ IntUnlockWindowlessTimerBitmap();
+ Ret = IDEvent;
}
-
- HintIndex = ++nIDEvent;
- }
else
- {
- WindowObject = IntGetWindowObject(hWnd);
- if(!WindowObject)
{
- IntUnLockTimerList();
- SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE);
- return 0;
- }
+ WindowObject = IntGetWindowObject(Wnd);
+ if (! WindowObject)
+ {
+ DPRINT1("Invalid window handle\n");
+ SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE);
+ return 0;
+ }
- if(WindowObject->OwnerThread != PsGetCurrentThread())
- {
- IntUnLockTimerList();
+ if (WindowObject->OwnerThread != PsGetCurrentThread())
+ {
+ IntReleaseWindowObject(WindowObject);
+ DPRINT1("Trying to set timer for window in another thread (shatter attack?)\n");
+ SetLastWin32Error(ERROR_ACCESS_DENIED);
+ return 0;
+ }
IntReleaseWindowObject(WindowObject);
- SetLastWin32Error(ERROR_ACCESS_DENIED);
- return 0;
+ Ret = 1;
}
- IntReleaseWindowObject(WindowObject);
-
- /* remove timer if already in the queue */
- MsgTimer = IntRemoveTimer(hWnd, nIDEvent, ThreadID, SystemTimer);
- }
#if 1
/* Win NT/2k/XP */
- if(uElapse > 0x7fffffff)
- uElapse = 1;
+ if (Elapse > 0x7fffffff)
+ {
+ DPRINT("Adjusting uElapse\n");
+ Elapse = 1;
+ }
#else
/* Win Server 2003 */
- if(uElapse > 0x7fffffff)
- uElapse = 0x7fffffff;
+ if (Elapse > 0x7fffffff)
+ {
+ DPRINT("Adjusting uElapse\n");
+ Elapse = 0x7fffffff;
+ }
#endif
/* Win 2k/XP */
- if(uElapse < 10)
- uElapse = 10;
-
- if(MsgTimer)
- {
- /* modify existing (removed) timer */
- NewTimer = MsgTimer;
-
- NewTimer->Period = uElapse;
- NewTimer->Timeout.QuadPart = CurrentTime.QuadPart + (uElapse * 10000);
- NewTimer->Msg.lParam = (LPARAM)lpTimerFunc;
- }
- else
- {
- /* FIXME: use lookaside? */
- NewTimer = ExAllocatePoolWithTag(PagedPool, sizeof(MSG_TIMER_ENTRY), TAG_TIMER);
- if(!NewTimer)
+ if (Elapse < 10)
+ {
+ DPRINT("Adjusting uElapse\n");
+ Elapse = 10;
+ }
+
+ if (! MsqSetTimer(PsGetWin32Thread()->MessageQueue, Wnd,
+ IDEvent, Elapse, TimerFunc,
+ SystemTimer ? WM_SYSTIMER : WM_TIMER))
{
- IntUnLockTimerList();
- SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
+ DPRINT1("Failed to set timer in message queue\n");
+ SetLastWin32Error(ERROR_NO_SYSTEM_RESOURCES);
return 0;
}
-
- NewTimer->Msg.hwnd = hWnd;
- NewTimer->Msg.message = (SystemTimer ? WM_SYSTIMER : WM_TIMER);
- NewTimer->Msg.wParam = (WPARAM)nIDEvent;
- NewTimer->Msg.lParam = (LPARAM)lpTimerFunc;
- NewTimer->Period = uElapse;
- NewTimer->Timeout.QuadPart = CurrentTime.QuadPart + (uElapse * 10000);
- NewTimer->ThreadID = ThreadID;
- }
-
- Ret = nIDEvent; // FIXME - return lpTimerProc if it's not a system timer
-
- if(IntInsertTimerAscendingOrder(NewTimer))
- {
- /* new timer is first in queue and expires first */
- KeSetTimer(&Timer, NewTimer->Timeout, NULL);
- }
- IntUnLockTimerList();
return Ret;
}
BOOL FASTCALL
-IntKillTimer(HWND hWnd, UINT_PTR uIDEvent, BOOL SystemTimer)
+IntKillTimer(HWND Wnd, UINT_PTR IDEvent, BOOL SystemTimer)
{
- PMSG_TIMER_ENTRY MsgTimer;
- PWINDOW_OBJECT WindowObject;
-
- IntLockTimerList();
-
- /* window-less timer? */
- if((hWnd == NULL) && !SystemTimer)
- {
- if(!RtlAreBitsSet(&WindowLessTimersBitMap, uIDEvent - 1, 1))
- {
- IntUnLockTimerList();
- /* bit was not set */
- /* FIXME: set the last error */
- return FALSE;
- }
- RtlClearBits(&WindowLessTimersBitMap, uIDEvent - 1, 1);
- }
- else
- {
- WindowObject = IntGetWindowObject(hWnd);
- if(!WindowObject)
- {
- IntUnLockTimerList();
- SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE);
- return FALSE;
- }
- if(WindowObject->OwnerThread != PsGetCurrentThread())
+ DPRINT("IntKillTimer wnd %x id %p systemtimer %s\n",
+ Wnd, IDEvent, SystemTimer ? "TRUE" : "FALSE");
+
+ if (! MsqKillTimer(PsGetWin32Thread()->MessageQueue, Wnd,
+ IDEvent, SystemTimer ? WM_SYSTIMER : WM_TIMER))
{
- IntUnLockTimerList();
- IntReleaseWindowObject(WindowObject);
- SetLastWin32Error(ERROR_ACCESS_DENIED);
+ DPRINT1("Unable to locate timer in message queue\n");
+ SetLastWin32Error(ERROR_INVALID_PARAMETER);
return FALSE;
}
- IntReleaseWindowObject(WindowObject);
- }
- MsgTimer = IntRemoveTimer(hWnd, uIDEvent, PsGetCurrentThreadId(), SystemTimer);
-
- IntUnLockTimerList();
-
- if(MsgTimer == NULL)
- {
- /* didn't find timer */
- /* FIXME: set the last error */
- return FALSE;
- }
-
- /* FIXME: use lookaside? */
- ExFreePool(MsgTimer);
-
- return TRUE;
-}
-
-static VOID STDCALL
-TimerThreadMain(PVOID StartContext)
-{
- NTSTATUS Status;
- LARGE_INTEGER CurrentTime;
- PLIST_ENTRY EnumEntry;
- PMSG_TIMER_ENTRY MsgTimer;
- PETHREAD Thread;
- PETHREAD *ThreadsToDereference;
- ULONG ThreadsToDereferenceCount, ThreadsToDereferencePos, i;
-
- for(;;)
- {
- Status = KeWaitForSingleObject(&Timer,
- Executive,
- KernelMode,
- FALSE,
- NULL);
- if (!NT_SUCCESS(Status))
- {
- DPRINT1("Error waiting in TimerThreadMain\n");
- KEBUGCHECK(0);
- }
-
- ThreadsToDereferenceCount = ThreadsToDereferencePos = 0;
-
- IntLockTimerList();
-
- KeQuerySystemTime(&CurrentTime);
-
- for (EnumEntry = TimerListHead.Flink;
- EnumEntry != &TimerListHead;
- EnumEntry = EnumEntry->Flink)
+ /* window-less timer? */
+ if ((Wnd == NULL) && ! SystemTimer)
{
- MsgTimer = CONTAINING_RECORD(EnumEntry, MSG_TIMER_ENTRY, ListEntry);
- if (CurrentTime.QuadPart >= MsgTimer->Timeout.QuadPart)
- ++ThreadsToDereferenceCount;
- else
- break;
- }
-
-
- ThreadsToDereference = (PETHREAD *)ExAllocatePoolWithTag(
- NonPagedPool, ThreadsToDereferenceCount * sizeof(PETHREAD), TAG_TIMERTD);
+ /* Release the id */
+ IntLockWindowlessTimerBitmap();
- EnumEntry = TimerListHead.Flink;
- while (EnumEntry != &TimerListHead)
- {
- MsgTimer = CONTAINING_RECORD(EnumEntry, MSG_TIMER_ENTRY, ListEntry);
-
- if (CurrentTime.QuadPart >= MsgTimer->Timeout.QuadPart)
- {
- EnumEntry = EnumEntry->Flink;
-
- RemoveEntryList(&MsgTimer->ListEntry);
-
- /*
- * FIXME: 1) Find a faster way of getting the thread message queue? (lookup by id is slow)
- */
-
- if (!NT_SUCCESS(PsLookupThreadByThreadId(MsgTimer->ThreadID, &Thread)))
- {
- ExFreePool(MsgTimer);
- continue;
- }
-
- MsqPostMessage(Thread->Tcb.Win32Thread->MessageQueue, &MsgTimer->Msg, FALSE);
-
- ThreadsToDereference[ThreadsToDereferencePos] = Thread;
- ++ThreadsToDereferencePos;
-
- //set up next periodic timeout
- //FIXME: is this calculation really necesary (and correct)? -Gunnar
- do
- {
- MsgTimer->Timeout.QuadPart += (MsgTimer->Period * 10000);
- }
- while (MsgTimer->Timeout.QuadPart <= CurrentTime.QuadPart);
- IntInsertTimerAscendingOrder(MsgTimer);
- }
- else
- {
- break;
- }
+ ASSERT(RtlAreBitsSet(&WindowLessTimersBitMap, IDEvent - 1, 1));
+ RtlClearBits(&WindowLessTimersBitMap, IDEvent - 1, 1);
+ IntUnlockWindowlessTimerBitmap();
}
-
-
- //set up next timeout from first entry (if any)
- if (!IsListEmpty(&TimerListHead))
- {
- MsgTimer = CONTAINING_RECORD( TimerListHead.Flink, MSG_TIMER_ENTRY, ListEntry);
- KeSetTimer(&Timer, MsgTimer->Timeout, NULL);
- }
-
- IntUnLockTimerList();
-
- for (i = 0; i < ThreadsToDereferencePos; i++)
- ObDereferenceObject(ThreadsToDereference[i]);
-
- ExFreePool(ThreadsToDereference);
- }
+
+ return TRUE;
}
NTSTATUS FASTCALL
InitTimerImpl(VOID)
{
- NTSTATUS Status;
ULONG BitmapBytes;
- BitmapBytes = ROUND_UP(NUM_WINDOW_LESS_TIMERS, sizeof(ULONG) * 8) / 8;
-
- InitializeListHead(&TimerListHead);
- KeInitializeTimerEx(&Timer, SynchronizationTimer);
ExInitializeFastMutex(&Mutex);
+ BitmapBytes = ROUND_UP(NUM_WINDOW_LESS_TIMERS, sizeof(ULONG) * 8) / 8;
WindowLessTimersBitMapBuffer = ExAllocatePoolWithTag(PagedPool, BitmapBytes, TAG_TIMERBMP);
RtlInitializeBitMap(&WindowLessTimersBitMap,
WindowLessTimersBitMapBuffer,
BitmapBytes * 8);
- //yes we need this, since ExAllocatePool isn't supposed to zero out allocated memory
+ /* yes we need this, since ExAllocatePool isn't supposed to zero out allocated memory */
RtlClearAllBits(&WindowLessTimersBitMap);
-
- Status = PsCreateSystemThread(&MsgTimerThreadHandle,
- THREAD_ALL_ACCESS,
- NULL,
- NULL,
- &MsgTimerThreadId,
- TimerThreadMain,
- NULL);
- return Status;
+
+ return STATUS_SUCCESS;
}
reactos/subsys/win32k/ntuser
diff -u -r1.67.8.2 -r1.67.8.3
--- windc.c 13 Dec 2004 16:18:18 -0000 1.67.8.2
+++ windc.c 30 Dec 2004 04:37:11 -0000 1.67.8.3
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: windc.c,v 1.67.8.2 2004/12/13 16:18:18 hyperion Exp $
+/* $Id: windc.c,v 1.67.8.3 2004/12/30 04:37:11 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -138,6 +138,8 @@
defaultDCstate = NtGdiGetDCState(Dce->hDC);
GDIOBJ_SetOwnership(defaultDCstate, NULL);
}
+ GDIOBJ_SetOwnership(Dce->Self, NULL);
+ DC_SetOwnership(Dce->hDC, NULL);
Dce->hwndCurrent = hWnd;
Dce->hClipRgn = NULL;
DCE_LockList();
@@ -213,6 +215,7 @@
}
else if (Dce->hClipRgn > (HRGN) 1)
{
+ GDIOBJ_SetOwnership(Dce->hClipRgn, PsGetCurrentProcess());
NtGdiDeleteObject(Dce->hClipRgn);
}
@@ -467,18 +470,13 @@
if (Dce == NULL)
{
- Dce = (DceEmpty == NULL) ? DceEmpty : DceUnused;
+ Dce = (DceEmpty == NULL) ? DceUnused : DceEmpty;
}
if (Dce == NULL)
{
Dce = DceAllocDCE(NULL, DCE_CACHE_DC);
}
- else if (! GDIOBJ_OwnedByCurrentProcess(Dce->Self))
- {
- GDIOBJ_SetOwnership(Dce->Self, PsGetCurrentProcess());
- DC_SetOwnership(Dce->hDC, PsGetCurrentProcess());
- }
}
else
{
@@ -519,6 +517,7 @@
Dce->hClipRgn = NtGdiCreateRectRgn(0, 0, 0, 0);
if (Dce->hClipRgn && Window->UpdateRegion)
{
+ GDIOBJ_SetOwnership(Dce->hClipRgn, NULL);
NtGdiCombineRgn(Dce->hClipRgn, Window->UpdateRegion, NULL, RGN_COPY);
if(Window->WindowRegion && !(Window->Style & WS_MINIMIZE))
NtGdiCombineRgn(Dce->hClipRgn, Dce->hClipRgn, Window->WindowRegion, RGN_AND);
@@ -537,6 +536,7 @@
if (!(Flags & DCX_WINDOW))
{
Dce->hClipRgn = UnsafeIntCreateRectRgnIndirect(&Window->ClientRect);
+ GDIOBJ_SetOwnership(Dce->hClipRgn, NULL);
if(!Window->WindowRegion || (Window->Style & WS_MINIMIZE))
{
NtGdiOffsetRgn(Dce->hClipRgn, -Window->ClientRect.left, -Window->ClientRect.top);
@@ -552,6 +552,7 @@
else
{
Dce->hClipRgn = UnsafeIntCreateRectRgnIndirect(&Window->WindowRect);
+ GDIOBJ_SetOwnership(Dce->hClipRgn, NULL);
NtGdiOffsetRgn(Dce->hClipRgn, -Window->WindowRect.left,
-Window->WindowRect.top);
if(Window->WindowRegion && !(Window->Style & WS_MINIMIZE))
@@ -563,6 +564,7 @@
Dce->hClipRgn = NtGdiCreateRectRgn(0, 0, 0, 0);
if (Dce->hClipRgn)
{
+ GDIOBJ_SetOwnership(Dce->hClipRgn, NULL);
if(!Window->WindowRegion || (Window->Style & WS_MINIMIZE))
NtGdiCombineRgn(Dce->hClipRgn, ClipRegion, NULL, RGN_COPY);
else
@@ -669,7 +671,6 @@
DceFreeDCE(PDCE dce, BOOLEAN Force)
{
DCE *ret;
- HANDLE hDce;
if (NULL == dce)
{
@@ -684,24 +685,18 @@
if(Force && !GDIOBJ_OwnedByCurrentProcess(dce->hDC))
{
- /* FIXME - changing ownership to current process only works for global objects! */
- GDIOBJ_SetOwnership(dce->hDC, PsGetCurrentProcess());
+ GDIOBJ_SetOwnership(dce->Self, PsGetCurrentProcess());
DC_SetOwnership(dce->hDC, PsGetCurrentProcess());
}
NtGdiDeleteDC(dce->hDC);
if (dce->hClipRgn && ! (dce->DCXFlags & DCX_KEEPCLIPRGN))
{
+ GDIOBJ_SetOwnership(dce->hClipRgn, PsGetCurrentProcess());
NtGdiDeleteObject(dce->hClipRgn);
}
- hDce = dce->Self;
- if(Force && !GDIOBJ_OwnedByCurrentProcess(hDce))
- {
- /* FIXME - changing ownership to current process only works for global objects! */
- GDIOBJ_SetOwnership(hDce, PsGetCurrentProcess());
- }
- DCEOBJ_FreeDCE(hDce);
+ DCEOBJ_FreeDCE(dce->Self);
return ret;
}
@@ -775,11 +770,13 @@
}
VOID FASTCALL
-DceResetActiveDCEs(PWINDOW_OBJECT Window, int DeltaX, int DeltaY)
+DceResetActiveDCEs(PWINDOW_OBJECT Window)
{
DCE *pDCE;
PDC dc;
PWINDOW_OBJECT CurrentWindow;
+ INT DeltaX;
+ INT DeltaY;
if (NULL == Window)
{
@@ -806,11 +803,6 @@
continue;
}
}
- if (!GDIOBJ_OwnedByCurrentProcess(pDCE->hDC))
- {
- /* skip DCs we don't even own */
- goto skip;
- }
dc = DC_LockDc(pDCE->hDC);
if (dc == NULL)
@@ -823,11 +815,22 @@
pDCE = pDCE->next;
continue;
}
- if ((0 != DeltaX || 0 != DeltaY)
- && (Window == CurrentWindow || IntIsChildWindow(Window->Self, CurrentWindow->Self)))
+ if (Window == CurrentWindow || IntIsChildWindow(Window->Self, CurrentWindow->Self))
{
- dc->w.DCOrgX += DeltaX;
- dc->w.DCOrgY += DeltaY;
+ if (pDCE->DCXFlags & DCX_WINDOW)
+ {
+ DeltaX = CurrentWindow->WindowRect.left - dc->w.DCOrgX;
+ DeltaY = CurrentWindow->WindowRect.top - dc->w.DCOrgY;
+ dc->w.DCOrgX = CurrentWindow->WindowRect.left;
+ dc->w.DCOrgY = CurrentWindow->WindowRect.top;
+ }
+ else
+ {
+ DeltaX = CurrentWindow->ClientRect.left - dc->w.DCOrgX;
+ DeltaY = CurrentWindow->ClientRect.top - dc->w.DCOrgY;
+ dc->w.DCOrgX = CurrentWindow->ClientRect.left;
+ dc->w.DCOrgY = CurrentWindow->ClientRect.top;
+ }
if (NULL != dc->w.hClipRgn)
{
NtGdiOffsetRgn(dc->w.hClipRgn, DeltaX, DeltaY);
reactos/subsys/win32k/ntuser
diff -u -r1.250.2.2 -r1.250.2.3
--- window.c 13 Dec 2004 16:18:18 -0000 1.250.2.2
+++ window.c 30 Dec 2004 04:37:11 -0000 1.250.2.3
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: window.c,v 1.250.2.2 2004/12/13 16:18:18 hyperion Exp $
+/* $Id: window.c,v 1.250.2.3 2004/12/30 04:37:11 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -268,7 +268,7 @@
ASSERT(Window);
- RemoveTimersWindow(Window->Self);
+ MsqRemoveTimersWindow(ThreadData->MessageQueue, Window->Self);
IntLockThreadWindows(Window->OwnerThread->Tcb.Win32Thread);
if(Window->Status & WINDOWSTATUS_DESTROYING)
@@ -2273,7 +2273,7 @@
HWND FASTCALL
IntFindWindow(PWINDOW_OBJECT Parent,
PWINDOW_OBJECT ChildAfter,
- PWNDCLASS_OBJECT ClassObject,
+ RTL_ATOM ClassAtom,
PUNICODE_STRING WindowName)
{
BOOL CheckWindowName;
@@ -2305,11 +2305,8 @@
/* Do not send WM_GETTEXT messages in the kernel mode version!
The user mode version however calls GetWindowText() which will
send WM_GETTEXT messages to windows belonging to its processes */
- if(((!CheckWindowName || (CheckWindowName && !RtlCompareUnicodeString(WindowName, &(Child->WindowName), FALSE))) &&
- (!ClassObject || (ClassObject && (Child->Class == ClassObject))))
- ||
- ((!CheckWindowName || (CheckWindowName && !RtlCompareUnicodeString(WindowName, &(Child->WindowName), FALSE))) &&
- (!ClassObject || (ClassObject && (Child->Class == ClassObject)))))
+ if((!CheckWindowName || !RtlCompareUnicodeString(WindowName, &(Child->WindowName), FALSE)) &&
+ (!ClassAtom || Child->Class->Atom == ClassAtom))
{
Ret = Child->Self;
IntReleaseWindowObject(Child);
@@ -2358,8 +2355,7 @@
UNICODE_STRING ClassName, WindowName;
NTSTATUS Status;
HWND Desktop, Ret = NULL;
- PWNDCLASS_OBJECT ClassObject = NULL;
- BOOL ClassFound;
+ RTL_ATOM ClassAtom;
Desktop = IntGetCurrentThreadDesktopWindow();
@@ -2427,25 +2423,38 @@
/* find the class object */
if(ClassName.Buffer)
- {
- /* this expects the string in ClassName to be NULL-terminated! */
- ClassFound = ClassReferenceClassByNameOrAtom(&ClassObject, ClassName.Buffer, NULL);
- if(!ClassFound)
{
- if (IS_ATOM(ClassName.Buffer))
- DPRINT1("Window class not found (%lx)\n", (ULONG_PTR)ClassName.Buffer);
- else
- DPRINT1("Window class not found (%S)\n", ClassName.Buffer);
- SetLastWin32Error(ERROR_FILE_NOT_FOUND);
- goto Cleanup;
- }
+ PWINSTATION_OBJECT WinStaObject;
+
+ if (PsGetWin32Thread()->Desktop == NULL)
+ {
+ SetLastWin32Error(ERROR_INVALID_HANDLE);
+ goto Cleanup;
+ }
+
+ WinStaObject = PsGetWin32Thread()->Desktop->WindowStation;
+
+ Status = RtlLookupAtomInAtomTable(
+ WinStaObject->AtomTable,
+ ClassName.Buffer,
+ &ClassAtom);
+
+ if (!NT_SUCCESS(Status))
+ {
+ DPRINT1("Failed to lookup class atom!\n");
+ SetLastWin32Error(ERROR_CLASS_DOES_NOT_EXIST);
+ goto Cleanup;
+ }
}
if(Parent->Self == Desktop)
{
HWND *List, *phWnd;
PWINDOW_OBJECT TopLevelWindow;
- BOOL CheckWindowName;
+ BOOLEAN CheckWindowName;
+ BOOLEAN CheckClassName;
+ BOOLEAN WindowMatches;
+ BOOLEAN ClassMatches;
/* windows searches through all top-level windows if the parent is the desktop
window */
@@ -2461,6 +2470,7 @@
}
CheckWindowName = WindowName.Length > 0;
+ CheckClassName = ClassName.Buffer != NULL;
/* search children */
while(*phWnd)
@@ -2473,18 +2483,19 @@
/* Do not send WM_GETTEXT messages in the kernel mode version!
The user mode version however calls GetWindowText() which will
send WM_GETTEXT messages to windows belonging to its processes */
- if(((!CheckWindowName || (CheckWindowName && !RtlCompareUnicodeString(&WindowName, &(TopLevelWindow->WindowName), FALSE))) &&
- (!ClassObject || (ClassObject && (TopLevelWindow->Class == ClassObject))))
- ||
- ((!CheckWindowName || (CheckWindowName && !RtlCompareUnicodeString(&WindowName, &(TopLevelWindow->WindowName), FALSE))) &&
- (!ClassObject || (ClassObject && (TopLevelWindow->Class == ClassObject)))))
+ WindowMatches = !CheckWindowName || !RtlCompareUnicodeString(
+ &WindowName, &TopLevelWindow->WindowName, FALSE);
+ ClassMatches = !CheckClassName ||
+ ClassAtom == TopLevelWindow->Class->Atom;
+
+ if (WindowMatches && ClassMatches)
{
Ret = TopLevelWindow->Self;
IntReleaseWindowObject(TopLevelWindow);
break;
}
- if(IntFindWindow(TopLevelWindow, NULL, ClassObject, &WindowName))
+ if (IntFindWindow(TopLevelWindow, NULL, ClassAtom, &WindowName))
{
/* window returns the handle of the top-level window, in case it found
the child window */
@@ -2499,7 +2510,7 @@
}
}
else
- Ret = IntFindWindow(Parent, ChildAfter, ClassObject, &WindowName);
+ Ret = IntFindWindow(Parent, ChildAfter, ClassAtom, &WindowName);
#if 0
if(Ret == NULL && hwndParent == NULL && hwndChildAfter == NULL)
@@ -2511,17 +2522,12 @@
if((MsgWindows = IntGetWindowObject(IntGetMessageWindow())))
{
- Ret = IntFindWindow(MsgWindows, ChildAfter, ClassObject, &WindowName);
+ Ret = IntFindWindow(MsgWindows, ChildAfter, ClassAtom, &WindowName);
IntReleaseWindowObject(MsgWindows);
}
}
#endif
- if (ClassObject != NULL)
- {
- ClassDereferenceObject(ClassObject);
- }
-
Cleanup:
if(ClassName.Length > 0 && ClassName.Buffer)
ExFreePool(ClassName.Buffer);
reactos/subsys/win32k/ntuser
diff -u -r1.124.2.2 -r1.124.2.3
--- winpos.c 13 Dec 2004 16:18:18 -0000 1.124.2.2
+++ winpos.c 30 Dec 2004 04:37:11 -0000 1.124.2.3
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: winpos.c,v 1.124.2.2 2004/12/13 16:18:18 hyperion Exp $
+/* $Id: winpos.c,v 1.124.2.3 2004/12/30 04:37:11 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -977,9 +977,7 @@
Window->Style |= WS_VISIBLE;
}
- DceResetActiveDCEs(Window,
- NewWindowRect.left - OldWindowRect.left,
- NewWindowRect.top - OldWindowRect.top);
+ DceResetActiveDCEs(Window);
if (!(WinPos.flags & SWP_NOREDRAW))
{
reactos/subsys/win32k/ntuser
diff -u -r1.67.2.2 -r1.67.2.3
--- winsta.c 13 Dec 2004 16:18:18 -0000 1.67.2.2
+++ winsta.c 30 Dec 2004 04:37:12 -0000 1.67.2.3
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: winsta.c,v 1.67.2.2 2004/12/13 16:18:18 hyperion Exp $
+ * $Id: winsta.c,v 1.67.2.3 2004/12/30 04:37:12 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
reactos/subsys/win32k/objects
diff -u -r1.81.2.2 -r1.81.2.3
--- bitmaps.c 13 Dec 2004 16:18:18 -0000 1.81.2.2
+++ bitmaps.c 30 Dec 2004 04:37:12 -0000 1.81.2.3
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: bitmaps.c,v 1.81.2.2 2004/12/13 16:18:18 hyperion Exp $ */
+/* $Id: bitmaps.c,v 1.81.2.3 2004/12/30 04:37:12 hyperion Exp $ */
#include <w32k.h>
#define IN_RECT(r,x,y) \
reactos/subsys/win32k/objects
diff -u -r1.40.10.3 -r1.40.10.4
--- brush.c 13 Dec 2004 16:18:18 -0000 1.40.10.3
+++ brush.c 30 Dec 2004 04:37:13 -0000 1.40.10.4
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: brush.c,v 1.40.10.3 2004/12/13 16:18:18 hyperion Exp $
+ * $Id: brush.c,v 1.40.10.4 2004/12/30 04:37:13 hyperion Exp $
*/
#include <w32k.h>
@@ -83,8 +83,10 @@
VOID FASTCALL
IntGdiInitBrushInstance(GDIBRUSHINST *BrushInst, PGDIBRUSHOBJ BrushObj, XLATEOBJ *XlateObj)
{
+ ASSERT(BrushInst);
+ ASSERT(BrushObj);
if (BrushObj->flAttrs & GDIBRUSH_IS_NULL)
- BrushInst->BrushObject.iSolidColor = 0;
+ BrushInst->BrushObject.iSolidColor = 0;
else if (BrushObj->flAttrs & GDIBRUSH_IS_SOLID)
BrushInst->BrushObject.iSolidColor = XLATEOBJ_iXlate(XlateObj, BrushObj->BrushAttr.lbColor);
else
reactos/subsys/win32k/objects
diff -u -r1.42.10.3 -r1.42.10.4
--- cliprgn.c 13 Dec 2004 16:18:18 -0000 1.42.10.3
+++ cliprgn.c 30 Dec 2004 04:37:14 -0000 1.42.10.4
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: cliprgn.c,v 1.42.10.3 2004/12/13 16:18:18 hyperion Exp $ */
+/* $Id: cliprgn.c,v 1.42.10.4 2004/12/30 04:37:14 hyperion Exp $ */
#include <w32k.h>
int FASTCALL
reactos/subsys/win32k/objects
diff -u -r1.50.10.2 -r1.50.10.3
--- color.c 13 Dec 2004 16:18:18 -0000 1.50.10.2
+++ color.c 30 Dec 2004 04:37:14 -0000 1.50.10.3
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: color.c,v 1.50.10.2 2004/12/13 16:18:18 hyperion Exp $ */
+/* $Id: color.c,v 1.50.10.3 2004/12/30 04:37:14 hyperion Exp $ */
#include <w32k.h>
// FIXME: Use PXLATEOBJ logicalToSystem instead of int *mapping
reactos/subsys/win32k/objects
diff -u -r1.147.2.3 -r1.147.2.4
--- dc.c 13 Dec 2004 16:18:18 -0000 1.147.2.3
+++ dc.c 30 Dec 2004 04:37:14 -0000 1.147.2.4
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: dc.c,v 1.147.2.3 2004/12/13 16:18:18 hyperion Exp $
+/* $Id: dc.c,v 1.147.2.4 2004/12/30 04:37:14 hyperion Exp $
*
* DC.C - Device context functions
*
reactos/subsys/win32k/objects
diff -u -r1.56.12.2 -r1.56.12.3
--- dib.c 13 Dec 2004 16:18:19 -0000 1.56.12.2
+++ dib.c 30 Dec 2004 04:37:14 -0000 1.56.12.3
@@ -1,5 +1,5 @@
/*
- * $Id: dib.c,v 1.56.12.2 2004/12/13 16:18:19 hyperion Exp $
+ * $Id: dib.c,v 1.56.12.3 2004/12/30 04:37:14 hyperion Exp $
*
* ReactOS W32 Subsystem
* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 ReactOS Team
@@ -159,7 +159,21 @@
BitmapFormat(bmi->bmiHeader.biBitCount, bmi->bmiHeader.biCompression),
0 < bmi->bmiHeader.biHeight ? 0 : BMF_TOPDOWN,
(PVOID) Bits);
+ if (0 == SourceBitmap)
+ {
+ BITMAPOBJ_UnlockBitmap(hBitmap);
+ SetLastWin32Error(ERROR_NO_SYSTEM_RESOURCES);
+ return 0;
+ }
+
SourceSurf = EngLockSurface((HSURF)SourceBitmap);
+ if (NULL == SourceSurf)
+ {
+ EngDeleteSurface((HSURF)SourceBitmap);
+ BITMAPOBJ_UnlockBitmap(hBitmap);
+ SetLastWin32Error(ERROR_NO_SYSTEM_RESOURCES);
+ return 0;
+ }
// Destination palette obtained from the hDC
hDCPalette = PALETTE_LockPalette(DC->DevInfo->hpalDefault);
@@ -711,6 +725,10 @@
hSection, dwOffset, 0);
DC_UnlockDc(hDC);
}
+ else
+ {
+ SetLastWin32Error(ERROR_INVALID_HANDLE);
+ }
if (bDesktopDC)
NtGdiDeleteDC(hDC);
@@ -760,6 +778,7 @@
/* bm.bmBits = MapViewOfFile(section, FILE_MAP_ALL_ACCESS,
0L, offset, totalSize); */
DbgPrint("DIB_CreateDIBSection: Cannot yet handle section DIBs\n");
+ SetLastWin32Error(ERROR_INVALID_FUNCTION);
return 0;
}
else if (ovr_pitch && offset)
@@ -825,11 +844,13 @@
bm.bmBits);
if (! res)
{
+ SetLastWin32Error(ERROR_NO_SYSTEM_RESOURCES);
return NULL;
}
bmp = BITMAPOBJ_LockBitmap(res);
if (NULL == bmp)
{
+ SetLastWin32Error(ERROR_INVALID_HANDLE);
NtGdiDeleteObject(bmp);
return NULL;
}
reactos/subsys/win32k/objects
diff -u -r1.52.10.2 -r1.52.10.3
--- fillshap.c 13 Dec 2004 16:18:19 -0000 1.52.10.2
+++ fillshap.c 30 Dec 2004 04:37:14 -0000 1.52.10.3
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: fillshap.c,v 1.52.10.2 2004/12/13 16:18:19 hyperion Exp $ */
+/* $Id: fillshap.c,v 1.52.10.3 2004/12/30 04:37:14 hyperion Exp $ */
#include <w32k.h>
/*
reactos/subsys/win32k/objects
diff -u -r1.73.6.2 -r1.73.6.3
--- gdiobj.c 13 Dec 2004 16:18:19 -0000 1.73.6.2
+++ gdiobj.c 30 Dec 2004 04:37:14 -0000 1.73.6.3
@@ -19,19 +19,25 @@
/*
* GDIOBJ.C - GDI object manipulation routines
*
- * $Id: gdiobj.c,v 1.73.6.2 2004/12/13 16:18:19 hyperion Exp $
+ * $Id: gdiobj.c,v 1.73.6.3 2004/12/30 04:37:14 hyperion Exp $
*/
#include <w32k.h>
+#include <ddk/ntddk.h>
#define NDEBUG
#include <debug.h>
+#include <pseh.h>
+
#ifdef __USE_W32API
/* F*(&#$ header mess!!!! */
HANDLE
STDCALL PsGetProcessId(
PEPROCESS Process
);
+/* ditto */
+ULONG STDCALL
+KeRosGetStackFrames ( PULONG Frames, ULONG FrameCount );
#endif /* __USE_W32API */
@@ -52,13 +58,12 @@
typedef struct _GDI_HANDLE_TABLE
{
- LONG HandlesCount;
- LONG nEntries;
- PPAGED_LOOKASIDE_LIST LookasideLists;
- PGDI_TABLE_ENTRY EntriesEnd;
+ SLIST_HEADER FreeEntriesHead;
+ SLIST_ENTRY FreeEntries[((GDI_HANDLE_COUNT * sizeof(GDI_TABLE_ENTRY)) << 3) /
+ (sizeof(SLIST_ENTRY) << 3)];
- GDI_TABLE_ENTRY Entries[1];
+ GDI_TABLE_ENTRY Entries[GDI_HANDLE_COUNT];
} GDI_HANDLE_TABLE, *PGDI_HANDLE_TABLE;
typedef struct
@@ -116,20 +121,26 @@
* \param Size - number of entries in the object table.
*/
static PGDI_HANDLE_TABLE INTERNAL_CALL
-GDIOBJ_iAllocHandleTable(ULONG Entries)
+GDIOBJ_iAllocHandleTable(VOID)
{
PGDI_HANDLE_TABLE handleTable;
UINT ObjType;
- ULONG MemSize = sizeof(GDI_HANDLE_TABLE) + (sizeof(GDI_TABLE_ENTRY) * (Entries - 1));
+ UINT i;
+ PGDI_TABLE_ENTRY Entry;
- handleTable = ExAllocatePoolWithTag(NonPagedPool, MemSize, TAG_GDIHNDTBLE);
+ handleTable = ExAllocatePoolWithTag(NonPagedPool, sizeof(GDI_HANDLE_TABLE), TAG_GDIHNDTBLE);
ASSERT( handleTable );
- RtlZeroMemory(handleTable, MemSize);
-
- handleTable->HandlesCount = 0;
- handleTable->nEntries = Entries;
+ RtlZeroMemory(handleTable, sizeof(GDI_HANDLE_TABLE));
- handleTable->EntriesEnd = &handleTable->Entries[Entries];
+ /*
+ * initialize the free entry cache
+ */
+ InitializeSListHead(&handleTable->FreeEntriesHead);
+ Entry = &HandleTable->Entries[RESERVE_ENTRIES_COUNT];
+ for(i = GDI_HANDLE_COUNT - 1; i >= RESERVE_ENTRIES_COUNT; i--)
+ {
+ InterlockedPushEntrySList(&handleTable->FreeEntriesHead, &handleTable->FreeEntries[i]);
+ }
handleTable->LookasideLists = ExAllocatePoolWithTag(NonPagedPool,
OBJTYPE_COUNT * sizeof(PAGED_LOOKASIDE_LIST),
@@ -203,6 +214,98 @@
return 0;
}
+#ifdef GDI_DEBUG
+
+static int leak_reported = 0;
+#define GDI_STACK_LEVELS 12
+static ULONG GDIHandleAllocator[GDI_HANDLE_COUNT][GDI_STACK_LEVELS];
+struct DbgOpenGDIHandle
+{
+ ULONG idx;
+ int count;
+};
+#define H 1024
+static struct DbgOpenGDIHandle h[H];
+
+void IntDumpHandleTable()
+{
+ int i, n = 0, j, k, J;
+
+ if ( leak_reported )
+ {
+ DPRINT1("gdi handle abusers already reported!\n");
+ return;
+ }
+
+ leak_reported = 1;
+ DPRINT1("reporting gdi handle abusers:\n");
+
+ /* step through GDI handle table and find out who our culprit is... */
+ for ( i = RESERVE_ENTRIES_COUNT; i < GDI_HANDLE_COUNT; i++ )
+ {
+ for ( j = 0; j < n; j++ )
+ {
+next:
+ J = h[j].idx;
+ for ( k = 0; k < GDI_STACK_LEVELS; k++ )
+ {
+ if ( GDIHandleAllocator[i][k]
+ != GDIHandleAllocator[J][k] )
+ {
+ if ( ++j == n )
+ goto done;
+ else
+ goto next;
+ }
+ }
+ goto done;
+ }
+done:
+ if ( j < H )
+ {
+ if ( j == n )
+ {
+ h[j].idx = i;
+ h[j].count = 1;
+ n = n + 1;
+ }
+ else
+ h[j].count++;
+ }
+ }
+ /* bubble sort time! weeeeee!! */
+ for ( i = 0; i < n-1; i++ )
+ {
+ if ( h[i].count < h[i+1].count )
+ {
+ struct DbgOpenGDIHandle t;
+ t = h[i+1];
+ h[i+1] = h[i];
+ j = i;
+ while ( j > 0 && h[j-1].count < t.count )
+ j--;
+ h[j] = t;
+ }
+ }
+ /* print the worst offenders... */
+ DbgPrint ( "Worst GDI Handle leak offenders (out of %i unique locations):\n", n );
+ for ( i = 0; i < n && h[i].count > 1; i++ )
+ {
+ int j;
+ DbgPrint ( " %i allocs: ", h[i].count );
+ for ( j = 0; j < GDI_STACK_LEVELS; j++ )
+ {
+ ULONG Addr = GDIHandleAllocator[h[i].idx][j];
+ if ( !KeRosPrintAddress ( (PVOID)Addr ) )
+ DbgPrint ( "<%X>", Addr );
+ }
+ DbgPrint ( "\n" );
+ }
+ if ( i < n && h[i].count == 1 )
+ DbgPrint ( "(list terminated - the remaining entries have 1 allocation only)\n" );
+}
+#endif /* GDI_DEBUG */
+
/*!
* Allocate memory for GDI object and return handle to it.
*
@@ -214,12 +317,25 @@
* \todo return the object pointer and lock it by default.
*/
HGDIOBJ INTERNAL_CALL
+#ifdef GDI_DEBUG
+GDIOBJ_AllocObjDbg(const char* file, int line, ULONG ObjectType)
+#else /* !GDI_DEBUG */
GDIOBJ_AllocObj(ULONG ObjectType)
+#endif /* GDI_DEBUG */
{
PW32PROCESS W32Process;
PGDIOBJHDR newObject;
PPAGED_LOOKASIDE_LIST LookasideList;
LONG CurrentProcessId, LockedProcessId;
+#ifdef GDI_DEBUG
+ ULONG Attempts = 0;
+#endif
+
+ W32Process = PsGetWin32Process();
+ /* HACK HACK HACK: simplest-possible quota implementation - don't allow a process
+ to take too many GDI objects, itself. */
+ if ( W32Process && W32Process->GDIObjects >= 0x2710 )
+ return NULL;
ASSERT(ObjectType != GDI_OBJECT_TYPE_DONTCARE);
@@ -229,6 +345,7 @@
newObject = ExAllocateFromPagedLookasideList(LookasideList);
if(newObject != NULL)
{
+ PSLIST_ENTRY FreeEntry;
PGDI_TABLE_ENTRY Entry;
PGDIOBJ ObjectBody;
LONG TypeInfo;
@@ -238,12 +355,13 @@
FIXME - don't shift once ROS' PIDs match with nt! */
CurrentProcessId = (LONG)PsGetCurrentProcessId() << 1;
LockedProcessId = CurrentProcessId | 0x1;
- W32Process = PsGetWin32Process();
newObject->LockingThread = NULL;
newObject->Locks = 0;
#ifdef GDI_DEBUG
+ newObject->createdfile = file;
+ newObject->createdline = line;
newObject->lockfile = NULL;
newObject->lockline = 0;
#endif
@@ -254,44 +372,69 @@
TypeInfo = (ObjectType & 0xFFFF0000) | (ObjectType >> 16);
- /* Search for a free handle entry */
- for(Entry = &HandleTable->Entries[RESERVE_ENTRIES_COUNT];
- Entry < HandleTable->EntriesEnd;
- Entry++)
+ FreeEntry = InterlockedPopEntrySList(&HandleTable->FreeEntriesHead);
+ if(FreeEntry != NULL)
{
- LONG PrevProcId = InterlockedCompareExchange(&Entry->ProcessId, LockedProcessId, 0);
+ LONG PrevProcId;
+ UINT Index;
+ HGDIOBJ Handle;
+
+ /* calculate the entry from the address of the entry in the free slot array */
+ Index = ((ULONG_PTR)FreeEntry - (ULONG_PTR)&HandleTable->FreeEntries[0]) /
+ sizeof(HandleTable->FreeEntries[0]);
+ Entry = &HandleTable->Entries[Index];
+ Handle = (HGDIOBJ)((Index & 0xFFFF) | (ObjectType & 0xFFFF0000));
+
+LockHandle:
+ PrevProcId = InterlockedCompareExchange(&Entry->ProcessId, LockedProcessId, 0);
if(PrevProcId == 0)
{
- if(InterlockedCompareExchangePointer(&Entry->KernelData, ObjectBody, NULL) == NULL)
- {
- HGDIOBJ Handle;
- UINT Index = GDI_ENTRY_TO_INDEX(HandleTable, Entry);
-
- Handle = (HGDIOBJ)((Index & 0xFFFF) | (ObjectType & 0xFFFF0000));
-
- /* we found a free entry, no need to exchange this field atomically
- since we're holding the lock */
- Entry->Type = TypeInfo;
+ ASSERT(Entry->KernelData == NULL);
- InterlockedExchange(&Entry->ProcessId, CurrentProcessId);
+ Entry->KernelData = ObjectBody;
- if(W32Process != NULL)
- {
- InterlockedIncrement(&W32Process->GDIObjects);
- }
+ /* we found a free entry, no need to exchange this field atomically
+ since we're holding the lock */
+ Entry->Type = TypeInfo;
+
+ /* unlock the entry */
+ InterlockedExchange(&Entry->ProcessId, CurrentProcessId);
+
+#ifdef GDI_DEBUG
+ memset ( GDIHandleAllocator[Index], 0xcd, GDI_STACK_LEVELS * sizeof(ULONG) );
+ KeRosGetStackFrames ( GDIHandleAllocator[Index], GDI_STACK_LEVELS );
+#endif /* GDI_DEBUG */
- DPRINT("GDIOBJ_AllocObj: 0x%x ob: 0x%x\n", Handle, ObjectBody);
- return Handle;
+ if(W32Process != NULL)
+ {
+ InterlockedIncrement(&W32Process->GDIObjects);
}
- else
+
+ DPRINT("GDIOBJ_AllocObj: 0x%x ob: 0x%x\n", Handle, ObjectBody);
+ return Handle;
+ }
+ else
+ {
+#ifdef GDI_DEBUG
+ if(++Attempts > 20)
{
- InterlockedExchange(&Entry->ProcessId, PrevProcId);
+ DPRINT1("[%d]Waiting on 0x%x\n", Attempts, Handle);
}
+#endif
+ /* damn, someone is trying to lock the object even though it doesn't
+ eve nexist anymore, wait a little and try again!
+ FIXME - we shouldn't loop forever! Give up after some time! */
+ DelayExecution();
+ /* try again */
+ goto LockHandle;
}
}
ExFreeToPagedLookasideList(LookasideList, newObject);
DPRINT1("Failed to insert gdi object into the handle table, no handles left!\n");
+#ifdef GDI_DEBUG
+ IntDumpHandleTable();
+#endif /* GDI_DEBUG */
}
else
{
@@ -330,7 +473,7 @@
#endif
DPRINT("GDIOBJ_FreeObj: hObj: 0x%08x\n", hObj);
-
+
if(GDI_HANDLE_IS_STOCKOBJ(hObj))
{
DPRINT1("GDIOBJ_FreeObj() failed, can't delete stock object handle: 0x%x !!!\n", hObj);
@@ -370,10 +513,14 @@
/* Clear the type field so when unlocking the handle it gets finally deleted */
Entry->Type = 0;
Entry->KernelData = NULL;
-
+
/* unlock the handle slot */
InterlockedExchange(&Entry->ProcessId, 0);
-
+
+ /* push this entry to the free list */
+ InterlockedPushEntrySList(&HandleTable->FreeEntriesHead,
+ &HandleTable->FreeEntries[GDI_ENTRY_TO_INDEX(HandleTable, Entry)]);
+
if(W32Process != NULL)
{
InterlockedDecrement(&W32Process->GDIObjects);
@@ -396,7 +543,7 @@
/* the object is currently locked. just clear the type field so when the
object gets unlocked it will be finally deleted from the table. */
Entry->Type = 0;
-
+
/* unlock the handle slot */
InterlockedExchange(&Entry->ProcessId, 0);
@@ -536,7 +683,7 @@
{
DPRINT("InitGdiObjectHandleTable\n");
- HandleTable = GDIOBJ_iAllocHandleTable (GDI_HANDLE_COUNT);
+ HandleTable = GDIOBJ_iAllocHandleTable();
DPRINT("HandleTable: %x\n", HandleTable);
}
@@ -561,7 +708,7 @@
BOOL INTERNAL_CALL
GDI_CleanupForProcess (struct _EPROCESS *Process)
{
- PGDI_TABLE_ENTRY Entry;
+ PGDI_TABLE_ENTRY Entry, End;
PEPROCESS CurrentProcess;
PW32PROCESS W32Process;
LONG ProcId;
@@ -582,8 +729,9 @@
we should delete it directly here! */
ProcId = ((LONG)Process->UniqueProcessId << 1);
+ End = &HandleTable->Entries[GDI_HANDLE_COUNT];
for(Entry = &HandleTable->Entries[RESERVE_ENTRIES_COUNT];
- Entry < HandleTable->EntriesEnd;
+ Entry < End;
Entry++, Index++)
{
/* ignore the lock bit */
@@ -642,7 +790,7 @@
#endif
DPRINT("GDIOBJ_LockObj: hObj: 0x%08x\n", hObj);
-
+
Thread = PsGetCurrentThread();
/* shift the process id to the left so we can use the first bit to lock the object.
@@ -675,7 +823,7 @@
that locked the object. There's no need to do this atomically as we're
holding the lock of the handle slot, but this way it's easier ;) */
PrevThread = InterlockedCompareExchangePointer(&GdiHdr->LockingThread, Thread, NULL);
-
+
if(PrevThread == NULL || PrevThread == Thread)
{
if(++GdiHdr->Locks == 1)
@@ -687,14 +835,14 @@
}
InterlockedExchange(&Entry->ProcessId, PrevProcId);
-
+
/* we're done, return the object body */
return GDIHdrToBdy(GdiHdr);
}
else
{
InterlockedExchange(&Entry->ProcessId, PrevProcId);
-
+
#ifdef GDI_DEBUG
if(++Attempts > 20)
{
@@ -709,14 +857,16 @@
else
{
InterlockedExchange(&Entry->ProcessId, PrevProcId);
-
+
if(EntryType == 0)
{
DPRINT1("Attempted to lock object 0x%x that is deleted!\n", hObj);
+ KeRosDumpStackFrames ( NULL, 20 );
}
else
{
DPRINT1("Attempted to lock object 0x%x, type mismatch (0x%x : 0x%x)\n", hObj, EntryType, ExpectedType);
+ KeRosDumpStackFrames ( NULL, 20 );
}
#ifdef GDI_DEBUG
DPRINT1("-> called from %s:%i\n", file, line);
@@ -748,6 +898,7 @@
else
{
DPRINT1("Attempted to lock foreign handle: 0x%x, Owner: 0x%x locked: 0x%x Caller: 0x%x, stockobj: 0x%x\n", hObj, PrevProcId >> 1, PrevProcId & 0x1, PsGetCurrentProcessId(), GDI_HANDLE_IS_STOCKOBJ(hObj));
+ KeRosDumpStackFrames ( NULL, 20 );
#ifdef GDI_DEBUG
DPRINT1("-> called from %s:%i\n", file, line);
#endif
@@ -804,7 +955,7 @@
PGDIOBJHDR GdiHdr;
GdiHdr = GDIBdyToHdr(Entry->KernelData);
-
+
PrevThread = GdiHdr->LockingThread;
if(PrevThread == Thread)
{
@@ -813,30 +964,33 @@
if(--GdiHdr->Locks == 0)
{
GdiHdr->LockingThread = NULL;
-
+
#ifdef GDI_DEBUG
GdiHdr->lockfile = NULL;
GdiHdr->lockline = 0;
#endif
}
-
+
if(Entry->Type == 0 && GdiHdr->Locks == 0)
{
PPAGED_LOOKASIDE_LIST LookasideList;
PW32PROCESS W32Process = PsGetWin32Process();
DWORD Type = GDI_HANDLE_GET_TYPE(hObj);
-
+
ASSERT(ProcessId != 0); /* must not delete a global handle!!!! */
-
+
/* we should delete the handle */
Entry->KernelData = NULL;
InterlockedExchange(&Entry->ProcessId, 0);
-
+
+ InterlockedPushEntrySList(&HandleTable->FreeEntriesHead,
+ &HandleTable->FreeEntries[GDI_ENTRY_TO_INDEX(HandleTable, Entry)]);
+
if(W32Process != NULL)
{
InterlockedDecrement(&W32Process->GDIObjects);
}
-
+
/* call the cleanup routine. */
Ret = RunCleanupCallback(GDIHdrToBdy(GdiHdr), Type);
@@ -953,11 +1107,11 @@
#ifdef GDI_DEBUG
ULONG Attempts = 0;
#endif
-
+
ASSERT(hObj);
DPRINT("GDIOBJ_ConvertToStockObj: hObj: 0x%08x\n", *hObj);
-
+
Thread = PsGetCurrentThread();
if(!GDI_HANDLE_IS_STOCKOBJ(*hObj))
@@ -1089,7 +1243,7 @@
#endif
DPRINT("GDIOBJ_SetOwnership: hObj: 0x%x, NewProcess: 0x%x\n", ObjectHandle, (NewOwner ? PsGetProcessId(NewOwner) : 0));
-
+
Thread = PsGetCurrentThread();
if(!GDI_HANDLE_IS_STOCKOBJ(ObjectHandle))
@@ -1111,7 +1265,7 @@
if(Entry->Type != 0 && Entry->KernelData != NULL)
{
PGDIOBJHDR GdiHdr = GDIBdyToHdr(Entry->KernelData);
-
+
PrevThread = GdiHdr->LockingThread;
if(PrevThread == NULL || PrevThread == Thread)
{
@@ -1204,11 +1358,7 @@
}
else if((PrevProcId >> 1) != (LONG)PsGetCurrentProcessId())
{
- /* FIXME - should we really allow changing the ownership of objects we don't own? */
- DPRINT1("WARNING! Changing ownership of object 0x%x (pid: 0x%x) from pid 0x%x!!!\n", ObjectHandle, PrevProcId >> 1, PsGetCurrentProcessId());
- ProcessId = PrevProcId & ~0x1;
- LockedProcessId = ProcessId | 0x1;
- goto LockHandle;
+ DPRINT1("Attempted to change ownership of object 0x%x (pid: 0x%x) from pid 0x%x!!!\n", ObjectHandle, PrevProcId >> 1, PsGetCurrentProcessId());
}
else
{
@@ -1228,7 +1378,7 @@
#endif
DPRINT("GDIOBJ_CopyOwnership: from: 0x%x, to: 0x%x\n", CopyFrom, CopyTo);
-
+
Thread = PsGetCurrentThread();
if(!GDI_HANDLE_IS_STOCKOBJ(CopyFrom) && !GDI_HANDLE_IS_STOCKOBJ(CopyTo))
reactos/subsys/win32k/objects
diff -u -r1.37.10.2 -r1.37.10.3
--- line.c 13 Dec 2004 16:18:19 -0000 1.37.10.2
+++ line.c 30 Dec 2004 04:37:15 -0000 1.37.10.3
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: line.c,v 1.37.10.2 2004/12/13 16:18:19 hyperion Exp $ */
+/* $Id: line.c,v 1.37.10.3 2004/12/30 04:37:15 hyperion Exp $ */
#include <w32k.h>
// Some code from the WINE project source (www.winehq.com)
reactos/subsys/win32k/objects
diff -u -r1.20.12.2 -r1.20.12.3
--- palette.c 13 Dec 2004 16:18:19 -0000 1.20.12.2
+++ palette.c 30 Dec 2004 04:37:15 -0000 1.20.12.3
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: palette.c,v 1.20.12.2 2004/12/13 16:18:19 hyperion Exp $ */
+/* $Id: palette.c,v 1.20.12.3 2004/12/30 04:37:15 hyperion Exp $ */
#include <w32k.h>
#ifndef NO_MAPPING
reactos/subsys/win32k/objects
diff -u -r1.16.10.2 -r1.16.10.3
--- pen.c 13 Dec 2004 16:18:19 -0000 1.16.10.2
+++ pen.c 30 Dec 2004 04:37:15 -0000 1.16.10.3
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: pen.c,v 1.16.10.2 2004/12/13 16:18:19 hyperion Exp $
+ * $Id: pen.c,v 1.16.10.3 2004/12/30 04:37:15 hyperion Exp $
*/
#include <w32k.h>
reactos/subsys/win32k/objects
diff -u -r1.23.8.2 -r1.23.8.3
--- print.c 13 Dec 2004 16:18:19 -0000 1.23.8.2
+++ print.c 30 Dec 2004 04:37:15 -0000 1.23.8.3
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: print.c,v 1.23.8.2 2004/12/13 16:18:19 hyperion Exp $ */
+/* $Id: print.c,v 1.23.8.3 2004/12/30 04:37:15 hyperion Exp $ */
#include <w32k.h>
INT
reactos/subsys/win32k/objects
diff -u -r1.62.10.2 -r1.62.10.3
--- region.c 13 Dec 2004 16:18:19 -0000 1.62.10.2
+++ region.c 30 Dec 2004 04:37:15 -0000 1.62.10.3
@@ -113,7 +113,7 @@
* the y-x-banding that's so nice to have...
*/
-/* $Id: region.c,v 1.62.10.2 2004/12/13 16:18:19 hyperion Exp $ */
+/* $Id: region.c,v 1.62.10.3 2004/12/30 04:37:15 hyperion Exp $ */
#include <w32k.h>
#include <win32k/float.h>
reactos/subsys/win32k/objects
diff -u -r1.112.4.2 -r1.112.4.3
--- text.c 13 Dec 2004 16:18:22 -0000 1.112.4.2
+++ text.c 30 Dec 2004 04:37:15 -0000 1.112.4.3
@@ -22,7 +22,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: text.c,v 1.112.4.2 2004/12/13 16:18:22 hyperion Exp $ */
+/* $Id: text.c,v 1.112.4.3 2004/12/30 04:37:15 hyperion Exp $ */
#include <w32k.h>
#include <ft2build.h>
@@ -184,7 +184,7 @@
ZwClose(hDirectory);
return;
}
-
+
FileName.Buffer = ExAllocatePool(PagedPool, MAX_PATH);
if (FileName.Buffer == NULL)
{
@@ -357,7 +357,7 @@
return 0;
}
- FontGDI = EngAllocMem(0, sizeof(FONTGDI), TAG_FONTOBJ);
+ FontGDI = EngAllocMem(FL_ZERO_MEMORY, sizeof(FONTGDI), TAG_FONTOBJ);
if(FontGDI == NULL)
{
FT_Done_Face(Face);
@@ -424,7 +424,7 @@
FT_Render_Mode FASTCALL
IntGetFontRenderMode(LOGFONTW *logfont)
-{
+{
switch(logfont->lfQuality)
{
//case ANTIALIASED_QUALITY:
@@ -449,7 +449,7 @@
PWSTR src;
NTSTATUS Status;
int Ret;
-
+
/* Copy the UNICODE_STRING structure */
Status = MmCopyFromCaller(&SafeFileName, Filename, sizeof(UNICODE_STRING));
if(!NT_SUCCESS(Status))
@@ -461,7 +461,7 @@
/* Reserve for prepending '\??\' */
SafeFileName.Length += 4 * sizeof(WCHAR);
SafeFileName.MaximumLength += 4 * sizeof(WCHAR);
-
+
src = SafeFileName.Buffer;
SafeFileName.Buffer = (PWSTR)ExAllocatePoolWithTag(PagedPool, SafeFileName.MaximumLength, TAG_STRING);
if(!SafeFileName.Buffer)
@@ -469,7 +469,7 @@
SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
return 0;
}
-
+
/* Prepend '\??\' */
RtlCopyMemory(SafeFileName.Buffer, L"\\??\\", 4 * sizeof(WCHAR));
@@ -480,9 +480,9 @@
SetLastNtError(Status);
return 0;
}
-
+
Ret = IntGdiAddFontResource(&SafeFileName, fl);
-
+
ExFreePool(SafeFileName.Buffer);
return Ret;
}
@@ -511,7 +511,7 @@
{
/* FIXME */
/* ASSERT(FALSE);*/
- Status = STATUS_INVALID_HANDLE;
+ Status = STATUS_INVALID_HANDLE;
}
}
else
@@ -694,90 +694,14 @@
return (BOOL) Ret;
}
-
-/*************************************************************
- * IntGetOutlineTextMetrics
- *
- */
-static unsigned FASTCALL
-IntGetOutlineTextMetrics(PFONTGDI FontGDI, UINT Size,
- OUTLINETEXTMETRICW *Otm)
+static void FASTCALL
+FillTM(TEXTMETRICW *TM, FT_Face Face, TT_OS2 *pOS2, TT_HoriHeader *pHori)
{
- unsigned Needed;
- TT_OS2 *pOS2;
- TT_HoriHeader *pHori;
- TT_Postscript *pPost;
FT_Fixed XScale, YScale;
- ANSI_STRING FamilyNameA, StyleNameA;
- UNICODE_STRING FamilyNameW, StyleNameW, Regular;
- char *Cp;
int Ascent, Descent;
- TEXTMETRICW *TM;
-
- Needed = sizeof(OUTLINETEXTMETRICW);
-
- RtlInitAnsiString(&FamilyNameA, FontGDI->face->family_name);
- RtlAnsiStringToUnicodeString(&FamilyNameW, &FamilyNameA, TRUE);
- RtlInitAnsiString(&StyleNameA, FontGDI->face->style_name);
- RtlAnsiStringToUnicodeString(&StyleNameW, &StyleNameA, TRUE);
-
- /* These names should be read from the TT name table */
-
- /* length of otmpFamilyName */
- Needed += FamilyNameW.Length + sizeof(WCHAR);
-
- RtlInitUnicodeString(&Regular, L"regular");
- /* length of otmpFaceName */
- if (0 == RtlCompareUnicodeString(&StyleNameW, &Regular, TRUE))
- {
- Needed += FamilyNameW.Length + sizeof(WCHAR); /* just the family name */
- }
- else
- {
- Needed += FamilyNameW.Length + StyleNameW.Length + (sizeof(WCHAR) << 1); /* family + " " + style */
- }
-
- /* length of otmpStyleName */
- Needed += StyleNameW.Length + sizeof(WCHAR);
-
- /* length of otmpFullName */
- Needed += FamilyNameW.Length + StyleNameW.Length + (sizeof(WCHAR) << 1);
-
- if (Size < Needed)
- {
- RtlFreeUnicodeString(&FamilyNameW);
- RtlFreeUnicodeString(&StyleNameW);
- return Needed;
- }
-
- XScale = FontGDI->face->size->metrics.x_scale;
- YScale = FontGDI->face->size->metrics.y_scale;
-
- IntLockFreeType;
- pOS2 = FT_Get_Sfnt_Table(FontGDI->face, ft_sfnt_os2);
- if (NULL == pOS2)
- {
- IntUnLockFreeType;
- DPRINT1("Can't find OS/2 table - not TT font?\n");
- RtlFreeUnicodeString(&StyleNameW);
- RtlFreeUnicodeString(&FamilyNameW);
- return 0;
- }
-
- pHori = FT_Get_Sfnt_Table(FontGDI->face, ft_sfnt_hhea);
- if (NULL == pHori)
- {
- IntUnLockFreeType;
- DPRINT1("Can't find HHEA table - not TT font?\n");
- RtlFreeUnicodeString(&StyleNameW);
- RtlFreeUnicodeString(&FamilyNameW);
- return 0;
- }
-
- pPost = FT_Get_Sfnt_Table(FontGDI->face, ft_sfnt_post); /* we can live with this failing */
-
- Otm->otmSize = Needed;
+ XScale = Face->size->metrics.x_scale;
+ YScale = Face->size->metrics.y_scale;
if (0 == pOS2->usWinAscent + pOS2->usWinDescent)
{
@@ -790,11 +714,10 @@
Descent = pOS2->usWinDescent;
}
- TM = &Otm->otmTextMetrics;
TM->tmAscent = (FT_MulFix(Ascent, YScale) + 32) >> 6;
TM->tmDescent = (FT_MulFix(Descent, YScale) + 32) >> 6;
TM->tmInternalLeading = (FT_MulFix(Ascent + Descent
- - FontGDI->face->units_per_EM, YScale) + 32) >> 6;
+ - Face->units_per_EM, YScale) + 32) >> 6;
TM->tmHeight = TM->tmAscent + TM->tmDescent;
@@ -809,10 +732,10 @@
TM->tmAveCharWidth = (FT_MulFix(pOS2->xAvgCharWidth, XScale) + 32) >> 6;
if (0 == TM->tmAveCharWidth)
{
- TM->tmAveCharWidth = 1;
+ TM->tmAveCharWidth = 1;
}
- TM->tmMaxCharWidth = (FT_MulFix(FontGDI->face->bbox.xMax - FontGDI->face->bbox.xMin,
- XScale) + 32) >> 6;
+ TM->tmMaxCharWidth = (FT_MulFix(Face->bbox.xMax - Face->bbox.xMin,
+ XScale) + 32) >> 6;
TM->tmWeight = pOS2->usWeightClass;
TM->tmOverhang = 0;
TM->tmDigitizedAspectX = 300;
@@ -821,12 +744,12 @@
TM->tmLastChar = pOS2->usLastCharIndex;
TM->tmDefaultChar = pOS2->usDefaultChar;
TM->tmBreakChar = L'\0' != pOS2->usBreakChar ? pOS2->usBreakChar : ' ';
- TM->tmItalic = (FontGDI->face->style_flags & FT_STYLE_FLAG_ITALIC) ? 255 : 0;
+ TM->tmItalic = (Face->style_flags & FT_STYLE_FLAG_ITALIC) ? 255 : 0;
TM->tmUnderlined = 0; /* entry in OS2 table */
TM->tmStruckOut = 0; /* entry in OS2 table */
/* Yes TPMF_FIXED_PITCH is correct; braindead api */
- if (! FT_IS_FIXED_WIDTH(FontGDI->face))
+ if (! FT_IS_FIXED_WIDTH(Face))
{
TM->tmPitchAndFamily = TMPF_FIXED_PITCH;
}
@@ -868,18 +791,101 @@
TM->tmPitchAndFamily |= FF_DONTCARE;
}
- if (FT_IS_SCALABLE(FontGDI->face))
+ if (FT_IS_SCALABLE(Face))
{
TM->tmPitchAndFamily |= TMPF_VECTOR;
}
- if (FT_IS_SFNT(FontGDI->face))
+ if (FT_IS_SFNT(Face))
{
TM->tmPitchAndFamily |= TMPF_TRUETYPE;
}
-#ifndef TODO
TM->tmCharSet = DEFAULT_CHARSET;
-#endif
+}
+
+/*************************************************************
+ * IntGetOutlineTextMetrics
+ *
+ */
+static unsigned FASTCALL
+IntGetOutlineTextMetrics(PFONTGDI FontGDI, UINT Size,
+ OUTLINETEXTMETRICW *Otm)
+{
+ unsigned Needed;
+ TT_OS2 *pOS2;
+ TT_HoriHeader *pHori;
+ TT_Postscript *pPost;
+ FT_Fixed XScale, YScale;
+ ANSI_STRING FamilyNameA, StyleNameA;
+ UNICODE_STRING FamilyNameW, StyleNameW, Regular;
+ char *Cp;
+
+ Needed = sizeof(OUTLINETEXTMETRICW);
+
+ RtlInitAnsiString(&FamilyNameA, FontGDI->face->family_name);
+ RtlAnsiStringToUnicodeString(&FamilyNameW, &FamilyNameA, TRUE);
+
+ RtlInitAnsiString(&StyleNameA, FontGDI->face->style_name);
+ RtlAnsiStringToUnicodeString(&StyleNameW, &StyleNameA, TRUE);
+
+ /* These names should be read from the TT name table */
+
+ /* length of otmpFamilyName */
+ Needed += FamilyNameW.Length + sizeof(WCHAR);
+
+ RtlInitUnicodeString(&Regular, L"regular");
+ /* length of otmpFaceName */
+ if (0 == RtlCompareUnicodeString(&StyleNameW, &Regular, TRUE))
+ {
+ Needed += FamilyNameW.Length + sizeof(WCHAR); /* just the family name */
+ }
+ else
+ {
+ Needed += FamilyNameW.Length + StyleNameW.Length + (sizeof(WCHAR) << 1); /* family + " " + style */
+ }
+
+ /* length of otmpStyleName */
+ Needed += StyleNameW.Length + sizeof(WCHAR);
+
+ /* length of otmpFullName */
+ Needed += FamilyNameW.Length + StyleNameW.Length + (sizeof(WCHAR) << 1);
+
+ if (Size < Needed)
+ {
+ RtlFreeUnicodeString(&FamilyNameW);
+ RtlFreeUnicodeString(&StyleNameW);
+ return Needed;
+ }
+
+ XScale = FontGDI->face->size->metrics.x_scale;
+ YScale = FontGDI->face->size->metrics.y_scale;
+
+ IntLockFreeType;
+ pOS2 = FT_Get_Sfnt_Table(FontGDI->face, ft_sfnt_os2);
+ if (NULL == pOS2)
+ {
+ IntUnLockFreeType;
+ DPRINT1("Can't find OS/2 table - not TT font?\n");
+ RtlFreeUnicodeString(&StyleNameW);
+ RtlFreeUnicodeString(&FamilyNameW);
+ return 0;
+ }
+
+ pHori = FT_Get_Sfnt_Table(FontGDI->face, ft_sfnt_hhea);
+ if (NULL == pHori)
+ {
+ IntUnLockFreeType;
+ DPRINT1("Can't find HHEA table - not TT font?\n");
+ RtlFreeUnicodeString(&StyleNameW);
+ RtlFreeUnicodeString(&FamilyNameW);
+ return 0;
+ }
+
+ pPost = FT_Get_Sfnt_Table(FontGDI->face, ft_sfnt_post); /* we can live with this failing */
+
+ Otm->otmSize = Needed;
+
+ FillTM(&Otm->otmTextMetrics, FontGDI->face, pOS2, pHori);
Otm->otmFiller = 0;
memcpy(&Otm->otmPanoseNumber, pOS2->panose, PANOSE_COUNT);
@@ -972,7 +978,7 @@
FontGDI = CurrentEntry->Font;
ASSERT(FontGDI);
-
+
RtlInitAnsiString(&EntryFaceNameA, FontGDI->face->family_name);
RtlAnsiStringToUnicodeString(&EntryFaceNameW, &EntryFaceNameA, TRUE);
if ((LF_FACESIZE - 1) * sizeof(WCHAR) < EntryFaceNameW.Length)
@@ -1032,7 +1038,7 @@
LOGFONTW *Lf;
TEXTMETRICW *TM;
NEWTEXTMETRICW *Ntm;
-
+
ZeroMemory(Info, sizeof(FONTFAMILYINFO));
Size = IntGetOutlineTextMetrics(FontGDI, 0, NULL);
Otm = ExAllocatePoolWithTag(PagedPool, Size, TAG_GDITEXT);
@@ -1124,7 +1130,7 @@
if (0 == pOS2->version)
{
FT_UInt Dummy;
-
+
if (FT_Get_First_Char(FontGDI->face, &Dummy) < 0x100)
{
fs_fsCsb0 |= 1;
@@ -1411,7 +1417,7 @@
/* Enumerate font families in the process local list */
Win32Process = PsGetWin32Process();
IntLockProcessPrivateFonts(Win32Process);
- if (! GetFontFamilyInfoForList(&LogFont, Info, &Count, Size,
+ if (! GetFontFamilyInfoForList(&LogFont, Info, &Count, Size,
&Win32Process->PrivateFontListHead))
{
IntUnLockProcessPrivateFonts(Win32Process);
@@ -1499,7 +1505,7 @@
PFONTGDI FontGDI;
PTEXTOBJ TextObj = NULL;
PPALGDI PalDestGDI;
- XLATEOBJ *XlateObj, *XlateObj2;
+ XLATEOBJ *XlateObj=NULL, *XlateObj2=NULL;
ULONG Mode;
FT_Render_Mode RenderMode;
BOOLEAN Render;
@@ -1513,7 +1519,7 @@
SetLastWin32Error(ERROR_INVALID_HANDLE);
return FALSE;
}
-
+
if (NULL != UnsafeDx && Count > 0)
{
Dx = ExAllocatePoolWithTag(PagedPool, Count * sizeof(INT), TAG_GDITEXT);
@@ -1527,10 +1533,14 @@
goto fail;
}
}
-
+
BitmapObj = BITMAPOBJ_LockBitmap(dc->w.hBitmap);
- ASSERT(BitmapObj);
+ if ( !BitmapObj )
+ {
+ goto fail;
+ }
SurfObj = &BitmapObj->SurfObj;
+ ASSERT(SurfObj);
Start.x = XStart; Start.y = YStart;
IntLPtoDP(dc, &Start, 1);
@@ -1541,33 +1551,48 @@
/* Create the brushes */
PalDestGDI = PALETTE_LockPalette(dc->w.hPalette);
if ( !PalDestGDI )
- Mode = PAL_RGB;
+ Mode = PAL_RGB;
else
{
- Mode = PalDestGDI->Mode;
- PALETTE_UnlockPalette(dc->w.hPalette);
+ Mode = PalDestGDI->Mode;
+ PALETTE_UnlockPalette(dc->w.hPalette);
}
XlateObj = (XLATEOBJ*)IntEngCreateXlate(Mode, PAL_RGB, dc->w.hPalette, NULL);
+ if ( !XlateObj )
+ {
+ goto fail;
+ }
hBrushFg = NtGdiCreateSolidBrush(XLATEOBJ_iXlate(XlateObj, dc->w.textColor));
+ if ( !hBrushFg )
+ {
+ goto fail;
+ }
BrushFg = BRUSHOBJ_LockBrush(hBrushFg);
+ if ( !BrushFg )
+ {
+ goto fail;
+ }
IntGdiInitBrushInstance(&BrushFgInst, BrushFg, NULL);
if ((fuOptions & ETO_OPAQUE) || dc->w.backgroundMode == OPAQUE)
{
hBrushBg = NtGdiCreateSolidBrush(XLATEOBJ_iXlate(XlateObj, dc->w.backgroundColor));
- if (hBrushBg)
+ if ( !hBrushBg )
{
- BrushBg = BRUSHOBJ_LockBrush(hBrushBg);
- /* FIXME - Handle BrushBg == NULL !!!!! */
- IntGdiInitBrushInstance(&BrushBgInst, BrushBg, NULL);
+ goto fail;
}
- else
+ BrushBg = BRUSHOBJ_LockBrush(hBrushBg);
+ if ( !BrushBg )
{
- EngDeleteXlate(XlateObj);
goto fail;
}
+ IntGdiInitBrushInstance(&BrushBgInst, BrushBg, NULL);
}
XlateObj2 = (XLATEOBJ*)IntEngCreateXlate(PAL_RGB, Mode, NULL, dc->w.hPalette);
-
+ if ( !XlateObj2 )
+ {
+ goto fail;
+ }
+
SourcePoint.x = 0;
SourcePoint.y = 0;
MaskRect.left = 0;
@@ -1611,7 +1636,9 @@
}
FontObj = TextObj->Font;
+ ASSERT(FontObj);
FontGDI = ObjToGDI(FontObj, FONT);
+ ASSERT(FontGDI);
face = FontGDI->face;
if (face->charmap == NULL)
@@ -1630,12 +1657,16 @@
}
}
if (!found)
+ {
DPRINT1("WARNING: Could not find desired charmap!\n");
+ }
IntLockFreeType;
error = FT_Set_Charmap(face, found);
IntUnLockFreeType;
if (error)
+ {
DPRINT1("WARNING: Could not set the charmap!\n");
+ }
}
Render = IntIsFontRenderingEnabled();
@@ -1643,15 +1674,15 @@
RenderMode = IntGetFontRenderMode(&TextObj->logfont);
else
RenderMode = FT_RENDER_MODE_MONO;
-
+
IntLockFreeType;
error = FT_Set_Pixel_Sizes(
face,
+ TextObj->logfont.lfWidth,
/* FIXME should set character height if neg */
(TextObj->logfont.lfHeight < 0 ?
- TextObj->logfont.lfHeight :
- TextObj->logfont.lfHeight),
- TextObj->logfont.lfWidth);
+ TextObj->logfont.lfHeight == 0 ? 11 : TextObj->logfont.lfHeight));
IntUnLockFreeType;
if (error)
{
@@ -1704,7 +1735,7 @@
glyph_index = FT_Get_Char_Index(face, *TempText);
error = FT_Load_Glyph(face, glyph_index, FT_LOAD_DEFAULT);
IntUnLockFreeType;
-
+
if (error)
{
DPRINT1("WARNING: Failed to load and render glyph! [index: %u]\n", glyph_index);
@@ -1757,8 +1788,6 @@
if (error)
{
- EngDeleteXlate(XlateObj);
- EngDeleteXlate(XlateObj2);
DPRINT1("WARNING: Failed to load and render glyph! [index: %u]\n", glyph_index);
goto fail;
}
@@ -1782,8 +1811,6 @@
IntUnLockFreeType;
if (error)
{
- EngDeleteXlate(XlateObj);
- EngDeleteXlate(XlateObj2);
DPRINT1("WARNING: Failed to render glyph!\n");
goto fail;
}
@@ -1817,12 +1844,12 @@
DestRect.right = DestRect.left + glyph->bitmap.width;
DestRect.top = TextTop + yoff - glyph->bitmap_top;
DestRect.bottom = DestRect.top + glyph->bitmap.rows;
-
+
bitSize.cx = glyph->bitmap.width;
bitSize.cy = glyph->bitmap.rows;
MaskRect.right = glyph->bitmap.width;
MaskRect.bottom = glyph->bitmap.rows;
-
+
/*
* We should create the bitmap out of the loop at the biggest possible
* glyph size. Then use memset with 0 to clear it and sourcerect to
@@ -1830,8 +1857,19 @@
*/
HSourceGlyph = EngCreateBitmap(bitSize, pitch, (glyph->bitmap.pixel_mode == ft_pixel_mode_grays) ? BMF_8BPP : BMF_1BPP, BMF_TOPDOWN, glyph->bitmap.buffer);
+ if ( !HSourceGlyph )
+ {
+ DPRINT1("WARNING: EngLockSurface() failed!\n");
+ goto fail;
+ }
SourceGlyphSurf = EngLockSurface((HSURF)HSourceGlyph);
-
+ if ( !SourceGlyphSurf )
+ {
+ EngDeleteSurface((HSURF)HSourceGlyph);
+ DPRINT1("WARNING: EngLockSurface() failed!\n");
+ goto fail;
+ }
+
/*
* Use the font data as a mask to paint onto the DCs surface using a
* brush.
@@ -1882,10 +1920,14 @@
ExFreePool(Dx);
}
DC_UnlockDc( hDC );
-
+
return TRUE;
fail:
+ if ( XlateObj2 != NULL )
+ EngDeleteXlate(XlateObj2);
+ if ( XlateObj != NULL )
+ EngDeleteXlate(XlateObj);
if(TextObj != NULL)
TEXTOBJ_UnlockText(dc->w.hFont);
BITMAPOBJ_UnlockBitmap(dc->w.hBitmap);
@@ -2001,7 +2043,7 @@
}
FontGDI = ObjToGDI(TextObj->Font, FONT);
-
+
face = FontGDI->face;
if (face->charmap == NULL)
{
@@ -2030,11 +2072,11 @@
IntLockFreeType;
FT_Set_Pixel_Sizes(face,
+ TextObj->logfont.lfWidth,
/* FIXME should set character height if neg */
(TextObj->logfont.lfHeight < 0 ?
- TextObj->logfont.lfHeight :
- TextObj->logfont.lfHeight),
- TextObj->logfont.lfWidth);
+ TextObj->logfont.lfHeight == 0 ? 11 : TextObj->logfont.lfHeight));
for (i = FirstChar; i <= LastChar; i++)
{
@@ -2188,11 +2230,11 @@
IntLockFreeType;
error = FT_Set_Pixel_Sizes(face,
+ TextObj->logfont.lfWidth,
/* FIXME should set character height if neg */
(TextObj->logfont.lfHeight < 0 ?
- TextObj->logfont.lfHeight :
- TextObj->logfont.lfHeight),
- TextObj->logfont.lfWidth);
+ TextObj->logfont.lfHeight == 0 ? 11 : TextObj->logfont.lfHeight));
IntUnLockFreeType;
if (error)
{
@@ -2512,7 +2554,7 @@
BOOL
STDCALL
NtGdiGetTextMetrics(HDC hDC,
- LPTEXTMETRICW tm)
+ LPTEXTMETRICW tm)
{
PDC dc;
PTEXTOBJ TextObj;
@@ -2521,6 +2563,7 @@
TEXTMETRICW SafeTm;
FT_Face Face;
TT_OS2 *pOS2;
+ TT_HoriHeader *pHori;
ULONG Error;
if (NULL == tm)
@@ -2528,7 +2571,7 @@
SetLastWin32Error(STATUS_INVALID_PARAMETER);
return FALSE;
}
-
+
if(!(dc = DC_LockDc(hDC)))
{
SetLastWin32Error(ERROR_INVALID_HANDLE);
@@ -2537,62 +2580,65 @@
TextObj = TEXTOBJ_LockText(dc->w.hFont);
if (NULL != TextObj)
- {
+ {
FontGDI = ObjToGDI(TextObj->Font, FONT);
Face = FontGDI->face;
IntLockFreeType;
Error = FT_Set_Pixel_Sizes(Face,
+ TextObj->logfont.lfWidth,
/* FIXME should set character height if neg */
- (TextObj->logfont.lfHeight < 0 ?
- - TextObj->logfont.lfHeight :
- TextObj->logfont.lfHeight),
- TextObj->logfont.lfWidth);
+ (TextObj->logfont.lfHeight < 0 ?
+ - TextObj->logfont.lfHeight :
+ TextObj->logfont.lfHeight == 0 ? 11 : TextObj->logfont.lfHeight));
IntUnLockFreeType;
if (0 != Error)
{
- DPRINT1("Error in setting pixel sizes: %u\n", Error);
- Status = STATUS_UNSUCCESSFUL;
+ DPRINT1("Error in setting pixel sizes: %u\n", Error);
+ Status = STATUS_UNSUCCESSFUL;
}
else
{
- memcpy(&SafeTm, &FontGDI->TextMetric, sizeof(TEXTMETRICW));
- IntLockFreeType;
- pOS2 = FT_Get_Sfnt_Table(Face, ft_sfnt_os2);
- IntUnLockFreeType;
- if (NULL == pOS2)
- {
- DPRINT1("Can't find OS/2 table - not TT font?\n");
- Status = STATUS_UNSUCCESSFUL;
- }
- else
- {
- SafeTm.tmAveCharWidth = (pOS2->xAvgCharWidth + 32) >> 6;
- }
- SafeTm.tmAscent = (Face->size->metrics.ascender + 32) >> 6; // units above baseline
- SafeTm.tmDescent = (32 - Face->size->metrics.descender) >> 6; // units below baseline
- SafeTm.tmHeight = SafeTm.tmAscent + SafeTm.tmDescent;
- SafeTm.tmMaxCharWidth = (Face->size->metrics.max_advance + 32) >> 6;
- if (FT_IS_SFNT(FontGDI->face))
- {
- SafeTm.tmPitchAndFamily |= TMPF_TRUETYPE;
- }
- Status = MmCopyToCaller(tm, &SafeTm, sizeof(TEXTMETRICW));
+ memcpy(&SafeTm, &FontGDI->TextMetric, sizeof(TEXTMETRICW));
+
+ Status = STATUS_SUCCESS;
+ IntLockFreeType;
+ pOS2 = FT_Get_Sfnt_Table(FontGDI->face, ft_sfnt_os2);
+ if (NULL == pOS2)
+ {
+ DPRINT1("Can't find OS/2 table - not TT font?\n");
+ Status = STATUS_INTERNAL_ERROR;
+ }
+
+ pHori = FT_Get_Sfnt_Table(FontGDI->face, ft_sfnt_hhea);
+ if (NULL == pHori)
+ {
+ DPRINT1("Can't find HHEA table - not TT font?\n");
+ Status = STATUS_INTERNAL_ERROR;
+ }
+
+ IntUnLockFreeType;
+
+ if (NT_SUCCESS(Status))
+ {
+ FillTM(&SafeTm, FontGDI->face, pOS2, pHori);
+ Status = MmCopyToCaller(tm, &SafeTm, sizeof(TEXTMETRICW));
+ }
}
- TEXTOBJ_UnlockText(dc->w.hFont);
- }
+ TEXTOBJ_UnlockText(dc->w.hFont);
+ }
else
- {
- Status = STATUS_INVALID_HANDLE;
- }
+ {
+ Status = STATUS_INVALID_HANDLE;
+ }
DC_UnlockDc(hDC);
-
+
if(!NT_SUCCESS(Status))
- {
- SetLastNtError(Status);
- return FALSE;
- }
-
+ {
+ SetLastNtError(Status);
+ return FALSE;
+ }
+
return TRUE;
}
@@ -2716,9 +2762,9 @@
SetLastWin32Error(ERROR_INVALID_HANDLE);
return GDI_ERROR;
}
-
+
FontGdi = ObjToGDI(TextObj->Font, FONT);
-
+
IntLockFreeType;
if (FT_IS_SFNT(FontGdi->face))
@@ -2738,7 +2784,7 @@
TEXTOBJ_UnlockText(hFont);
- return Result;
+ return Result;
}
static UINT FASTCALL
@@ -2751,7 +2797,7 @@
LONG WeightDiff;
NTSTATUS Status;
UINT Score = 1;
-
+
RtlInitAnsiString(&EntryFaceNameA, FontGDI->face->family_name);
Status = RtlAnsiStringToUnicodeString(&EntryFaceNameW, &EntryFaceNameA, TRUE);
if (NT_SUCCESS(Status))
@@ -2897,7 +2943,7 @@
SubstituteFontFamily(&FaceName, 0);
MatchScore = 0;
TextObj->Font = NULL;
-
+
/* First search private fonts */
Win32Process = PsGetWin32Process();
IntLockProcessPrivateFonts(Win32Process);
@@ -2905,7 +2951,7 @@
&TextObj->logfont, &FaceName,
&Win32Process->PrivateFontListHead);
IntUnLockProcessPrivateFonts(Win32Process);
-
+
/* Search system fonts */
IntLockGlobalFonts;
FindBestFontFromList(&TextObj->Font, &MatchScore,
@@ -2926,7 +2972,7 @@
RtlFreeUnicodeString(&FaceName);
TEXTOBJ_UnlockText(FontHandle);
-
+
ASSERT((NT_SUCCESS(Status) ^ (NULL == TextObj->Font)) != 0);
return Status;
reactos/tools/bin2res
diff -u -r1.2 -r1.2.24.1
--- Makefile 3 Jan 2004 22:25:51 -0000 1.2
+++ Makefile 30 Dec 2004 04:37:15 -0000 1.2.24.1
@@ -8,7 +8,7 @@
CLEAN_FILES = *.o bin2res$(EXE_POSTFIX)
-HOST_CFLAGS = -I$(PATH_TO_TOP)/include/wine -I$(PATH_TO_TOP)/include -D__REACTOS__ -Wall -Werror
+HOST_CFLAGS = -I$(PATH_TO_TOP)/include/wine -D__REACTOS__ -Wall -Werror
bin2res.o: bin2res.c
$(HOST_CC) -g $(HOST_CFLAGS) -c bin2res.c -o bin2res.o
reactos/tools/bin2res
diff -u -r1.2 -r1.2.8.1
--- bin2res.c 2 Aug 2004 07:59:38 -0000 1.2
+++ bin2res.c 30 Dec 2004 04:37:15 -0000 1.2.8.1
@@ -21,7 +21,6 @@
*/
#include "config.h"
-#include "wine/port.h"
#include <stdio.h>
#include <stdlib.h>
@@ -32,6 +31,11 @@
#ifdef HAVE_SYS_PARAM_H
# include <sys/param.h>
#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
+extern int mkstemps(char *template, int suffix_len);
static const char* help =
"Usage: bin2res [OPTIONS] <rsrc.rc>\n"
reactos/tools/bin2res
diff -u -r1.1 -r1.1.24.1
--- mkstemps.c 2 Jan 2004 19:49:47 -0000 1.1
+++ mkstemps.c 30 Dec 2004 04:37:16 -0000 1.1.24.1
@@ -17,7 +17,6 @@
Boston, MA 02111-1307, USA. */
#include "config.h"
-#include "wine/port.h"
#include <sys/types.h>
#include <stdlib.h>
reactos/tools/cabman
diff -u -r1.7 -r1.7.18.1
--- cabinet.cxx 10 May 2004 07:44:43 -0000 1.7
+++ cabinet.cxx 30 Dec 2004 04:37:16 -0000 1.7.18.1
@@ -3092,7 +3092,7 @@
#if defined(WIN32)
FILETIME FileTime;
- if (GetFileTime(FileHandle, NULL, &FileTime, NULL))
+ if (GetFileTime(FileHandle, NULL, NULL, &FileTime))
FileTimeToDosDateTime(&FileTime,
&File->File.FileDate,
&File->File.FileTime);
reactos/tools
diff -u -r1.95.2.3 -r1.95.2.4
--- helper.mk 13 Dec 2004 16:18:22 -0000 1.95.2.3
+++ helper.mk 30 Dec 2004 04:37:16 -0000 1.95.2.4
@@ -1,4 +1,4 @@
-# $Id: helper.mk,v 1.95.2.3 2004/12/13 16:18:22 hyperion Exp $
+# $Id: helper.mk,v 1.95.2.4 2004/12/30 04:37:16 hyperion Exp $
#
# Helper makefile for ReactOS modules
# Variables this makefile accepts:
reactos/tools
diff -u -r1.9 -r1.9.6.1
--- rcopy.c 27 Sep 2004 04:32:52 -0000 1.9
+++ rcopy.c 30 Dec 2004 04:37:16 -0000 1.9.6.1
@@ -2,6 +2,7 @@
#include <string.h>
#include <stdlib.h>
#include <sys/stat.h>
+#include <utime.h>
#ifdef WIN32
#include <io.h>
#include <dos.h>
@@ -85,6 +86,8 @@
char* buf;
int n_in;
int n_out;
+ struct stat st_buffer;
+ struct utimbuf ut_buffer;
in = fopen(path1, "rb");
if (in == NULL)
@@ -115,6 +118,21 @@
exit(1);
}
}
+ free(buf);
+ fclose(in);
+ fclose(out);
+
+ if (stat(path2, &st_buffer) >= 0)
+ {
+ ut_buffer.actime = st_buffer.st_atime;
+
+ if (stat(path1, &st_buffer) >= 0)
+ {
+ ut_buffer.modtime = st_buffer.st_mtime;
+ utime(path2, &ut_buffer);
+ }
+ }
+
}
#ifdef WIN32
reactos/tools
diff -u -r1.4 -r1.4.20.1
--- rsym.c 15 Mar 2004 21:31:45 -0000 1.4
+++ rsym.c 30 Dec 2004 04:37:16 -0000 1.4.20.1
@@ -125,7 +125,7 @@
#define N_SLINE 0x44
#define N_SO 0x64
-typedef struct
+typedef struct
{
unsigned long OldOffset;
unsigned long NewOffset;
@@ -137,9 +137,9 @@
{
char* newpath;
int i;
-
+
newpath = strdup(origpath);
-
+
i = 0;
while (newpath[i] != 0)
{
@@ -154,8 +154,8 @@
{
newpath[i] = '\\';
}
-#endif
-#endif
+#endif
+#endif
i++;
}
return(newpath);
@@ -168,7 +168,9 @@
SYMBOLFILE_HEADER SymbolFileHeader;
IMAGE_DOS_HEADER PEDosHeader;
IMAGE_FILE_HEADER PEFileHeader;
+ PIMAGE_OPTIONAL_HEADER PEOptHeader;
PIMAGE_SECTION_HEADER PESectionHeaders;
+ ULONG ImageBase;
PVOID SymbolsBase;
ULONG SymbolsLength;
PVOID SymbolStringsBase;
@@ -187,16 +189,16 @@
PSTR_ENTRY StrEntry;
ULONG StrCount;
ULONG j;
-
+
if (argc != 3)
{
fprintf(stderr, "Too many arguments\n");
exit(1);
}
-
+
path1 = convert_path(argv[1]);
path2 = convert_path(argv[2]);
-
+
in = fopen(path1, "rb");
if (in == NULL)
{
@@ -224,6 +226,11 @@
fseek(in, PEDosHeader.e_lfanew + sizeof(ULONG), SEEK_SET);
n_in = fread(&PEFileHeader, 1, sizeof(PEFileHeader), in);
+ /* Read optional header */
+ PEOptHeader = malloc(PEFileHeader.SizeOfOptionalHeader);
+ fread ( PEOptHeader, 1, PEFileHeader.SizeOfOptionalHeader, in );
+ ImageBase = PEOptHeader->ImageBase;
+
/* Read PE section headers */
PESectionHeaders = malloc(PEFileHeader.NumberOfSections * sizeof(IMAGE_SECTION_HEADER));
fseek(in, PEDosHeader.e_lfanew + sizeof(ULONG) + sizeof(IMAGE_FILE_HEADER)
@@ -239,10 +246,10 @@
for (Idx = 0; Idx < PEFileHeader.NumberOfSections; Idx++)
{
//printf("section: '%.08s'\n", PESectionHeaders[Idx].Name);
- if ((strncmp(PESectionHeaders[Idx].Name, ".stab", 5) == 0)
+ if ((strncmp((char*)PESectionHeaders[Idx].Name, ".stab", 5) == 0)
&& (PESectionHeaders[Idx].Name[5] == 0))
{
- //printf(".stab section found. Size %d\n",
+ //printf(".stab section found. Size %d\n",
// PESectionHeaders[Idx].SizeOfRawData);
SymbolsLength = PESectionHeaders[Idx].SizeOfRawData;
@@ -252,9 +259,9 @@
n_in = fread(SymbolsBase, 1, SymbolsLength, in);
}
- if (strncmp(PESectionHeaders[Idx].Name, ".stabstr", 8) == 0)
+ if (strncmp((char*)PESectionHeaders[Idx].Name, ".stabstr", 8) == 0)
{
- //printf(".stabstr section found. Size %d\n",
+ //printf(".stabstr section found. Size %d\n",
// PESectionHeaders[Idx].SizeOfRawData);
SymbolStringsLength = PESectionHeaders[Idx].SizeOfRawData;
@@ -271,13 +278,23 @@
for (i = 0; i < SymbolsCount; i++)
{
- if (StabEntry[i].n_type == N_FUN ||
- StabEntry[i].n_type == N_SLINE ||
- StabEntry[i].n_type == N_SO)
- {
- memmove(&StabEntry[Count], &StabEntry[i], sizeof(STAB_ENTRY));
- Count++;
- }
+ switch ( StabEntry[i].n_type )
+ {
+ case N_FUN:
+ if ( StabEntry[i].n_desc == 0 ) // line # 0 isn't valid
+ continue;
+ break;
+ case N_SLINE:
+ break;
+ case N_SO:
+ break;
+ default:
+ continue;
+ }
+ memmove(&StabEntry[Count], &StabEntry[i], sizeof(STAB_ENTRY));
+ if ( StabEntry[Count].n_value >= ImageBase )
+ StabEntry[Count].n_value -= ImageBase;
+ Count++;
}
StrEntry = malloc(sizeof(STR_ENTRY) * Count);
reactos/tools/winebuild
diff -u -r1.6 -r1.6.6.1
--- Makefile 27 Sep 2004 08:15:07 -0000 1.6
+++ Makefile 30 Dec 2004 04:37:16 -0000 1.6.6.1
@@ -22,7 +22,7 @@
CLEAN_FILES = *.o $(TARGET)
-HOST_CFLAGS = -D__USE_W32API -I$(PATH_TO_TOP)/include -I$(PATH_TO_TOP)/include/wine -I$(W32API_PATH)/include
+HOST_CFLAGS = -D__USE_W32API -I$(PATH_TO_TOP)/include/wine
%.o: %.c
$(HOST_CC) $(HOST_CFLAGS) -c $< -o $@
reactos/tools/winebuild
diff -u -r1.4 -r1.4.6.1
--- import.c 23 Sep 2004 20:27:30 -0000 1.4
+++ import.c 30 Dec 2004 04:37:16 -0000 1.4.6.1
@@ -20,7 +20,6 @@
*/
#include "config.h"
-#include "wine/port.h"
#include <ctype.h>
#include <fcntl.h>
@@ -31,8 +30,7 @@
# include <unistd.h>
#endif
-#include "windef.h"
-#include "winbase.h"
+#include "winglue.h"
#include "build.h"
struct import
reactos/tools/winebuild
diff -u -r1.5 -r1.5.2.1
--- main.c 2 Nov 2004 19:47:18 -0000 1.5
+++ main.c 30 Dec 2004 04:37:16 -0000 1.5.2.1
@@ -23,7 +23,6 @@
*/
#include "config.h"
-#include "wine/port.h"
#include <assert.h>
#include <stdio.h>
@@ -35,8 +34,7 @@
# include <getopt.h>
#endif
-#include "windef.h"
-#include "winbase.h"
+#include "winglue.h"
#include "build.h"
int UsePIC = 0;
reactos/tools/winebuild
diff -u -r1.1 -r1.1.24.1
--- mkstemps.c 5 Jan 2004 19:49:59 -0000 1.1
+++ mkstemps.c 30 Dec 2004 04:37:16 -0000 1.1.24.1
@@ -17,7 +17,6 @@
Boston, MA 02111-1307, USA. */
#include "config.h"
-#include "wine/port.h"
#include <sys/types.h>
#include <stdlib.h>
reactos/tools/winebuild
diff -u -r1.3 -r1.3.6.1
--- parser.c 23 Sep 2004 20:27:30 -0000 1.3
+++ parser.c 30 Dec 2004 04:37:16 -0000 1.3.6.1
@@ -23,7 +23,6 @@
*/
#include "config.h"
-#include "wine/port.h"
#include <assert.h>
#include <ctype.h>
@@ -32,8 +31,7 @@
#include <stdlib.h>
#include <string.h>
-#include "windef.h"
-#include "winbase.h"
+#include "winglue.h"
#include "build.h"
int current_line = 0;
reactos/tools/winebuild
diff -u -r1.2 -r1.2.6.1
--- relay.c 23 Sep 2004 20:27:30 -0000 1.2
+++ relay.c 30 Dec 2004 04:37:16 -0000 1.2.6.1
@@ -23,7 +23,6 @@
*/
#include "config.h"
-#include "wine/port.h"
#include <ctype.h>
reactos/tools/winebuild
diff -u -r1.3 -r1.3.6.1
--- res16.c 23 Sep 2004 20:27:30 -0000 1.3
+++ res16.c 30 Dec 2004 04:37:16 -0000 1.3.6.1
@@ -19,7 +19,6 @@
*/
#include "config.h"
-#include "wine/port.h"
#include <ctype.h>
#include <stdlib.h>
@@ -37,8 +36,7 @@
#include <sys/mman.h>
#endif
-#include "windef.h"
-#include "winbase.h"
+#include "winglue.h"
#include "build.h"
#define ALIGNMENT 2 /* alignment for resource data */
reactos/tools/winebuild
diff -u -r1.3 -r1.3.6.1
--- res32.c 23 Sep 2004 20:27:30 -0000 1.3
+++ res32.c 30 Dec 2004 04:37:16 -0000 1.3.6.1
@@ -19,7 +19,6 @@
*/
#include "config.h"
-#include "wine/port.h"
#include <ctype.h>
#include <stdlib.h>
@@ -37,8 +36,7 @@
#include <sys/mman.h>
#endif
-#include "windef.h"
-#include "winbase.h"
+#include "winglue.h"
#include "build.h"
/* Unicode string or integer id */
reactos/tools/winebuild
diff -u -r1.2 -r1.2.6.1
--- spec16.c 23 Sep 2004 20:27:30 -0000 1.2
+++ spec16.c 30 Dec 2004 04:37:16 -0000 1.2.6.1
@@ -23,7 +23,6 @@
*/
#include "config.h"
-#include "wine/port.h"
#include <assert.h>
#include <ctype.h>
reactos/tools/winebuild
diff -u -r1.8 -r1.8.2.1
--- spec32.c 24 Nov 2004 20:11:52 -0000 1.8
+++ spec32.c 30 Dec 2004 04:37:16 -0000 1.8.2.1
@@ -23,19 +23,14 @@
*/
#include "config.h"
-#include "wine/port.h"
#include <assert.h>
#include <ctype.h>
#include <stdarg.h>
#include <string.h>
-#ifdef WIN32
-#include "windef.h"
-#include "winbase.h"
-#else
#include "winglue.h"
-#endif
+
#define EXCEPTION_WINE_STUB 0x80000100 /* stub entry point called */
#define EH_NONCONTINUABLE 0x01
reactos/tools/winebuild
diff -u -r1.3 -r1.3.6.1
--- utils.c 23 Sep 2004 20:27:30 -0000 1.3
+++ utils.c 30 Dec 2004 04:37:17 -0000 1.3.6.1
@@ -19,7 +19,6 @@
*/
#include "config.h"
-#include "wine/port.h"
#if !defined(WIN32)
#undef strdup
reactos/tools/winebuild
diff -u -r1.1 -r1.1.6.1
--- winehq2ros.patch 23 Sep 2004 20:27:30 -0000 1.1
+++ winehq2ros.patch 30 Dec 2004 04:37:17 -0000 1.1.6.1
@@ -1,11 +1,104 @@
-Index: main.c
-===================================================================
-RCS file: /home/wine/wine/tools/winebuild/main.c,v
-retrieving revision 1.55
-diff -u -r1.55 main.c
---- main.c 25 Mar 2004 00:40:52 -0000 1.55
-+++ main.c 23 Sep 2004 20:38:14 -0000
-@@ -412,9 +412,7 @@
+--- build.h Thu Mar 25 07:35:37 2004
++++ build.h Sun Dec 26 19:03:46 2004
+@@ -185,6 +185,7 @@
+ extern void BuildSpec32File( FILE *outfile, DLLSPEC *spec );
+ extern void BuildDef32File( FILE *outfile, DLLSPEC *spec );
+ extern void BuildDebugFile( FILE *outfile, const char *srcdir, char **argv );
++extern void BuildPedllFile( FILE *outfile, DLLSPEC *spec );
+
+ extern int parse_spec_file( FILE *file, DLLSPEC *spec );
+ extern int parse_def_file( FILE *file, DLLSPEC *spec );
+--- import.c Thu Jul 29 07:35:19 2004
++++ import.c Sun Dec 26 19:05:00 2004
+@@ -20,7 +20,6 @@
+ */
+
+ #include "config.h"
+-#include "wine/port.h"
+
+ #include <ctype.h>
+ #include <fcntl.h>
+@@ -31,8 +30,7 @@
+ # include <unistd.h>
+ #endif
+
+-#include "windef.h"
+-#include "winbase.h"
++#include "winglue.h"
+ #include "build.h"
+
+ struct import
+--- main.c Thu Mar 25 07:35:37 2004
++++ main.c Sun Dec 26 19:05:06 2004
+@@ -23,7 +23,6 @@
+ */
+
+ #include "config.h"
+-#include "wine/port.h"
+
+ #include <assert.h>
+ #include <stdio.h>
+@@ -35,8 +34,7 @@
+ # include <getopt.h>
+ #endif
+
+-#include "windef.h"
+-#include "winbase.h"
++#include "winglue.h"
+ #include "build.h"
+
+ int UsePIC = 0;
+@@ -74,7 +72,8 @@
+ MODE_DEF,
+ MODE_DEBUG,
+ MODE_RELAY16,
+- MODE_RELAY32
++ MODE_RELAY32,
++ MODE_PEDLL
+ };
+
+ static enum exec_mode_values exec_mode = MODE_NONE;
+@@ -159,7 +158,8 @@
+ " --exe=NAME Build a .c file for the named executable\n"
+ " --debug [FILES] Build a .c file with the debug channels declarations\n"
+ " --relay16 Build the 16-bit relay assembly routines\n"
+-" --relay32 Build the 32-bit relay assembly routines\n\n"
++" --relay32 Build the 32-bit relay assembly routines\n"
++" --pedll Build a .c file for PE dll\n\n"
+ "The mode options are mutually exclusive; you must specify one and only one.\n\n";
+
+ enum long_options_values
+@@ -171,7 +171,8 @@
+ LONG_OPT_RELAY16,
+ LONG_OPT_RELAY32,
+ LONG_OPT_SUBSYSTEM,
+- LONG_OPT_VERSION
++ LONG_OPT_VERSION,
++ LONG_OPT_PEDLL
+ };
+
+ static const char short_options[] = "C:D:F:H:I:K:L:M:N:d:e:f:hi:kl:m:o:r:w";
+@@ -186,6 +187,7 @@
+ { "relay32", 0, 0, LONG_OPT_RELAY32 },
+ { "subsystem",1, 0, LONG_OPT_SUBSYSTEM },
+ { "version", 0, 0, LONG_OPT_VERSION },
++ { "pedll", 1, 0, LONG_OPT_PEDLL },
+ /* aliases for short options */
+ { "source-dir", 1, 0, 'C' },
+ { "delay-lib", 1, 0, 'd' },
+@@ -341,6 +343,11 @@
+ case LONG_OPT_VERSION:
+ printf( "winebuild version " PACKAGE_VERSION "\n" );
+ exit(0);
++ case LONG_OPT_PEDLL:
++ set_exec_mode( MODE_PEDLL );
++ spec_file_name = xstrdup( optarg );
++ set_dll_file_name( optarg, spec );
++ break;
+ case '?':
+ usage(1);
+ break;
+@@ -412,9 +419,7 @@
switch (spec->type)
{
case SPEC_WIN16:
@@ -16,7 +109,7 @@
break;
case SPEC_WIN32:
read_undef_symbols( argv );
-@@ -439,12 +437,10 @@
+@@ -439,12 +444,15 @@
BuildDebugFile( output_file, current_src_dir, argv );
break;
case MODE_RELAY16:
@@ -25,39 +118,170 @@
+ fatal_error( "Win16 relays are not supported in ReactOS version of winebuild\n" );
break;
case MODE_RELAY32:
-- if (argv[0]) fatal_error( "file argument '%s' not allowed in this mode\n", argv[0] );
-- BuildRelays32( output_file );
+ fatal_error( "Win32 relays are not supported in ReactOS version of winebuild\n" );
++ break;
++ case MODE_PEDLL:
+ if (argv[0]) fatal_error( "file argument '%s' not allowed in this mode\n", argv[0] );
+- BuildRelays32( output_file );
++ if (!parse_input_file( spec )) break;
++ BuildPedllFile( output_file, spec );
break;
default:
usage(1);
-Index: spec32.c
-===================================================================
-RCS file: /home/wine/wine/tools/winebuild/spec32.c,v
-retrieving revision 1.83
-diff -u -r1.83 spec32.c
---- spec32.c 15 Jul 2004 18:58:42 -0000 1.83
-+++ spec32.c 23 Sep 2004 20:38:15 -0000
-@@ -30,9 +30,15 @@
+--- parser.c Sat Aug 28 07:35:50 2004
++++ parser.c Sun Dec 26 19:05:14 2004
+@@ -23,7 +23,6 @@
+ */
+
+ #include "config.h"
+-#include "wine/port.h"
+
+ #include <assert.h>
+ #include <ctype.h>
+@@ -32,8 +31,7 @@
+ #include <stdlib.h>
+ #include <string.h>
+
+-#include "windef.h"
+-#include "winbase.h"
++#include "winglue.h"
+ #include "build.h"
+
+ int current_line = 0;
+--- relay.c Wed May 19 07:35:43 2004
++++ relay.c Sun Dec 26 19:04:48 2004
+@@ -23,7 +23,6 @@
+ */
+
+ #include "config.h"
+-#include "wine/port.h"
+
+ #include <ctype.h>
+
+--- res16.c Thu Feb 12 06:50:19 2004
++++ res16.c Sun Dec 26 19:05:20 2004
+@@ -19,7 +19,6 @@
+ */
+
+ #include "config.h"
+-#include "wine/port.h"
+
+ #include <ctype.h>
+ #include <stdlib.h>
+@@ -37,8 +36,7 @@
+ #include <sys/mman.h>
+ #endif
+
+-#include "windef.h"
+-#include "winbase.h"
++#include "winglue.h"
+ #include "build.h"
+
+ #define ALIGNMENT 2 /* alignment for resource data */
+--- res32.c Wed Sep 8 07:35:21 2004
++++ res32.c Sun Dec 26 19:05:26 2004
+@@ -19,7 +19,6 @@
+ */
+
+ #include "config.h"
+-#include "wine/port.h"
+
+ #include <ctype.h>
+ #include <stdlib.h>
+@@ -37,8 +36,7 @@
+ #include <sys/mman.h>
+ #endif
+
+-#include "windef.h"
+-#include "winbase.h"
++#include "winglue.h"
+ #include "build.h"
+
+ /* Unicode string or integer id */
+--- spec16.c Wed May 19 07:35:43 2004
++++ spec16.c Sun Dec 26 19:04:48 2004
+@@ -23,7 +23,6 @@
+ */
+
+ #include "config.h"
+-#include "wine/port.h"
+
+ #include <assert.h>
+ #include <ctype.h>
+--- spec32.c Fri Jul 16 07:35:18 2004
++++ spec32.c Sun Dec 26 19:05:36 2004
+@@ -23,16 +23,17 @@
+ */
+
+ #include "config.h"
+-#include "wine/port.h"
+
+ #include <assert.h>
+ #include <ctype.h>
#include <stdarg.h>
#include <string.h>
-+#ifdef WIN32
- #include "windef.h"
- #include "winbase.h"
+-#include "windef.h"
+-#include "winbase.h"
-#include "wine/exception.h"
-+#else
+#include "winglue.h"
-+#endif
++
+#define EXCEPTION_WINE_STUB 0x80000100 /* stub entry point called */
+#define EH_NONCONTINUABLE 0x01
+
#include "build.h"
-@@ -886,7 +892,10 @@
+@@ -845,12 +846,10 @@
+ int is_data = 0;
+
+ if (!odp) continue;
+- if (odp->flags & FLAG_REGISTER) continue;
+- if (odp->type == TYPE_STUB) continue;
+-
+ if (odp->name) name = odp->name;
++ else if (odp->type == TYPE_STUB) name = make_internal_name( odp, spec, "stub" );
+ else if (odp->export_name) name = odp->export_name;
+- else continue;
++ else name = make_internal_name( odp, spec, "noname_export" );
+
+ fprintf(outfile, " %s", name);
+
+@@ -880,13 +879,42 @@
+ }
+ break;
+ }
++ case TYPE_STUB:
++ {
++ if (!kill_at)
++ {
++ const char *check = name + strlen(name);
++ while (name != check &&
++ '0' <= check[-1] && check[-1] <= '9')
++ {
++ check--;
++ }
++ if (name != check && check != name + strlen(name) &&
++ '@' == check[-1])
++ {
++ fprintf(outfile, "%s", check - 1);
++ }
++ }
++ if (NULL != odp->name)
++ {
++ fprintf(outfile, "=%s", make_internal_name( odp, spec, "stub" ));
++ }
++ break;
++ }
+ default:
+ assert(0);
+ }
fprintf( outfile, " @%d", odp->ordinal );
++#if 0 /* MinGW binutils cannot handle this correctly */
if (!odp->name) fprintf( outfile, " NONAME" );
++#else
++ if (!odp->name && (odp->type == TYPE_STUB || odp->export_name)) fprintf( outfile, " NONAME" );
++#endif
if (is_data) fprintf( outfile, " DATA" );
+#if 0
+ /* MinGW binutils cannot handle this correctly */
@@ -66,21 +290,43 @@
fprintf( outfile, "\n" );
}
}
-Index: utils.c
-===================================================================
-RCS file: /home/wine/wine/tools/winebuild/utils.c,v
-retrieving revision 1.20
-diff -u -r1.20 utils.c
---- utils.c 25 Mar 2004 00:40:52 -0000 1.20
-+++ utils.c 23 Sep 2004 20:38:15 -0000
-@@ -21,6 +21,10 @@
- #include "config.h"
- #include "wine/port.h"
+@@ -984,4 +1012,25 @@
+ "}\n", prefix );
+
+ free( prefix );
++}
++
++
++/*******************************************************************
++ * BuildPedllFile
++ *
++ * Build a PE DLL C file from a spec file.
++ */
++void BuildPedllFile( FILE *outfile, DLLSPEC *spec )
++{
++ int nr_exports;
++
++ nr_exports = spec->base <= spec->limit ? spec->limit - spec->base + 1 : 0;
++ output_standard_file_header( outfile );
++
++ if (nr_exports)
++ {
++ /* Output the stub functions */
++
++ output_stub_funcs( outfile, spec );
++ }
+ }
+--- winebuild/utils.c Thu Mar 25 07:35:37 2004
++++ winebuild/utils.c Sun Dec 26 19:04:48 2004
+@@ -19,7 +19,10 @@
+ */
+ #include "config.h"
+-#include "wine/port.h"
++
+#if !defined(WIN32)
+#undef strdup
+#endif
-+
+
#include <ctype.h>
#include <stdarg.h>
- #include <stdio.h>
reactos/w32api/include
diff -u -r1.2 -r1.2.8.1
--- accctrl.h 10 Jul 2004 23:23:06 -0000 1.2
+++ accctrl.h 30 Dec 2004 04:37:17 -0000 1.2.8.1
@@ -347,6 +347,11 @@
SI_PAGE_OWNER
} SI_PAGE_TYPE;
+typedef struct _FN_OBJECT_MGR_FUNCTIONS
+{
+ ULONG Placeholder;
+} FN_OBJECT_MGR_FUNCTS, *PFN_OBJECT_MGR_FUNCTS;
+
#ifdef UNICODE
#define ACCCTRL_DEFAULT_PROVIDER ACCCTRL_DEFAULT_PROVIDERW
typedef TRUSTEE_W TRUSTEE_, *PTRUSTEE_;
reactos/w32api/include
diff -u -r1.1 -r1.1.20.1
--- aclapi.h 21 Feb 2004 09:20:34 -0000 1.1
+++ aclapi.h 30 Dec 2004 04:37:17 -0000 1.1.20.1
@@ -34,8 +34,8 @@
DWORD WINAPI GetExplicitEntriesFromAclA(PACL,PULONG,PEXPLICIT_ACCESS_A*);
DWORD WINAPI GetExplicitEntriesFromAclW(PACL,PULONG,PEXPLICIT_ACCESS_W*);
#if (_WIN32_WINNT >= 0x0501)
-DWORD WINAPI GetInheritanceSourceA(LPSTR,SE_OBJECT_TYPE,SECURITY_INFORMATION,BOOL,GUID**,DWORD,PACL,void*,PGENERIC_MAPPING,PINHERITED_FROMA);
-DWORD WINAPI GetInheritanceSourceW(LPWSTR,SE_OBJECT_TYPE,SECURITY_INFORMATION,BOOL,GUID**,DWORD,PACL,void*,PGENERIC_MAPPING,PINHERITED_FROMW);
+DWORD WINAPI GetInheritanceSourceA(LPSTR,SE_OBJECT_TYPE,SECURITY_INFORMATION,BOOL,GUID**,DWORD,PACL,PFN_OBJECT_MGR_FUNCTS,PGENERIC_MAPPING,PINHERITED_FROMA);
+DWORD WINAPI GetInheritanceSourceW(LPWSTR,SE_OBJECT_TYPE,SECURITY_INFORMATION,BOOL,GUID**,DWORD,PACL,PFN_OBJECT_MGR_FUNCTS,PGENERIC_MAPPING,PINHERITED_FROMW);
#endif
DWORD WINAPI GetNamedSecurityInfoA(LPSTR,SE_OBJECT_TYPE,SECURITY_INFORMATION,
PSID*,PSID*,PACL*,PACL*,PSECURITY_DESCRIPTOR*);
reactos/w32api/include
diff -u -r1.3.20.1 -r1.3.20.2
--- ocidl.h 8 Dec 2004 21:57:42 -0000 1.3.20.1
+++ ocidl.h 30 Dec 2004 04:37:17 -0000 1.3.20.2
@@ -20,6 +20,7 @@
typedef interface IFont *LPFONT;
typedef interface IFontDisp *LPFONTDISP;
typedef interface IOleUndoManager *LPOLEUNDOMANAGER;
+typedef interface IQuickActivate *LPQUICKACTIVATE;
#ifndef OLE2ANSI
typedef TEXTMETRICW TEXTMETRICOLE;
reactos/w32api/include
diff -u -r1.2 -r1.2.20.1
--- oleidl.h 28 Feb 2004 20:14:33 -0000 1.2
+++ oleidl.h 30 Dec 2004 04:37:17 -0000 1.2.20.1
@@ -22,6 +22,7 @@
typedef interface IEnumOLEVERB *LPENUMOLEVERB;
typedef interface IOleWindow *LPOLEWINDOW;
typedef interface IOleInPlaceUIWindow *LPOLEINPLACEUIWINDOW;
+typedef interface IOleInPlaceObject *LPOLEINPLACEOBJECT;
typedef interface IOleInPlaceActiveObject *LPOLEINPLACEACTIVEOBJECT;
typedef interface IOleInPlaceFrame *LPOLEINPLACEFRAME;
typedef interface IOleAdviseHolder *LPOLEADVISEHOLDER;
reactos/w32api/include
diff -u -r1.9 -r1.9.18.1
--- userenv.h 5 May 2004 15:28:30 -0000 1.9
+++ userenv.h 30 Dec 2004 04:37:17 -0000 1.9.18.1
@@ -52,6 +52,8 @@
BOOL WINAPI AddItemW (LPCWSTR, BOOL, LPCWSTR, LPCWSTR, LPCWSTR, INT, LPCWSTR, WORD, INT);
BOOL WINAPI DeleteItemA (LPCSTR, BOOL, LPCSTR, BOOL);
BOOL WINAPI DeleteItemW (LPCWSTR, BOOL, LPCWSTR, BOOL);
+BOOL WINAPI CopyProfileDirectoryA(LPCSTR, LPCSTR, DWORD);
+BOOL WINAPI CopyProfileDirectoryW(LPCWSTR, LPCWSTR, DWORD);
/* end private */
BOOL WINAPI LoadUserProfileA (HANDLE, LPPROFILEINFOA);
BOOL WINAPI LoadUserProfileW (HANDLE, LPPROFILEINFOW);
@@ -80,6 +82,7 @@
#define DeleteGroup DeleteGroupW
#define AddItem AddItemW
#define DeleteItem DeleteItemW
+#define CopyProfileDirectory CopyProfileDirectoryW
/* end private */
#define LoadUserProfile LoadUserProfileW
#define GetAllUsersProfileDirectory GetAllUsersProfileDirectoryW
@@ -97,6 +100,7 @@
#define DeleteGroup DeleteGroupA
#define AddItem AddItemA
#define DeleteItem DeleteItemA
+#define CopyProfileDirectory CopyProfileDirectoryA
/* end private */
#define LoadUserProfile LoadUserProfileA
#define GetAllUsersProfileDirectory GetAllUsersProfileDirectoryA
reactos/w32api/include/ddk
diff -u -r1.7.4.2 -r1.7.4.3
--- ntifs.h 18 Dec 2004 02:58:56 -0000 1.7.4.2
+++ ntifs.h 30 Dec 2004 04:37:17 -0000 1.7.4.3
@@ -750,102 +750,6 @@
ULONG ProcessCount;
} EPROCESS_QUOTA_BLOCK, *PEPROCESS_QUOTA_BLOCK;
-/*
- * When needing these parameters cast your PIO_STACK_LOCATION to
- * PEXTENDED_IO_STACK_LOCATION
- */
-#if !defined(_ALPHA_)
-#include <pshpack4.h>
-#endif
-typedef struct _EXTENDED_IO_STACK_LOCATION {
-
- /* Included for padding */
- UCHAR MajorFunction;
- UCHAR MinorFunction;
- UCHAR Flags;
- UCHAR Control;
-
- union {
-
- struct {
- PIO_SECURITY_CONTEXT SecurityContext;
- ULONG Options;
- USHORT Reserved;
- USHORT ShareAccess;
- PMAILSLOT_CREATE_PARAMETERS Parameters;
- } CreateMailslot;
-
- struct {
- PIO_SECURITY_CONTEXT SecurityContext;
- ULONG Options;
- USHORT Reserved;
- USHORT ShareAccess;
- PNAMED_PIPE_CREATE_PARAMETERS Parameters;
- } CreatePipe;
-
- struct {
- ULONG OutputBufferLength;
- ULONG InputBufferLength;
- ULONG FsControlCode;
- PVOID Type3InputBuffer;
- } FileSystemControl;
-
- struct {
- PLARGE_INTEGER Length;
- ULONG Key;
- LARGE_INTEGER ByteOffset;
- } LockControl;
-
- struct {
- ULONG Length;
- ULONG CompletionFilter;
- } NotifyDirectory;
-
- struct {
- ULONG Length;
- PUNICODE_STRING FileName;
- FILE_INFORMATION_CLASS FileInformationClass;
- ULONG FileIndex;
- } QueryDirectory;
-
- struct {
- ULONG Length;
- PVOID EaList;
- ULONG EaListLength;
- ULONG EaIndex;
- } QueryEa;
-
- struct {
- ULONG Length;
- PSID StartSid;
- PFILE_GET_QUOTA_INFORMATION SidList;
- ULONG SidListLength;
- } QueryQuota;
-
- struct {
- ULONG Length;
- } SetEa;
-
- struct {
- ULONG Length;
- } SetQuota;
-
- struct {
- ULONG Length;
- FS_INFORMATION_CLASS FsInformationClass;
- } SetVolume;
-
- } Parameters;
- PDEVICE_OBJECT DeviceObject;
- PFILE_OBJECT FileObject;
- PIO_COMPLETION_ROUTINE CompletionRoutine;
- PVOID Context;
-
-} EXTENDED_IO_STACK_LOCATION, *PEXTENDED_IO_STACK_LOCATION;
-#if !defined(_ALPHA_)
-#include <poppack.h>
-#endif
-
typedef struct _FILE_ACCESS_INFORMATION {
ACCESS_MASK AccessFlags;
} FILE_ACCESS_INFORMATION, *PFILE_ACCESS_INFORMATION;
@@ -907,35 +811,35 @@
} FILE_DIRECTORY_INFORMATION, *PFILE_DIRECTORY_INFORMATION;
typedef struct _FILE_FULL_DIRECTORY_INFORMATION {
- ULONG NextEntryOffset;
- ULONG FileIndex;
- LARGE_INTEGER CreationTime;
- LARGE_INTEGER LastAccessTime;
- LARGE_INTEGER LastWriteTime;
- LARGE_INTEGER ChangeTime;
- LARGE_INTEGER EndOfFile;
- LARGE_INTEGER AllocationSize;
- ULONG FileAttributes;
- ULONG FileNameLength;
- ULONG EaSize;
- WCHAR FileName[0];
+ ULONG NextEntryOffset;
+ ULONG FileIndex;
+ LARGE_INTEGER CreationTime;
+ LARGE_INTEGER LastAccessTime;
+ LARGE_INTEGER LastWriteTime;
+ LARGE_INTEGER ChangeTime;
+ LARGE_INTEGER EndOfFile;
+ LARGE_INTEGER AllocationSize;
+ ULONG FileAttributes;
+ ULONG FileNameLength;
+ ULONG EaSize;
+ WCHAR FileName[0];
} FILE_FULL_DIRECTORY_INFORMATION, *PFILE_FULL_DIRECTORY_INFORMATION;
typedef struct _FILE_BOTH_DIRECTORY_INFORMATION {
- ULONG NextEntryOffset;
- ULONG FileIndex;
- LARGE_INTEGER CreationTime;
- LARGE_INTEGER LastAccessTime;
- LARGE_INTEGER LastWriteTime;
- LARGE_INTEGER ChangeTime;
- LARGE_INTEGER EndOfFile;
- LARGE_INTEGER AllocationSize;
- ULONG FileAttributes;
- ULONG FileNameLength;
- ULONG EaSize;
- CHAR ShortNameLength;
- WCHAR ShortName[12];
- WCHAR FileName[0];
+ ULONG NextEntryOffset;
+ ULONG FileIndex;
+ LARGE_INTEGER CreationTime;
+ LARGE_INTEGER LastAccessTime;
+ LARGE_INTEGER LastWriteTime;
+ LARGE_INTEGER ChangeTime;
+ LARGE_INTEGER EndOfFile;
+ LARGE_INTEGER AllocationSize;
+ ULONG FileAttributes;
+ ULONG FileNameLength;
+ ULONG EaSize;
+ CHAR ShortNameLength;
+ WCHAR ShortName[12];
+ WCHAR FileName[0];
} FILE_BOTH_DIRECTORY_INFORMATION, *PFILE_BOTH_DIRECTORY_INFORMATION;
typedef struct _FILE_EA_INFORMATION {
reactos/w32api/include/ddk
diff -u -r1.22.2.1 -r1.22.2.2
--- winddk.h 13 Dec 2004 09:39:25 -0000 1.22.2.1
+++ winddk.h 30 Dec 2004 04:37:19 -0000 1.22.2.2
@@ -155,9 +155,12 @@
typedef struct _HAL_PRIVATE_DISPATCH_TABLE *PHAL_PRIVATE_DISPATCH_TABLE;
typedef struct _DRIVE_LAYOUT_INFORMATION *PDRIVE_LAYOUT_INFORMATION;
typedef struct _DRIVE_LAYOUT_INFORMATION_EX *PDRIVE_LAYOUT_INFORMATION_EX;
+typedef struct _NAMED_PIPE_CREATE_PARAMETERS *PNAMED_PIPE_CREATE_PARAMETERS;
+typedef struct _MAILSLOT_CREATE_PARAMETERS *PMAILSLOT_CREATE_PARAMETERS;
+typedef struct _FILE_GET_QUOTA_INFORMATION *PFILE_GET_QUOTA_INFORMATION;
/* Constants */
-#define MAXIMUM_PROCESSORS 32
+#define MAXIMUM_PROCESSORS 32
#define MAXIMUM_WAIT_OBJECTS 64
@@ -2680,7 +2683,9 @@
PVOID ReservePointer;
} IO_CSQ, *PIO_CSQ;
+#if !defined(_ALPHA_)
#include <pshpack4.h>
+#endif
typedef struct _IO_STACK_LOCATION {
UCHAR MajorFunction;
UCHAR MinorFunction;
@@ -2695,6 +2700,20 @@
ULONG POINTER_ALIGNMENT EaLength;
} Create;
struct {
+ PIO_SECURITY_CONTEXT SecurityContext;
+ ULONG Options;
+ USHORT Reserved;
+ USHORT ShareAccess;
+ PNAMED_PIPE_CREATE_PARAMETERS Parameters;
+ } CreatePipe;
+ struct {
+ PIO_SECURITY_CONTEXT SecurityContext;
+ ULONG Options;
+ USHORT Reserved;
+ USHORT ShareAccess;
+ PMAILSLOT_CREATE_PARAMETERS Parameters;
+ } CreateMailslot;
+ struct {
ULONG Length;
ULONG POINTER_ALIGNMENT Key;
LARGE_INTEGER ByteOffset;
@@ -2706,6 +2725,16 @@
} Write;
struct {
ULONG Length;
+ PUNICODE_STRING FileName;
+ FILE_INFORMATION_CLASS FileInformationClass;
+ ULONG FileIndex;
+ } QueryDirectory;
+ struct {
+ ULONG Length;
+ ULONG CompletionFilter;
+ } NotifyDirectory;
+ struct {
+ ULONG Length;
FILE_INFORMATION_CLASS POINTER_ALIGNMENT FileInformationClass;
} QueryFile;
struct {
@@ -2723,9 +2752,33 @@
} SetFile;
struct {
ULONG Length;
+ PVOID EaList;
+ ULONG EaListLength;
+ ULONG EaIndex;
+ } QueryEa;
+ struct {
+ ULONG Length;
+ } SetEa;
+ struct {
+ ULONG Length;
FS_INFORMATION_CLASS POINTER_ALIGNMENT FsInformationClass;
} QueryVolume;
struct {
+ ULONG Length;
+ FS_INFORMATION_CLASS FsInformationClass;
+ } SetVolume;
+ struct {
+ ULONG OutputBufferLength;
+ ULONG InputBufferLength;
+ ULONG FsControlCode;
+ PVOID Type3InputBuffer;
+ } FileSystemControl;
+ struct {
+ PLARGE_INTEGER Length;
+ ULONG Key;
+ LARGE_INTEGER ByteOffset;
+ } LockControl;
+ struct {
ULONG OutputBufferLength;
ULONG POINTER_ALIGNMENT InputBufferLength;
ULONG POINTER_ALIGNMENT IoControlCode;
@@ -2751,6 +2804,15 @@
struct _SCSI_REQUEST_BLOCK *Srb;
} Scsi;
struct {
+ ULONG Length;
+ PSID StartSid;
+ PFILE_GET_QUOTA_INFORMATION SidList;
+ ULONG SidListLength;
+ } QueryQuota;
+ struct {
+ ULONG Length;
+ } SetQuota;
+ struct {
DEVICE_RELATION_TYPE Type;
} QueryDeviceRelations;
struct {
@@ -2821,7 +2883,9 @@
PIO_COMPLETION_ROUTINE CompletionRoutine;
PVOID Context;
} IO_STACK_LOCATION, *PIO_STACK_LOCATION;
+#if !defined(_ALPHA_)
#include <poppack.h>
+#endif
/* IO_STACK_LOCATION.Control */
@@ -3047,6 +3111,90 @@
#define PCI_MULTIFUNCTION_DEVICE(PciData) \
((((PPCI_COMMON_CONFIG) (PciData))->HeaderType & PCI_MULTIFUNCTION) != 0)
+/* PCI device classes */
+
+#define PCI_CLASS_PRE_20 0x00
+#define PCI_CLASS_MASS_STORAGE_CTLR 0x01
+#define PCI_CLASS_NETWORK_CTLR 0x02
+#define PCI_CLASS_DISPLAY_CTLR 0x03
+#define PCI_CLASS_MULTIMEDIA_DEV 0x04
+#define PCI_CLASS_MEMORY_CTLR 0x05
+#define PCI_CLASS_BRIDGE_DEV 0x06
+#define PCI_CLASS_SIMPLE_COMMS_CTLR 0x07
+#define PCI_CLASS_BASE_SYSTEM_DEV 0x08
+#define PCI_CLASS_INPUT_DEV 0x09
+#define PCI_CLASS_DOCKING_STATION 0x0a
+#define PCI_CLASS_PROCESSOR 0x0b
+#define PCI_CLASS_SERIAL_BUS_CTLR 0x0c
+
+/* PCI device subclasses for class 0 */
+
+#define PCI_SUBCLASS_PRE_20_NON_VGA 0x00
+#define PCI_SUBCLASS_PRE_20_VGA 0x01
+
+/* PCI device subclasses for class 1 (mass storage controllers)*/
+
+#define PCI_SUBCLASS_MSC_SCSI_BUS_CTLR 0x00
+#define PCI_SUBCLASS_MSC_IDE_CTLR 0x01
+#define PCI_SUBCLASS_MSC_FLOPPY_CTLR 0x02
+#define PCI_SUBCLASS_MSC_IPI_CTLR 0x03
+#define PCI_SUBCLASS_MSC_RAID_CTLR 0x04
+#define PCI_SUBCLASS_MSC_OTHER 0x80
+
+/* PCI device subclasses for class 2 (network controllers)*/
+
+#define PCI_SUBCLASS_NET_ETHERNET_CTLR 0x00
+#define PCI_SUBCLASS_NET_TOKEN_RING_CTLR 0x01
+#define PCI_SUBCLASS_NET_FDDI_CTLR 0x02
+#define PCI_SUBCLASS_NET_ATM_CTLR 0x03
+#define PCI_SUBCLASS_NET_OTHER 0x80
+
+/* PCI device subclasses for class 3 (display controllers)*/
+
+#define PCI_SUBCLASS_VID_VGA_CTLR 0x00
+#define PCI_SUBCLASS_VID_XGA_CTLR 0x01
+#define PCI_SUBLCASS_VID_3D_CTLR 0x02
+#define PCI_SUBCLASS_VID_OTHER 0x80
+
+/* PCI device subclasses for class 4 (multimedia device)*/
+
+#define PCI_SUBCLASS_MM_VIDEO_DEV 0x00
+#define PCI_SUBCLASS_MM_AUDIO_DEV 0x01
+#define PCI_SUBCLASS_MM_TELEPHONY_DEV 0x02
+#define PCI_SUBCLASS_MM_OTHER 0x80
+
+/* PCI device subclasses for class 5 (memory controller)*/
+
+#define PCI_SUBCLASS_MEM_RAM 0x00
+#define PCI_SUBCLASS_MEM_FLASH 0x01
+#define PCI_SUBCLASS_MEM_OTHER 0x80
+
+/* PCI device subclasses for class 6 (bridge device)*/
+
+#define PCI_SUBCLASS_BR_HOST 0x00
+#define PCI_SUBCLASS_BR_ISA 0x01
+#define PCI_SUBCLASS_BR_EISA 0x02
+#define PCI_SUBCLASS_BR_MCA 0x03
+#define PCI_SUBCLASS_BR_PCI_TO_PCI 0x04
+#define PCI_SUBCLASS_BR_PCMCIA 0x05
+#define PCI_SUBCLASS_BR_NUBUS 0x06
+#define PCI_SUBCLASS_BR_CARDBUS 0x07
+#define PCI_SUBCLASS_BR_OTHER 0x80
+
+/* PCI device subclasses for class C (serial bus controller)*/
+
+#define PCI_SUBCLASS_SB_IEEE1394 0x00
+#define PCI_SUBCLASS_SB_ACCESS 0x01
+#define PCI_SUBCLASS_SB_SSA 0x02
+#define PCI_SUBCLASS_SB_USB 0x03
+#define PCI_SUBCLASS_SB_FIBRE_CHANNEL 0x04
+
+#define PCI_MAX_DEVICES 32
+#define PCI_MAX_FUNCTION 8
+#define PCI_MAX_BRIDGE_NUMBER 0xFF
+#define PCI_INVALID_VENDORID 0xFFFF
+#define PCI_COMMON_HDR_LENGTH (FIELD_OFFSET(PCI_COMMON_CONFIG, DeviceSpecific))
+
typedef struct _PCI_SLOT_NUMBER {
union {
struct {
CVSspam 0.2.8