CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 1999
    Posts
    50

    NetStatisticsGet fails in Windows 7

    We have been having trouble with a program running on Windows 7 and we have traced it to this code.

    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?

  2. #2
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,620

    Re: NetStatisticsGet fails in Windows 7

    Most promising way is to find out which parameter is invalid.
    Best regards,
    Igor

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured