The harvest truly is plenteous, but the labourers are few. Matthew 9:37 Below, you will find a few Win32 samples. They are not stylish, they ignore error handling, they ridicule the principles of OO design; yet they do work, and maybe you will find one that is useful to you. bumpup.awk Massages MIDL-generated RPC stubs to fix a 5 KB, 09-Jul-97 buffer overrun in the RPC runtime libraries. checkacl.cpp Explores the contents of an NT security 15 KB, 25-Apr-97 descriptor, down to its smallest components. Checkacl optionally fixes ACE inheritance and writes the SD back to disk. dump_ntfs_streams.cpp [Image] dump_ntfs_streams uses BackupRead() and 3 KB, 13-Jan-97 BackupSeek() to iterate through all the streams of a given NTFS file and reports name, type, and size for each stream. fkill.cpp Shows how to use OpenProcess() and 3 KB, 21-Oct-97 TerminateProcess() to kill a running program. If the user has the SeDebugPrivilege, it is enabled, allowing fkill to kill processes under builtin\system, too. is_admin.cpp This sample determines whether it is 2 KB, 03-Nov-97 running with administrative privileges. More precisely, it checks whether the user under which the program was started is a member of the local Administrators group. is_svc.txt Demonstrates how to find out whether it is 8 KB, 14-Mar-97 running as a service and, if so, whether it is running under builtin\system or under a vanilla account. Also determines whether the service is running with access to the interactive window station. Kudos to Rohan Phillips! lnw.cpp [Image] This sample demonstrates how to create a 2 KB, 13-Jan-97 hard, Posix-style, link with the Win32 function BackupWrite(). lsa_lear.cpp [Image] This sample uses 4 KB, 14-Dec-97 LsaEnumerateAccountRights() from the LSA API to display the privileges associated with an account. Note that only directly assigned privs are examined; in normal use, a user's privileges are the agglomeration of his and all his groups' rights. lu_cpau_gui.cpp Kindly provided by Chris Novak, this 14 KB, 19-Sep-97 sample demonstrates how a non-interactive service running as builtin\system ("LocalSystem") uses LogonUser() and CreateProcessAsUser() to run a GUI app on the default desktop of the interactive window station. midlbug.zip Initially demonstrated old MIDL bugs. Now, 64 KB, 24-Jun-97 it is the only sample for authenticated RPC that I am aware of. nse.c Shows the use of NetServerEnum() and 3 KB, 16-Sep-97 decodes the server flags. nue_nqdi.cpp Uses NetUserEnum() and 4 KB, 28-Jul-97 NetQueryDisplayInformation() to retrieve a list of users. NQDI() is also employed to get a list of machine accounts and groups. nugg.cpp Demos NetUserGetGroups() and its somewhat 1 KB, 12-Aug-97 odd way of managing memory. rb.c Reboots Windows NT on the local or on a 5 KB, 08-May-97 remote machine and demonstrates all options of InitiateSystemShutDown(). showpriv_getsetcbpriv.cpp Shows the privileges that the current user 3 KB, 29-Jul-97 has and then tries to enable the SeTcbPrivilege. wnoe_wner.c Enumerates the entire network with 3 KB, 31-Jul-97 WNetOpenEnum() and WNetEnumResource(). zoomview.zip Modified Scribble MFC sample that 38 KB, 12-Nov-97 demonstrates the use of CZoomView, a modification of CScrollView that allows zooming. Kudos to Thomas Zeisluft for sharing this! [Home] · [INS utilities] · [Win32 samples] · [VB samples] [Lynx-Enhanced]