News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

How to synchronize a database?

Started by NoCforMe, January 10, 2025, 08:33:32 AM

Previous topic - Next topic

TimoVJL

krnl32x.def
LIBRARY kernel32.dll
EXPORTS
 _CancelSynchronousIo@4
polib -def:krnl32x.def -out:krnl32x.lib -machine:x86
May the source be with you

sinsi


NoCforMe

Assembly language programming should be fun. That's why I do it.

NoCforMe

Quote from: TimoVJL on January 15, 2025, 02:08:34 PMkrnl32x.def
LIBRARY kernel32.dll
EXPORTS
 _CancelSynchronousIo@4
polib -def:krnl32x.def -out:krnl32x.lib -machine:x86
Timo, I'm not using that Po stuff; I'm using regular old MASM.
Assembly language programming should be fun. That's why I do it.


NoCforMe

Quote from: TimoVJL on January 15, 2025, 04:03:47 PMBuilding an Import Library and Export File

I'm not going to go to the trouble to create a library just for one stupid missing function in MASM include files: I just load it directly from the DLL using LoadLibrary() and GetProcAddress().
Assembly language programming should be fun. That's why I do it.

NoCforMe

OK, here's an update: everything seems to work correctly, except for one thing.

What doesn't work is setting the parameter to ReadDirectoryChangesW() that selects whether the subtree below the selected directory is monitored or not. (The parameter is bWatchSubtree, a BOOL set to TRUE or FALSE.)

To be precise, it does work--the first time you call the function. But afterwards, even though I'm exiting the thread within which this function is called, and then restarting the thread anew with the new setting of this parameter, it stubbornly holds onto the original value.

Maybe someone here can do a little testing of this? It's annoying, and certainly not covered at all in the Micro$oft documentation.
Assembly language programming should be fun. That's why I do it.

sinsi

I had to make one change (added WS_VSCROLL to the editbox).
Subdirectory flag only seems to work as it is initially set at program start, changing it (even after stop) does nothing.
QuoteWhen you first call ReadDirectoryChangesW, the system allocates a buffer to store change information. This buffer is associated with the directory handle until it is closed and its size does not change during its lifetime.
I suspect it caches that flag, maybe open the dir handle at the start of the thread and close it when the thread exits.

edit:
It works if you open/close within the thread but only if you stop monitoring, toggle the flag then start monitoring.
You could probably get it to work in the check handler by stop/starting the monitor.