News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

WinInet.dll from IE6

Started by bomz, May 23, 2011, 03:37:36 AM

Previous topic - Next topic

bomz

I want my application use wininet.dll from IE6. There is some differences which I already don't research between IE6 and IE8.
I renameĀ  wininet.dll from IE6 to IE6.dll, wininet.inc - IE6.inc, wininet.lib - IE6.lib
change code:
Quote
   include \masm32\include\windows.inc

   include \masm32\include\user32.inc
   include \masm32\include\kernel32.inc
   include \masm32\include\shell32.inc
   include \masm32\include\masm32.inc
   include \masm32\include\comdlg32.inc
   include \masm32\include\Comctl32.inc
   include \masm32\include\winmm.inc
   include \masm32\include\advapi32.inc
   include \masm32\include\ntdll.inc
   include IE6.inc

   includelib \masm32\lib\user32.lib
   includelib \masm32\lib\kernel32.lib
   includelib \masm32\lib\shell32.lib
   includelib \masm32\lib\masm32.lib
   includelib \masm32\lib\comdlg32.lib
   includelib IE6.lib
   includelib \masm32\lib\Comctl32.lib
   includelib \masm32\lib\winmm.LIB
   includelib \masm32\lib\advapi32.lib
   includelib \masm32\lib\ntdll.lib

compiling OK. But application use wininet from system - IE8, work even IE6.dll not in the same directory. What's wrong?

donkey

"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

bomz

My English is poor - as I understand simply put IE6 dll to the same path as application? But application still work like IE8 library use

donkey

Hi,

First off, just renaming wininet.lib ie6.lib changes nothing, the actual library name is contained within the lib file and the name you give to it doesn't change that. Second you have to create an empty file in the form Myapp.exe.local and place it along with the wininet dll in your application folder.
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

bomz

I try to explain what happen.

Application make Thread, and if it don't get result in some period of time begin one another, and set flag which allow stop first. With IE6 all is OK, when I close old thread wininet handle - old thread quickly stopped . But with IE8 all waiting request from old threads back to last! thread. so this last thread work like 5-6 thread
I know that exactly because each Thread have it's own local ID which allow to manage them. So all old request have last ID

donkey

Sorry,

Just checked, wininet.dll is a known dll and calls to it cannot be redirected. You might try to recompile the import library using the ie6.dll library then use that to import the functions, here's the recompiled export library for ie6.dll.
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

bomz


bomz

   include ie6.inc
   includelib ie6.lib

thats wright?

The same result application works without ie6.dll

donkey

Not much I can think of then, known dlls are protected OS libraries and cannot be redirected as easily as most. It could be that some other DLL is importing the functions directly and the PE loader doesn't bother with the ie6.dll. If that's the case then there isn't anything you can do about it. Have you tried Dependency Walker on it ?
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

bomz

great thanks. so i try do this with socket without wininet or may be use async - not it emulation


bomz

May somebody explain me. I do HTTP with socket. I see request in HTTP analyzer and do the same. All is work OK, but I see small differences which I can't explain.

My program never have URL address with host here

Here IE8 have 3 string and my application only 2.



Quote
   invoke WSAStartup, 0101h, ADDR wsaData
   mov ax,0101h
   cmp ax, wsaData.wVersion
   jne NoTelnet
   invoke socket,AF_INET,SOCK_STREAM,IPPROTO_TCP
   mov s1,eax
   mov ax,AF_INET
   mov sin1.sin_family,ax
   invoke htons,80
   mov sin1.sin_port,ax

   invoke gethostbyname,offset URL   
   mov eax,[eax+12]
   mov eax,[eax]
   mov eax,[eax]
   mov sin1.sin_addr,eax

   invoke connect, s1, addr sin1, sizeof sockaddr_in

   invoke send, s1, addr Message, sizeof Message,0
   invoke recv, s1, addr String, 65536,0
   mov bytesRecieve, eax