topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Sunday December 15, 2024, 3:16 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Last post Author Topic: How to create a shortcut for the "wireless network connection" in Windows XP?  (Read 60211 times)

Stoic Joker

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 6,649
    • View Profile
    • Donate to Member
So for a (lack of) progress report...

At this point I have it working, or at least it appears to be...With one minor exception. It crashes on XP x86. Runs fine on Win7 x64 and Server 2k3 x64, but crashes on (the target platform) XP x86... *Sigh*

I've narrowed it down to a specific function and line of code, but I've not a clue why/what's wrong with it:
Code: C++ [Select]
  1. //================================================================================================
  2. //-------------+++--> Strip \DEVICE\TCPIP_ Off of wszName to Get the Adapter's GUID For Comparison:
  3. void StripOutGUID(WCHAR *szGUID, WCHAR *wszName) { //---------------------------------------+++-->
  4.         WCHAR *p; // Walk the string to find the GUID opening '{' character. Sure There
  5.                  // Are Easier Ways to do This ... But This Way I Avoid Language Issues.
  6.  
  7.   p = wszName;
  8.   while(*p != L'{') *p++;
  9.  
  10. //  wsprintf(szGUID, L"%s", p);                 // ALL of These Work, but Crash on XP...?!?
  11. //  StringCbPrintf(szGUID, GEN_BUFF, L"%s", p); // ALL of These Work, but Crash on XP...?!?
  12.   StringCbCopy(szGUID, GEN_BUFF, p);            // ALL of These Work, but Crash on XP...?!?
  13. }

Suggestions appreciated. :)
« Last Edit: February 04, 2011, 06:28 PM by Stoic Joker »

Stoic Joker

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 6,649
    • View Profile
    • Donate to Member
...Nevermind, I hadn't backed up far enough. Apparently it's the MIB_IFROW structure that is tossing out garbage... Who'da Thunk...

pMibIfRow->wszName is both extremely critical (e.g. the point of the function)...and complete trash (buffer content wise).

Shit...  :(

worstje

  • Honorary Member
  • Joined in 2009
  • **
  • Posts: 588
  • The Gent with the White Hat
    • View Profile
    • Donate to Member
If you throw some more code out there I can take a look. I've got some experience hunting nasty bugs involving Windows, memory structures and the likes: Cautomaton exposed me to tons of weirdness from MS and other application 'vendors' when I wrote it. :(

Stoic Joker

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 6,649
    • View Profile
    • Donate to Member
If you throw some more code out there I can take a look. I've got some experience hunting nasty bugs involving Windows, memory structures and the likes: Cautomaton exposed me to tons of weirdness from MS and other application 'vendors' when I wrote it. :(

Thanks, actually I'd already posted the code in its entirety earlier when I (had only tested it on x64) thought it was working. It's back aways in this thread  here the part that is throwing blanks at me is on line 46 of that code. I was then (incorrectly) assuming that the buffer passed to the function 3 posts up had content, which it didn't, which explains why incrementing the pointer to it went ...Badly.

Which makes my current nemesis the empty/corrupt/borked buffer on line 46.