"Vijay Kiran Kamuju" infyquest@gmail.com wrote:
as previous implementation had some bugs use this version
You still need to check buffer size before filling the buffer. Also using a new variable instead of casting lpBuffer would be much cleaner. Same applies to all cases.
I'd suggest to use FIXME instead of WARN here. It doesn't really matter that current version of miscrosoft's implementation doesn't support them, they may add support for them later, and the apps will start to use them.
char useragent[] = "Wininet Test";
works just fine.
Again, checking last error without setting it first to a bogus value.
+ SetLastError(0); + buffer=HeapAlloc(GetProcessHeap(),0,len+1); + retval=InternetQueryOptionA(hinet,INTERNET_OPTION_USER_AGENT,buffer,&len); + err=GetLastError();
Do not set last error to 0, you then miss the case when API sets it to 0.
You don't initialize length variable before calling InternetQueryOption.
Hi,
On Wed, Nov 09, 2005 at 12:07:57AM +0800, Dmitry Timoshkov wrote:
Maybe it works, but not "fine" ;)
static const char useragent[] = "Wininet Test";
does.
Andreas