[fixed] Multiple, duplicated network shares without doing anything (2 Viewers)

jimmyo

MP Donator
  • Premium Supporter
  • October 1, 2006
    89
    19
    Home Country
    Sweden Sweden
    Thanks for taking the time to find the bug, just tell me when you want me to try something.
     

    MJGraf

    Retired Team Member
  • Premium Supporter
  • January 13, 2006
    2,478
    1,385
    Hi @jimmyo,

    that's a very strange Problem. I checked all the calls to Windows functions we make, but I couldn't find anything we do wrong. Nevertheless Windows Returns strange objects...
    I've prepared another Mediaportal.Utils.dll with much more logging included. Would you be so Kind and use this one, do the same steps as described above and post the result here? (This time the file is called c:\NetworkResourceEnumeratorLog2.txt).

    If we don't find in this log, then it's probably caused by a Buggy Network Driver or the like. In this case, I think I will provide a relatively easy patch. This method I'm talking about Returns a list of strings with the names of the Computers in your Network. If we just use a "HashSet" instead of a List, there cannot be multiple entries with the same Name and so we filter out the duplicates.

    But before doing so, I want to be 200% sure we have no bug in our code.

    One final question: Can you see all the Computers in your Network appearing at least once in the Screen above or is one missing? If so, what is the missing one called (in particular are there Special characters in the Name)?

    Thanks a lot for all your help!

    Michael
     

    Attachments

    • MediaPortal.Utilities.dll.zip
      91.2 KB

    jimmyo

    MP Donator
  • Premium Supporter
  • October 1, 2006
    89
    19
    Home Country
    Sweden Sweden
    Hi

    Attached new log, I don't have my HTPC2 on so all computers is showing.
     

    Attachments

    • NetworkResourceEnumeratorLog2.txt
      1.1 MB

    MJGraf

    Retired Team Member
  • Premium Supporter
  • January 13, 2006
    2,478
    1,385
    Thanks so much, jimmyo!
    This really seems to be a bug somewhere in the Win32 API of Windows itself. I've created a jira issue, where I tried to explain the Problem here:
    https://issues.team-mediaportal.com/browse/MP2-356

    I'll provide a patch later today (will probably keep the logging first and if your problem is solved, I'll remove the logging later on).

    Just out of curiosity: The problem results from a Domain or Workgroup in your Network, which has an empty Name (at least this is what Windows reports). There is the Standard Workgroup in your Network called "Workgroup". Can you check if all your Computers in the Network are in this Workgroup or if there are Computers with other Workgroups they belong to?

    Michael
     

    MJGraf

    Retired Team Member
  • Premium Supporter
  • January 13, 2006
    2,478
    1,385
    Here we go...

    @jimmyo, could you please test with the attached MediaportalUtils.dll?

    It should resolve the problem already, but it still generates a log (this time: NetworkResourceEnumeratorLog3.txt). And please attach the log file here.

    Michael
     

    Attachments

    • MediaPortal.Utilities.dll.zip
      91.3 KB

    jimmyo

    MP Donator
  • Premium Supporter
  • October 1, 2006
    89
    19
    Home Country
    Sweden Sweden
    Thanks for the new dll, now it works.

    Before using the new dll I checked all my computers even HTPC2 and all are in the same WORKGROUP.
    Then I tried turning off all network devices one by one and checking if the problem in MP2 still was there.

    When I turned off my Cisco E2000 MP2 finds the right amount of shares, but when I turned it on again there are duplicates. I don't know why MP2 doesn't like it. I use the Cisco E2000 for my smartphones, smarttv and HTPC2 for wireless Communications.

    I attached the log using the new dll.
     

    Attachments

    • NetworkResourceEnumeratorLog3.txt
      22.9 KB

    MJGraf

    Retired Team Member
  • Premium Supporter
  • January 13, 2006
    2,478
    1,385
    Thanks so much jimmyo!

    I would bet that your E2000 has something like an inbuilt shared folder but when propagating this shared folder on the network, it uses an inbuilt workgroup of an empty string. I don't know whether this is an allowed behavior. If not, it is a bug in the E2000. If it is an allowed behavior, there is a bug in the Win 32 API's WNetEnumResource function.

    Either way, we should not allow that this misbehavior of other devices / software leads to a misbehavior of MP2. I'll provide a patch for this.

    morpheus_xx @chefkoch, I just tried to make a patch based on current dev branch. When I tried to compile, I got the following errors:

    Error 1 Could not copy the file "C:\_MP\Quellcode\MediaPortal-2\MediaPortal\Source\Extensions\MetadataExtractors\MediaInfoLib\bin\x86\Debug\MediaInfo.dll" because it was not found. MediaInfoLib
    Error 2 Could not copy the file "C:\_MP\Quellcode\MediaPortal-2\MediaPortal\Source\Extensions\MetadataExtractors\MatroskaLib\bin\x86\Debug\mkvextract.exe" because it was not found. MatroskaLib
    Error 3 Could not copy the file "C:\_MP\Quellcode\MediaPortal-2\MediaPortal\Source\Extensions\MetadataExtractors\MatroskaLib\bin\x86\Debug\mkvinfo.exe" because it was not found. MatroskaLib
    Error 4 Could not copy the file "C:\_MP\Quellcode\MediaPortal-2\MediaPortal\Source\Extensions\BassLibraries\bin\x86\Debug\bass.dll" because it was not found. BassLibraries
    Error 5 Could not copy the file "C:\_MP\Quellcode\MediaPortal-2\MediaPortal\Source\Extensions\BassLibraries\bin\x86\Debug\basscd.dll" because it was not found. BassLibraries
    Error 6 Could not copy the file "C:\_MP\Quellcode\MediaPortal-2\MediaPortal\Source\Extensions\BassLibraries\bin\x86\Debug\bassmix.dll" because it was not found. BassLibraries
    Error 11 Could not copy the file "C:\_MP\Quellcode\MediaPortal-2\MediaPortal\Source\Extensions\MetadataExtractors\ImageMetadataExtractor\bin\x86\Debug\FreeImage.dll" because it was not found. ImageMetadataExtractor
    Error 25 Could not copy the file "C:\_MP\Quellcode\MediaPortal-2\MediaPortal\Source\Extensions\MetadataExtractors\VideoThumbnailer\bin\x86\Debug\ffmpeg.exe" because it was not found. VideoThumbnailer

    Is there something wrong with the current dev branch?!?
    Furthermore I noticed that a Mediaportal.Utilities.dll built with the current dev branch does not work anymore with MP2 Alpha 2. Is that correct? Shall I make the patch based on MP2 Alpha 2 to make testing easier? Thanks for your help!
    Michael
     
    Last edited:

    chefkoch

    Retired Team Member
  • Premium Supporter
  • October 5, 2004
    3,129
    1,634
    Dresden / Munich / Maastricht
    Home Country
    Germany Germany
    Either way, we should not allow that this misbehavior of other devices / software leads to a misbehavior of MP2. I'll provide a patch for this.

    Either you have to start the BuildCompleteInstaller once or the RestorePackage or start the Client build a second time.
    see http://wiki.team-mediaportal.com/index.php?title=2_MEDIAPORTAL_2/8_Contribute/Development/Building_&_Compiling/1_Build_Process

    I will fine tune the build scripts a bit more to ensure nothing is being missed like calling RestorePackage no matter if building complete installer, client only or server only bin dir, but only call RestorePackage once, when full isntaller (client, server, servicemonitor is started).
     
    Last edited:

    Users who are viewing this thread

    Top Bottom