ntos.h 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. /** BEGIN COPYRIGHT BLOCK
  2. * This Program is free software; you can redistribute it and/or modify it under
  3. * the terms of the GNU General Public License as published by the Free Software
  4. * Foundation; version 2 of the License.
  5. *
  6. * This Program is distributed in the hope that it will be useful, but WITHOUT
  7. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  8. * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  9. *
  10. * You should have received a copy of the GNU General Public License along with
  11. * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple
  12. * Place, Suite 330, Boston, MA 02111-1307 USA.
  13. *
  14. * In addition, as a special exception, Red Hat, Inc. gives You the additional
  15. * right to link the code of this Program with code not covered under the GNU
  16. * General Public License ("Non-GPL Code") and to distribute linked combinations
  17. * including the two, subject to the limitations in this paragraph. Non-GPL Code
  18. * permitted under this exception must only link to the code of this Program
  19. * through those well defined interfaces identified in the file named EXCEPTION
  20. * found in the source code files (the "Approved Interfaces"). The files of
  21. * Non-GPL Code may instantiate templates or use macros or inline functions from
  22. * the Approved Interfaces without causing the resulting work to be covered by
  23. * the GNU General Public License. Only Red Hat, Inc. may make changes or
  24. * additions to the list of Approved Interfaces. You must obey the GNU General
  25. * Public License in all respects for all of the Program code and other code used
  26. * in conjunction with the Program except the Non-GPL Code covered by this
  27. * exception. If you modify this file, you may extend this exception to your
  28. * version of the file, but you are not obligated to do so. If you do not wish to
  29. * provide this exception without modification, you must delete this exception
  30. * statement from your version and license this file solely under the GPL without
  31. * exception.
  32. *
  33. *
  34. * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
  35. * Copyright (C) 2005 Red Hat, Inc.
  36. * All rights reserved.
  37. * END COPYRIGHT BLOCK **/
  38. #ifdef HAVE_CONFIG_H
  39. # include <config.h>
  40. #endif
  41. /**********************************************************************
  42. * ntOS.h - functionality used bt NT Operating System
  43. *
  44. **********************************************************************/
  45. #ifndef _ntos_h
  46. #define _ntos_h
  47. #ifdef __cplusplus
  48. extern "C" { /* Assume C declarations for C++ */
  49. #endif /* __cplusplus */
  50. #ifdef ISHIELD_DLL
  51. #define NS_WINAPI WINAPI
  52. #else
  53. #define NS_WINAPI
  54. #endif
  55. /* prototypes for info.c */
  56. typedef enum {
  57. OS_WIN95,
  58. OS_WINNT,
  59. OS_WIN32S,
  60. OS_UNKNOWN
  61. } OS_TYPE;
  62. typedef enum {
  63. PROCESSOR_I386,
  64. PROCESSOR_ALPHA,
  65. PROCESSOR_MIPS,
  66. PROCESSOR_PPC,
  67. PROCESSOR_UNKNOWN
  68. } PROCESSOR_TYPE;
  69. OS_TYPE NS_WINAPI INFO_GetOperatingSystem ();
  70. DWORD NS_WINAPI INFO_GetOSMajorVersion ();
  71. DWORD NS_WINAPI INFO_GetOSMinorVersion ();
  72. void NS_WINAPI OS_GetComputerName (LPTSTR computerName, int nComputerNameLength );
  73. PROCESSOR_TYPE NS_WINAPI OS_GetProcessor ();
  74. DWORD NS_WINAPI INFO_GetOSServicePack ();
  75. /* prototypes for path.c */
  76. DWORD NS_WINAPI PATH_RemoveRelative ( char * path );
  77. DWORD NS_WINAPI PATH_ConvertNtSlashesToUnix( LPCTSTR lpszNtPath, LPSTR lpszUnixPath );
  78. DWORD NS_WINAPI PATH_GetNextFileInDirectory ( long hFile, char * path, char * lpFileName );
  79. DWORD NS_WINAPI PATH_GetNextSubDirectory( long hFile, char * path, char * lpSubDirectoryName, char * lpSubDirectoryPrefix );
  80. DWORD NS_WINAPI PATH_DeleteRecursively ( char * path );
  81. /* prototypes for registry.c */
  82. BOOL NS_WINAPI REG_CheckIfKeyExists( HKEY hKey, LPCTSTR registryKey );
  83. BOOL NS_WINAPI REG_CreateKey( HKEY hKey, LPCTSTR registryKey );
  84. BOOL NS_WINAPI REG_DeleteKey( HKEY hKey, LPCTSTR registryKey );
  85. BOOL NS_WINAPI REG_DeleteValue( HKEY hKey, LPCTSTR registryKey, LPCSTR valueName );
  86. BOOL NS_WINAPI
  87. REG_GetRegistryParameter(
  88. HKEY hKey,
  89. LPCTSTR registryKey,
  90. LPTSTR QueryValueName,
  91. LPDWORD ValueType,
  92. LPBYTE ValueBuffer,
  93. LPDWORD ValueBufferSize
  94. );
  95. BOOL NS_WINAPI
  96. REG_SetRegistryParameter(
  97. HKEY hKey,
  98. LPCTSTR registryKey,
  99. LPTSTR valueName,
  100. DWORD valueType,
  101. LPCTSTR ValueString,
  102. DWORD valueStringLength
  103. );
  104. BOOL NS_WINAPI
  105. REG_GetSubKeysInfo(
  106. HKEY hKey,
  107. LPCTSTR registryKey,
  108. LPDWORD lpdwNumberOfSubKeys,
  109. LPDWORD lpdwMaxSubKeyLength
  110. );
  111. BOOL NS_WINAPI
  112. REG_GetSubKey( HKEY hKey,
  113. LPCTSTR registryKey,
  114. DWORD nSubKeyIndex,
  115. LPTSTR registrySubKeyBuffer,
  116. DWORD subKeyBufferSize
  117. );
  118. /* prototypes for service.c */
  119. #define SERVRET_ERROR 0
  120. #define SERVRET_INSTALLED 1
  121. #define SERVRET_STARTING 2
  122. #define SERVRET_STARTED 3
  123. #define SERVRET_STOPPING 4
  124. #define SERVRET_REMOVED 5
  125. DWORD NS_WINAPI SERVICE_GetNTServiceStatus(LPCTSTR szServiceName, LPDWORD lpLastError );
  126. DWORD NS_WINAPI SERVICE_InstallNTService(LPCTSTR szServiceName, LPCTSTR szServiceDisplayName, LPCTSTR szServiceExe );
  127. DWORD NS_WINAPI SERVICE_ReinstallNTService(LPCTSTR szServiceName, LPCTSTR szServiceDisplayName, LPCTSTR szServiceExe );
  128. DWORD NS_WINAPI SERVICE_RemoveNTService(LPCTSTR szServiceName);
  129. DWORD NS_WINAPI SERVICE_StartNTService(LPCTSTR szServiceName);
  130. DWORD NS_WINAPI SERVICE_StartNTServiceAndWait(LPCTSTR szServiceName, LPDWORD lpdwLastError);
  131. DWORD NS_WINAPI SERVICE_StopNTService(LPCTSTR szServiceName);
  132. DWORD NS_WINAPI SERVICE_StopNTServiceAndWait(LPCTSTR szServiceName, LPDWORD lpdwLastError);
  133. /* prototypes for pmddeml.c */
  134. DWORD PMDDEML_Open ( void );
  135. BOOL PMDDEML_Close ( DWORD idInst );
  136. BOOL PMDDEML_CreateProgramManagerGroup ( DWORD idInst, LPCTSTR lpszGroupName );
  137. BOOL PMDDEML_DeleteProgramManagerGroup ( DWORD idInst, LPCTSTR lpszGroupName );
  138. BOOL PMDDEML_ShowProgramManagerGroup ( DWORD idInst, LPCTSTR lpszGroupName );
  139. BOOL PMDDEML_AddIconToProgramManagerGroup ( DWORD idInst, LPCTSTR lpszCmdLine,
  140. LPCTSTR lpszTitle, LPCTSTR lpszIconPath, LPCTSTR lpszWorkingDir,
  141. BOOL bReplace );
  142. BOOL PMDDEML_CreateProgramManagerCommonGroup ( DWORD idInst,
  143. LPCTSTR lpszGroupName );
  144. BOOL PMDDEML_DeleteProgramManagerCommonGroup ( DWORD idInst,
  145. LPCTSTR lpszGroupName );
  146. BOOL PMDDEML_ShowProgramManagerCommonGroup ( DWORD idInst,
  147. LPCTSTR lpszGroupName );
  148. BOOL PMDDEML_DeleteIconInProgramManagerGroup ( DWORD idInst, LPCTSTR lpszTitle );
  149. BOOL PMDDEML_GetProgramGroupInfo(DWORD idInst, LPSTR lpProgramGroup, char *szBuffer, DWORD cbBuffer);
  150. /* prototypes for tcpip.c */
  151. #define TCPIP_NO_ERROR 0
  152. #define TCPIP_UNSUPPORTED_OS 1
  153. #define TCPIP_NO_WINSOCK_DLL 2
  154. #define TCPIP_NO_TCPIP 3
  155. #define TCPIP_NETWORK_DOWN 4 /* The Windows Sockets implementation has detected that the network subsystem has failed. */
  156. #define TCPIP_NETWORK_ERROR 5
  157. #define TCPIP_HOST_NOT_FOUND 6 /* Authoritative Answer Host not found. */
  158. #define TCPIP_HOST_SERVER_DOWN 7 /* Non-Authoritative Host not found, or SERVERFAIL */
  159. #define TCPIP_HOST_VALID_NAME 8 /* Valid name, no data record of requested type. */
  160. DWORD NS_WINAPI
  161. TCPIP_GetDefaultHostName( LPTSTR lpszFullHostName, LPTSTR lpszHostName, LPTSTR lpszDomainName );
  162. DWORD NS_WINAPI TCPIP_VerifyHostName( LPCTSTR lpszHostName );
  163. #ifdef __cplusplus
  164. }
  165. #endif /* __cplusplus */
  166. #endif