DroopyLib

Developed or developing a new product in PureBasic? Tell the world about it.
SeregaZ
Enthusiast
Enthusiast
Posts: 628
Joined: Fri Feb 20, 2009 9:24 am
Location: Almaty (Kazakhstan. not Borat, but Triple G)
Contact:

Re: DroopyLib

Post by SeregaZ »

i cant find UserLibUnicodeThreadSafe... in old 4.30 Droopy version it is present, in 4.61 version is not :(
User avatar
Droopy
Enthusiast
Enthusiast
Posts: 658
Joined: Thu Sep 16, 2004 9:50 pm
Location: France
Contact:

Re: DroopyLib

Post by Droopy »

i cant find UserLibUnicodeThreadSafe... in old 4.30 Droopy version it is present, in 4.61 version is not
The version 4.30 is managed by Lexvictory.
I don't know how to manage Unicode & ThreadSafe :(
User avatar
Sveinung
Enthusiast
Enthusiast
Posts: 142
Joined: Tue Oct 07, 2003 11:03 am
Location: Bergen, Norway

Re: DroopyLib

Post by Sveinung »

Here is both x64 and x86 with unicode & treadsafe.
http://www.sherrox.com/droopy.rar

Regards
Sveinung
SeregaZ
Enthusiast
Enthusiast
Posts: 628
Joined: Fri Feb 20, 2009 9:24 am
Location: Almaty (Kazakhstan. not Borat, but Triple G)
Contact:

Re: DroopyLib

Post by SeregaZ »

thanks a lot :)
User avatar
Sveinung
Enthusiast
Enthusiast
Posts: 142
Joined: Tue Oct 07, 2003 11:03 am
Location: Bergen, Norway

Re: DroopyLib

Post by Sveinung »

Droopy wrote:
i cant find UserLibUnicodeThreadSafe... in old 4.30 Droopy version it is present, in 4.61 version is not
The version 4.30 is managed by Lexvictory.
I don't know how to manage Unicode & ThreadSafe :(
But you know how to make a very good and usefull lib :lol:

Sveinung
User avatar
Droopy
Enthusiast
Enthusiast
Posts: 658
Joined: Thu Sep 16, 2004 9:50 pm
Location: France
Contact:

Re: DroopyLib

Post by Droopy »

26/06/12 : Library 4.61.002
'Tailbite MultiLib Compile Mode' Unicode & ThreadSafe options can be checked in compiler options
First Compilation with PbFastLib 2
First version of the x64 version
Version supporting Unicode and ThreadSafe avalaible
Version x64 avalaible

Thanks to Sveinung and Lexvitory
SeregaZ
Enthusiast
Enthusiast
Posts: 628
Joined: Fri Feb 20, 2009 9:24 am
Location: Almaty (Kazakhstan. not Borat, but Triple G)
Contact:

Re: DroopyLib

Post by SeregaZ »

hey! where is thanks for me? :) i am starting this research :)
Korolev Michael
Enthusiast
Enthusiast
Posts: 200
Joined: Wed Feb 01, 2012 5:30 pm
Location: Russian Federation

Re: DroopyLib

Post by Korolev Michael »

x86 version incorrectly works in Unicode mode. Check it out.

Code: Select all

#Version$="200"
RegCreateKeyValue("HKEY_CURRENT_USER\SOFTWARE\Vendor\TestApp","Version",#Version$,#REG_SZ,".")
Registry entry will be "20" instead of "200"

Edit:
Just looked into source of Droopy lib. Unocode symbols are coded by 2 bytes. So, next sequence:

Code: Select all

Case #REG_SZ
  GetHandle = RegSetValueEx_(hKey, ValueName, 0, #REG_SZ, @Value, Len(Value) + 1) 
is incorrect. In cases of "unicoding " you need to multiply length of value by 2.
Former user of pirated PB.
Now registered user :].
SeregaZ
Enthusiast
Enthusiast
Posts: 628
Joined: Fri Feb 20, 2009 9:24 am
Location: Almaty (Kazakhstan. not Borat, but Triple G)
Contact:

Re: DroopyLib

Post by SeregaZ »

GetPidProcess in unicode didnt working too :(

as i see in source this code:
Nom.s=UCase(PeekS(@Process\szExeFile))

must become to:
Nom.s=UCase(PeekS(@Process\szExeFile, Len(Name.s), #PB_UTF8))

i am right?
Korolev Michael
Enthusiast
Enthusiast
Posts: 200
Joined: Wed Feb 01, 2012 5:30 pm
Location: Russian Federation

Re: DroopyLib

Post by Korolev Michael »

Yep.

Offtop SeregaZ, выучи уже английский, не позорься.
Former user of pirated PB.
Now registered user :].
SeregaZ
Enthusiast
Enthusiast
Posts: 628
Joined: Fri Feb 20, 2009 9:24 am
Location: Almaty (Kazakhstan. not Borat, but Triple G)
Contact:

Re: DroopyLib

Post by SeregaZ »

i am studied German language at school... so i have a discounts
User avatar
Droopy
Enthusiast
Enthusiast
Posts: 658
Joined: Thu Sep 16, 2004 9:50 pm
Location: France
Contact:

Re: DroopyLib

Post by Droopy »

I have to contact the author of the Tailbite 'MultiLib Compile Mode' to understand howto make this library a real unicode library
(I just compile the library with this option :oops: )
ABBKlaus
Addict
Addict
Posts: 1143
Joined: Sat Apr 10, 2004 1:20 pm
Location: Germany

Re: DroopyLib

Post by ABBKlaus »

There is nothing wrong with TailBite, you are using the ASCII versions of the Windows-API and your structure definition is wrong !

Code: Select all

Procedure.l GetProcessPID(Processname.s,CaseSensitive=#False) ; get PID from the Processname
  ;// Author : Fred
  Protected Kernel32dll,CreateToolhelpSnapshot,ProcessFirst,ProcessNext,Process.PROCESSENTRY32,Snapshot,ProcessFound,Pid
  
  Kernel32dll=OpenLibrary(#PB_Any, "Kernel32.dll") 
  If Kernel32dll
    CreateToolhelpSnapshot = GetFunction(Kernel32dll, "CreateToolhelp32Snapshot") 
    CompilerIf #PB_Compiler_Unicode=0
      ProcessFirst = GetFunction(Kernel32dll, "Process32First") 
      ProcessNext  = GetFunction(Kernel32dll, "Process32Next") 
    CompilerElse
      ProcessFirst = GetFunction(Kernel32dll, "Process32FirstW")
      ProcessNext  = GetFunction(Kernel32dll, "Process32NextW")
    CompilerEndIf
    If CreateToolhelpSnapshot And ProcessFirst And ProcessNext ; Ensure than all the functions are found
      Process.PROCESSENTRY32\dwSize = SizeOf(PROCESSENTRY32)
      Snapshot = CallFunctionFast(CreateToolhelpSnapshot, #TH32CS_SNAPPROCESS, 0)
      If Snapshot <> #INVALID_HANDLE_VALUE
        ProcessFound = CallFunctionFast(ProcessFirst, Snapshot, Process)
        While ProcessFound
          Debug PeekS(@Process\szExeFile)
          If CaseSensitive
            If PeekS(@Process\szExeFile)=Processname
              Pid=Process\th32ProcessID
              Break
            EndIf
          Else
            If LCase(PeekS(@Process\szExeFile))=LCase(Processname)
              Pid=Process\th32ProcessID
              Break
            EndIf
          EndIf
          ProcessFound = CallFunctionFast(ProcessNext, Snapshot, Process) 
        Wend 
      EndIf 
      CloseHandle_(Snapshot) 
    EndIf 
    CloseLibrary(Kernel32dll)
  EndIf
  
  ProcedureReturn Pid
EndProcedure
Last edited by ABBKlaus on Wed Jul 18, 2012 9:25 am, edited 1 time in total.
User avatar
Droopy
Enthusiast
Enthusiast
Posts: 658
Joined: Thu Sep 16, 2004 9:50 pm
Location: France
Contact:

Re: DroopyLib

Post by Droopy »

There is nothing wrong with TailBite, you are using the ASCII versions of the Windows-API and your structure definition is wrong !
I know TB is ok, i just search how to return ascii or unicode string when necessary (according compiler options)
Regards
SeregaZ
Enthusiast
Enthusiast
Posts: 628
Joined: Fri Feb 20, 2009 9:24 am
Location: Almaty (Kazakhstan. not Borat, but Triple G)
Contact:

Re: DroopyLib

Post by SeregaZ »

so when we can expect small update with fix our two bugs with GetPidProcess and registry functions?
Post Reply