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. General Programming
  3. Windows API
  4. Crash in NetStatisticsGet while unloading DLLs

Crash in NetStatisticsGet while unloading DLLs

Scheduled Pinned Locked Moved Windows API
question
1 Posts 1 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.
  • A Offline
    A Offline
    Andrew Hain
    wrote on last edited by
    #1

    One of our programs crashes right at the end when it runs under Windows 7. We have traced it to this bit of code.

    CT2W szwService(SERVICE\_WORKSTATION);
    

    #if (_MSC_VER == 1500)
    // XXXX The following weirdness is because Microsoft forgot that
    // The signature for NetStatisticsGet should *always* be unicode!
    LPTSTR szService = (LPTSTR)(LPWSTR)szwService;
    #else
    LPWSTR szService(szwService);
    #endif
    STAT_WORKSTATION_0 *pStatistics;
    if (::NetStatisticsGet(NULL, szService, 0, 0, (LPBYTE*)&pStatistics) != NERR_Success)
    ...

    The call to NetStatisticsGet returns NERR_Success on Windows XP (both 32 and 64 bits) but on Windows 7 (64-bit) it returns 0xC000000D (STATUS_INVALID_PARAMETER). Has anyone got an idea what to do next?

    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