Hi Nick, I do not like hardcoding the structure size. As you correctly point out,on Win2k, a default project maps to WINVER=0x400 on VC6 and to WINVER=0x501 (XP!) on VC7. This accounts for different sizes of RASCONN. I think this is something Microsoft needs to fix. Best, Aleksey
On Thu, 30 May 2002 12:54:05 +1000, Nick Wienholt <[EMAIL PROTECTED]> wrote: http://groups.google.com/groups? q=winver+0x501&hl=en&lr=&ie=UTF8&oe=UTF8&selm=fdb16e25.0203041310.3ef80195% 40posting.google.com&rnum=4 >Hi Aleksey, > >Problems with RASCONN size values are often due to differences between the >#define WINVER value in a project and the target OS. Make sure these values >are in synch. > >Hard-coding a dwSize member variable is a struct that is passed as a >[in/out] parameter to a Win32 API call is extremely risky. Changing a >#define like UNICODE or WINVER somewhere else in the program can end up >causing stack corruption, and is a huge security risk. > >Nick > >----- Original Message ----- >From: "Dr. Aleksey Nudelman" <[EMAIL PROTECTED]> >To: <[EMAIL PROTECTED]> >Sent: Thursday, May 30, 2002 12:19 PM >Subject: [DOTNET] incrorrect RASCONN structure size in VC++ 7.0 > > >> Hello, >> sizeof(RASCONNA) returns different values in VC++ 7.0 and VC++ 6.0. >> This causes failure of RasEnumConnections calls. >> This apparently happens because of the changes in ras.h between VC 7 and >VC >> 6 >> Workaround: >> 1. Ignore MSDN example on RasEnumConnections >> 2. Hardcode >> lpRasConn->dwSize = 412;lpcb=412; >> Did anybody encounter a similar problem? >> Cheers, >> Aleksey >> >> You can read messages from the DOTNET archive, unsubscribe from DOTNET, or >> subscribe to other DevelopMentor lists at http://discuss.develop.com. > >You can read messages from the DOTNET archive, unsubscribe from DOTNET, or >subscribe to other DevelopMentor lists at http://discuss.develop.com. You can read messages from the DOTNET archive, unsubscribe from DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com.