dcsimg
Results 1 to 19 of 19

Thread: [vb6] IDE-Safety Thunks: A new breed

  1. #1

    Thread Starter
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    18,277

    [vb6] IDE-Safety Thunks: A new breed

    Attached project is something I've been thinking about for a couple years, just never found the time to put it together.

    The suite of thunks included in the sample project are wrapped in VB COM objects. This means that the thunks have properties and methods exposed just like any VB object. Granted, the object methods are late-bound vs. early-bound and can be made early-bound with use of wrappers. See next posting below for download of sample wrappers.

    The documentation for each thunk and more is included with the attached Readme files. Those files are important for you to download if you want to play with the thunks outside of the sample projects. Also included are the NASM scripts used to compile the thunks and directions on how to compile them if you want to manipulate the scripts.

    What is a thunk? It is simply executable code placed in process memory, unknown to VB. Typically, thunks are used to enhance VB in one way or another beyond what can be done within VB and without using an external DLL. Thunks are not scary if you have the source code and can verify what is being done. I don't expect everyone to know how to read assembly; therefore, every thunk source is heavily commented so that anyone could follow the logic and see there is nothing malicious.

    Thunks included, along with a brief description:

    1) Subclassing. Uses the common controls subclassing library. The thunk can subclass multiple hWnds simultaneously.

    2) Hooks. Windows offers various hooks, i.e., keyboard, mouse, CBT and more. A sample project shows how subclassing and hooking are used together to create owner-drawn VB comboboxes.

    3) Timer. Probably of little use, but provided anyway. The only real advantage of a thunk timer is the ability to add it to a VB class and extended interval values.

    4) Custom Window Classes. For those of you that are API-nuts and like to create pure or semi-pure custom windows, the thunk helps manage the class procedure.

    5) Callbacks. Both standard Windows (stdCall) and C-style (cDecl) formats are supported. A sample project shows both.

    6) COM object hooks. Ability to hook/subclass a COM object, either one exposed by VB or a VTable-only interface. An example shows how to subclass the stdPicture object to hook its rendering.

    7) GDI+ token/handle management. Ensures GDI+ is shut down properly and GDI+ handles are destroyed even if the IDE is terminated unexpectedly. Sample included in using GDI+ to load and display a PNG inside of a VB image control and animating a GIF.

    8) API caller. This thunk ensures one or more APIs are called after the project unloads, regardless of how it is unloaded. Such a thunk can be used to ensure objects created with GDI or files opened with CreateFile APIs are destroyed/released. This thunk also enables CDecl APIs to be called on demand.

    9) VTable caller. Similar to DispCallFunc API, the thunk enables calling methods directly to a VTable-only interface.

    Name:  SShot.png
Views: 136
Size:  90.6 KB

    Each thunk type is included in the sample projects. Also included is a sample to allow you to attempt to crash the IDE due to "End" statements. There may be a scenario that includes various levels of usercontrols, but haven't discovered one yet that crashes the IDE due to "End". If you discover a scenario, let me know so I can find a workaround as needed.

    The key to strong resistance to crashing is the fact that the thunk is a COM object. By being one, VB will always unload it. Since it knows it is being unloaded, it can manage its own destruction, including its own clean-up and removal from process memory. The ReadMe files have far more details and information.

    Code:
    Update History
     3 Sep: re-upload. Failed to parse thunk 4-byte blocks with values of zero. Needed to include 
             them as it is possible there memory can be allocated with junk if not overwritten.
     1 Sep: Complete revision
        - uses private heap vs VirtualAlloc for thunks, overall memory reduction
        - includes two new thunks: APICaller and VTableCaller thunks
        - documentation completely redone, each thunk has its own readme file
        - thunks can be optionally used with wrappers for early-bound, intellisense capability
    22 Jun: Enhancements
        - replaced COM hook thunk with another that can hook multiple objects vs. just one
        - added a new thunk to help make GDI+ IDE-safe and added a sample of its usage
        - by request, increased default max method count expected in any VB code page to 700
        - other minor enhancements/changes made
     3 Jun: Bug reported when compiled. Fixed (see post #4)
     2 Jun 2019: initial release
    Note: In the future any changes to the clsThunk class will be attached separately. Will not repost the test project unless I change something in it. If the class is a separate attachment, it should be used in place of the one in the test project.
    Attached Files Attached Files
    Last edited by LaVolpe; Sep 3rd, 2019 at 03:07 PM. Reason: updated thunks, added new thunks
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  2. #2

    Thread Starter
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    18,277

    Re: [vb6] Thunks - A new breed

    I'll reserve this section for tips & such...

    FYI: Included here are sample wrappers for each thunk. Wrappers enable intellisense and early-bound method calls. At the top of each wrapper class are the simple instructions for converting your late-bound tasker calls to early-bound: Wrappers.zip

    FYI: All thunks except the generic callback, COM hooking and VTable caller thunks know how many parameters and the size of the parameters that are required. With those other three, the thunk needs to be told when it is created or called because they are unknown at that point. The parameter count is straightforward, but the sizes of each are not. So, the creation routines expect you to provide the number of total DWords (4 bytes) for all parameters. Most parameters will use minimum of 1 DWord each. Even if the parameter is just a Byte or Integer. This is because parameters are promoted to DWords in x86 assembly stdCall/cDecl. Basically, this means in most cases, the number of DWords required for all parameters is the same as the parameter count. However, with COM, a single parameter may require 2 or more DWords (i.e., LongLong, Currency, etc). This FYI is just meant to help you better understand what is required, relative to DWord parameter sizes. The readme files for those specific thunks detail more information.

    Tip. The GDI+ thunk creates tasker objects that have just a few properties, one of them being HandleByRef. That property is provided for convenience when creating handles via GDI+ API calls. But use caution. Simply referencing that property will destroy any handle already being managed by the tasker, by design, before it returns. If you are using that property, then you will be replacing its current value; hence the destruction. So don't Debug.Print it out. Its value is meaningless to you, it is just a memory location where the Handle is stored.
    Code:
    ' using the HandleByRef property as a convenience
    
    GdipCreateFromHDC hDC, ByVal oTasker.HandleByRef
    ' If you: Debug.Print oTasker.HandleByRef then you just destroyed the handle
    
    ' without using it requires 1 more line of code... 
    
    ' The Handle property only destroys existing handles when 
    ' a new handle is assigned to the tasker. So you can Debug.Print it out
    GdipCreateFromHDC hDC, hGraphics
    oTasker.Handle = hGraphics
    Tip: When wanting to hook stdPictures to draw PNGs inside of image controls, a transparent icon is useful as a placeholder inside the image control. The image control needs something assigned to it in order for VB to have it redraw as needed. We need that so we can intercept and draw our PNG instead. Attached here is a 100% transparent icon: blank.zip. Also, a sub-tip of sorts... make Image1.Stretch=True

    Tip: The pvGetAddressOf routine is hardcoded to search up to 700 methods of any host. If you have more than 700 in your host (form, class, whatever), then you will need to up that limit. In that routine, there is a constant that dictates the size limit.
    Last edited by LaVolpe; Sep 1st, 2019 at 04:07 PM.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  3. #3
    Lively Member
    Join Date
    Jun 2016
    Posts
    81

    Re: [vb6] Thunks - A new breed

    very good project keeps improving it.
    I have not had much time to do tests.
    but I had the following problem, with the project compiled in the first two examples when it closes its window closes everything, in the ide no.

    a greeting and forgiveness for the language

  4. #4

    Thread Starter
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    18,277

    Re: [vb6] Thunks - A new breed

    @yokesee. I see what you are describing. I'll have to look at my subclassing thunk, something is wrong with the suicide timer procedure when compiled. Thank you for pointing it out. I'll upload the patched thunk soon.

    P.S. Same problem will be with the last example.

    Follow-up. Patched & re-uploaded. Problem was that I was using edi register but failed to preserve it beforehand which is a no-no and an oversight on my part. Unfortunately, the same logic was used in every thunk (copy & paste). So every thunk was modified to address the problem. Thanx again yokesee
    Last edited by LaVolpe; Jun 3rd, 2019 at 08:50 PM.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  5. #5
    Frenzied Member
    Join Date
    Dec 2008
    Posts
    1,205

    Re: [vb6] Thunks - A new breed

    If us XP users thunk this would work in XP
    Would we be thunking wrong ?

  6. #6

    Thread Starter
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    18,277

    Re: [vb6] Thunks - A new breed

    Quote Originally Posted by Bobbles View Post
    If us XP users thunk this would work in XP
    Would we be thunking wrong ?
    No, you'd be thunking correct.

    The subclassing thunk actually checks for the common controls library exporting needed APIs by ordinal, which XP did. However, I did not test it on XP. If you do play around and it works, feedback is encouraged for others. If it has problems, would like to know that too.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  7. #7
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    2,296

    Re: [vb6] Thunks - A new breed

    4) Custom Window Classes. For those of you that are API-nuts and like to create pure or semi-pure custom windows, the thunk helps manage the class procedure.
    Baby you're singing my song

    Tip: The pvGetAddressOf routine is hardcoded to only search up to 256 methods of any host. If you have more than 256 in your host (form, class, whatever), then you will need to up that limit. In that routine, look for the value 1024. That is equal to 256*4. Increase it to a max number of methods your host could possibly have, multiplied by 4.
    What? That's crazy talk, who would ever have a class with more than 256 methods??? Or even more impossible, needing to up it above the 512 limit that was in the old one


    ---
    Great work, can't wait to check it all out.

  8. #8
    Frenzied Member wqweto's Avatar
    Join Date
    May 2011
    Posts
    1,491

    Re: [vb6] Thunks - A new breed

    Quote Originally Posted by fafalone View Post
    What? That's crazy talk, who would ever have a class with more than 256 methods???
    You already have 400-450 methods in default IDispatch vtbl "inherited" from VB's form/usercontrol base implementation. Of these significat percent are empty/dummy slots carried from legacy (VB3?) versions of the base classes but if not taken care of these use-cases explicitly, probing only first 256 methods might turn out insufficient.

    cheers,
    </wqw>

  9. #9

  10. #10
    Frenzied Member wqweto's Avatar
    Join Date
    May 2011
    Posts
    1,491

    Re: [vb6] Thunks - A new breed

    Quote Originally Posted by fafalone View Post
    The joke was that this exact problem happened, because my shell browser UC has over 512 methods just in the .ctl file
    Ouch! :-))

    cheers,
    </wqw>

  11. #11
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    2,296

    Re: [vb6] Thunks - A new breed

    Yeah it's a little crazy, Sub+Function+Property totals 797 right now

    LaVolpe, I'd even suggest retaining the default of 512; I've seen a number of UserControls that would exceed 256 (UC's being particularly vulnerable because of the desire to self-contain them and property let/gets running up the count).

  12. #12

    Thread Starter
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    18,277

    Re: [vb6] Thunks - A new breed

    Quote Originally Posted by fafalone View Post
    LaVolpe, I'd even suggest retaining the default of 512; I've seen a number of UserControls that would exceed 256 (UC's being particularly vulnerable because of the desire to self-contain them and property let/gets running up the count).
    Will consider it when I update the project. The newest version (on my pc only) uses a constant so it is easier to change for any individual user, as needed. The original intent of the limit imposed by Paul Caton was because he didn't provide a starting point for parsing VTables except for classes. And as mentioned, forms can be quite large, but so are UCs & property pages. I'm not sure it is even worthwhile any longer since I've added those offsets, but I haven't played with the various Designer VTables.

    BTW, the reason for the newest version is a multi-COM object thunk, otherwise, I might just be done with this project barring bugs.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  13. #13

    Thread Starter
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    18,277

    Re: [vb6] Thunks - A new breed

    Updated the project with enhancements and to correct some minor code flaws. The _ReadMe file is updated to address new thunks and any other pertinent information that changed.

    Major enhancements include the replacement of the COM hook thunk with a new one that can be used to hook multiple objects on the same thunk or a slightly smaller one used for single object hooking. Also included is a new GDI+ thunk that will ensure GDI+ and and handles it is managing are shut down/released even if the IDE is terminated with an End action.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  14. #14

    Thread Starter
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    18,277

    Re: [vb6] IDE-Safety Thunks: A new breed

    Looking at posting one more update, really a revision. That will remove most compatibility with this project.

    I'm leaning towards revamping how the thunks are created. Currently, they are created one thunk at a time as needed. Each thunk instance uses its own reserved memory. Let's say one thunk uses 2K memory and you wanted 5 of them: 10K total. The route I'm thinking about will use reserved memory just once for a "Factory" thunk. The factory creates/spawns worker objects as requested. Each worker object will use about 32 bytes (not a typo). So if a Factory uses 2K, you can create 10 workers that only use about 320 bytes more. The COM hook thunk will be the exception and will remain mostly as is since it doesn't fit well into my Factory theme.

    Also going to include one new thunk. For time being, calling it APIcaller. The gist is that you can assign an API to it, along with parameters and have it call that API when the worker is released. This can help reduce memory leaks and possible crashing when IDE is terminated unexpectedly, i.e., "End". Let's say you are using APIs to load files and want to ensure the file handle is freed on termination. That APIcaller worker is setup like:
    Code:
    oWorker.SetAPIcall "kernel32.dll", "CloseHandle", m_MyFileHandle
    The worker can contain a batch call, of sorts too, if more than one action needs to be taken in a specific order:
    Code:
    oWorker.SetAPIcall "kernel32.dll", "UnmapViewOfFile", m_MyView
    oWorker.SetAPIcall "kernel32.dll", "CloseHandle", m_MyFileHandle
    
    ' another example
    oWorker.SetAPIcall "gdi32.dll", "SelectObject", Array(m_Hdc, m_OrigBmp)
    oWorker.SetAPIcall "gdi32.dll", "DeleteObject", m_Bitmap
    oWorker.SetAPIcall "gdi32.dll", "DeleteDC", m_Hdc
    The worker will be able to accept multiple parameters also...
    Code:
    oWorker.SetAPIcall "kernel32.dll", "VirtualFree", Array(m_MemAddr, 0, MEM_RELEASE)
    The idea is that the worker is setup very similar to how an API declaration is setup -- with some restrictions. It usage would typically contain stuff that is declared at class/form level that should be cleaned up in the unload/terminate event which won't happen if IDE terminates with "End"
    Last edited by LaVolpe; Jun 25th, 2019 at 09:25 PM.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  15. #15
    Frenzied Member wqweto's Avatar
    Join Date
    May 2011
    Posts
    1,491

    Re: [vb6] IDE-Safety Thunks: A new breed

    Quote Originally Posted by LaVolpe View Post
    Each worker object will use about 32 bytes (not a typo).
    MST thunks CoTaskMemAlloc between 16 and 24 bytes per COM object and their respective executable thunk code + vtable is VirtualAlloc'd once per process no matter if needed by self-contained thunks or by global module impl. Code address is shared through environment variables named "_MST_GLOBAL" & App.hInstance & "_" & sKey which is a bit awkward.

    cheers,
    </wqw>

  16. #16

    Thread Starter
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    18,277

    Re: [vb6] IDE-Safety Thunks: A new breed

    @wqweto. My factory approach appears similar to yours. A factory shares its thunk with any workers it spawns/workers (both being Com objects). The 2 VTables (factory/worker) are also included in the thunk. The workers currently use up to 28 bytes each. The factory object uses more, however only one instance of it is ever created. I could have opted to include much of the factory object data into the top/bottom of the thunk but chose against it and kept it with the Com object instead. A few different ways to skin that cat.

    I have a slightly different approach to shared data/variables. Each worker has the address of the factory's object data. The worker's object data contains only per-instance variables. When a worker needs to access the shared data, it gets it from known offsets off the factory's object. These offsets are constants within the thunk.

    The only thunk I have in this project, right now, that uses a factory approach is the GDI+ thunk. But I like it a lot and will convert all, except the COM-hook thunk, to factory/worker themes also.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  17. #17
    Frenzied Member wqweto's Avatar
    Join Date
    May 2011
    Posts
    1,491

    Re: [vb6] IDE-Safety Thunks: A new breed

    Yes, the GDI+ thunk has a lot of potential.

    I'm considering impl DISPID_VALUE get/let on my cleanup thunk too (which is a whole new IDispatch interface). Will come handy for such use-cases, provided that performance testing graphics intensive routines does not foil the effort.

    I'm very glad to see your alternative impl with new ideas and more use-cases.

    cheers,
    </wqw>

  18. #18

    Thread Starter
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    18,277

    Re: [vb6] IDE-Safety Thunks: A new breed

    Project and thunks have been completely rewritten. In short, the thunks now use a shared private heap that can significantly reduce overall memory usage when multiple thunks and taskers are used simultaneously. In addition, I've used a "class factory" approach. Each time a tasker is created, if it is the first tasker of its category (9 categories currently), then the factory is created along with the tasker. As each new tasker is created of the same category, that tasker uses the same thunk. Every thunk has been designed this way, regardless of past comments where I said there could/would be exceptions.

    Also included with this update are more detailed documentation and two additional thunks. See first post at top of thread.

    Also included are optional wrappers. The wrappers can be found in post #2 above. Wrappers enable early-bound method calling, intellisense capable.

    This revision is completely incompatible with the previous. Do not overwrite your previous download if you still want that.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  19. #19

    Thread Starter
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    18,277

    Re: [vb6] IDE-Safety Thunks: A new breed

    One more try - a big blunder on my part. You may not have experienced the problem, but not worth the risk. Project is uploaded once again.

    Problem: I changed the way I allocated and overwrote memory allocations to speed up thunk creation (efficiency tweak). In doing so, the thunk allocations were no longer guaranteed to be zeroized. That means I need to overwrite the 4-byte blocks that would otherwise contain the value zero. I failed to include those blocks. That means if Windows gave me the allocation with junk in it (not zeroized), then the junk for those blocks remained.

    Solution: Simply include z_Sc() statements that have a value of zero instead of not including them. Did that & reposted.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width