locked
Programmatically configure media streaming options (UPnP) - Windows XP RRS feed

  • Question

  • Hello

    I'm trying to programmatically configure the Media Sharing settings in a Windows XP / Windows Media Player 11 scenario.

    Using the wmpnssci.dll COM library I am able to list the UPnP devices and give streaming permissions to the devices I want, but I haven't figured out how to enable/disable the media sharing option programatically. Could you assist me on that?

    This is my current code (I'm actually using C#, but the COM library is C++, right?):

    
    
    Interop.WMPNSSCI.NSSManagerClass nssmanager = new NSSManagerClass();
    Interop.WMPNSSCI.Devices devices = nssmanager.GetAllDevices();
    //Act on devices
    DoSomethingWithDevices();
    //Enable sharing
    nssmanager.InitializeLibrarySharing();
    string UserSID = GetSid(System.Environment.UserName);
    nssmanager.InitializeLibrarySharing(UserSID);        

    The "enable sharing" part does not seem to do anything...

    I've posted a similar thread here:

    http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/4aa3d991-167c-4ced-b711-0a056dcda7a0/

    and I've found a solution for Windows 7 / WMP12 scenarios, but I couldn't figure it out for Windows XP / WMP11.

    Thanks


    • Edited by joaopbnogueira Monday, July 16, 2012 9:50 AM
    • Moved by Helen Zhao Tuesday, July 17, 2012 6:51 AM (From:Visual C++ General)
    Monday, July 16, 2012 9:49 AM

All replies

  • Hi joaopbnogueira,

    According to your description, I'd like to move this thread to "Media Foundation Development for Windows Desktop Forum" for better support. It is because that we only discuss general questions about Visual C++ in Visual C++ General Forum.

    Thanks for your understanding.
    Best regards,


    Helen Zhao [MSFT]
    MSDN Community Support | Feedback to us

    Tuesday, July 17, 2012 6:51 AM
  • Unfortunately, Windows XP does not provide the means to programatically enable and disable media sharing.  InitializeLibrarySharing will run the network sharing service, but it does not perform all of the other steps (linking to a media library, opening firewall ports, etc) that are necessary for enabling sharing.
    Wednesday, August 15, 2012 10:53 PM
  • Hum,

    Ok, so I guess I'll have to do all those steps "manually".

    I couldn't find any documentation regarding wmpnssci.dll, is it available publicly?

    Thanks,

    Thursday, August 16, 2012 9:46 AM
  • wmpnssci.dll is a helper library used internally by media sharing, so there is not any documentation available on it.
    Monday, August 20, 2012 6:39 PM