| Table Of Contents |
| WFC Classes |
NetServerGetInfo().
CService
- NT Services class. Makes creating services pretty brainless.
CServiceApplication - This
class encapsulates all of the logic behind installing, removing and running from a command line (to make
debugging easier) needed by a service application.
CServiceConfiguration - Basically duplicated QUERY_SERVICE_CONFIG structure.
CServiceControlManager
- Plays with the Service Control Manager. Allows you to start, stop, install
and remove services on the local machine or on a server on the net.
CServiceNameAndStatus - Encapsulates the ENUM_SERVICE_STATUS structure.
CSessionInformation - Session information based on SESSION_INFO_502 structure.
Basically, gives you same info as Control Panel->Server->Users->Connected Users
CSharedMemoryObject - Let's
you create shared memory segments easily.
CSimpleSocket - Base class for TCP/IP sockets.
Derived from CDummyFile.
CSimpleSocketFile - Turns an existing
CSimpleSocket
into a CFile. Generally, this is called from
CListeningSocket::OnNewConnection()
CSoundSentry - Encapsulates the SOUNDSENTRY structure.
CStickyKeys - Encapsulates the STICKYKEYS structure.
CSystemAuditEntry - Encapsulates the SYSTEM_AUDIT_ACE structure.
CSystemTime - Encapsulates the SYSTEMTIME structure/API.
It also allows you to get and set the computer's clock.
CTalkingSocket - A socket you can use to connect to existing sockets (you connect to a server).
CTape - Handles the Tape API. It finally works.
CTapeGetDriveParameters - Encapsulates the TAPE_GET_DRIVE_PARAMETERS data structure.
CTapeGetMediaParameters -
Encapsulates the TAPE_GET_MEDIA_PARAMETERS data structure.
CTapeSetDriveParameters - Encapsulates the TAPE_SET_DRIVE_PARAMETERS data structure.
CTapeSetMediaParameters - Encapsulates the TAPE_SET_MEDIA_PARAMETERS data structure.
CTextMetric - Encapsulates the TEXTMETRIC structure.
CToggleKeys - Encapsulates the TOGGLEKEYS structure.
CUINT64 - Encapsulates the UINT64 structure.
CUniformResourceLocator - Plays with URL's Example: http://www.microsoft.com/hello.html
CUniversalNamingConvention - Plays with UNC's Example: \\buckaroo\public\neato\readme.txt
CVolume -
This class let's you eject removable media (CD-ROM's
JAZ drives, tapes, etc). It also let's you lock drives.
CWindowPlacement - Encapsulates the WINDOWPLACEMENT structure.
CWorkstationTransport - Patterend after WKSTA_TRANSPORT_INFO_0, gives you smurphy
information about you network transports (ever wonder what your MAC address is?).
CWorkstationInformation - Patterned after WKSTA_INFO_102, used in CNetWorkstation::Enumerate
CWorkstationUser - Patterned after WKSTA_USER_INFO_1, used in CNetWorkstation::Enumerate
CXMLArchive - This class
is modeled after the CArchive MFC class. It allows
you to serialize (or persist) objects to and from
XML documents.
| Classes That Ain't Exactly Win32 |
NERR_* error codes to text; the FormatMessage() trick doesn't work on
these error codes.
bit_clear - Macro to set a bit to zero.
bit_set - Macro to set a bit to one.
bit_test - Test the value of a bit.
wfc_am_i_administrator - C Function
that returns TRUE if you have Administrator priveleges.
wfc_append_string_to_CByteArray - C Function
that appends a string to an array of bytes.
wfc_append_text_to_edit_control - C Function
that appends text to an edit control.
wfc_close_handle - C function
that returns TRUE if CloseHandle() returns not FALSE. This helps
in debugging when you pass an invalid handle to CloseHandle().
wfc_convert_double_null_terminated_string() -
Converts a double-NULL terminated string to a CStringArray.
double-NULL strings are used in a lot of self-referential structures.
wfc_convert_lpcwstr_to_cstring() - This eliminated a lot of code in the networking classes.
Microsoft (even in Visual C++ version 4.2) has the networking API header files all screwed up.
The string parameters are mis-typed. I used to have a lot of code in the classes to detect and
fix this but it was real ugly (and prevented const correctness). Adding this function allowed
me to fix Microsoft's mistake in one function.
wfc_create_hard_link - C function
that creates two directory entries for one file. It implements the upcoming NT 5.0
API named CreateHardLink().
wfc_delete_oldest_file - C function
that deletes the oldest file in a directory. It will return TRUE if a file
was deleted or FALSE it a file was not deleted. This is useful in a file cache
management system.
wfc_enable_privilege -
A little routine to enable a specific privilege by name.
wfc_enable_all_privileges -
A routine I wrote because I hate
Microsoft's error messages. They are 100% accurate and totally useless.
For example, "Access is Denied." WHICH access
is denied???? Another brilliant message was "class failed to
initialize" It came from a COM application. Wouldn't it be helpful
to know which of the four cudzillion COM objects hidden on the system
failed to load??? Anyway, wfc_enable_all_privileges simply
acquires as many privileges as is possible.
wfc_get_activex_servers - C function
that retrieves a list of servers that are marked as safe to download ActiveX controls from.
If you see a server named CODEBASE listed, it means your machine is
vulnerable to malicious code being downloaded. You can secure your machine by
removing CODEBASE from the server list and calling
wfc_set_activex_servers.
wfc_get_directory_usage_percentage - C function
that returns an integer percentage of the space used on a volume by a directory.
This is useful in a file cache management system.
wfc_get_error_string - C function
that cryptic error codes into something humanly readable.
wfc_get_executable_directory - C function
that returns the directory name (ending in a slash) that the executable calling this function exists in. This is good for
finding configuration files that must exist in the same directory as the executable.
wfc_get_filename_from_handle -
C function that returns the file name given a file's handle. It
uses the partially documented NtQueryInformationFile to perform this magic.
wfc_get_operating_system_version_string -
Fills a CString with a nice OS version string (including service pack level).
wfc_get_string_from_clipboard -
Fills a CString with whatever is in the clipboard.
wfc_get_thread_name -
A function that fills a CString with the name of the thread it
was called in. Really handy when debugging multi-threaded programs.
This name is set via
wfc_set_thread_name.
Also by putting (char*)((DW(@TIB)+0x14)) in the debugger's
watch window, you can see the thread name appear. When you select a new
thread to debug, the thread's name will automatically appear in the watch window.
wfc_get_web_page() -
Retrieves a URL and puts the page into a CStringArray.
This is great for retrieving data from the web.
wfc_move_file_at_reboot() - This function let's
you schedule a file to be moved at the next reboot.
This is how system DLL's are upgraded.
wfc_parse_iso_8601_string -
This function parses ISO8601 dates into a CTime or COleDateTime object.
wfc_set_activex_servers - C function
that sets the list of servers that are marked as safe to download ActiveX controls from.
If include a server named CODEBASE, your machine will
vulnerable to malicious code being downloaded. You can retrieve the list of trusted servers via
wfc_get_activex_servers.
wfc_set_thread_name -
A function that allows you to set a string constant as the "name"
of a thread. Really handy when debugging multi-threaded programs.
Also by putting (char*)((DW(@TIB)+0x14)) in the debugger's
watch window, you can see the thread name appear. When you select a new
thread to debug, the thread's name will automatically appear in the watch window.
wfc_start_screen_saver -
C function that activates the screen saver.
wfc_undocumented_get_system_process_list - Uses an
undocumented function to get a list of all processes running in an NT system.