"World's smallest Browser" and Windows XP

Just starting out? Need help? Post your questions and find answers here.
User avatar
Lord
Addict
Addict
Posts: 847
Joined: Tue May 26, 2009 2:11 pm

Re: "World's smallest Browser" and Windows XP

Post by Lord »

From german help file (PB 5.50 and 5.43LTS):
Systemvoraussetzungen

PureBasic läuft auf Windows XP, Windows Vista, Windows 7, Windows 8 und Windows 10, Linux (Kernel 2.2 oder höher) und MacOS X (10.6 oder höher).
So if ReceiveHTTPMemory() (and WebGadget()) works with https on Win7 it should also work with WinXP.
If this is not longer true, the help file schould be corrected.
Maybe Fred should clarify this situation?
Image
IdeasVacuum
Always Here
Always Here
Posts: 6425
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: "World's smallest Browser" and Windows XP

Post by IdeasVacuum »

Hi Lord

Is one of your customers friendly enough to test snippet executables for you? That at least ensures VM is not affecting anything.

I'm running Win7 32bit, which is as close as you can get to WinXP SP3 and your code does work perfectly well as you said (Tested PB 5.44LTS). Instead of ReceiveHTTPMemory, have you tried ReceiveHTTPFile?

Code: Select all

InitNetwork()

  sFilename.s = "C:\Test.txt"

  If ReceiveHTTPFile("https://das.familysearch.org/das/v2/dgs:004948415/size", sFilename)
       Debug "ReceiveHTTPFile Success"
  Else
       Debug "ReceiveHTTPFile Fail"
  EndIf

;------------------------------------------------------------------------------------------------

     *Buffer = ReceiveHTTPMemory("https://das.familysearch.org/das/v2/dgs:004948415/size")
  If *Buffer
       iSize.i = MemorySize(*Buffer)
       Debug "ReceiveHTTPMemory: " + PeekS(*Buffer, iSize, #PB_UTF8)
       FreeMemory(*Buffer)
  Else
       Debug "ReceiveHTTPMemory Fail"
  EndIf

End
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
Lord
Addict
Addict
Posts: 847
Joined: Tue May 26, 2009 2:11 pm

Re: "World's smallest Browser" and Windows XP

Post by Lord »

Hi IdeasVacuum!

I get the same results here on WinXP in VMware as the user with their WinXP:
Debugger wrote:ReceiveHTTPFile Fail
ReceiveHTTPMemory Fail
Image
IdeasVacuum
Always Here
Always Here
Posts: 6425
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: "World's smallest Browser" and Windows XP

Post by IdeasVacuum »

Using MesageRequester instead of Debug, I ran the code as an exe (Unicode, thread-safe, User Mode) on Win7-32, in WinXP SP2/3 compatibility mode, works perfectly.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
normeus
Enthusiast
Enthusiast
Posts: 414
Joined: Fri Apr 20, 2012 8:09 pm
Contact:

Re: "World's smallest Browser" and Windows XP

Post by normeus »

I know I have an XP machine at work which gets info from an https site. ( not at the office now so I cannot get more info)
It is using WGET with following dependencies :

Code: Select all

libcharset1.dll 
libeay32.dll 
libiconv2.dll 
libintl3.dll 
libssl32.dll 
openssl.exe 
wget .exe 

All these files are 2008 or older
You might be missing some of these to run CURL or maybe just download WGET and these files from gnu site:

http://gnuwin32.sourceforge.net/packages/wget.htm

Norm.
google Translate;Makes my jokes fall flat- Fait mes blagues tombent à plat- Machte meine Witze verpuffen- Eh cumpari ci vo sunari
User avatar
Lord
Addict
Addict
Posts: 847
Joined: Tue May 26, 2009 2:11 pm

Re: "World's smallest Browser" and Windows XP

Post by Lord »

Hi normeus!
normeus wrote:...

Code: Select all

libcharset1.dll 
libeay32.dll 
libiconv2.dll 
libintl3.dll 
libssl32.dll
...
You might be missing some of these to run CURL ...
None of these DLL cured the problem.

The Dependency Walker reports that these DLL are not found on WinXP:
Depemdency Walker wrote:API-MS-WIN-CORE-DELAYLOAD-L1-1-1.DLL
API-MS-WIN-CORE-ERRORHANDLING-L1-1-1.DLL
API-MS-WIN-CORE-HANDLE-L1-1-0.DLL
API-MS-WIN-CORE-HEAP-L2-1-0.DLL
API-MS-WIN-CORE-LIBRARYLOADER-L1-2-0.DLL
API-MS-WIN-CORE-MEMORY-L1-1-2.DLL
API-MS-WIN-CORE-PROCESSTHREADS-L1-1-2.DLL
API-MS-WIN-CORE-REGISTRY-L1-1-0.DLL
API-MS-WIN-CORE-RTLSUPPORT-L1-2-0.DLL
API-MS-WIN-CORE-STRING-L1-1-0.DLL
API-MS-WIN-CORE-SYNCH-L1-2-0.DLL
API-MS-WIN-CORE-SYSINFO-L1-2-1.DLL
API-MS-WIN-DOWNLEVEL-ADVAPI32-L1-1-0.DLL
API-MS-WIN-DOWNLEVEL-OLE32-L1-1-0.DLL
API-MS-WIN-DOWNLEVEL-SHLWAPI-L1-1-0.DLL
API-MS-WIN-SECURITY-BASE-L1-2-0.DLL
BCRYPT.DLL
CRYPTSP.DLL
NTASN1.DLL
All these seem to be for WinVista and up and not vor WinXP.

So it looks to me that PB gave up compability to WinXP.
Image
IdeasVacuum
Always Here
Always Here
Posts: 6425
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: "World's smallest Browser" and Windows XP

Post by IdeasVacuum »

Given the DLL dependencies, I think the best solution for now, if possible, is to use an earlier version of PB for the WinXP customers. Now, that might mean they cannot upgrade to a better version of your app without upgrading their Windows OS too, but that is pretty much the norm these days thanks to Microsoft's policy.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
Lord
Addict
Addict
Posts: 847
Joined: Tue May 26, 2009 2:11 pm

Re: "World's smallest Browser" and Windows XP

Post by Lord »

Now it's getting crazy.

Given this code:

Code: Select all

URL.s="https://das.familysearch.org/das/v2/dgs:004948415/size"
InitNetwork()

*Buffer = ReceiveHTTPMemory(URL)
If *Buffer
  Result.s=PeekS(*Buffer, MemorySize(*Buffer), #PB_UTF8)
  Debug Result
  FreeMemory(*Buffer)
Else
  Debug "No result"
EndIf
I saved it as "TestReceiveHTTPMemory.pb".

When I load and start it in debug mode in the IDE I get this error message:
---------------------------
PureBasic_Compilation1.exe - Systemfehler
---------------------------
Das Programm kann nicht gestartet werden, da api-ms-win-core-libraryloader-l1-2-0.dll auf dem Computer fehlt. Installieren Sie das Programm erneut, um das Problem zu beheben.
---------------------------
OK
---------------------------
That means: "system error, the program can't be started because api-ms-win-core-libraryloader-l1-2-0.dll is missing. Install program again (???)."
After clicking "OK" the debug output shows "No result".

When I copy the code above in an empty tab and and start it also in debug mode I get the expected result:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><nodeSize xmlns="http://digitalarchive.familysearch.org/v1" descendantCount="728" descendantSize="1410349511" size="21640625" upToDate="true"/>
:?: :?: :?:

This is true with PB5.43LTS(x86) and PB5.50(x86), both on Win7x64

But...
... using PB5.43LTS(x64) or PB5.50(x64) on Win7x64 doesn't show that error.

I always used only the x86-versions of PB in the last couple of weeks.

I searched on my system for "api-ms-win-core-libraryloader-l1-2-0.dll" but found none.
Only a couple of "api-ms-win-core-libraryloader-l1-1-0.dll" in "..\winsx\amd64.." and "..\winsx\amd86.." were found.

A system restore to some last restore points didn't solve this problem.

Can this behaviour be initiated by the "Dependency Walker"?
How can I get back my working system? :cry:
Image
normeus
Enthusiast
Enthusiast
Posts: 414
Joined: Fri Apr 20, 2012 8:09 pm
Contact:

Re: "World's smallest Browser" and Windows XP

Post by normeus »

Dependency walker would not change anything on your system.

I am wondering if you might just have to clear the dns cache on your computer.

in command prompt

Code: Select all

ipconfig /flushdns
it wont hurt and will give you a fresh start.
If you downloaded wget try this:

Code: Select all

wget -r --no-check-certificate --tries=10 https://das.familysearch.org/das/v2/dgs:004948415/size -o log.txt
it will create a log file and save the data it gets.

I will check our XP machine as soon as I can.

Norm.
google Translate;Makes my jokes fall flat- Fait mes blagues tombent à plat- Machte meine Witze verpuffen- Eh cumpari ci vo sunari
normeus
Enthusiast
Enthusiast
Posts: 414
Joined: Fri Apr 20, 2012 8:09 pm
Contact:

Re: "World's smallest Browser" and Windows XP

Post by normeus »

@lord,
It has to do with the type of certificate The website is using and the forwarding they do once you get there.
The easiest workaround I can think of is:

1 download a curl version which works on windowsXP:
http://www.paehl.com/open_source/?CURL_7.53.1
This one is compiled as a single file.
2 runprogram with:

Code: Select all

curl -k https://das.familysearch.org/das/v2/dgs:004948415/size
"-k" will tell it to ignore errors which in this occasion is fine because you know the site you are connecting to.
this option might be available using @infratec suggestion to use "libcurl.pbi" but I didn't have a chance to look at the code.
also you can download a certificate that will verify the certificate for that certain website. I don't think you want your users to do that but here are instructions in how to do it:
http://unitstep.net/blog/2009/05/05/usi ... ted-sites/


Norm.
google Translate;Makes my jokes fall flat- Fait mes blagues tombent à plat- Machte meine Witze verpuffen- Eh cumpari ci vo sunari
User avatar
ChrisR
Addict
Addict
Posts: 1127
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Re: "World's smallest Browser" and Windows XP

Post by ChrisR »

Rather than Dependency Walker, I would use Process Monitor for my part, with a filter on Create File API.
User avatar
ChrisR
Addict
Addict
Posts: 1127
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Re: "World's smallest Browser" and Windows XP

Post by ChrisR »

Curl seems better but If it can help, here is an old version of WGet v1.11.4 that should run trouble-free on XP
With dependencies: libeay32.dll, ssleay32.dll and msvcr71.dll
(MS allows redistribution of msvcr71.dll with the application that requires: http://support.microsoft.com/kb/326922)
WGet_v1.11.4.zip
User avatar
Lord
Addict
Addict
Posts: 847
Joined: Tue May 26, 2009 2:11 pm

Re: "World's smallest Browser" and Windows XP

Post by Lord »

@normeus:
normeus wrote:...
in command prompt

Code: Select all

ipconfig /flushdns
it wont hurt and will give you a fresh start.
...
You are right. It doesn't hurt, but it doesn't help also. :cry:

normeus wrote:...
If you downloaded wget try this:

Code: Select all

wget -r --no-check-certificate --tries=10 https://das.familysearch.org/das/v2/dgs:004948415/size -o log.txt
it will create a log file and save the data it gets.
...
wget works:
wget log file wrote:--2017-03-29 07:49:55-- https://das.familysearch.org/das/v2/dgs:004948415/size
Auflösen des Hostnamen »das.familysearch.org«.... 204.9.224.34
Verbindungsaufbau zu das.familysearch.org|204.9.224.34|:443... verbunden.
WARNUNG: Kann das Zertifikat von »das.familysearch.org« nicht prüfen, ausgestellt von »/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert SHA2 High Assurance Server CA«:.
Die Authorität des Ausstellers des Zertifikates kann lokal nicht geprüft werden.
HTTP Anforderung gesendet, warte auf Antwort... 200
Länge: 198 [application/familysearch+xml]
In »das.familysearch.org/das/v2/dgs%3A004948415/size« speichern.

0K 100% 64,5M=0s

2017-03-29 07:49:56 (64,5 MB/s) - »das.familysearch.org/das/v2/dgs%3A004948415/size« gespeichert [198/198]

BEENDET --2017-03-29 07:49:56--
Geholt: 1 Dateien, 198 in 0s (64,5 MB/s)
Result:
size wrote:<?xml version="1.0" encoding="UTF-8" standalone="yes"?><nodeSize xmlns="http://digitalarchive.familysearch.org/v1" descendantCount="728" descendantSize="1410349511" size="21640625" upToDate="true"/>
Image
User avatar
Lord
Addict
Addict
Posts: 847
Joined: Tue May 26, 2009 2:11 pm

Re: "World's smallest Browser" and Windows XP

Post by Lord »

@ ChrisR, normeus, IdeasVacuum, infratec and all the others

I think we should take a brake and recapitulate bevore moving on.

What is the situation now?

Given is this code snippet:

Code: Select all

URL.s="https://das.familysearch.org/das/v2/dgs:004948415/size"
InitNetwork()

*Buffer = ReceiveHTTPMemory(URL)
If *Buffer
  Result.s=PeekS(*Buffer, MemorySize(*Buffer), #PB_UTF8)
  FreeMemory(*Buffer)
Else
  Result="No result"
EndIf

MessageRequester("", Result)
There are 3 possibilities to execute this code:
1. Pasting the snippet in a "New" tab of the PB IDE and hitting F5
2. Pasting the snippet in a "New" tab of the PB IDE, saving the code as "TestReceiveHTTPMemory.pb" and then hitting F5
3. Pasting the snippet in a "New" tab of the PB IDE, saving the code as "TestReceiveHTTPMemory.pb", building an executable "TestReceiveHTTPMemory.exe" and then starting this exe.

What's the outcome?
I tried the above 3 variants on different versions of PB:
A. PB5.50(x86)
B. PB5.50(x64)
C. PB5.43LTS(x86)
D. PB5.43LTS(x64)
E. PB5.40LTS(x86)
F. PB5.40LTS(x64)

The result is:

Code: Select all

     A    B    C    D    E    F
1   OK   OK   OK   OK   OK   OK
2   err  OK   err  OK   err  OK
3   err  OK   err  OK   err  OK
err means:
First an Error message:
---------------------------
PureBasic_Compilation1.exe - Systemfehler
---------------------------
Das Programm kann nicht gestartet werden, da api-ms-win-core-libraryloader-l1-2-0.dll auf dem Computer fehlt. Installieren Sie das Programm erneut, um das Problem zu beheben.
---------------------------
OK
---------------------------
and then the message requester showing "No result".

Remember, the system error message started to show up after I used the Dependency Walker.
Before that I noticed "only" that ReceiveHTTPMemeory() and WebGadget() weren't able to get HTTPS pages. (I now know, that this is only true on PB(x86) versions).
And this was after I was informed, that some customers (using XP) couldn't use my program anymore.

So it looks to me that there are 2 problems to solve:
1. get rid of this system error message on x86
2. get x86 code to work again with https as it does with x64

Some more information.
Before ReceiveHTTPMemory() was intuduced (PB5.40LTS ?), I used GetHTTPFile.pbi by HeX0R: http://www.purebasic.fr/german/viewtopi ... =8&t=23478
I digged out some older versions of my program (~2012) and run the code on PB 5.50(x86): no system error message, results are shown.

So the question is: what happend? How can I solve this mess?
Image
IdeasVacuum
Always Here
Always Here
Posts: 6425
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: "World's smallest Browser" and Windows XP

Post by IdeasVacuum »

Focusing on the system error message:

i) The error message only displayed since the time Dependency Walker was installed.
ii) The message is only displayed when running the test code on WinXP x86 (in a VM on Win7 x64).

Lord, are you using Dependency Walker v2.2? I ask because that version became more dependent on the Web itself:
http://www.dependencywalker.com/
Moved to new HTML help system and updated the help text.
Added support for MSDN 8.0 external help and updated the online help URL.
So, it is possible that the Dependency Walker installer updates one or two OS files, hence the system now essentially gives more information about faults on x86. Not necessarily a bad thing, but if you are still concerned, does uninstalling Dependency Walker return your system status quo?

In my view, the differences between the methods (1, 2 and 3) used to run the test code should not produce different results for the same OS version. That is weird and I can't think of an explanation for it because in each case PB makes an exe.
Curiosity: What happens if you run the temp exe (PureBasic_Compilation0.exe) produced by method 1, independent of the PB IDE?

As I understand it, your customers that use WinXPx86 get the failure, but not the system error message, so that too points to Dependency Walker making a small OS update. It is also possible that running a VM is not 100% the same as using a 'native' WinXP x86 PC......
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
Post Reply