none
Query Directory SMB2 Command Problem

    Question

  • Hi

    I am using SMB2 Command Query Directory in order to fetch directory information from a server. While I am using the flag "SMB2_INDEX_SPECIFIED" I can see that Server keeps on sending information against multiple Query Directory until the list is exhausted , then server returns an NT STATUS Error as "No More Files". If I again send another similar request I receive the same error. Is there any way to reset the information at the server side directory handle so that I can freshly start the Query Directory with the same option ?.

    I tried with "RESTART_SCAN" but using it server also returns back the first set of information which I don't require. Can someone help me out here. I just need to reset the current state of the directory handle at the server side.

    Tuesday, July 23, 2013 8:27 AM

Answers

  • Hello Tanuman,

                          Since you have not responded, I am assuming either you need more time or you actually found the solution based on the information shared or on your own. In any case if you wish to resume investigation you could post here again or send e-mail to dochelp @ Microsoft dot com.

    Regards,
    Sreekanth Nadendla
    Microsoft Windows Open Specifications

    Wednesday, August 21, 2013 5:35 PM
    Moderator

All replies

  • Hello Tanuman,
                           Thank you for your inquiry about File sharing protocols. One of the Open specifications team member will contact you shortly.


    Regards,
    Sreekanth Nadendla
    Microsoft Windows Open Specifications

    Tuesday, July 23, 2013 5:40 PM
    Moderator
  • Hello Tanuman,

                           Just want to let you know that I am the contact person on this issue. Thank you for being patient while I debug this server behavior you've reported.

    Regards,
    Sreekanth Nadendla
    Microsoft Windows Open Specifications                      

    Wednesday, July 24, 2013 5:50 PM
    Moderator
  • Hello Tanuman,

                           Can you collect netmon trace while reproducing the behavior and send it to dochelp @ Microsoft dot com. Please remember to address it to Sreekanth. Please state the version details of your server and client OS.

    Regards,
    Sreekanth Nadendla
    Microsoft Windows Open Specifications

    Wednesday, July 24, 2013 7:06 PM
    Moderator
  • Hello Sreekanth,

    Thanks a lot for looking into the issue and getting back on it. I needed to know whether there is configurable bit/value present which can be set at the server side handle so that if a server finishes sending it's end of query directory response we can reset the value and from next request coming from Client we can see a server responding freshly. Currently we have a option in Client end called "Restart Scan" but server also returns a list of directories with this response which I don't need.

    Also please let me know if you are referring this behavior as an issue at the server end so that I can then send you the relevant captures as well

    Regards

    Tanuman

    Thursday, July 25, 2013 12:25 PM
  • Hello Tanuman,

                          Have noticed the Windows behavior note for flag SMB2_INDEX_SPECIFIED.

    <64> Section 2.2.33: Windows-based servers do not support resuming an enumeration at a specified FileIndex. The server will ignore this flag.

    So that flag cannot be used. Have you looked into SMB2_REOPEN ?

    Any time a directory is first opened and Query Directory is issued, we will see the results as described in the specification document.

    It is not clear why you seem to think that there should be a way to abort enumeration state on the server where server would not return directory information even for a single file (e.g. Option  SMB2_RETURN_SINGLE_ENTRY). If this is not correct interpretation of your question please let me know.

    Regards,
    Sreekanth Nadendla
    Microsoft Windows Open Specifications

    Thursday, July 25, 2013 9:15 PM
    Moderator
  • Hi Sreekanth

    Thanks a lot for reverting back, I have tried with "SMB2_REOPEN" as well but it behaves in a similar way like "SMB2_RESTART_SCAN".

    Consider the sequence of SMB2 commands issued by Client "Query Directory", again "Query Directory" both on the same directory. The first one completes scanning the directory completely and server returns "No More Files". The second query directory is also on the same Directory handle but in between I want to reset the state of the server side handle so that I can start afresh from the next query directory command (I don't want to use Restart_Scan).

    Can you let me know if there is any other command(like SetInfo) to reset the option at the server side so that if I don't specify any flag then also I can start afresh.

    Regards

    Tanuman

    Monday, July 29, 2013 1:45 PM
  • Hello Tanuman,
                           You say "reset the state on server and start afresh from next query" and SMB2_REOPEN or SMB2_RESTART_SCAN are not acceptable choices for you. SMB2_REOPEN effectively abandons the state and starts all over again and unlike SMB2_RESTART_SCAN, you could change search pattern also. Here the TWO steps of resetting state and performing a new query are done with one single call.

    There is no separate command specifically for clearing server side directory enumeration state.  

    Perhaps you can explain the problem in the context of an actual trace. Can you collect netmon trace while reproducing the behavior and send it to dochelp @ Microsoft dot com. Please remember to address it to Sreekanth. Please state the version details of your server and client OS.


    Regards,
    Sreekanth Nadendla
    Microsoft Windows Open Specifications


    Tuesday, July 30, 2013 3:09 PM
    Moderator
  • Hello Tanuman,

                          Please let us know if you got a chance to collect traces as suggested in my post earlier (30th July).

    Regards,
    Sreekanth Nadendla
    Microsoft Windows Open Specifications

    Monday, August 12, 2013 4:38 PM
    Moderator
  • Hello Tanuman,

                          Since you have not responded, I am assuming either you need more time or you actually found the solution based on the information shared or on your own. In any case if you wish to resume investigation you could post here again or send e-mail to dochelp @ Microsoft dot com.

    Regards,
    Sreekanth Nadendla
    Microsoft Windows Open Specifications

    Wednesday, August 21, 2013 5:35 PM
    Moderator