How to make NulMRx running on Windows 2000?

Dear All, I have some troubles with NulMRx under Windows 2000.

I make changes in NulMRx source code, in order to build it under Windows 2000 Environment. (Fixed parameter count for RxPrefixTableLookupName for Windows 2000 compilation). When I compile NulMRx driver with Vista Environment - the sample seems to be working. When I compile NulMrx driver with Windows 2000 environment - there is a problem. Network redirector don’t start. It returns STATUS_PENDING as result code of RxStartMinirdr. And redirector don’t start - start callback never executed.

P. S. I use WDK 6000.
P. S. S. I used Windows XP SP2 as test system.

Do you have any suggestions?

This is not my thing, but as it is late, I wonder if it is supported at
all, given that in appears in a ‘wlh’ subfolder in the WDK source tree.
Also, given that you are running on XP SP2, why are you building for
2000 and Vista?

Good luck,

mmm

xxxxx@googlemail.com wrote:

Dear All, I have some troubles with NulMRx under Windows 2000.

I make changes in NulMRx source code, in order to build it under Windows 2000 Environment. (Fixed parameter count for RxPrefixTableLookupName for Windows 2000 compilation). When I compile NulMRx driver with Vista Environment - the sample seems to be working. When I compile NulMrx driver with Windows 2000 environment - there is a problem. Network redirector don’t start. It returns STATUS_PENDING as result code of RxStartMinirdr. And redirector don’t start - start callback never executed.

P. S. I use WDK 6000.
P. S. S. I used Windows XP SP2 as test system.

Do you have any suggestions?

The problem could be that the RxStartMinirdr() is called from DriverEntry(). Try to call it from IOCTL call. See SmbMrx sample. I have also downported both samples to Win2k and bumped into issues.

Also take look on message 2 of this thread
http://www.osronline.com/showThread.cfm?link=118422

Good Luck!
Bronislav

I am providing my downport of NullMRx. It is based on WDK 6001. I was forced to change ntifs.h, because of bug mentioned above. It is copied into sample sources. I have also added wdkcompat.h, which is below.

Hope it helps.
Bronislav

<<>>
Index: D:/projects/!minirdr/downport/nullmrx/dll/SOURCES
===================================================================
— D:/projects/!minirdr/downport/nullmrx/dll/SOURCES (revision 19)
+++ D:/projects/!minirdr/downport/nullmrx/dll/SOURCES (revision 20)
@@ -30,7 +30,8 @@

DLLBASE=0x1010000

-USE_NTDLL=0
+#USE_NTDLL=0
+USE_MSVCRT=1

INCLUDES=$(IFSKIT_INC_PATH); <br> $(DDK_INC_PATH); <br>Index: D:/projects/!minirdr/downport/nullmrx/dll/MAKEFILE
===================================================================
— D:/projects/!minirdr/downport/nullmrx/dll/MAKEFILE (revision 19)
+++ D:/projects/!minirdr/downport/nullmrx/dll/MAKEFILE (revision 20)
@@ -14,11 +14,11 @@

!ENDIF

-!if “$(DDK_TARGET_OS)”==“Win2K”
-!message This sample is not intended to target the Windows 2000 platform.
-!elseif “$(DDK_TARGET_OS)”==“WinXP”
-!message This sample is not intended to target the Windows XP platform.
-!else
+#!if “$(DDK_TARGET_OS)”==“Win2K”
+#!message This sample is not intended to target the Windows 2000 platform.
+#!elseif “$(DDK_TARGET_OS)”==“WinXP”
+#!message This sample is not intended to target the Windows XP platform.
+#!else
!INCLUDE $(NTMAKEENV)\makefile.def
-!endif
+#!endif

Index: D:/projects/!minirdr/downport/nullmrx/sys/sources
===================================================================
— D:/projects/!minirdr/downport/nullmrx/sys/sources (revision 19)
+++ D:/projects/!minirdr/downport/nullmrx/sys/sources (revision 20)
@@ -4,8 +4,8 @@
!IF $(MONOLITHIC_MINIRDR)

TARGETLIBS= $(TARGETLIBS) <br>- $(DDK_LIB_PATH)\rxce.lib <br>- $(DDK_LIB_PATH)\copysup.lib
+ $(DDK_LIB_PATH2)\rxce.lib <br>+ $(DDK_LIB_PATH2)\copysup.lib

!ENDIF

Index: D:/projects/!minirdr/downport/nullmrx/sys/precomp.h
===================================================================
— D:/projects/!minirdr/downport/nullmrx/sys/precomp.h (revision 19)
+++ D:/projects/!minirdr/downport/nullmrx/sys/precomp.h (revision 20)
@@ -6,12 +6,23 @@
/

-
#define MINIRDR NAME NulMRx
#define
_ MINIRDR_IMPORTS_NAME (NulMRxDeviceObject->RdbssExports)

+#if (NTDDI_VERSION < NTDDI_VISTA)
+ #define FORCE_FSRTL_FCB_HEADER_V0
+#endif
+
#include <ntifs.h>

+
+// fix bug in rh.h for win2k
+#if (NTDDI_VERSION < NTDDI_WINXP)
+ #undef BooleanFlagOn
+ #undef ClearFlag
+ #undef SetFlag
+#endif
+
#include “rx.h”

#include “nodetype.h”
@@ -23,5 +34,5 @@
#include “minip.h”
#include <lmcons.h> // from the Win32 SDK
#include “mrxglobs.h”
+#include “wdkcompat.h”

-
Index: D:/projects/!minirdr/downport/nullmrx/sys/sources.inc
===================================================================
— D:/projects/!minirdr/downport/nullmrx/sys/sources.inc (revision 19)
+++ D:/projects/!minirdr/downport/nullmrx/sys/sources.inc (revision 20)
@@ -8,19 +8,34 @@
$(IFSKIT_INC_PATH);

+USER_C_FLAGS=$(USER_C_FLAGS) /showIncludes
+
+!IF “$(DDK_TARGET_OS)” == “Win2K”
+DDK_LIB_PATH2=$(DDK_LIB_PATH)$(DDKBUILDENV)
+!ELSE
+DDK_LIB_PATH2=$(DDK_LIB_PATH)
+!ENDIF
+
+
TARGETLIBS=$(DDK_LIB_PATH)\ksecdd.lib <br>- $(DDK_LIB_PATH)\rdbsslib.lib
+ $(DDK_LIB_PATH2)\rdbsslib.lib

#NTLAYGO=1

-MSC_WARNING_LEVEL=/W3 /WX
+#MSC_WARNING_LEVEL=/W3 /WX
+
C_DEFINES= $(C_DEFINES) -DEXPLODE_POOLTAGS
+
!IF $(MONOLITHIC_MINIRDR)
C_DEFINES=$(C_DEFINES) -DMONOLITHIC_MINIRDR
!ENDIF

+!IF “$(DDK_TARGET_OS)” == “Win2K”
+C_DEFINES=$(C_DEFINES) -D_WIN2K_COMPAT_SLIST_USAGE
+!ENDIF
+
MOST_SOURCES= <br> devfcb.c <br> fileinfo.c <br>Index: D:/projects/!minirdr/downport/nullmrx/sys/ntifs.h
===================================================================
— D:/projects/!minirdr/downport/nullmrx/sys/ntifs.h (revision 19)
+++ D:/projects/!minirdr/downport/nullmrx/sys/ntifs.h (revision 20)
@@ -11789,7 +11789,7 @@

LIST_ENTRY FilterContexts;

-#ifndef FORCE_FSRTL_FCB_HEADER_V0
+#if !defined(FORCE_FSRTL_FCB_HEADER_V0) || (NTDDI_VERSION >= NTDDI_VISTA)
//
// The following fields are valid only if the Version
// field in the FSRTL_COMMON_FCB_HEADER is greater than
@@ -11810,7 +11810,7 @@
//

PVOID
FileContextSupportPointer;
-#endif //FORCE_FSRTL_FCB_HEADER_V0
+#endif

} FSRTL_ADVANCED_FCB_HEADER;
typedef FSRTL_ADVANCED_FCB_HEADER *PFSRTL_ADVANCED_FCB_HEADER;
@@ -13974,7 +13974,7 @@
//

-#ifndef FORCE_FSRTL_FCB_HEADER_V0
+#if !defined(FORCE_FSRTL_FCB_HEADER_V0) || (NTDDI_VERSION >= NTDDI_VISTA)
#define FsRtlSetupAdvancedHeader( _advhdr, _fmutx ) <br> { <br> SetFlag( (_advhdr)->Flags, FSRTL_FLAG_ADVANCED_HEADER ); <br>Index: D:/projects/!minirdr/downport/nullmrx/sys/makefile
===================================================================
— D:/projects/!minirdr/downport/nullmrx/sys/makefile (revision 19)
+++ D:/projects/!minirdr/downport/nullmrx/sys/makefile (revision 20)
@@ -14,11 +14,11 @@

!ENDIF

-!if “$(DDK_TARGET_OS)”==“Win2K”
-!message This sample is not intended to target the Windows 2000 platform.
-!elseif “$(DDK_TARGET_OS)”==“WinXP”
-!message This sample is not intended to target the Windows XP platform.
-!else
+#!if “$(DDK_TARGET_OS)”==“Win2K”
+#!message This sample is not intended to target the Windows 2000 platform.
+#!elseif “$(DDK_TARGET_OS)”==“WinXP”
+#!message This sample is not intended to target the Windows XP platform.
+#!else
!INCLUDE $(NTMAKEENV)\makefile.def
-!endif
+#!endif
<<>>

<<>>
#ifndef FCB_COMPAT_HEADER_INCLUDED
#define FCB_COMPAT_HEADER_INCLUDED

#ifndef NTDDI_VERSION
#error NTDDI_VERSION is not defined
#endif

#if (NTDDI_VERSION < NTDDI_WS03)
#define FCB_STATE_WRITECACHING_ENABLED FCB_STATE_WRITECACHEING_ENABLED
#define FCB_STATE_READCACHING_ENABLED FCB_STATE_READCACHEING_ENABLED
#define SRVOPEN_FLAG_DONTUSE_WRITE_CACHING SRVOPEN_FLAG_DONTUSE_WRITE_CACHEING

#undef RxSynchronizeBlockingOperationsAndDropFcbLock
#undef RxSynchronizeBlockingOperations

#define RxSynchronizeBlockingOperationsAndDropFcbLock(RXCONTEXT,FCB,IOQUEUE) <br> __RxSynchronizeBlockingOperationsMaybeDroppingFcbLock(RXCONTEXT,IOQUEUE,TRUE)
#define RxSynchronizeBlockingOperations(RXCONTEXT,FCB,IOQUEUE) <br>__RxSynchronizeBlockingOperationsMaybeDroppingFcbLock(RXCONTEXT,IOQUEUE,FALSE)
#endif //(NTDDI_VERSION < NTDDI_WS03)
#endif // FCB_COMPAT_HEADER_INCLUDED
<<>></lmcons.h></ntifs.h>