Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. FindFirstChangeNotification() results in "The network BIOS command limit has been reached."

FindFirstChangeNotification() results in "The network BIOS command limit has been reached."

Scheduled Pinned Locked Moved C / C++ / MFC
sysadminquestionc++help
14 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Still learning how to code

    Here is the code in my worker thread, as requested:- UINT WaitNewScheduleThread(LPVOID Param)          //20090723 {      CWinThread* pThread = AfxGetThread();      int iID = pThread->m_nThreadID;      CString szLogMsg;      szLogMsg.Format("\n>>> Worker thread ID = 0x%X\n",iID);      OutputDebugString(szLogMsg);      CMCManagerBEDlg* pDlg = (CMCManagerBEDlg*)Param;      CMCManagerBEApp* pApp;      pApp = (CMCManagerBEApp*)AfxGetApp();           HANDLE hCN;      CString szPathName;      szPathName.Format("Z:\\WinDVR");      //szPathName.Format("C:\\Dell");      // Set up array of two handles      HANDLE hExitEvent;      hExitEvent = pApp->m_hExitEvent;      HANDLE handles[2];      int iRetCode;      DWORD dwRC;             DWORD         err;      do      {           hCN = FindFirstChangeNotification(szPathName,FALSE,FILE_NOTIFY_CHANGE_FILE_NAME);           if(hCN == INVALID_HANDLE_VALUE)                err = GetLastError();           handles[0] = hCN;           handles[1] = pApp->m_hExitEvent;           dwRC = WaitForMultipleObjects(2,handles,FALSE,INFINITE);           if(dwRC == WAIT_OBJECT_0)           {                szLogMsg.Format("Found new file on %s",szPathName);                g_pLogFile->Add(szLogMsg);                OutputDebugString(szLogMsg);                if(g_pDlg->m_bPermitSchedUpdate)         &

    K Offline
    K Offline
    killabyte
    wrote on last edited by
    #4

    so i think because your polling the call FindFirstChangeNotification() in an infinite loop it cries might try adding a lil timer to the thread and put the contents of the do{}while(1) in the thread OnTimer event setting the polling interval to be something sensible

    S 1 Reply Last reply
    0
    • K killabyte

      so i think because your polling the call FindFirstChangeNotification() in an infinite loop it cries might try adding a lil timer to the thread and put the contents of the do{}while(1) in the thread OnTimer event setting the polling interval to be something sensible

      S Offline
      S Offline
      Still learning how to code
      wrote on last edited by
      #5

      But the loop gets suspended at WaitOnMultipleObjects() after the very FIRST invocation of FindFirstChangeNotification().   (The whole reason for using this approach is to get away from a polling mechanism which introduces a delay)   As I said originally, the code works fine when the target is a local disk - something to do with network, and I don't know how to fix it !!)

      Doug

      K 1 Reply Last reply
      0
      • S Still learning how to code

        But the loop gets suspended at WaitOnMultipleObjects() after the very FIRST invocation of FindFirstChangeNotification().   (The whole reason for using this approach is to get away from a polling mechanism which introduces a delay)   As I said originally, the code works fine when the target is a local disk - something to do with network, and I don't know how to fix it !!)

        Doug

        K Offline
        K Offline
        killabyte
        wrote on last edited by
        #6

        i am thinking that WaitOnMultipleObjects()doesnt "wait" that long (assumption about to make an ass of me) try printing out a gettickcount() or something in the do loop and see if that is the case. [edit] and yes assupmtion has made an ass of me once again http://support.microsoft.com/kb/810886[^] [edit]

        S 1 Reply Last reply
        0
        • K killabyte

          i am thinking that WaitOnMultipleObjects()doesnt "wait" that long (assumption about to make an ass of me) try printing out a gettickcount() or something in the do loop and see if that is the case. [edit] and yes assupmtion has made an ass of me once again http://support.microsoft.com/kb/810886[^] [edit]

          S Offline
          S Offline
          Still learning how to code
          wrote on last edited by
          #7

          Hi Killabyte,   Actually, I'm getting the problem single-stepping in the debugger, so the loop isn't executing as such.   Also the WaitOnMultipleObjects() has an INFINITE timeout.   I don't quite know how FindFirstChangeNotification() is implemented, but presumably the problem resides in the firmware of the network disk controller - have logged on to it, but can't see any parameters in the SMB server that I can tweak.   Or am I missing something here ?

          Doug

          K 1 Reply Last reply
          0
          • S Still learning how to code

            Hi Killabyte,   Actually, I'm getting the problem single-stepping in the debugger, so the loop isn't executing as such.   Also the WaitOnMultipleObjects() has an INFINITE timeout.   I don't quite know how FindFirstChangeNotification() is implemented, but presumably the problem resides in the firmware of the network disk controller - have logged on to it, but can't see any parameters in the SMB server that I can tweak.   Or am I missing something here ?

            Doug

            K Offline
            K Offline
            killabyte
            wrote on last edited by
            #8

            see my edit above =) think that is your issue... i was barking up the wrong tree

            S 1 Reply Last reply
            0
            • S Still learning how to code

              Here is the code in my worker thread, as requested:- UINT WaitNewScheduleThread(LPVOID Param)          //20090723 {      CWinThread* pThread = AfxGetThread();      int iID = pThread->m_nThreadID;      CString szLogMsg;      szLogMsg.Format("\n>>> Worker thread ID = 0x%X\n",iID);      OutputDebugString(szLogMsg);      CMCManagerBEDlg* pDlg = (CMCManagerBEDlg*)Param;      CMCManagerBEApp* pApp;      pApp = (CMCManagerBEApp*)AfxGetApp();           HANDLE hCN;      CString szPathName;      szPathName.Format("Z:\\WinDVR");      //szPathName.Format("C:\\Dell");      // Set up array of two handles      HANDLE hExitEvent;      hExitEvent = pApp->m_hExitEvent;      HANDLE handles[2];      int iRetCode;      DWORD dwRC;             DWORD         err;      do      {           hCN = FindFirstChangeNotification(szPathName,FALSE,FILE_NOTIFY_CHANGE_FILE_NAME);           if(hCN == INVALID_HANDLE_VALUE)                err = GetLastError();           handles[0] = hCN;           handles[1] = pApp->m_hExitEvent;           dwRC = WaitForMultipleObjects(2,handles,FALSE,INFINITE);           if(dwRC == WAIT_OBJECT_0)           {                szLogMsg.Format("Found new file on %s",szPathName);                g_pLogFile->Add(szLogMsg);                OutputDebugString(szLogMsg);                if(g_pDlg->m_bPermitSchedUpdate)         &

              F Offline
              F Offline
              Frank Seidler
              wrote on last edited by
              #9

              Hi, a quick look at the code shows that the handle will not be closed. From MSDN: When the handle is no longer needed, it can be closed by using the FindCloseChangeNotification function. So I guess the error will show up after the loop has been executed a few times? Regards Frank

              S 1 Reply Last reply
              0
              • K killabyte

                see my edit above =) think that is your issue... i was barking up the wrong tree

                S Offline
                S Offline
                Still learning how to code
                wrote on last edited by
                #10

                Hi again,   I had seen <a href="http://support.microsoft.com/kb/810886\[^\]">http://support.microsoft.com/kb/810886\[^\]</a>[<a href="http://support.microsoft.com/kb/810886\[^\]" target="_blank" title="New Window">^</a>] already - it only seems (unless I have missed something) to address the situation where the FindFirstChangeNotification() is aimed at a SERVER and then you can edit it's registry accordingly. In this case, the target is a network disk and that is why I logged on to it to see what parameters were available for tweaking - basically none !) I'd be surprised if I'm the first person to hit such a problem ! P.S. I clearly don't know how to insert a link (copied from a previous posting) in a new posting !!

                Doug

                K 1 Reply Last reply
                0
                • F Frank Seidler

                  Hi, a quick look at the code shows that the handle will not be closed. From MSDN: When the handle is no longer needed, it can be closed by using the FindCloseChangeNotification function. So I guess the error will show up after the loop has been executed a few times? Regards Frank

                  S Offline
                  S Offline
                  Still learning how to code
                  wrote on last edited by
                  #11

                  Hi Frank, Getting the problem whilst single-stepping in the debugger !

                  Doug

                  1 Reply Last reply
                  0
                  • S Still learning how to code

                    Hi again,   I had seen <a href="http://support.microsoft.com/kb/810886\[^\]">http://support.microsoft.com/kb/810886\[^\]</a>[<a href="http://support.microsoft.com/kb/810886\[^\]" target="_blank" title="New Window">^</a>] already - it only seems (unless I have missed something) to address the situation where the FindFirstChangeNotification() is aimed at a SERVER and then you can edit it's registry accordingly. In this case, the target is a network disk and that is why I logged on to it to see what parameters were available for tweaking - basically none !) I'd be surprised if I'm the first person to hit such a problem ! P.S. I clearly don't know how to insert a link (copied from a previous posting) in a new posting !!

                    Doug

                    K Offline
                    K Offline
                    killabyte
                    wrote on last edited by
                    #12

                    oh crap. so your saying that there is no registry edit applicable on your target network disk? i would have thought that if there is no "server" so to speak of then the client side registry would be altered? but then again who said logic plays a part in software development haha

                    S 1 Reply Last reply
                    0
                    • K killabyte

                      oh crap. so your saying that there is no registry edit applicable on your target network disk? i would have thought that if there is no "server" so to speak of then the client side registry would be altered? but then again who said logic plays a part in software development haha

                      S Offline
                      S Offline
                      Still learning how to code
                      wrote on last edited by
                      #13

                      Hi Killabyte,   Yes !! When you logon to 192.168.1.9 using a browser, the facilities provided are minimal.   Don't forget that the whole thing is implemented in firmware !!   Basically, I'm beginning to think that I'm at it's mercy, and I'm stuffed !!!   (Will have to stick with my old polling mechanism after all ... unless someone knows different ...... !

                      Doug

                      1 Reply Last reply
                      0
                      • S Still learning how to code

                        My MFC application needs to monitor a directory on a network disk (mapped as Z:), and I'm using FindFirstChangeNotification() to do this.   However, I am getting an INVALID_HANDLE_VALUE returned, and GetLastError() return 56 (which appears to be "The network BIOS command limit has been reached." If I change the path of the monitored folder to a local drive, it works fine.   How do I get over this problem ?   (MSVC 6.0 - Win2000)   (All the results from a Google search only seem to refer to a server situation)

                        Doug

                        R Offline
                        R Offline
                        Rozis
                        wrote on last edited by
                        #14

                        I got the same problem as you have, but never found a solution. Thaught then that it was because i use Linux with Samba as the networkserver. Rozis

                        1 Reply Last reply
                        0
                        Reply
                        • Reply as topic
                        Log in to reply
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes


                        • Login

                        • Don't have an account? Register

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • World
                        • Users
                        • Groups