It is currently Wed Jun 19, 2013 1:35 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 136 posts ]  Go to page Previous  1, 2, 3, 4, 5 ... 10  Next
Author Message
 Post subject: Re: DroopyLib
PostPosted: Wed Jul 20, 2011 9:48 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Thu Sep 16, 2004 9:50 pm
Posts: 617
Location: France
Frontier wrote:
Any plans to provide a library for the 64-bit version of PureBasic?

I have no plan for x64 yet.

_________________
DroopyLib & PBFastLib


Top
 Profile  
 
 Post subject: Re: DroopyLib
PostPosted: Fri Jul 22, 2011 4:20 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Thu Sep 16, 2004 9:50 pm
Posts: 617
Location: France
22/07/11 : Library 4.51.008
Code:
MozillaPreferenceLoad() added
MozillaPreferenceSave() added
MozillaPreferenceSet() added
MozillaPreferenceGet() added
MozillaPreferencePrejsJsPath() added
MozillaPath() added
MozillaExtensionName() added
MozillaExtensionVersion() added

_________________
DroopyLib & PBFastLib


Top
 Profile  
 
 Post subject: Re: DroopyLib
PostPosted: Sat Aug 27, 2011 8:32 pm 
Offline
User
User

Joined: Mon Jun 06, 2011 8:28 am
Posts: 13
error with WMI (droopy lib) ,when I compile with unicode ... WMI give error : [ERROR] Invalid memory access. (Read error at address 0) ... why ?

Code:
;{ WMI2 CONSTANT FUNCTIONS STRUCTURES
#VT_EMPTY = 0
#VT_NULL = 1
#VT_I2 = 2
#VT_I4 = 3
#VT_R4 = 4
#VT_R8 = 5
#VT_CY = 6
#VT_DATE = 7
#VT_BSTR = 8
#VT_DISPATCH = 9
#VT_ERROR = 10
#VT_BOOL = 11
#VT_VARIANT = 12
#VT_UNKNOWN = 13
#VT_DECIMAL = 14
#VT_I1 = 16
#VT_UI1 = 17
#VT_UI2 = 18
#VT_UI4 = 19
#VT_I8 = 20
#VT_UI8 = 21
#VT_INT = 22
#VT_UINT = 23
#VT_VOID = 24
#VT_HRESULT = 25
#VT_PTR = 26
#VT_SAFEARRAY = 27
#VT_CARRAY = 28
#VT_USERDEFINED = 29
#VT_LPSTR = 30
#VT_LPWSTR = 31
#VT_RECORD = 36
#VT_INT_PTR = 37
#VT_UINT_PTR = 38
#VT_FILETIME = 64
#VT_BLOB = 65
#VT_STREAM = 66
#VT_STORAGE = 67
#VT_STREAMED_OBJECT = 68
#VT_STORED_OBJECT = 69
#VT_BLOB_OBJECT = 70
#VT_CF = 71
#VT_CLSID = 72
#VT_VERSIONED_STREAM = 73
#VT_BSTR_BLOB = $FFF
#VT_VECTOR = $1000
#VT_ARRAY = $2000
#VT_BYREF = $4000
#VT_RESERVED = $8000
#VT_ILLEGAL = $FFFF
#VT_ILLEGALMASKED = $FFF
#VT_TYPEMASK = $FFF
#COINIT_MULTITHREAD = 0
#RPC_C_AUTHN_LEVEL_CONNECT = 2
#RPC_C_IMP_LEVEL_IDENTIFY = 2
#EOAC_NONE = 0
#RPC_C_AUTHN_WINNT = 10
#RPC_C_AUTHZ_NONE = 0
#RPC_C_AUTHN_LEVEL_CALL = 3
#RPC_C_IMP_LEVEL_IMPERSONATE = 3
#CLSCTX_INPROC_SERVER = 1
#wbemFlagReturnImmediately = 16
#wbemFlagForwardOnly = 32
#IFlags = #wbemFlagReturnImmediately + #wbemFlagForwardOnly
#WBEM_INFINITE = $FFFFFFFF
#VARIANT_FALSE = $0000
#WMISeparator = ","
;}

Structure BRECORD 
  pvRecord.l;
  IRecordInfo.l
EndStructure

Structure SIGNSCALE
  scale.b
  sign.b
EndStructure

Structure DECIMAL
  wReserved.w
  signscale.SIGNSCALE
  high32.l
  low64.Double
EndStructure
 
Structure pToVariant 
  a.l
  b.l
  c.l
  d.l
EndStructure

ProcedureDLL.l Ansi2Uni(string.s) ; Converts normal (Ansi) string To Unicode
  *out = AllocateMemory(Len(string)*4)
  MultiByteToWideChar_(#CP_ACP, 0, string, -1, *out, Len(string)) 
  ProcedureReturn *out 
EndProcedure

; ProcedureDLL.s Uni2Ansi(Pointer) ; Converts Unicode to normal (Ansi) string
;   Buffer.s=Space(512)
;   WideCharToMultiByte_(#CP_ACP,0,Pointer,-1,@Buffer,512,0,0)
;   ProcedureReturn Buffer
; EndProcedure


Procedure.s ipf_Uni2Ansi(Pointer) ; Converts Unicode to normal (Ansi) string
  Buffer.s=Space(512)
  WideCharToMultiByte_(#CP_ACP,0,Pointer,-1,@Buffer,512,0,0)
  ProcedureReturn Buffer
EndProcedure

ProcedureDLL.s Uni2Ansi(Pointer) ; Converts Unicode to normal (Ansi) string
  ProcedureReturn ipf_Uni2Ansi(Pointer)
EndProcedure




Procedure.s WMI2(WMICommand.s) ; Interrogate WMI2 Database
 
  ;// MSDN : http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnanchor/html/anch_wmi.asp
 
  ;- WMI2 Initialize
  CoInitializeEx_(0,#COINIT_MULTITHREAD)
  hres=CoInitializeSecurity_(0, -1,0,0,#RPC_C_AUTHN_LEVEL_CONNECT,#RPC_C_IMP_LEVEL_IDENTIFY,0,#EOAC_NONE,0)
  If hres <> 0: MessageRequester("ERROR", "unable to call CoInitializeSecurity", #MB_OK)
    CoUninitialize_()
    ProcedureReturn wmi$
  EndIf
  hres=CoCreateInstance_(?CLSID_WbemLocator,0,#CLSCTX_INPROC_SERVER,?IID_IWbemLocator,@loc.IWbemLocator)
  If hres <> 0: MessageRequester("ERROR", "unable to call CoCreateInstance", #MB_OK)
    loc\release()
    CoUninitialize_()
    ProcedureReturn wmi$
  EndIf
  hres=loc\ConnectServer(Ansi2Uni("root\cimv2"),0,0,0,0,0,0,@svc.IWbemServices)
  If hres <> 0: MessageRequester("ERROR", "unable to call IWbemLocator::ConnectServer", #MB_OK)
    [color=#FF0000]svc\release()[/color]
    loc\release()
    CoUninitialize_()
    ProcedureReturn wmi$
  EndIf
  hres=svc\queryinterface(?IID_IUnknown,@pUnk.IUnknown)
  hres=CoSetProxyBlanket_(svc,#RPC_C_AUTHN_WINNT,#RPC_C_AUTHZ_NONE,0,#RPC_C_AUTHN_LEVEL_CALL,#RPC_C_IMP_LEVEL_IMPERSONATE,0,#EOAC_NONE)
  If hres <> 0: MessageRequester("ERROR", "unable to call CoSetProxyBlanket", #MB_OK)
    svc\release()
    loc\release()
    CoUninitialize_()
    ProcedureReturn wmi$
  EndIf
  hres=CoSetProxyBlanket_(pUnk,#RPC_C_AUTHN_WINNT,#RPC_C_AUTHZ_NONE,0,#RPC_C_AUTHN_LEVEL_CALL,#RPC_C_IMP_LEVEL_IMPERSONATE,0,#EOAC_NONE)
  If hres <> 0: MessageRequester("ERROR", "unable to call CoSetProxyBlanket", #MB_OK)
    svc\release()
    loc\release()
    CoUninitialize_()
    ProcedureReturn wmi$
  EndIf
  pUnk\release()
 
 
  ;- CallData
  k=CountString(WMICommand,#WMISeparator)
  Dim wmitxt$(k)
  For i=0 To k
    wmitxt$(i) = Trim(StringField(WMICommand,i+1,#WMISeparator))
  Next
 
  hres=svc\ExecQuery(Ansi2Uni("WQL"),Ansi2Uni(wmitxt$(0)), #IFlags,0,@pEnumerator.IEnumWbemClassObject)
  If hres <> 0: MessageRequester("ERROR", "unable to call IWbemServices::ExecQuery", #MB_OK)
    svc\Release()
    loc\Release()
    pEnumerator\Release()
    CoUninitialize_()
    ProcedureReturn wmi$
  EndIf
  hres=pEnumerator\reset()
  Repeat
  hres=pEnumerator\Next(#WBEM_INFINITE, 1, @pclsObj.IWbemClassObject, @uReturn)
  For i=1 To k
    hres=pclsObj\get(Ansi2Uni(wmitxt$(i)), 0, @x.Variant, 0, 0)
   
    Type=x\vt
   
    Select Type
       
      Case 8200
        val.s=""
        nDim=SafeArrayGetDim_(x\lVal)
        SafeArrayGetUBound_(x\lVal, nDim, @plUbound)
        ;Dim rgVar(plUbound)
        For z=0 To plUbound
          SafeArrayGetElement_(x\lVal, @z, @rgVar)
          val.s=val.s+", "+ipf_Uni2Ansi(rgVar)
        Next
        val.s=Mid(val.s, 3, Len(val.s))
       
      Case 8195
        val.s=""
        nDim=SafeArrayGetDim_(x\scode)
        SafeArrayGetUBound_(x\scode, nDim, @plUbound)
        ;Dim rgVar(plUbound)
        For z=0 To plUbound
          SafeArrayGetElement_(x\scode, @z, @rgVar)
          val.s=val.s + ", " +  Str(rgVar)
        Next
        val.s=Mid(val.s, 3, Len(val.s))
       
      Case 11
        If x\boolVal=0
          val.s="FALSE"
        ElseIf x\boolVal=-1
          val.s="TRUE"
        EndIf
       
      Case 8
        val.s=ipf_Uni2Ansi(x\bstrVal)
       
      Case 3
        val.s=Str(x\lVal)
       
      Case 1
        val.s="n/a"
       
      Default
        val.s=""
       
    EndSelect
    If uReturn <> 0: wmi$=wmi$+wmitxt$(i)+" = "+val+Chr(10)+Chr(13): EndIf
  Next
Until uReturn = 0

;- Cleanup
svc\release()
loc\release()
pEnumerator\release()
pclsObj\release()
CoUninitialize_()
ProcedureReturn wmi$

EndProcedure




MessageRequester("WMI",WMI2("Select * FROM Win32_OperatingSystem,Name,CSDVersion,SerialNumber,RegisteredUser,Organization"))



;- Data
DataSection
  CLSID_IEnumWbemClassObject:
  ;1B1CAD8C-2DAB-11D2-B604-00104B703EFD
  Data.l $1B1CAD8C
  Data.w $2DAB, $11D2
  Data.b $B6, $04, $00, $10, $4B, $70, $3E, $FD
  IID_IEnumWbemClassObject:
  ;7C857801-7381-11CF-884D-00AA004B2E24
  Data.l $7C857801
  Data.w $7381, $11CF
  Data.b $88, $4D, $00, $AA, $00, $4B, $2E, $24
  CLSID_WbemLocator:
  ;4590f811-1d3a-11d0-891f-00aa004b2e24
  Data.l $4590F811
  Data.w $1D3A, $11D0
  Data.b $89, $1F, $00, $AA, $00, $4B, $2E, $24
  IID_IWbemLocator:
  ;dc12a687-737f-11cf-884d-00aa004b2e24
  Data.l $DC12A687
  Data.w $737F, $11CF
  Data.b $88, $4D, $00, $AA, $00, $4B, $2E, $24
  IID_IUnknown:
  ;00000000-0000-0000-C000-000000000046
  Data.l $00000000
  Data.w $0000, $0000
  Data.b $C0, $00, $00, $00, $00, $00, $00, $46
 
EndDataSection



hres=loc\ConnectServer(Ansi2Uni("root\cimv2"),0,0,0,0,0,0,@svc.IWbemServices)
If hres <> 0: MessageRequester("ERROR", "unable to call IWbemLocator::ConnectServer", #MB_OK)
svc\release()
loc\release()
........
> purebasic 4.51(x86).


Top
 Profile  
 
 Post subject: Re: DroopyLib
PostPosted: Sat Aug 27, 2011 9:21 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Thu Sep 16, 2004 9:50 pm
Posts: 617
Location: France
I don't use unicode and don't support unicode.
Sorry

_________________
DroopyLib & PBFastLib


Top
 Profile  
 
 Post subject: Re: DroopyLib
PostPosted: Sun Aug 28, 2011 9:21 am 
Offline
User
User

Joined: Mon Jun 06, 2011 8:28 am
Posts: 13
can you fix it ,I need WMI (but in Unicode) .. thx.

ps: older version of droopy lib .. is working in unicode fine (Droopy Library v1.31.14 ) ... but I need some function from new Lib ..


Top
 Profile  
 
 Post subject: Re: DroopyLib
PostPosted: Tue Aug 30, 2011 8:34 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Thu Sep 16, 2004 9:50 pm
Posts: 617
Location: France
Version 4.51.012 avalaible
Quote:
29/08/11 : Library 4.51.012
UnixToMSDosDate() added
MSDosDateToUnix() added
UnZip() added
SevenSegmentLed() added
SevenSegmentLedSet() added
SevenSegmentLedGet() added
GetShortPathName() added
GetLongPathName() added
22/08/11 : Library 4.51.011
MSIEnumInit() added
MSIEnumNext() added
MSIEnum_ProductName() added
MSIEnum_Version() added
MSIEnum_Guid() added
MSIVersion() added
MSIGuid() added
08/08/11 : Library 4.51.010
UserShellFolder() Deleted (buggy)
ExpandEnvironmentString() added
ProfilePath() added
08/08/11 : Library 4.51.009
MozillaPreferencePrejsJsPath renamed MozillaPreferencePath
MozillaPreferenceBackup() added

_________________
DroopyLib & PBFastLib


Top
 Profile  
 
 Post subject: Re: DroopyLib
PostPosted: Tue Aug 30, 2011 2:42 pm 
Offline
User
User
User avatar

Joined: Mon Dec 15, 2008 11:15 pm
Posts: 81
Location: Nashville, TN
Wow, do you EVER rest at all Droopy ? :shock: Lots of updates lately, been making lots of little demo programs just to test out the new library features.


Top
 Profile  
 
 Post subject: Re: DroopyLib
PostPosted: Sun Sep 18, 2011 3:19 pm 
Offline
User
User

Joined: Sun Nov 07, 2004 9:57 pm
Posts: 29
I am running PB 4.51 64bit and I love your lib. I was running the older verison and there were something that were not working so I finaly upgraded to the latest version but now when ever use any of the lib functions I get the following error:

Code:
Linker error:
POLINK:fatal error:Corrupt Library:'.\Droopy.lib'


I have tried download it a couple of time and even clicked on the link in the help menu to get latest version and I keep getting the same error. How to I fix the error or does this version not run in PB 64bit?


Top
 Profile  
 
 Post subject: Re: DroopyLib
PostPosted: Sun Sep 18, 2011 8:47 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Thu Sep 16, 2004 9:50 pm
Posts: 617
Location: France
This version is only for pb x32 (i use it with 7x64)

_________________
DroopyLib & PBFastLib


Top
 Profile  
 
 Post subject: Re: DroopyLib
PostPosted: Thu Mar 01, 2012 10:44 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Thu Sep 16, 2004 9:50 pm
Posts: 617
Location: France
Version 4.60.004 avalaible
Quote:
29/02/12 : Library 4.60.004
MozillaPreferencePath() bug fixed
NetUserEnum() bug fixed
Unicode2Ansi() help added
ErrorHandler Tips added
Match() added
ProgramFilenameEx() added
LogInitAuto() changed

31/01/12 : Library 4.60.003
UseInternalIni() Code & Help fixed
EditInternalIni() Code fixed & Parameter removed

15/11/11 : Library 4.60.002
DefaultUserProfile() added
Tips UserProfileEnum added
RegKeyExists() bug fixed / Thanks to Markus Ottiger
GetUserName() help changed
Ping() help changed
Oem help changed
Wow64DisableWow64FsRedirection() help changed
UserLoggedOn() Works with 7

10/11/11 : Library 4.60.001
RegGetValue() bug fixed / Thanks to Markus Ottiger

02/09/11 : Library 4.51.014
MSIEnumInit() bug fixed
MSIEnumNext() bug fixed
ComputerSerialNumber() Changed
MSI() Changed

30/08/11 : Library 4.51.013
UseInternalIni() remove optional parameter
UseInternalIni() remove optional parameter
Resource example changed

_________________
DroopyLib & PBFastLib


Top
 Profile  
 
 Post subject: Re: DroopyLib
PostPosted: Wed Mar 07, 2012 2:36 am 
Offline
Enthusiast
Enthusiast

Joined: Thu Feb 16, 2006 1:41 am
Posts: 167
Location: New Zealand
Thanks for the update, Droopy.

I get "This file is no longer available." from the Dropbox site?

_________________
WinXP Pro-SP3, PB4, slow CPU, ancient video card, fuzzy monitor
"When the facts change, I change my mind" - John Maynard Keynes


Top
 Profile  
 
 Post subject: Re: DroopyLib
PostPosted: Fri Mar 09, 2012 9:41 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Thu Sep 16, 2004 9:50 pm
Posts: 617
Location: France
my public folders in dropbox is suspended because droopy.exe is seen as a malware :evil:
I search a way to publish my library
Regards

_________________
DroopyLib & PBFastLib


Top
 Profile  
 
 Post subject: Re: DroopyLib
PostPosted: Fri Mar 09, 2012 9:47 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Feb 17, 2010 12:00 am
Posts: 1007
Location: Anderson Island, WA
Droopy wrote:
my public folders in dropbox is suspended because droopy.exe is seen as a malware :evil:
I search a way to publish my library
Regards

I'll give you ftp space on my website - pm if you want it.


Top
 Profile  
 
 Post subject: Re: DroopyLib
PostPosted: Sat Mar 10, 2012 7:53 am 
Offline
Enthusiast
Enthusiast

Joined: Tue Oct 09, 2007 2:15 am
Posts: 249
Droopy wrote:
... because droopy.exe is seen as a malware :evil:
...


I think it's the URLDownloadToFile_ API function.
And the Fileformat : .exe .... why not zip ?

_________________
English is not my native language...
ImageImageImage


Top
 Profile  
 
 Post subject: Re: DroopyLib
PostPosted: Sat Mar 10, 2012 12:52 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Fri Jun 26, 2009 3:51 pm
Posts: 194
Location: Westernmost tip of Norway
Using VirusTotal for a wide scan and then contact all that flag the file normally works well, at least with all main AV-companies. The updated is often out with the next update.
I have from lessons learned also started keeping a collection of old false positive that I re-scan after some time just to minimize the risk of getting my final flagged when released.

Personally I'v installed the VirusTotal Uplader in PureBasic menu so that I simply can click it and send any compilation in a fast and convenient way. It's no fun when I client calls after a few days when their AV start complaining about a potential mal-ware. :?

_________________
You never learn anything by doing it right.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 136 posts ]  Go to page Previous  1, 2, 3, 4, 5 ... 10  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


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

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye