none
Problem with redir.dll RRS feed

  • Question

  • I  am developing my own WinCE 6 image for OMAP family SoC. I've confirmed that CE_MODULES_REDIR and CE_MODULES_NETBIOS are both set to 1 in ceconfig.h.  Also, my reginit.ini has the key HKLM\Comm\Redir: RegisterFSRoot value set to 1.  I see that netbios.dll and redir.dll files exist in my FLATRELEASEDIR folder and nk.bin contains those two files.

    Even so, I cannot see a folder \NETWORK in my WinCE Explorer.  If I type \\my_PC\my_share at the Explorer address bar, I get an error msg something like "the network is not started".

    Part of image's debug build output:

    130780 PID:400002 TID:c10002 RdrMain: DLL_PROCESS_ATTACH, hInst:0x877EFEA0

    130780 PID:400002 TID:c10002   +RDR:Redir helper func: Ctxt:0x0, OpCode:1

     130780 PID:400002 TID:c10002   +RDR:InitRedir

     130780 PID:400002 TID:c10002 Rdrofgt:ntaieeiCni:

     130781 PID:400002 TID:c10002 ClearTextPasswordAllowed: FALSE

     130781 PID:400002 TID:c10002 ServerTimeoutMs: 10000

     130781 PID:400002 TID:c10002 FindCacheMaxSize: 8192

     130781 PID:400002 TID:c10002 ResourceExpiryInt: 600

     130781 PID:400002 TID:c10002 ReceiveBufferSize: 9000

     130781 PID:400002 TID:c10002 RegisterFileSystemRoot: TRUE

     130781 PID:400002 TID:c10002 ReceiveThreadPriority: 251

     130781 PID:400002 TID:c10002 AllowedAuthMethods: 3

     130781 PID:400002 TID:c10002 TimeZoneBias: 480

     130781 PID:400002 TID:c10002   +RDR:InitNetBIOS

     130782 PID:400002 TID:c10002 NETBIOS: NB_NET_NOTIFY for callback at address 0xc0e2e338

     130782 PID:400002 TID:c10002 Browser initialized

     130782 PID:400002 TID:c10002   +RDR:FSAPIInit

     130782 PID:400002 TID:c10002 !RDR:FSAPIInit: RegisterAFSEx failed

     130782 PID:400002 TID:c10002   +RDR:+FSAPIDeinit

     130782 PID:400002 TID:c10002   -RDR:FSAPIDenit

     130783 PID:400002 TID:c10002   -RDR:FSAPIInit: Returning error

     130785 PID:400002 TID:c10002   +RDR:DenitRedir

     130786 PID:400002 TID:c10002   +RDR:+FSAPIDeinit

     130787 PID:400002 TID:c10002   -RDR:FSAPIDenit

     130788 PID:400002 TID:c10002 !ERROR: Calling EnterCriticalSection on a CS (c0e3f820) that is not initialized!

     130789 PID:400002 TID:c10002 Coredll: DEBUGCHK failed in file c:\yzkiqfe\private\winceos\coreos\core\dll\cscode.c at line 117 

     138303 PID:400002 TID:c10002   -RDR:DenitRedir

     138303 PID:400002 TID:c10002   -RDR:InitRedir:  initialization failed

    As I understand redir.dll is not loaded correctly therefore I see such incorrect behavior.

    There are no sources not for RDR:InitRedir, nor for RegisterAFSEx - the one that fails.

    Can you help me with my problem?

     

    Kind regards,

    Freidman Dmitri

    Wednesday, September 21, 2011 7:07 AM

Answers

  • Hi,

    The problem was in key:
    [HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\XXX]

    Value:
    "MountAsNetwork"=dword:1
    was causing  to exfat.dll to register at Network's index(1).

    Removing it solved the problem.

    Thanks a lot
    Dmitri Freidman 

    Sunday, October 16, 2011 1:32 PM

All replies

  • the only thing I can help you with is telling you that you can find the code for RegisterAFSEx  in %_WINCEROOT%\PRIVATE\WINCEOS\COREOS\STORAGE\FSDMGR\afsapi.cpp
    Luca Calligaris lucaDOTcalligarisATeurotechDOTcom www.eurotech.com Check my blog: http://lcalligaris.wordpress.com
    Wednesday, September 21, 2011 11:27 AM
  • Thanks for the help.

    Do you know what prerequisites do RegisterAFSEx (or RegisterFileSystem()) function need?

    What modules must be loaded before using it?

     

    BR

    Dmitri

     

    Thursday, September 22, 2011 5:19 AM
  • To be honest I do not know: I'd put a breakpoint in RegisterAFSEx and follow the calls with the debugger until you find the function which fails. Maybe this can help to narrow the problem. If you're lucky most of the function will be in %_WINCEROOT%\PRIVATE\WINCEOS\COREOS\STORAGE\FSDMGR


    Luca Calligaris lucaDOTcalligarisATeurotechDOTcom www.eurotech.com Check my blog: http://lcalligaris.wordpress.com
    Thursday, September 22, 2011 3:07 PM
  • I've posted a number of times previously about what you need to do to make your CE device a file server client or server. These things include: the device must have a 1) unique, and 2) NOT THE DEFAULT, device name. It would be worthwhile to verify that you aren't suffering from this.

    That is, there's a NetBIOS-compatible device name in the registry, typically something like "WindowsCE". Once the device has booted the first time, you must change that value to something unique on your network (no other devices have the same name, as is the requirement with Windows boxes, too). You must then save the registry and reboot your device. When NetBIOS starts up, if it finds that the device has the default name, it doesn't enable network operations, so you're not "present" on the network.

    Paul T.

    Monday, September 26, 2011 5:55 PM
  • Paul,

    Does it suffice to change the value of "name" under the \HKLM\Ident key in the registry at the time that the WinCE image is built?  Or does it have to be done dynamically; i.e., do I have to boot the device once, then change the name via the WinCE shell, and then re-boot?

    And can you please refresh my memory, what constitutes a NetBIOS-compatible name?  how many chars, any spaces allowed, what about underscores, etc?

    thanks very much

    Monday, September 26, 2011 8:36 PM
  • Paul,

    I read all the information from google about redir.dll including your posts. I do have a unique device name.

    After some debugging I found that redir.dll doesn't success to load because of failure in %_WINCEROOT%\private\winceos\COREOS\storage\fsdmgr\mounttable.cpp MountTable_t::RegisterVolume() function. It returns ERROR_ALREADY_EXISTS.

    This happens because of exfat.dll earlier registered volume with the same index (1). This is erroneous behavior because the name of index 1, is still "network"

    Debug output:

     

     200426 PID:400002 TID:a30002 FSDMGR!StoreDisk_t::LoadPartition: mounting partition "Part00" on store "DSK1:"

     200427 PID:400002 TID:a30002 FSDMGR!ParitionDisk::LoadPartition: Partition Type 0x0e --> "FATFS"

     200427 PID:400002 TID:a30002 FSDMGR!ParitionDisk::MountPartition: "FATFS" --> exfat.dll

     200431 PID:400002 TID:a30002 OSAXST1: >>> Loading Module 'exfat.dll' (0x93ED0CA8) at address 0xC0540000-0xC057B000 in Process 'NK.EXE' (0x873FDAA0)

     200849 PID:400002 TID:a30002 FSD_MountDisk: Mounting volume for hDsk=D004D260

     200854 PID:400002 TID:a30002 FATFS!InitVolume: Block driver reports fewer sectors than BPB! (7743425 vs. 7744449)

     3380742 PID:400002 TID:a30002 FSDMGR!MountTable_t::RegisterVolume: Registered volume at index 1 (Name="", MountFlags=0xe6)

    Call stack:

     

    FSDMGR!MountTable_t::RegisterVolume(int 0x840a2d38, void * 0x873fdaa0, unsigned long 0x00000000, void * 0x00000001, unsigned long 0x00000000)  line 382

    FSDMGR!RegisterFileSystem(int 0x00000001, void * 0x007a0003, unsigned long 0xd004d800, unsigned long 0x00000004, unsigned long 0x000000e6, void * 0x00400002)  line 26 + 40 bytes

    FSDMGR!FSINT_RegisterAFSEx(int 0x00000001, void * 0x007a0003, unsigned long 0xd004d800, unsigned long 0x00000004, unsigned long 0x000000e6)  line 119 + 36 bytes

    K.COREDLL!xxx_RegisterAFSEx(int 0x00000001, void * 0x007a0003, unsigned long 0xd004d800, unsigned long 0x00000004, unsigned long 0x000000e6)  line 272 + 48 bytes

    FSDMGR!FSDMGR_RegisterVolume(LogicalDisk_t * 0xd004d260, const unsigned short * 0xd025ee24, MountedVolume_t * 0xd1580500)  line 464 + 32 bytes

    EXFAT!Volume::RegisterVolume()  line 950 + 16 bytes

    EXFAT!Volume::MountVolume()  line 548 + 8 bytes

    EXFAT!VolumeManager::MountVolume(unsigned long 0xd004d260)  line 77 + 28 bytes

    EXFAT!FSD_MountDisk(unsigned long 0xd004d260)  line 95 + 12 bytes

    FSDMGR!FileSystemDriver_t::Mount()  line 734 + 24 bytes

    FSDMGR!MountFileSystemDriver(MountableDisk_t * 0xd004d260, FileSystemDriver_t * 0xd004d6e0, unsigned long 0x000000e6, int 0x00000000)  line 294 + 8 bytes

    FSDMGR!PartitionDisk_t::MountPartition(void * 0x01a30003)  line 481 + 28 bytes

    FSDMGR!StoreDisk_t::LoadPartition(const unsigned short * 0xd025fa68, int 0x00000001, int 0x00000000)  line 574 + 12 bytes

    FSDMGR!StoreDisk_t::LoadExistingPartitions(int 0x00000001, int 0x00000000)  line 601

    FSDMGR!StoreDisk_t::MountStore(void * 0x01990003, int 0x00000001)  line 684

    FSDMGR!MountStore(const unsigned short * 0xc06617e4, const _GUID * 0xc06617c8, const unsigned short * 0x00000000, StoreDisk_t * * 0x00000000)  line 411 + 16 bytes

    FSDMGR!PNPThread(void * 0x00000000)  line 1023

    K.COREDLL!ThreadBaseFunc(unsigned long (void *)* 0xc0632230, void * 0x00000000)  line 1131 + 16 bytes

     

    I can't understand why exfat.dll wants to register file system. I don't observe such behavior on reference OMAP(EVM2) platform. Can you suggest what is my problem?

     

    Thanks in advance,
    Freidman Dmitri 


    Tuesday, September 27, 2011 11:26 AM
  • Hello,

    I'm dealing with a similar problem, is there anything new regarding the issue?


    Thanks a lot, very much appreciated!

    Shahal

    Sunday, October 2, 2011 7:54 AM
  • Hi,

    The problem was in key:
    [HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\XXX]

    Value:
    "MountAsNetwork"=dword:1
    was causing  to exfat.dll to register at Network's index(1).

    Removing it solved the problem.

    Thanks a lot
    Dmitri Freidman 

    Sunday, October 16, 2011 1:32 PM
  • Good posts, Dmitri. Sorry I wasn't around to be of any help!

    Paul T.

    Thursday, November 3, 2011 6:48 PM