Results 1 to 9 of 9

Thread: VBWERX Core Language Extensions - need source code

  1. #1

    Thread Starter
    Member Dragokas's Avatar
    Join Date
    Aug 2015
    Location
    Ukraine on fire (country of slaves)
    Posts
    748

    VBWERX Core Language Extensions - need source code

    I'm quite long time ago using this VB6.tlb

    I'm curious, if somebody have the source code of it?
    Malware analyst, VirusNet developer, HiJackThis+ author || my CodeBank works

  2. #2

  3. #3

    Thread Starter
    Member Dragokas's Avatar
    Join Date
    Aug 2015
    Location
    Ukraine on fire (country of slaves)
    Posts
    748

    Re: VBWERX Core Language Extensions - need source code

    Yeah, I know. But, if there is already the source, I don't want to make the single oversight on possible incorrect decompilation which can cost me ghost bugs.
    Malware analyst, VirusNet developer, HiJackThis+ author || my CodeBank works

  4. #4
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    6,966

    Re: VBWERX Core Language Extensions - need source code

    It doesn't look like the source was ever distributed. The typelib has an about string that points to dexwerx.com, which only posts the TLB; a quick search doesn't show DEXWERX ever posting it here either. But it's a fairly small typelib, wouldn't take long to manually review the OLEVIEW output for errors.

  5. #5
    Addicted Member
    Join Date
    Feb 2022
    Posts
    217

    Re: VBWERX Core Language Extensions - need source code


  6. #6
    PowerPoster
    Join Date
    Jun 2015
    Posts
    2,229

    Re: VBWERX Core Language Extensions - need source code

    VB6.idl

    C Code:
    1. /* Copyright © 2017 Dexter Freivald. All Rights Reserved. DEXWERX.COM
    2. *
    3. * VB6.idl
    4. *
    5. * VBWERX Core Language Extensions
    6. *   - 64Bit LongLong type as an alias to Currency, CLngLng()
    7. *   - LongPtr type as an alias to Long
    8. *   - .NET style Interfaces ISubclass, IEnumerator, IDisposable, ICallback (Early Binding only)
    9. *   - Standardized Mem Alloc and Free (CoTaskMemAlloc/CoTaskMemFree)
    10. *   - Standardized Subclassing Interface and related APIs
    11. *   - Typed (and untyped) Memory Access adapted from Michel Rutten's VBVM6Lib
    12. *   - AryPtr() for access to an Array's SAFEARRAY struct
    13. *   - Access to variable pointers via Ref and RefAry (VarPtr/VarPtrArray)
    14. *   - Read/Write Reference Pointers to VB's Reference Types via StrRef()/AryRef()/ObjRef()
    15. *   - ObjSet() calls AddRef when setting an Objects Ptr
    16. *
    17. *   - COM / OLE Interfaces IStream
    18. *   - IID/CLSID/UUID type
    19. *   - Multithreading APIs, threadsafe PostMessage
    20. *   - .NET style Sized System Types Int16/Int32/Int64/IntPtr
    21. *   - NOTE: A Typelib'd SAFEARRAY(void)* sidesteps VBs Unicode/ANSI Conversion in MIDL
    22. *   - TODO: Add User Control Interfaces? or keep in OLE
    23. **/
    24. [
    25.     helpstring("VBWERX Core Language Extensions"),
    26.     uuid(2DF86ADB-D46C-4496-8F5D-32B46DDCF73E),
    27.     lcid(0x00000000),
    28.     version(3.2)
    29. ]
    30. library VB6 {
    31.     //importlib("msdatsrc.tlb");
    32.     importlib("stdole2.tlb");           // IUnknown,IDispatch hidden / restricted
    33.     importlib("comctl32.oca");
    34.     //importlib("vb6.olb");
    35.  
    36.     //[public] coclass CheckBoxControlArray;
    37.  
    38.     // VBA7 types
    39.     typedef [public] VARIANT Decimal;   // VB6.Decimal type as an alias to Variant
    40.     typedef [public] CY LongLong;       // 64bit Integer Type as an alias to Currency
    41.     typedef [public] __int3264 LongPtr; // 32bit Pointer type as an alias to Long
    42.     typedef LongPtr PTR;                //__int3264
    43.     typedef long BOOL;
    44.  
    45.     // .NET System types
    46.     // typedef [public] long Int32;
    47.     // typedef [public] short Int16;
    48.     // typedef [public] CY Int64;
    49.     // typedef [public] BSTR Char;
    50.     // typedef [public] long IntPtr;
    51.  
    52.  
    53.  
    54.     [helpstring("Windows API Constants that differ from VB"), v1_enum]
    55.     typedef enum API {
    56.         FALSE_ = 0,
    57.         TRUE_ = 1,
    58.         NULL_ = 0,
    59.         False = 0,
    60.         True = 1,
    61.         Null = 0
    62.     } API;
    63.  
    64.  
    65.     [helpstring("VB6 and Windows Errors"), v1_enum]
    66.     typedef enum Ern {
    67. // removed for  posting
    68.     } Ern;
    69.    
    70.     typedef struct EXCEPINFO {
    71.         WORD wCode;
    72.         WORD wReserved;
    73.         BSTR  Source;
    74.         BSTR  Description;
    75.         BSTR  HelpFile;
    76.         DWORD dwHelpContext;
    77.         PTR pvReserved;
    78.         PTR pfnDeferredFillIn;
    79.         DWORD scode;
    80.     } EXCEPINFO;
    81.  
    82.     //typedef [public] struct UUID IID;
    83.     //typedef [public] struct UUID CLSID;
    84.  
    85.     interface IStream;                  // Objidlbase.idl
    86.     interface IEnumVARIANT;             // OAIdl.Idl
    87.     interface IPicture;                 // OCIdl.Idl / stdole2.tlb
    88.  
    89.     // #include "vbole.idl"
    90.     #include "interfaces.idl"
    91.  
    92.     [dllname("user32.DLL")]
    93.     module User {
    94.         const PTR HWND_BROADCAST = 0xFFFF;
    95.         [entry("PostMessageW"),helpstring("Thread Safe PostMessage")]
    96.         BOOL PostMessage([in] PTR hWnd, [in] long Msg, [in] PTR wParam, [in] void* lParam);
    97.         [entry("SendMessageW")]
    98.         BOOL SendMessage([in] PTR hWnd,[in] long Msg, [in] PTR wParam, [in] void* lParam);
    99.     }
    100.  
    101.     [dllname("comctl32.DLL")]
    102.     module Subclassing {
    103.         [entry("SetWindowSubclass"),helpstring("Insert a SubclassProc/ISubclass into the message chain.")]
    104.         BOOL SetWindowSubclass(
    105.             [in] PTR hWnd,
    106.             [in] PTR pfnSubclass,
    107.             [in] PTR uIdSubclass,
    108.             [in,defaultvalue(0)] PTR dwRefData);
    109.         [entry("RemoveWindowSubclass"),helpstring("Remove a SubclassProc/ISubclass from the message chain.")]
    110.         BOOL RemoveWindowSubclass(
    111.             [in] PTR hWnd,
    112.             [in] PTR pfnSubclass,
    113.             [in] PTR uIdSubclass);
    114.         [entry("DefSubclassProc"),helpstring("Forward the message to next procedure in the message chain.")]
    115.         PTR DefSubclassProc(
    116.             [in] PTR hWnd,
    117.             [in] long uMsg,
    118.             [in] PTR wParam,
    119.             [in] PTR lParam);
    120.     }
    121.  
    122.     [dllname("kernel32.DLL"),helpstring("WIN32 Kernel")]
    123.     module Kernel {
    124.         [entry("RtlMoveMemory"),helpstring("Copies Length Bytes from Source to Destination")]
    125.         void CopyMemory( [in] void* Destination, [in] void* Source, [in] PTR Length);
    126.         [entry("RtlZeroMemory"),helpstring("Zeroes Length Bytes at Destination")]
    127.         void ZeroMemory( [in] void* Destination, [in] PTR Length);
    128.         [entry("RtlFillMemory"),helpstring("Fills Length Bytes with Fill")]
    129.         void FillMemory( [in] void* Destination, [in] PTR Length, [in] byte Fill);
    130.         [entry("RtlCompareMemory"),helpstring("Compares Length Bytes between Source1 and Source2. Returns number of equal bytes")]
    131.         PTR CompareMemory([in] void* Source1, [in] void* Source2, [in] PTR Length);
    132.         [entry("ExitProcess"),hidden]
    133.         void ExitProcess([in] long uExitCode);
    134.  
    135.         [entry("OutputDebugStringW"),hidden,helpstring("Thread Safe Unicode OutputDebugString")]
    136.         void OutputDebugString(LPWSTR lpOutputString);
    137.         [entry("QueryPerformanceCounter"),hidden]
    138.         BOOL QueryPerformanceCounter([in] void* lpPerformanceCount);
    139.         [entry("QueryPerformanceFrequency"),hidden]
    140.         BOOL QueryPerformanceFrequency([in] void* lpFrequency);
    141.     }
    142.  
    143.     [hidden] enum CALLCONV;
    144.  
    145.     [dllname("ole32.DLL"),helpstring("Ole/COM Memory Allocation and Threading")]
    146.     module OLE {
    147.         [entry("CoTaskMemAlloc"),helpstring("Allocates Length Bytes, and returns a pointer to the allocated memory. (CoTaskMemAlloc)")]
    148.         PTR Alloc([in] PTR Length);
    149.         [entry("CoTaskMemRealloc"),helpstring("Reallocates a previously allocated block of memory to Length Bytes, and returns the new pointer. (CoTaskMemRealloc)")]
    150.         PTR Realloc([in] PTR Ptr, [in] PTR Length);
    151.         [entry("CoTaskMemFree"),helpstring("Frees previously allocated memory. (CoTaskMemFree)")]
    152.         void Free([in] PTR Ptr);
    153.         [entry("CoTaskMemAlloc"),helpstring("Allocates Length Bytes, and returns a pointer to the allocated memory. (CoTaskMemAlloc)")]
    154.         PTR CoTaskMemAlloc([in] PTR Length);
    155.         [entry("CoTaskMemRealloc"),helpstring("Reallocates a previously allocated block of memory to Length Bytes, and returns the new pointer. (CoTaskMemRealloc)")]
    156.         PTR CoTaskMemRealloc([in] PTR Ptr, [in] PTR Length);
    157.         [entry("CoTaskMemFree"),helpstring("Frees previously allocated memory. (CoTaskMemFree)")]
    158.         void CoTaskMemFree([in] PTR Ptr);
    159.         [entry("CLSIDFromString")]
    160.         HRESULT CLSIDFromString([in] LPWSTR lpszProgID, [out,retval] UUID* lpclsid);
    161.         [entry("CLSIDFromProgID")]
    162.         HRESULT CLSIDFromProgID([in] LPWSTR lpszProgID, [out,retval] UUID* lpclsid);    
    163.         // [entry("CoCreateInstance")]
    164.         // LONG CoCreateInstance(
    165.         //     [in] UUID *CLSID,
    166.         //     [in] IUnknown *pUnkOuter,
    167.         //     [in] CLSCTX dwClsContext,
    168.         //     [in] UUID *IID,
    169.         //     [out] void *ppv);            
    170.     }
    171.  
    172.     [dllname("oleaut32.DLL"),helpstring("Automation")]
    173.     module Automation {
    174.         // Type conversions for (LongLong/Unsigned Long) to Intrinsic types (Currency/Double)
    175.         [entry("VarUI4FromR8"),helpstring("Convert Double to Unsigned Long. Alias to VarUI4FromCy")]
    176.         HRESULT CDblToULng(     [in] CY Expr,       [out,retval] long*      Value);
    177.         [entry("VarUI4FromCy"),helpstring("Convert Currency to Unsigned Long. Alias to VarUI4FromCy")]
    178.         HRESULT CCurToULng(     [in] CY Expr,       [out,retval] long*      Value);
    179.         [entry("VarUI4FromI8"),helpstring("Convert LongLong to Unsigned Long. Alias to VarUI4FromI8")]
    180.         HRESULT CLngLngToULng(  [in] LongLong Expr, [out,retval] long*      Value);
    181.         [entry("VarCyFromI8"),helpstring("Convert LongLong to Currency. Alias to VarCyFromI8")]
    182.         HRESULT CLngLngToCur(   [in] LongLong Expr, [out,retval] CY*        Value);
    183.         [entry("VarR8FromI8"),helpstring("Convert LongLong to Double. Alias to VarR8FromI8")]
    184.         HRESULT CLngLngToDbl(   [in] LongLong Expr, [out,retval] DOUBLE*    Value);
    185.         [entry("VarR8FromUI8"),helpstring("Convert ULongLong to Double. Alias to VarR8FromUI8")]
    186.         HRESULT CULngLngToDbl(  [in] LongLong Expr, [out,retval] DOUBLE*    Value);
    187.         [entry("VarI8FromCy"),helpstring("Convert Currency to LongLong. Alias to VarI8FromCy")]
    188.         HRESULT CCurToLngLng(   [in] CY Expr,       [out,retval] LongLong*  Value);
    189.         [entry("VarI8FromR8"),helpstring("Convert Double to LongLong. Alias to VarI8FromR8")]
    190.         HRESULT CDblToLngLng(   [in] DOUBLE Expr,   [out,retval] LongLong*  Value);
    191.         [entry("VarI8FromR8"),helpstring("Convert to LongLong. Alias to VarI8FromR8")]
    192.         HRESULT CLngLng(        [in] DOUBLE Expr,   [out,retval] LongLong*  Value);
    193.         [entry("VarI8FromUI4"),helpstring("Convert Unsigned Long to LongLong. Alias to VarI8FromUI4")]
    194.         HRESULT CULngToLngLng(  [in] long Expr,     [out,retval] LongLong*  Value);
    195.         [entry("VarCyFromUI4"),helpstring("Convert Unsigned Long to Currency. Alias to VarCyFromUI4")]
    196.         HRESULT CULngToCur(     [in] long Expr,     [out,retval] CY*        Value);
    197.         [entry("VarR8FromUI4"),helpstring("Convert Unsigned Long to Double. Alias to VarR8FromUI4")]
    198.         HRESULT CULngToDbl(     [in] long Expr,     [out,retval] DOUBLE*    Value);
    199.  
    200.  
    201.  
    202.         // Variant Manipulation [url]https://msdn.microsoft.com/en-us/library/windows/desktop/ms221673(v=vs.85).aspx[/url]
    203.         [entry("VariantInit"),hidden,helpstring("Initializes a variant.")]
    204.         void VariantInit(void* pvarg);
    205.         [entry("VariantClear"),hidden,helpstring("Clears a variant.")]
    206.         HRESULT VariantClear(void* pvarg);
    207.         [entry("VariantCopy"),hidden,helpstring("Frees the destination variant and makes a copy of the source variant.")]
    208.         HRESULT VariantCopy(void* pvargDest, void* pvargSrc);
    209.         [entry("VariantCopyInd"),hidden,helpstring("Frees the destination variant and makes a copy of the source variant, performing the necessary indirection if the source is specified to be VT_BYREF.")]
    210.         HRESULT VariantCopyInd(void* pvargDest, void* pvargSrc);
    211.         [entry("VariantChangeType"),hidden,helpstring("Converts a variant from one type to another")]
    212.         HRESULT VariantChangeType([out] VARIANT* pvargDest, [in] VARIANT* pvarSrc, [in] short wFlags, [in] short vt);
    213.         [entry("VariantChangeTypeEx"),hidden,helpstring("Converts a variant from one type to another, using a given LCID")]
    214.         HRESULT VariantChangeTypeEx([in,out] VARIANT* pvargDest, [in,out] VARIANT* pvarSrc, [in] long lcid, [in] short wFlags, [in] short vt);
    215.  
    216.         // constants for varsiantchangetype wflags
    217.         [helpstring("Prevent coercian of an object to a fundamental type via its default property")]
    218.         const long vbNoValueProp        = 0x01;
    219.         [helpstring("Convert Bool to string value of 'True'/'False' instead of '-1'/'0'")]
    220.         const long vbAlphaBool          = 0x02;
    221.         [helpstring("Convert Bool to string value using local language")]
    222.         const long vbLocalBool          = 0x10;
    223.         [helpstring("Passes LOCALE_NOUSEROVERRIDE to core coercion routines")]
    224.         const long vbNoUserOverride     = 0x04;
    225.         [helpstring("Islamic Calendar Support")]
    226.         const long vbCalendarHijri      = 0x08;
    227.         [helpstring("South Asia Calendar support")]
    228.         const long vbCalendarThai       = 0x20;
    229.         [helpstring("Western Calendar")]
    230.         const long vbCalendarGregorian  = 0x40;
    231.         [helpstring("NLS function call support")]
    232.         const long vbUseNLS             = 0x80;
    233.         [helpstring("Locale Invariant LocaleId/LCID")]
    234.         const long vbLocaleInvariant    = 0x7f;
    235.  
    236.         // useful functions for converting pointers to strings
    237.         [entry("SysAllocString"),helpstring("Copies characters from an LPWSZ. (SysAllocString)")]
    238.         BSTR PtrStr([in] PTR lpwsz);
    239.         [entry("SysAllocStringLen"),helpstring("Copies Length characters from a Wide String (SysAllocStringLen)")]
    240.         BSTR PtrStrLen([in] PTR lpwsz, [in] long Length);
    241.         [entry("SysAllocStringByteLen"),helpstring("Copies Length bytes from an ANSI String without conversion. (SysAllocStringByteLen)")]
    242.         BSTR PtrStrLenB([in] PTR lpsz, [in] long Length);
    243.         [entry("SysAllocString"),helpstring("Copies characters from an LPWSZ. (SysAllocString)")]
    244.         BSTR SysAllocString([in] PTR lpwsz);
    245.         [entry("SysAllocStringLen"),helpstring("Copies Length characters from a Wide String (SysAllocStringLen)")]
    246.         BSTR SysAllocStringLen([in] PTR lpwsz, [in] long Length);
    247.         [entry("SysAllocStringByteLen"),helpstring("Copies Length bytes from an ANSI String without conversion. (SysAllocStringByteLen)")]
    248.         BSTR SysAllocStringByteLen([in] PTR lpsz, [in] long Length);
    249.  
    250.         // calling a function pointer from VB
    251.         [entry("DispCallFunc"),hidden,helpstring("Function Pointer Calling.")]
    252.         HRESULT DispCallFunc(
    253.             [in] PTR pvInstance,
    254.             [in] PTR oVft,
    255.             [in] enum CALLCONV cc,
    256.             [in] short vtReturn,
    257.             [in] long cActuals,
    258.             [in] void* prgvt,
    259.             [in] void* prgpvarg,
    260.             [out, retval] VARIANT* pvargResult);
    261.     }
    262.  
    263.     [dllname(""),hidden]
    264.     module Typelib {
    265.         [hidden] const LPSTR Version = "3.2";
    266.         [hidden] const LPSTR Project = "VBWERX";
    267.         [hidden] const LPSTR Author = "Copyright ? 2017 Dexter Freivald. All Rights Reserved. DEXWERX.COM";
    268.     }
    269.  
    270.     [dllname("msvbvm60.DLL"),helpstring("VB6 Runtime")]
    271.     module Runtime {
    272.         // Constants
    273.         [helpstring("Ubiquitous NULL value for pointers")]  const long vbNullPtr = 0;
    274.  
    275.         // Runtime Memory Copy
    276.         [entry("__vbaCopyBytes"),helpstring("Copies Length Bytes from Source to Destination")]
    277.         HRESULT CopyBytes(  [in] long Length, [in] void* Destination, [in] void* Source);
    278.         [entry("__vbaCopyBytesZero"),helpstring("Copies Length Bytes From Source to Destination and Zero Source")]
    279.         HRESULT CopyBytesZero([in] long Length, [in] void* Destination, [in] void* Source);
    280.  
    281.         // VarPtr Aliases
    282.         [entry("VarPtr"),helpstring("Allows assigning AddressOf Module.Function to a variable")]
    283.         PTR FncPtr([in] PTR Address);
    284.         [entry("VarPtr"),helpstring("Convert to LongPtr")]
    285.         PTR CLngPtr([in] long Expression);
    286.         [entry("VarPtr"),helpstring("Returns a pointer to a variable. Same as VarPtr or C/C++'s & Operator")]
    287.         PTR Ref([in] void* Ptr);
    288.         [entry("VarPtr"),helpstring("Returns a pointer to an Array variable. Avoids Unicode/ANSI Conversion of String Arrays. Same as VarPtrArray/VarPtrStringArray")]
    289.         PTR RefAry([in] SAFEARRAY(void)* Ptr);
    290.         // [entry("VarPtr"),hidden,helpstring("Returns a pointer to an Array variable. Typelib sidestep's the runtimes automatic Unicode/ANSI conversion.")]
    291.         // PTR VarPtrArray([in] SAFEARRAY(void)* Ptr);
    292.         // [entry("VarPtr"),hidden,helpstring("Returns a pointer to a String Array variable. Redundant, included only for consistency.")]
    293.         // PTR VarPtrStringArray([in] SAFEARRAY(BSTR)* Ptr);
    294.         [entry("VarPtr"),hidden,helpstring("Returns an Object from a pointer. Functional Inverse of ObjPtr()")]
    295.         IUnknown* PtrObj([in] PTR Address);
    296.         // WARNING: VB Assigns this reference without copying, allowing 2 Strings to point to the same BSTR. Expect the unexpected if runtime frees the same string
    297.         [entry("VarPtr"),hidden,helpstring("Returns a String from a BSTR. Functional Inverse of StrPtr(), WARNING: Allows multiple Strings to reference the same BSTR. Use PtrStr() to allocate a new string.")]
    298.         BSTR BstrStr([in] PTR Address);
    299.         [entry("VarPtr"),hidden,helpstring("Mock an External Error and Initiate runtime error handling")]
    300.         HRESULT ExtRaise([in] long ErrNum);
    301.         [entry("__vbaRefVarAry"),helpstring("Returns a pointer to an Array variable extracted from a Variant.")]
    302.         PTR RefVarAry([in] VARIANT *Ptr);
    303.  
    304.         [entry("__vbaObjAddref"),helpstring("Add a reference."),hidden]
    305.         void ObjAddRef([in] IUnknown* Obj);
    306.         [entry("VarPtr"),helpstring("Release an object reference. Call as a sub."),hidden]
    307.         IUnknown* ObjRelease([in] IUnknown* Obj);
    308.  
    309.         // Often used MemCopy Helpers
    310.         [entry("GetMem1"),hidden] HRESULT GetMem1([in] void *Src, [in,out] void* Dst);
    311.         [entry("GetMem2"),hidden] HRESULT GetMem2([in] void *Src, [in,out] void* Dst);
    312.         [entry("GetMem4"),hidden] HRESULT GetMem4([in] void *Src, [in,out] void* Dst);
    313.         [entry("GetMem8"),hidden] HRESULT GetMem8([in] void *Src, [in,out] void* Dst);
    314.         [entry("PutMem1"),hidden] HRESULT PutMem1([in] void *Dst, [in] byte  Src);
    315.         [entry("PutMem2"),hidden] HRESULT PutMem2([in] void *Dst, [in] short Src);
    316.         [entry("PutMem4"),hidden] HRESULT PutMem4([in] void *Dst, [in] long  Src);
    317.         [entry("PutMem8"),hidden] HRESULT PutMem8([in] void *Dst, [in] CY    Src);
    318.  
    319.         // strictly for nostalgia...
    320.         [entry("GetMem1"),hidden] HRESULT Peek([in] PTR Address, [out,retval] byte* Data);
    321.         [entry("PutMem1"),hidden] HRESULT Poke([in] PTR Address, [in] byte Data);
    322.         // [entry("GetMem2"),hidden] HRESULT PeekW([in] PTR Address, [out,retval] short* Data);
    323.         // [entry("PutMem2"),hidden] HRESULT PokeW([in] PTR Address, [in] short Data);
    324.         // [entry("GetMem4"),hidden] HRESULT PeekD([in] PTR Address, [out,retval] long* Data);
    325.         // [entry("PutMem4"),hidden] HRESULT PokeD([in] PTR Address, [in] long Data);
    326.         // [entry("GetMem8"),hidden] HRESULT PeekQ([in] PTR Address, [out,retval] CY* Data);
    327.         // [entry("PutMem8"),hidden] HRESULT PokeQ([in] PTR Address, [in] CY Data);
    328.  
    329.         [entry("GetMem4"),hidden,propget,helpstring("Reinterpret cast a LongPtr (SAFEARRAY*) to a Variant Array()")]
    330.         HRESULT RPtrVarAry([in] PTR Ptr, [out,retval] SAFEARRAY(VARIANT)* Dst);
    331.  
    332.         // Unmasked Access to VARIANT.vt
    333.         [entry("GetMem2"),propget,helpstring("Unmasked version of VarType(), ie: VARIANT.vt (R/W).")]
    334.                                     HRESULT VarVT(  [in] VARIANT* Var, [out,retval]     short*  Value);
    335.         [entry("PutMem2"),propput]  HRESULT VarVT(  [in] VARIANT* Var, [in]             short   Value);
    336.         // NOTE: vt (19,20,21) are not very useful.
    337.         //  The runtime throws an error for unsupported type after an API Call
    338.         //  except for VT_I8 with some APIs that return a long isntead of HRESULT
    339.         [helpstring("VarVT Constant. VT_UI2")]                  const long vbUInteger       = 0x0012L;
    340.         [helpstring("VarVT Constant. VT_UI4")]                  const long vbULong          = 0x0013L;
    341.         [helpstring("VarVT LongLong Constant. VT_I8")]          const long vbLongLong       = 0x0014L;
    342.         [helpstring("VarVT Constant. VT_UI8")]                  const long vbULongLong      = 0x0015L;
    343.         [helpstring("VarVT ByRef Constant. VT_BYREF")]          const long vbByRef          = 0x4000L;
    344.         [helpstring("VarVT TypeMask Constant. VT_TYPEMASK")]    const long vbTypeMask       = 0x0FFFL;
    345.  
    346.         // Dereference a Pointer to Pointer
    347.         [entry("GetMem4"),propget,helpstring("Dereference a reference pointer (R/W)")]
    348.                                     HRESULT DeRef(  [in] PTR  Address, [out,retval]     PTR*    Value);
    349.         [entry("PutMem4"),propput]  HRESULT DeRef(  [in] PTR  Address, [in]             PTR     Value);
    350.  
    351.         // Typed memory access via dereferencing
    352.         [entry("GetMem1"),propget,helpstring("Dereference a pointer as Byte (R/W)")]
    353.                                     HRESULT DByte(  [in] PTR  Address, [out,retval]     byte*   Value);
    354.         [entry("PutMem1"),propput]  HRESULT DByte(  [in] PTR  Address, [in]             byte    Value);
    355.         [entry("GetMem2"),propget,helpstring("Dereference a pointer as Integer (R/W)")]
    356.                                     HRESULT DInt(   [in] PTR  Address, [out,retval]     short*  Value);
    357.         [entry("PutMem2"),propput]  HRESULT DInt(   [in] PTR  Address, [in]             short   Value);
    358.         [entry("GetMem4"),propget,helpstring("Dereference a pointer as Long (R/W)")]
    359.                                     HRESULT DLng(   [in] PTR  Address, [out,retval]     long*   Value);
    360.         [entry("PutMem4"),propput]  HRESULT DLng(   [in] PTR  Address, [in]             long    Value);
    361.         [entry("GetMem4"),propget,helpstring("Dereference a pointer as LongPtr (R/W)")]
    362.                                     HRESULT DLngPtr([in] PTR  Address, [out,retval]     PTR*    Value);
    363.         [entry("PutMem4"),propput]  HRESULT DLngPtr([in] PTR  Address, [in]             PTR     Value);
    364.         [entry("GetMem4"),propget,helpstring("Dereference a pointer as Single (R/W)")]
    365.                                     HRESULT DSng(   [in] PTR  Address, [out,retval]     float*  Value);
    366.         [entry("PutMem4"),propput]  HRESULT DSng(   [in] PTR  Address, [in]             float   Value);
    367.         [entry("GetMem8"),propget,helpstring("Dereference a pointer as Double (R/W)")]
    368.                                     HRESULT DDbl(   [in] PTR  Address, [out,retval]     DOUBLE* Value);
    369.         [entry("PutMem8"),propput]  HRESULT DDbl(   [in] PTR  Address, [in]             DOUBLE  Value);
    370.         [entry("GetMem8"),propget,helpstring("Dereference a pointer as Currency (R/W)")]
    371.                                     HRESULT DCur(   [in] PTR  Address, [out,retval]     CY*     Value);
    372.         [entry("PutMem8"),propput]  HRESULT DCur(   [in] PTR  Address, [in]             CY      Value);
    373.         [entry("GetMem8"),propget,helpstring("Dereference a pointer as LongLong (R/W)")]
    374.                                     HRESULT DLngLng([in] PTR  Address,  [out,retval]    LongLong*   Value);
    375.         [entry("PutMem8"),propput]  HRESULT DLngLng([in] PTR  Address,  [in]            LongLong    Value);
    376.  
    377.         // Reinterpret reference as type
    378.         [entry("GetMem1"),propget,helpstring("Reinterpret reference as Byte (R/W)"),hidden]
    379.                                     HRESULT RByte(  [in] void* Ref,     [out,retval]    byte*   Value);
    380.         [entry("PutMem1"),propput]  HRESULT RByte(  [in] void* Ref,     [in]            byte    Value);
    381.         [entry("GetMem2"),propget,helpstring("Reinterpret reference as Integer (R/W)"),hidden]
    382.                                     HRESULT RInt(   [in] void* Ref,     [out,retval]    short*  Value);
    383.         [entry("PutMem2"),propput]  HRESULT RInt(   [in] void* Ref,     [in]            short   Value);
    384.         [entry("GetMem4"),propget,helpstring("Reinterpret reference as Long (R/W)"),hidden]
    385.                                     HRESULT RLng(   [in] void* Ref,     [out,retval]    long*   Value);
    386.         [entry("PutMem4"),propput]  HRESULT RLng(   [in] void* Ref,     [in]            long    Value);
    387.         [entry("GetMem4"),propget,helpstring("Reinterpret reference as Single (R/W)"),hidden]
    388.                                     HRESULT RSng(   [in] void* Ref,     [out,retval]    float*  Value);
    389.         [entry("PutMem4"),propput]  HRESULT RSng(   [in] void* Ref,     [in]            float   Value);
    390.         [entry("GetMem8"),propget,helpstring("Reinterpret reference as Double (R/W)"),hidden]
    391.                                     HRESULT RDbl(   [in] void* Ref,     [out,retval]    DOUBLE* Value);
    392.         [entry("PutMem8"),propput]  HRESULT RDbl(   [in] void* Ref,     [in]            DOUBLE  Value);
    393.         [entry("GetMem8"),propget,helpstring("Reinterpret reference as Currency (R/W)"),hidden]
    394.                                     HRESULT RCur(   [in] void* Ref,     [out,retval]    CY*     Value);
    395.         [entry("PutMem8"),propput]  HRESULT RCur(   [in] void* Ref,     [in]            CY      Value);
    396.         [entry("GetMem8"),propget,helpstring("Reinterpret reference as LongLong (R/W)"),hidden]
    397.                                     HRESULT RLngLng([in] void* Ref,     [out,retval]    LongLong*   Value);
    398.         [entry("PutMem8"),propput]  HRESULT RLngLng([in] void* Ref,     [in]            LongLong    Value);
    399.  
    400.  
    401.         // Read/Write reference pointers to VB's reference types (Objects/Strings/Arrays)
    402.         // WARNING: Directly setting reference pointers, bypasses the runtime. Clean up after yourself!
    403.         [entry("GetMem4"),helpstring("Returns a pointer to an Array's SAFEARRAY structure. Use RefAry() to get a pointer to an Array variable.")]
    404.                                     HRESULT AryPtr( [in] SAFEARRAY(void)* Ptr,  [out,retval]    PTR*    Address);
    405.         [entry("GetMem4"),helpstring("Returns a pointer to an Array's SAFEARRAY structure. Use RefAry() to get a pointer to an Array variable.")]
    406.                                     HRESULT AryIsDim([in] SAFEARRAY(void)* Ptr, [out,retval]    long*   Ary);
    407.  
    408.         [entry("GetMem4"),propget,helpstring("Get/Set an Array's SAFEARRAY reference pointer. R/W version of AryPtr()")]
    409.                                     HRESULT AryRef( [in] SAFEARRAY(void)* Ref,  [out,retval]    PTR*    Address);
    410.         [entry("PutMem4"),propput]  HRESULT AryRef( [in] SAFEARRAY(void)* Ref,  [in]            PTR     Address);
    411.         [entry("GetMem4"),propget,helpstring("Get/Set a String's BSTR reference. R/W version of StrPtr().")]
    412.                                     HRESULT StrRef( [in] BSTR*  Ref,            [out,retval]    PTR*    Address);
    413.         [entry("PutMem4"),propput]  HRESULT StrRef( [in] BSTR*  Ref,            [in]            PTR     Address);
    414.         [entry("GetMem4"),propget,helpstring("Get/Set an Object's reference (sidesteps AddRef unlike ObjPtr). R/W version of ObjPtr(). Not to be confused with DCOM's OBJREF'")]
    415.                                     HRESULT ObjRef( [in] void*  Ref,            [out,retval]    PTR*    Address);
    416.         [entry("PutMem4"),propput]  HRESULT ObjRef( [in] void*  Ref,            [in]            PTR     Address);
    417.         [entry("__vbaObjSetAddref"),propput,helpstring("Set a strong reference to an Object, by calling AddRef. (Write Only). ObjSetAddref()")]
    418.                                     HRESULT ObjSet( [in] void*  Ref,            [in]            PTR     Address);
    419.  
    420.         [entry("__vbaObjSetAddref"),helpstring("Set a strong reference to an Object, by calling AddRef. (Write Only). ObjSetAddref()")]
    421.         HRESULT ObjSetAddref(
    422.             [in] void* Ref,
    423.             [in] PTR Address
    424.         );
    425.  
    426.         // This should probably be in a threading typelib
    427.         // [entry("VBDllGetClassObject"),hidden]
    428.         // long VBDllGetClassObject(
    429.         //             [in] long lpHinstDLL,
    430.         //             [in] long Reserved,
    431.         //             [in] long lpVBHeader,
    432.         //             [in] void* rclsid,
    433.         //             [in] void* riid,
    434.         //             [out] void* ppUnk);
    435.     }
    436. }

  7. #7

  8. #8

    Thread Starter
    Member Dragokas's Avatar
    Join Date
    Aug 2015
    Location
    Ukraine on fire (country of slaves)
    Posts
    748

    Re: VBWERX Core Language Extensions - need source code

    Thanks, DEXWERX!
    Malware analyst, VirusNet developer, HiJackThis+ author || my CodeBank works

  9. #9
    PowerPoster
    Join Date
    Jun 2015
    Posts
    2,229

    Re: VBWERX Core Language Extensions - need source code

    Quote Originally Posted by The trick View Post
    DEXWERX, glad to see you
    Same - I wanted to thank you for all your help and inspiration over the years, and for being a super positive force in the community.

    Quote Originally Posted by Dragokas View Post
    Thanks, DEXWERX!
    Sorry I didn't see this sooner. I posted the modified Microsoft idl files on my github that are needed to compile with midl. Hopefully the files fly under the radar and don't get taken down. In order to rebuild the typelib, a Windows SDK environment needs to be setup, and at least 4 SDK idl files need to be modified that I posted.
    Last edited by DEXWERX; Mar 25th, 2025 at 01:43 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width