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. Other Discussions
  3. IT & Infrastructure
  4. Detect Winsock2?

Detect Winsock2?

Scheduled Pinned Locked Moved IT & Infrastructure
sysadminwindows-adminquestion
6 Posts 6 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.
  • M Offline
    M Offline
    Matt Philmon
    wrote on last edited by
    #1

    Hey gang, I still have to continue to support Windows 95 (grumble). At least our minimum support is 'B'. Anyway, we also require PWS for Win 9x and IIS for 2000/XP in order to run in "Offline" mode. (Don't ask - bleh). Anyway, a ghosted "virgin" Windows 95B machine (even if you install IE 5.5 SP2) does not include Winsock2 by default, even after installing a network card and setting up Internet access and all that. Winsock2 is a required component for installing Personal Web Server. I found a download that works for me from Microsoft that puts Winsock2 in place. However, in order to make things as easy as possible for the user, we've written a "Launcher" program that steps the user through the variety of setups that are required. Bottom line: Does anyone know how I can programatically check for Winsock2 installation? Obviously the PWS install is doing it. Thanks,

    C M J 3 Replies Last reply
    0
    • M Matt Philmon

      Hey gang, I still have to continue to support Windows 95 (grumble). At least our minimum support is 'B'. Anyway, we also require PWS for Win 9x and IIS for 2000/XP in order to run in "Offline" mode. (Don't ask - bleh). Anyway, a ghosted "virgin" Windows 95B machine (even if you install IE 5.5 SP2) does not include Winsock2 by default, even after installing a network card and setting up Internet access and all that. Winsock2 is a required component for installing Personal Web Server. I found a download that works for me from Microsoft that puts Winsock2 in place. However, in order to make things as easy as possible for the user, we've written a "Launcher" program that steps the user through the variety of setups that are required. Bottom line: Does anyone know how I can programatically check for Winsock2 installation? Obviously the PWS install is doing it. Thanks,

      C Offline
      C Offline
      ColinDavies
      wrote on last edited by
      #2

      Option 1. On detection of Win95 you should format the system-drive or similar. :-) Option 2. Check the registy key below exists. HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\WinSock2\Parameters and check the Winsock_Registry_Version value, I'd go for option 1 of course. :-) Regardz Colin J Davies

      Sonork ID 100.9197:Colin

      I live in Bob's HungOut now

      COBOL programmers understand why women hate periods

      S 1 Reply Last reply
      0
      • M Matt Philmon

        Hey gang, I still have to continue to support Windows 95 (grumble). At least our minimum support is 'B'. Anyway, we also require PWS for Win 9x and IIS for 2000/XP in order to run in "Offline" mode. (Don't ask - bleh). Anyway, a ghosted "virgin" Windows 95B machine (even if you install IE 5.5 SP2) does not include Winsock2 by default, even after installing a network card and setting up Internet access and all that. Winsock2 is a required component for installing Personal Web Server. I found a download that works for me from Microsoft that puts Winsock2 in place. However, in order to make things as easy as possible for the user, we've written a "Launcher" program that steps the user through the variety of setups that are required. Bottom line: Does anyone know how I can programatically check for Winsock2 installation? Obviously the PWS install is doing it. Thanks,

        M Offline
        M Offline
        Michael Dunn
        wrote on last edited by
        #3

        Do a LoadLibrary("ws2_32"); If it fails, WinSock 2 is not installed. --Mike-- "COM didn't solve the old version of DLL hell - it just provided us with a new and improved version of hell."   -- John Simmons, 1/22/2002 My really out-of-date homepage Sonork - 100.10414 AcidHelm Big fan of Alyson Hannigan.

        1 Reply Last reply
        0
        • C ColinDavies

          Option 1. On detection of Win95 you should format the system-drive or similar. :-) Option 2. Check the registy key below exists. HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\WinSock2\Parameters and check the Winsock_Registry_Version value, I'd go for option 1 of course. :-) Regardz Colin J Davies

          Sonork ID 100.9197:Colin

          I live in Bob's HungOut now

          COBOL programmers understand why women hate periods

          S Offline
          S Offline
          Simon Walton
          wrote on last edited by
          #4

          Colin Davies wrote: Option 1. On detection of Win95 you should format the system-drive or similar. That's the last time I run anything you send me, Colin. :P Simon C++: Only friends can see your private parts. Sonork ID 100.10024

          1 Reply Last reply
          0
          • M Matt Philmon

            Hey gang, I still have to continue to support Windows 95 (grumble). At least our minimum support is 'B'. Anyway, we also require PWS for Win 9x and IIS for 2000/XP in order to run in "Offline" mode. (Don't ask - bleh). Anyway, a ghosted "virgin" Windows 95B machine (even if you install IE 5.5 SP2) does not include Winsock2 by default, even after installing a network card and setting up Internet access and all that. Winsock2 is a required component for installing Personal Web Server. I found a download that works for me from Microsoft that puts Winsock2 in place. However, in order to make things as easy as possible for the user, we've written a "Launcher" program that steps the user through the variety of setups that are required. Bottom line: Does anyone know how I can programatically check for Winsock2 installation? Obviously the PWS install is doing it. Thanks,

            J Offline
            J Offline
            jan larsen
            wrote on last edited by
            #5

            You could try the API function int WSAStartup(WORD wVersionRequested, LPWSADATA lpWSAData); You can check the highest version supplied in lpWSAData->wHighVersion. (version encoded as: MAKEWORD(2, 0) for Winsock 2.0). Well, anyway this is what the manual says... Jan "It could have been worse, it could have been ME!"

            C 1 Reply Last reply
            0
            • J jan larsen

              You could try the API function int WSAStartup(WORD wVersionRequested, LPWSADATA lpWSAData); You can check the highest version supplied in lpWSAData->wHighVersion. (version encoded as: MAKEWORD(2, 0) for Winsock 2.0). Well, anyway this is what the manual says... Jan "It could have been worse, it could have been ME!"

              C Offline
              C Offline
              Christopher Duncan
              wrote on last edited by
              #6

              Yep, here's what we do at the shop to test for 2.2: iErr = WSAStartup(wVersionRequested, &wsaData); if (!iErr) { // Confirm that the WinSock DLL supports 2.2. // Note that if the DLL supports versions greater // than 2.2 in addition to 2.2, it will still return // 2.2 in wVersion since that is the version we // requested. if ( LOBYTE( wsaData.wVersion ) != 2 || HIBYTE( wsaData.wVersion ) != 2 ) { BarkAndWhine(_T("CIdsSocket::WinsockInit() - Could not find a usable WinSock DLL for version %d.%d"), byVersionHigh, byVersionLow); } else { // The WinSock DLL is acceptable. Proceed. } } Chistopher Duncan Author - The Career Programmer: Guerilla Tactics for an Imperfect World (Apress)

              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