Page 4 of 13

Re: DroopyLib

Posted: Fri Jun 22, 2012 7:41 am
by SeregaZ
i cant find UserLibUnicodeThreadSafe... in old 4.30 Droopy version it is present, in 4.61 version is not :(

Re: DroopyLib

Posted: Fri Jun 22, 2012 9:37 pm
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 :(

Re: DroopyLib

Posted: Fri Jun 22, 2012 11:18 pm
by Sveinung
Here is both x64 and x86 with unicode & treadsafe.
http://www.sherrox.com/droopy.rar

Regards
Sveinung

Re: DroopyLib

Posted: Sat Jun 23, 2012 7:44 am
by SeregaZ
thanks a lot :)

Re: DroopyLib

Posted: Sat Jun 23, 2012 9:18 am
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

Re: DroopyLib

Posted: Tue Jun 26, 2012 1:06 pm
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

Re: DroopyLib

Posted: Wed Jun 27, 2012 9:05 am
by SeregaZ
hey! where is thanks for me? :) i am starting this research :)

Re: DroopyLib

Posted: Fri Jul 06, 2012 4:14 am
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.

Re: DroopyLib

Posted: Sun Jul 15, 2012 4:01 pm
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?

Re: DroopyLib

Posted: Mon Jul 16, 2012 1:32 am
by Korolev Michael
Yep.

Offtop SeregaZ, выучи уже английский, не позорься.

Re: DroopyLib

Posted: Mon Jul 16, 2012 10:17 am
by SeregaZ
i am studied German language at school... so i have a discounts

Re: DroopyLib

Posted: Mon Jul 16, 2012 9:09 pm
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: )

Re: DroopyLib

Posted: Tue Jul 17, 2012 8:00 am
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

Re: DroopyLib

Posted: Tue Jul 17, 2012 10:44 am
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

Re: DroopyLib

Posted: Tue Jul 17, 2012 11:47 am
by SeregaZ
so when we can expect small update with fix our two bugs with GetPidProcess and registry functions?