AutoHotkey Community

It is currently May 27th, 2012, 10:20 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 82 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6
Author Message
 Post subject:
PostPosted: June 30th, 2007, 12:14 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
Dlls should not be used for StdLib unless they are core system components like common controls....

Still, we can make all those nice fast functions that differe available for User library.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 30th, 2007, 1:19 pm 
Offline
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8776
Laszlo wrote:
Edit: Sorry, .NET was part of the SW packet, which came with the PC, so I do have it.


How to find if it is pre-installed in WinXP SP2 ?
I have: Crypt32.dll , Version 5.131.2600.2180, Created: Tuesday, August 03, 2004
Add / Remove program does not show a trace of .NET

Your function runs perfectly in Windows XP SP2
and also in Windows 2000 SP2 if I provide the fullpath in DllCall().
I found .NET 2.0 was installed along with VC++ 2005 express edition,
So I uninstalled it as well as .NET and rechecked to find the function working.

In Windows 98 SE, I get a blank DllCall() with an errorlevel of -3

:)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 30th, 2007, 1:31 pm 
Offline
User avatar

Joined: August 11th, 2004, 1:47 am
Posts: 5347
Location: UK
I don't think uninstallling .NET will remove updated versions of shared libraries like cryptlib.dll. My version probably only works on Vista, could you confirm please? :/

_________________
GitHubScriptsIronAHK Contact by email not private message.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 30th, 2007, 1:55 pm 
Offline

Joined: March 16th, 2005, 10:33 pm
Posts: 969
Location: Frisia
Quite a mess. With the help of this MS Knowledgebase article and some searching, I've created a list of the probable different versions on the different Windows OSses.

Windows 95: ???
Windows 98: 5.131.1878.12
Windows ME: 5.131.2133.6
Windows NT 4: 5.131.1878.12
Windows 2K SP2 & SP3: 5.131.2195.6072 or 5.131.2195.6661
Windows 2K SP4: 5.131.2195.6926
Windows XP: 5.131.2600.1123
Windows XP SP2: 5.131.2600.2180

Other possible version numbers I found are: 5.131.2173.1, 5.131.2195.4558, 5.131.3790.2548, 5.131.3790.1830, 5.131.3790.1433, 5.131.1880.14

No idea which versions support which functions.

_________________
Image mirror 1mirror 2mirror 3ahk4.me • PM or Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 30th, 2007, 5:08 pm 
Offline
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8776
Titan wrote:
I don't think uninstallling .NET will remove updated versions of shared libraries like cryptlib.dll.
My version probably only works on Vista, could you confirm please? :/


For me, Win2k is setup in D:\ with the dll path as D:\WINNT\System32\Crypt32.dll and does not have the CryptBinaryToStringA function in it. I checked again with the following code in which I am calling the DLL function of WinXP SP2 :

Code:
FileRead, binData, %A_AhkPath%
BinaryToString( Str, binData )
MsgBox, % Str

BinaryToString(ByRef str, ByRef bin, base64 = true, sz = -1) {
   cp := VarSetCapacity(str, VarSetCapacity(bin) * (base64 ? 1.42 : 3.125))
   DllCall("E:\Windows\System32\Crypt32.dll\CryptBinaryToStringA", "UInt", &bin
      , "UInt", sz > 0 ? sz : VarSetCapacity(bin)
      , "UInt", base64 ? 1 : 4, "UInt", &str, "UInt", &cp), VarSetCapacity(str, -1)
   If !base64
      str := RegExReplace(str, "S)\s|0*$")
}



I am not sure but I think I do not find a trace of .NET in my Windows XP setup in which Laszlo's code runs as expected :roll:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 30th, 2007, 7:28 pm 
Offline

Joined: February 14th, 2005, 4:05 pm
Posts: 4710
Location: Boulder, CO
Could you MsgBox the ErrorLevel just after the dll call for CryptBinaryToStringA? -3 means the dll is not found, -4 means the function is not exported by the dll. In this later case, you could try to drop the trailing A from CryptBinaryToStringA (CryptBinaryToString), which should be the name on Windows versions prior to Unicode support.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 14th, 2011, 10:44 am 
After all these years, I found a bug in the Mem_Bin2Hex function.
If there is a null byte in the @bin data, the function fails.

original code:
Code:
Mem_Bin2Hex(ByRef @hexString, @bin, _byteNb=0){

fixed code:
Code:
Mem_Bin2Hex(ByRef @hexString, byref @bin, _byteNb=0){


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 82 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6

All times are UTC [ DST ]


Who is online

Users browsing this forum: specter333, XX0 and 25 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group