home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / include / edksetup.h < prev    next >
C/C++ Source or Header  |  1998-04-25  |  10KB  |  183 lines

  1. // --edksetup.h-----------------------------------------------------------------
  2. // 
  3. // Copyright 1986 - 1998 Microsoft Corporation.  All Rights Reserved.
  4. // -----------------------------------------------------------------------------
  5. #if !defined(_EDKSETUP_H)
  6. #define _EDkSETUP_H
  7.  
  8. #include <windows.h>
  9.  
  10. #ifdef __cplusplus
  11. extern "C" {
  12. #endif // __cplusplus
  13.  
  14. #include "msdetect.h"
  15. #include "msregdb.h"
  16. #include "msshared.h"
  17. #include "setupapi.h"
  18.  
  19. //$--HrSendProgManCommand----------------------------------------------------
  20. //  Send one or more commands to the program manager.
  21. // -----------------------------------------------------------------------------
  22. HRESULT HrSendProgManCommand(    // RETURNS: return code
  23.     LPDWORD lpIdInst,               // pointer to instance ID
  24.     LPSTR lpszCommand);             // pointer to command string
  25.  
  26. //$--HrGetProgManGroups------------------------------------------------------
  27. //  Get the names of all the program groups.
  28. // -----------------------------------------------------------------------------
  29. HRESULT HrGetProgManGroups(      // RETURNS: return code
  30.     LPDWORD lpIdInst,               // pointer to instance ID
  31.     LPSTR *lppszGroups);            // pointer to groups string address variable
  32.  
  33. //$--AppendSlash----------------------------------------------------------------
  34. //  This function will append a backslash to a string if one does not
  35. //  already exist.
  36. // -----------------------------------------------------------------------------
  37. void AppendSlash(                       // RETURNS: nothing
  38.     IN OUT LPSTR sz1);                  // string
  39.  
  40. //$--RemoveTrailingSlash--------------------------------------------------------
  41. //  This function will remove a trailing slash from a string if it exists.
  42. //  It will NOT remove trailing slash from "X:\".
  43. // -----------------------------------------------------------------------------
  44. void RemoveTrailingSlash(               // RETURNS: nothing
  45.     IN OUT LPSTR sz1);                  // string
  46.  
  47. //$--ShowMessageBox-------------------------------------------------------------
  48. //  This displays a localizable message built by the message compiler in a
  49. //  message box.
  50. // -----------------------------------------------------------------------------
  51. int ShowMessageBox(             // RETURNS: message box result
  52.     IN LPCVOID lpSource,        // source of message resource (NULL = embedded)
  53.     IN DWORD dwMessageID,       // message ID
  54.     IN LPSTR lpszTitle,         // title
  55.     IN DWORD dwMsgBoxFlags,     // message box flags
  56.     IN DWORD dwLanguageID,      // language ID
  57.     IN ...);                    // arguments required for the message resource
  58.  
  59. //$--ExtractPath----------------------------------------------------------------
  60. //  This routine will give the path portion of a file name.
  61. // -----------------------------------------------------------------------------
  62. void ExtractPath(                       // RETURNS: nothing
  63.     IN  CHAR *pszPathName,              // full path name
  64.     OUT    CHAR *pszPath);                 // path name
  65.  
  66. //$--FEnumFiles-----------------------------------------------------------------
  67. //  This function provides a wrapper for the FindFirstFile() and FindNextFile()
  68. //  functions. Given a search string [Drive:][PATH\\]SearchPattern this 
  69. //  function will place file names (one per call) in pszFileName. When there
  70. //  are no more files that match the search string it will return FALSE. It
  71. //  will filter out the . and .. directories. This function is generally used
  72. //  like this:
  73. //
  74. //      hEnumFile = NULL;
  75. //        while(fEnumFiles(&hEnumFile, szSearchString, szFileName, &fDir))
  76. //      {
  77. //            if(fDir) ProcessDir(szFileName);
  78. //            else     ProcessFile(szFileName);
  79. //        }
  80. //
  81. // -----------------------------------------------------------------------------
  82. BOOL FEnumFiles(                    // RETURNS: TRUE if a file/dir was found
  83.     IN     CHAR   *pszSearchString, // directory & search pattern
  84.     IN OUT HANDLE *phScan,          // a pointer to EnumFiles instance handle 
  85.     OUT    CHAR   *pszFileName,     // current file name
  86.     OUT    BOOL   *pfDir);          // TRUE if a directory was found
  87.  
  88. //$--DwConnectNetworkShare------------------------------------------------------
  89. //  Connect a local drive letter to a network disk resource.
  90. // -----------------------------------------------------------------------------
  91. DWORD DwConnectNetworkShare(            // RETURNS: return code
  92.     IN  LPSTR lpszUNCName,              // UNC path to network share
  93.     OUT LPSTR lpszDriveLetter);         // drive letter
  94.  
  95. //$--FGetServiceDirectory-------------------------------------------------------
  96. //  Given a service name, gives the directory to the executable image.
  97. // -----------------------------------------------------------------------------
  98. BOOL FGetServiceDirectory(              // RETURNS: TRUE/FALSE
  99.     IN  LPSTR lpszServiceName,          // service name
  100.     OUT LPSTR lpszServiceDir);          // service directory
  101.  
  102. //$--FServiceExists-------------------------------------------------------------
  103. //  Ask the Service Control Manager if a particular service exists.
  104. // -----------------------------------------------------------------------------
  105. BOOL FServiceExists(                    // RETURNS: TRUE/FALSE
  106.     IN LPSTR lpszServiceName);          // service
  107.  
  108. //$--FServiceRunning------------------------------------------------------------
  109. //  Ask the Service Control Manager if a particular service is running. If the
  110. //  service is running, this function will attempt to stop it before returning.
  111. // -----------------------------------------------------------------------------
  112. BOOL FServiceRunning(                   // RETURNS: TRUE/FALSE
  113.     IN LPSTR lpszServiceName);          // service
  114.  
  115. //$--FDirEmpty------------------------------------------------------------------
  116. //  Checks to see if a given directory is empty.
  117. // -----------------------------------------------------------------------------
  118. BOOL FDirEmpty(                         // RETURNS: TRUE/FALSE
  119.     IN LPSTR lpszDirName);              // directory name
  120.  
  121. //$--EDKDeleteNode--------------------------------------------------------------
  122. //  This deletes a directory and files and directories contained within.
  123. //  NOTE: This is a recursive function.
  124. // -----------------------------------------------------------------------------
  125. void EDKDeleteNode(                     // RETURNS: nothing
  126.     IN LPSTR lpszDirName);              // directory name
  127.  
  128. //$--FNetworkAvailable----------------------------------------------------------
  129. //  Checks to see that a network is available
  130. // -----------------------------------------------------------------------------
  131. BOOL FNetworkAvailable(                 // RETURNS: TRUE/FALSE
  132.     void);                              // nothing
  133.  
  134. //$--FRegisterEventLog----------------------------------------------------------
  135. //  This function registers an application with the event log.
  136. // -----------------------------------------------------------------------------
  137. BOOL FRegisterEventLog(                 // RETURNS: TRUE/FALSE
  138.     IN LPSTR lpszServer,                // server name
  139.     IN LPSTR lpszApplicationName,       // application name
  140.     IN LPSTR lpszMessageDllName,        // message DLL path name
  141.     IN DWORD dwTypesSupported);         // events supported
  142.  
  143. //$--FDeregisterEventLog--------------------------------------------------------
  144. //  This function deregisters an application with the Event Log.
  145. // -----------------------------------------------------------------------------
  146. BOOL FDeregisterEventLog(               // RETURNS: TRUE/FALSE
  147.     IN LPSTR lpszServer,                // server name
  148.     IN LPSTR lpszApplicationName);      // application Name 
  149.  
  150. //$--EscapeBackSlashes----------------------------------------------------------
  151. //  This function copies a string, but doubles the number of backslashes.
  152. // -----------------------------------------------------------------------------
  153. void EscapeBackSlashes(                 // RETURNS: nothing
  154.     IN  LPSTR lpszSrcStr,               // source string
  155.     OUT LPSTR lpszDestStr);             // destination string
  156.  
  157. //$--FLoadCounters--------------------------------------------------------------
  158. //  Loads the counters by creating a LODCTR.EXE process.    
  159. // -----------------------------------------------------------------------------
  160. BOOL FLoadCounters(                     // RETURNS: TRUE/FALSE
  161.     IN LPSTR lpszFileName);             // INI file name
  162.  
  163. //$--FUnloadCounters------------------------------------------------------------
  164. //  Unloads the counters by creating a UNLODCTR.EXE process.    
  165. // -----------------------------------------------------------------------------
  166. BOOL FUnloadCounters(                   // RETURNS: TRUE/FALSE
  167.     IN LPSTR lpszClassName);            // service class name
  168.  
  169. //$--FGetDomainAccountName------------------------------------------------------
  170. //  This function gets the current user's domain acount name.
  171. // -----------------------------------------------------------------------------
  172. BOOL FGetDomainAccountName(             // RETURNS: TRUE/FALSE
  173.     IN OUT DWORD *lpdwDomainSize,       // domain name buffer size
  174.     IN OUT DWORD *lpdwAccountSize,      // account name buffer size
  175.     OUT LPSTR lpszDomainName,           // domain name
  176.     OUT LPSTR lpszAccountName);         // account name
  177.  
  178. #ifdef __cplusplus
  179. }
  180. #endif
  181.  
  182. #endif
  183.