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 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?
@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.
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 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
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).