ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Main Area and Open Discussion > General Software Discussion

How to create a shortcut for the "wireless network connection" in Windows XP?

<< < (16/16)

Stoic Joker:
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++ ---//================================================================================================//-------------+++--> Strip \DEVICE\TCPIP_ Off of wszName to Get the Adapter's GUID For Comparison:void StripOutGUID(WCHAR *szGUID, WCHAR *wszName) { //---------------------------------------+++-->        WCHAR *p; // Walk the string to find the GUID opening '{' character. Sure There                 // Are Easier Ways to do This ... But This Way I Avoid Language Issues.   p = wszName;  while(*p != L'{') *p++; //  wsprintf(szGUID, L"%s", p);                 // ALL of These Work, but Crash on XP...?!?//  StringCbPrintf(szGUID, GEN_BUFF, L"%s", p); // ALL of These Work, but Crash on XP...?!?  StringCbCopy(szGUID, GEN_BUFF, p);            // ALL of These Work, but Crash on XP...?!?}
Suggestions appreciated. :)

Stoic Joker:
...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:
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:
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. :(-worstje (February 04, 2011, 08:06 PM)
--- End quote ---

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.

Navigation

[0] Message Index

[*] Previous page

Go to full version