D-Bus 1.4.20
|
00001 /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ 00002 /* dbus-sysdeps-util.c Would be in dbus-sysdeps.c, but not used in libdbus 00003 * 00004 * Copyright (C) 2002, 2003, 2004, 2005 Red Hat, Inc. 00005 * Copyright (C) 2003 CodeFactory AB 00006 * 00007 * Licensed under the Academic Free License version 2.1 00008 * 00009 * This program is free software; you can redistribute it and/or modify 00010 * it under the terms of the GNU General Public License as published by 00011 * the Free Software Foundation; either version 2 of the License, or 00012 * (at your option) any later version. 00013 * 00014 * This program is distributed in the hope that it will be useful, 00015 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00017 * GNU General Public License for more details. 00018 * 00019 * You should have received a copy of the GNU General Public License 00020 * along with this program; if not, write to the Free Software 00021 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00022 * 00023 */ 00024 00025 #include <config.h> 00026 00027 #define STRSAFE_NO_DEPRECATE 00028 00029 #include "dbus-sysdeps.h" 00030 #include "dbus-internals.h" 00031 #include "dbus-protocol.h" 00032 #include "dbus-string.h" 00033 #include "dbus-sysdeps.h" 00034 #include "dbus-sysdeps-win.h" 00035 #include "dbus-sockets-win.h" 00036 #include "dbus-memory.h" 00037 #include "dbus-pipe.h" 00038 00039 #include <stdio.h> 00040 #include <stdlib.h> 00041 #if HAVE_ERRNO_H 00042 #include <errno.h> 00043 #endif 00044 #include <winsock2.h> // WSA error codes 00045 00046 #ifndef DBUS_WINCE 00047 #include <io.h> 00048 #include <lm.h> 00049 #include <sys/stat.h> 00050 #endif 00051 00052 00062 dbus_bool_t 00063 _dbus_become_daemon (const DBusString *pidfile, 00064 DBusPipe *print_pid_pipe, 00065 DBusError *error, 00066 dbus_bool_t keep_umask) 00067 { 00068 return TRUE; 00069 } 00070 00079 static dbus_bool_t 00080 _dbus_write_pid_file (const DBusString *filename, 00081 unsigned long pid, 00082 DBusError *error) 00083 { 00084 const char *cfilename; 00085 HANDLE hnd; 00086 char pidstr[20]; 00087 int total; 00088 int bytes_to_write; 00089 00090 _DBUS_ASSERT_ERROR_IS_CLEAR (error); 00091 00092 cfilename = _dbus_string_get_const_data (filename); 00093 00094 hnd = CreateFileA (cfilename, GENERIC_WRITE, 00095 FILE_SHARE_READ | FILE_SHARE_WRITE, 00096 NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, 00097 INVALID_HANDLE_VALUE); 00098 if (hnd == INVALID_HANDLE_VALUE) 00099 { 00100 char *emsg = _dbus_win_error_string (GetLastError ()); 00101 dbus_set_error (error, _dbus_win_error_from_last_error (), 00102 "Could not create PID file %s: %s", 00103 cfilename, emsg); 00104 _dbus_win_free_error_string (emsg); 00105 return FALSE; 00106 } 00107 00108 if (snprintf (pidstr, sizeof (pidstr), "%lu\n", pid) < 0) 00109 { 00110 dbus_set_error (error, _dbus_error_from_system_errno (), 00111 "Failed to format PID for \"%s\": %s", cfilename, 00112 _dbus_strerror_from_errno ()); 00113 CloseHandle (hnd); 00114 return FALSE; 00115 } 00116 00117 total = 0; 00118 bytes_to_write = strlen (pidstr);; 00119 00120 while (total < bytes_to_write) 00121 { 00122 DWORD bytes_written; 00123 BOOL res; 00124 00125 res = WriteFile (hnd, pidstr + total, bytes_to_write - total, 00126 &bytes_written, NULL); 00127 00128 if (res == 0 || bytes_written <= 0) 00129 { 00130 char *emsg = _dbus_win_error_string (GetLastError ()); 00131 dbus_set_error (error, _dbus_win_error_from_last_error (), 00132 "Could not write to %s: %s", cfilename, emsg); 00133 _dbus_win_free_error_string (emsg); 00134 CloseHandle (hnd); 00135 return FALSE; 00136 } 00137 00138 total += bytes_written; 00139 } 00140 00141 if (CloseHandle (hnd) == 0) 00142 { 00143 char *emsg = _dbus_win_error_string (GetLastError ()); 00144 dbus_set_error (error, _dbus_win_error_from_last_error (), 00145 "Could not close file %s: %s", 00146 cfilename, emsg); 00147 _dbus_win_free_error_string (emsg); 00148 00149 return FALSE; 00150 } 00151 00152 return TRUE; 00153 } 00154 00166 dbus_bool_t 00167 _dbus_write_pid_to_file_and_pipe (const DBusString *pidfile, 00168 DBusPipe *print_pid_pipe, 00169 dbus_pid_t pid_to_write, 00170 DBusError *error) 00171 { 00172 if (pidfile) 00173 { 00174 _dbus_verbose ("writing pid file %s\n", _dbus_string_get_const_data (pidfile)); 00175 if (!_dbus_write_pid_file (pidfile, 00176 pid_to_write, 00177 error)) 00178 { 00179 _dbus_verbose ("pid file write failed\n"); 00180 _DBUS_ASSERT_ERROR_IS_SET(error); 00181 return FALSE; 00182 } 00183 } 00184 else 00185 { 00186 _dbus_verbose ("No pid file requested\n"); 00187 } 00188 00189 if (print_pid_pipe != NULL && _dbus_pipe_is_valid (print_pid_pipe)) 00190 { 00191 DBusString pid; 00192 int bytes; 00193 00194 _dbus_verbose ("writing our pid to pipe %d\n", print_pid_pipe->fd_or_handle); 00195 00196 if (!_dbus_string_init (&pid)) 00197 { 00198 _DBUS_SET_OOM (error); 00199 return FALSE; 00200 } 00201 00202 if (!_dbus_string_append_int (&pid, pid_to_write) || 00203 !_dbus_string_append (&pid, "\n")) 00204 { 00205 _dbus_string_free (&pid); 00206 _DBUS_SET_OOM (error); 00207 return FALSE; 00208 } 00209 00210 bytes = _dbus_string_get_length (&pid); 00211 if (_dbus_pipe_write (print_pid_pipe, &pid, 0, bytes, error) != bytes) 00212 { 00213 /* _dbus_pipe_write sets error only on failure, not short write */ 00214 if (error != NULL && !dbus_error_is_set(error)) 00215 { 00216 dbus_set_error (error, DBUS_ERROR_FAILED, 00217 "Printing message bus PID: did not write enough bytes\n"); 00218 } 00219 _dbus_string_free (&pid); 00220 return FALSE; 00221 } 00222 00223 _dbus_string_free (&pid); 00224 } 00225 else 00226 { 00227 _dbus_verbose ("No pid pipe to write to\n"); 00228 } 00229 00230 return TRUE; 00231 } 00232 00239 dbus_bool_t 00240 _dbus_verify_daemon_user (const char *user) 00241 { 00242 return TRUE; 00243 } 00244 00252 dbus_bool_t 00253 _dbus_change_to_daemon_user (const char *user, 00254 DBusError *error) 00255 { 00256 return TRUE; 00257 } 00258 00259 void 00260 _dbus_request_file_descriptor_limit (unsigned int limit) 00261 { 00262 } 00263 00264 void 00265 _dbus_init_system_log (void) 00266 { 00267 /* OutputDebugStringA doesn't need any special initialization, do nothing */ 00268 } 00269 00278 void 00279 _dbus_system_log (DBusSystemLogSeverity severity, const char *msg, ...) 00280 { 00281 va_list args; 00282 00283 va_start (args, msg); 00284 00285 _dbus_system_logv (severity, msg, args); 00286 00287 va_end (args); 00288 } 00289 00300 void 00301 _dbus_system_logv (DBusSystemLogSeverity severity, const char *msg, va_list args) 00302 { 00303 char *s = ""; 00304 char buf[1024]; 00305 00306 switch(severity) 00307 { 00308 case DBUS_SYSTEM_LOG_INFO: s = "info"; break; 00309 case DBUS_SYSTEM_LOG_SECURITY: s = "security"; break; 00310 case DBUS_SYSTEM_LOG_FATAL: s = "fatal"; break; 00311 } 00312 00313 sprintf(buf,"%s%s",s,msg); 00314 vsprintf(buf,buf,args); 00315 OutputDebugStringA(buf); 00316 00317 if (severity == DBUS_SYSTEM_LOG_FATAL) 00318 exit (1); 00319 } 00320 00326 void 00327 _dbus_set_signal_handler (int sig, 00328 DBusSignalHandler handler) 00329 { 00330 _dbus_verbose ("_dbus_set_signal_handler() has to be implemented\n"); 00331 } 00332 00341 dbus_bool_t 00342 _dbus_stat(const DBusString *filename, 00343 DBusStat *statbuf, 00344 DBusError *error) 00345 { 00346 const char *filename_c; 00347 WIN32_FILE_ATTRIBUTE_DATA wfad; 00348 char *lastdot; 00349 DWORD rc; 00350 00351 _DBUS_ASSERT_ERROR_IS_CLEAR (error); 00352 00353 filename_c = _dbus_string_get_const_data (filename); 00354 00355 if (!GetFileAttributesExA (filename_c, GetFileExInfoStandard, &wfad)) 00356 { 00357 _dbus_win_set_error_from_win_error (error, GetLastError ()); 00358 return FALSE; 00359 } 00360 00361 if (wfad.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) 00362 statbuf->mode = _S_IFDIR; 00363 else 00364 statbuf->mode = _S_IFREG; 00365 00366 statbuf->mode |= _S_IREAD; 00367 if (wfad.dwFileAttributes & FILE_ATTRIBUTE_READONLY) 00368 statbuf->mode |= _S_IWRITE; 00369 00370 lastdot = strrchr (filename_c, '.'); 00371 if (lastdot && stricmp (lastdot, ".exe") == 0) 00372 statbuf->mode |= _S_IEXEC; 00373 00374 statbuf->mode |= (statbuf->mode & 0700) >> 3; 00375 statbuf->mode |= (statbuf->mode & 0700) >> 6; 00376 00377 statbuf->nlink = 1; 00378 00379 #ifdef ENABLE_UID_TO_SID 00380 { 00381 PSID owner_sid, group_sid; 00382 PSECURITY_DESCRIPTOR sd; 00383 00384 sd = NULL; 00385 rc = GetNamedSecurityInfo ((char *) filename_c, SE_FILE_OBJECT, 00386 OWNER_SECURITY_INFORMATION | 00387 GROUP_SECURITY_INFORMATION, 00388 &owner_sid, &group_sid, 00389 NULL, NULL, 00390 &sd); 00391 if (rc != ERROR_SUCCESS) 00392 { 00393 _dbus_win_set_error_from_win_error (error, rc); 00394 if (sd != NULL) 00395 LocalFree (sd); 00396 return FALSE; 00397 } 00398 00399 /* FIXME */ 00400 statbuf->uid = _dbus_win_sid_to_uid_t (owner_sid); 00401 statbuf->gid = _dbus_win_sid_to_uid_t (group_sid); 00402 00403 LocalFree (sd); 00404 } 00405 #else 00406 statbuf->uid = DBUS_UID_UNSET; 00407 statbuf->gid = DBUS_GID_UNSET; 00408 #endif 00409 00410 statbuf->size = ((dbus_int64_t) wfad.nFileSizeHigh << 32) + wfad.nFileSizeLow; 00411 00412 statbuf->atime = 00413 (((dbus_int64_t) wfad.ftLastAccessTime.dwHighDateTime << 32) + 00414 wfad.ftLastAccessTime.dwLowDateTime) / 10000000 - DBUS_INT64_CONSTANT (116444736000000000); 00415 00416 statbuf->mtime = 00417 (((dbus_int64_t) wfad.ftLastWriteTime.dwHighDateTime << 32) + 00418 wfad.ftLastWriteTime.dwLowDateTime) / 10000000 - DBUS_INT64_CONSTANT (116444736000000000); 00419 00420 statbuf->ctime = 00421 (((dbus_int64_t) wfad.ftCreationTime.dwHighDateTime << 32) + 00422 wfad.ftCreationTime.dwLowDateTime) / 10000000 - DBUS_INT64_CONSTANT (116444736000000000); 00423 00424 return TRUE; 00425 } 00426 00427 00428 /* This file is part of the KDE project 00429 Copyright (C) 2000 Werner Almesberger 00430 00431 libc/sys/linux/sys/dirent.h - Directory entry as returned by readdir 00432 00433 This program is free software; you can redistribute it and/or 00434 modify it under the terms of the GNU Library General Public 00435 License as published by the Free Software Foundation; either 00436 version 2 of the License, or (at your option) any later version. 00437 00438 This program is distributed in the hope that it will be useful, 00439 but WITHOUT ANY WARRANTY; without even the implied warranty of 00440 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00441 Library General Public License for more details. 00442 00443 You should have received a copy of the GNU Library General Public License 00444 along with this program; see the file COPYING. If not, write to 00445 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00446 Boston, MA 02110-1301, USA. 00447 */ 00448 #define HAVE_NO_D_NAMLEN /* no struct dirent->d_namlen */ 00449 #define HAVE_DD_LOCK /* have locking mechanism */ 00450 00451 #define MAXNAMLEN 255 /* sizeof(struct dirent.d_name)-1 */ 00452 00453 #define __dirfd(dir) (dir)->dd_fd 00454 00455 /* struct dirent - same as Unix */ 00456 struct dirent 00457 { 00458 long d_ino; /* inode (always 1 in WIN32) */ 00459 off_t d_off; /* offset to this dirent */ 00460 unsigned short d_reclen; /* length of d_name */ 00461 char d_name[_MAX_FNAME+1]; /* filename (null terminated) */ 00462 }; 00463 00464 /* typedef DIR - not the same as Unix */ 00465 typedef struct 00466 { 00467 HANDLE handle; /* FindFirst/FindNext handle */ 00468 short offset; /* offset into directory */ 00469 short finished; /* 1 if there are not more files */ 00470 WIN32_FIND_DATAA fileinfo; /* from FindFirst/FindNext */ 00471 char *dir; /* the dir we are reading */ 00472 struct dirent dent; /* the dirent to return */ 00473 } 00474 DIR; 00475 00476 /********************************************************************** 00477 * Implement dirent-style opendir/readdir/closedir on Window 95/NT 00478 * 00479 * Functions defined are opendir(), readdir() and closedir() with the 00480 * same prototypes as the normal dirent.h implementation. 00481 * 00482 * Does not implement telldir(), seekdir(), rewinddir() or scandir(). 00483 * The dirent struct is compatible with Unix, except that d_ino is 00484 * always 1 and d_off is made up as we go along. 00485 * 00486 * Error codes are not available with errno but GetLastError. 00487 * 00488 * The DIR typedef is not compatible with Unix. 00489 **********************************************************************/ 00490 00491 static DIR * _dbus_opendir(const char *dir) 00492 { 00493 DIR *dp; 00494 char *filespec; 00495 HANDLE handle; 00496 int index; 00497 00498 filespec = malloc(strlen(dir) + 2 + 1); 00499 strcpy(filespec, dir); 00500 index = strlen(filespec) - 1; 00501 if (index >= 0 && (filespec[index] == '/' || filespec[index] == '\\')) 00502 filespec[index] = '\0'; 00503 strcat(filespec, "\\*"); 00504 00505 dp = (DIR *)malloc(sizeof(DIR)); 00506 dp->offset = 0; 00507 dp->finished = 0; 00508 dp->dir = strdup(dir); 00509 00510 handle = FindFirstFileA(filespec, &(dp->fileinfo)); 00511 if (handle == INVALID_HANDLE_VALUE) 00512 { 00513 if (GetLastError() == ERROR_NO_MORE_FILES) 00514 dp->finished = 1; 00515 else 00516 return NULL; 00517 } 00518 00519 dp->handle = handle; 00520 free(filespec); 00521 00522 return dp; 00523 } 00524 00525 static struct dirent * _dbus_readdir(DIR *dp) 00526 { 00527 int saved_err = GetLastError(); 00528 00529 if (!dp || dp->finished) 00530 return NULL; 00531 00532 if (dp->offset != 0) 00533 { 00534 if (FindNextFileA(dp->handle, &(dp->fileinfo)) == 0) 00535 { 00536 if (GetLastError() == ERROR_NO_MORE_FILES) 00537 { 00538 SetLastError(saved_err); 00539 dp->finished = 1; 00540 } 00541 return NULL; 00542 } 00543 } 00544 dp->offset++; 00545 00546 strncpy(dp->dent.d_name, dp->fileinfo.cFileName, _MAX_FNAME); 00547 dp->dent.d_ino = 1; 00548 dp->dent.d_reclen = strlen(dp->dent.d_name); 00549 dp->dent.d_off = dp->offset; 00550 00551 return &(dp->dent); 00552 } 00553 00554 00555 static int _dbus_closedir(DIR *dp) 00556 { 00557 if (!dp) 00558 return 0; 00559 FindClose(dp->handle); 00560 if (dp->dir) 00561 free(dp->dir); 00562 if (dp) 00563 free(dp); 00564 00565 return 0; 00566 } 00567 00568 00572 struct DBusDirIter 00573 { 00574 DIR *d; 00576 }; 00577 00585 DBusDirIter* 00586 _dbus_directory_open (const DBusString *filename, 00587 DBusError *error) 00588 { 00589 DIR *d; 00590 DBusDirIter *iter; 00591 const char *filename_c; 00592 00593 _DBUS_ASSERT_ERROR_IS_CLEAR (error); 00594 00595 filename_c = _dbus_string_get_const_data (filename); 00596 00597 d = _dbus_opendir (filename_c); 00598 if (d == NULL) 00599 { 00600 char *emsg = _dbus_win_error_string (GetLastError ()); 00601 dbus_set_error (error, _dbus_win_error_from_last_error (), 00602 "Failed to read directory \"%s\": %s", 00603 filename_c, emsg); 00604 _dbus_win_free_error_string (emsg); 00605 return NULL; 00606 } 00607 iter = dbus_new0 (DBusDirIter, 1); 00608 if (iter == NULL) 00609 { 00610 _dbus_closedir (d); 00611 dbus_set_error (error, DBUS_ERROR_NO_MEMORY, 00612 "Could not allocate memory for directory iterator"); 00613 return NULL; 00614 } 00615 00616 iter->d = d; 00617 00618 return iter; 00619 } 00620 00634 dbus_bool_t 00635 _dbus_directory_get_next_file (DBusDirIter *iter, 00636 DBusString *filename, 00637 DBusError *error) 00638 { 00639 struct dirent *ent; 00640 00641 _DBUS_ASSERT_ERROR_IS_CLEAR (error); 00642 00643 again: 00644 SetLastError (0); 00645 ent = _dbus_readdir (iter->d); 00646 if (ent == NULL) 00647 { 00648 if (GetLastError() != 0) 00649 { 00650 char *emsg = _dbus_win_error_string (GetLastError ()); 00651 dbus_set_error (error, _dbus_win_error_from_last_error (), 00652 "Failed to get next in directory: %s", emsg); 00653 _dbus_win_free_error_string (emsg); 00654 } 00655 return FALSE; 00656 } 00657 else if (ent->d_name[0] == '.' && 00658 (ent->d_name[1] == '\0' || 00659 (ent->d_name[1] == '.' && ent->d_name[2] == '\0'))) 00660 goto again; 00661 else 00662 { 00663 _dbus_string_set_length (filename, 0); 00664 if (!_dbus_string_append (filename, ent->d_name)) 00665 { 00666 dbus_set_error (error, DBUS_ERROR_NO_MEMORY, 00667 "No memory to read directory entry"); 00668 return FALSE; 00669 } 00670 else 00671 return TRUE; 00672 } 00673 } 00674 00678 void 00679 _dbus_directory_close (DBusDirIter *iter) 00680 { 00681 _dbus_closedir (iter->d); 00682 dbus_free (iter); 00683 } 00684 /* End of DBusInternalsUtils functions */ 00686 00698 dbus_bool_t 00699 _dbus_string_get_dirname(const DBusString *filename, 00700 DBusString *dirname) 00701 { 00702 int sep; 00703 00704 _dbus_assert (filename != dirname); 00705 _dbus_assert (filename != NULL); 00706 _dbus_assert (dirname != NULL); 00707 00708 /* Ignore any separators on the end */ 00709 sep = _dbus_string_get_length (filename); 00710 if (sep == 0) 00711 return _dbus_string_append (dirname, "."); /* empty string passed in */ 00712 00713 while (sep > 0 && 00714 (_dbus_string_get_byte (filename, sep - 1) == '/' || 00715 _dbus_string_get_byte (filename, sep - 1) == '\\')) 00716 --sep; 00717 00718 _dbus_assert (sep >= 0); 00719 00720 if (sep == 0 || 00721 (sep == 2 && 00722 _dbus_string_get_byte (filename, 1) == ':' && 00723 isalpha (_dbus_string_get_byte (filename, 0)))) 00724 return _dbus_string_copy_len (filename, 0, sep + 1, 00725 dirname, _dbus_string_get_length (dirname)); 00726 00727 { 00728 int sep1, sep2; 00729 _dbus_string_find_byte_backward (filename, sep, '/', &sep1); 00730 _dbus_string_find_byte_backward (filename, sep, '\\', &sep2); 00731 00732 sep = MAX (sep1, sep2); 00733 } 00734 if (sep < 0) 00735 return _dbus_string_append (dirname, "."); 00736 00737 while (sep > 0 && 00738 (_dbus_string_get_byte (filename, sep - 1) == '/' || 00739 _dbus_string_get_byte (filename, sep - 1) == '\\')) 00740 --sep; 00741 00742 _dbus_assert (sep >= 0); 00743 00744 if ((sep == 0 || 00745 (sep == 2 && 00746 _dbus_string_get_byte (filename, 1) == ':' && 00747 isalpha (_dbus_string_get_byte (filename, 0)))) 00748 && 00749 (_dbus_string_get_byte (filename, sep) == '/' || 00750 _dbus_string_get_byte (filename, sep) == '\\')) 00751 return _dbus_string_copy_len (filename, 0, sep + 1, 00752 dirname, _dbus_string_get_length (dirname)); 00753 else 00754 return _dbus_string_copy_len (filename, 0, sep - 0, 00755 dirname, _dbus_string_get_length (dirname)); 00756 } 00757 00758 00766 dbus_bool_t 00767 _dbus_unix_user_is_process_owner (dbus_uid_t uid) 00768 { 00769 return FALSE; 00770 } 00771 00772 dbus_bool_t _dbus_windows_user_is_process_owner (const char *windows_sid) 00773 { 00774 return TRUE; 00775 } 00776 00777 /*===================================================================== 00778 unix emulation functions - should be removed sometime in the future 00779 =====================================================================*/ 00780 00790 dbus_bool_t 00791 _dbus_unix_user_is_at_console (dbus_uid_t uid, 00792 DBusError *error) 00793 { 00794 dbus_set_error (error, DBUS_ERROR_NOT_SUPPORTED, 00795 "UNIX user IDs not supported on Windows\n"); 00796 return FALSE; 00797 } 00798 00799 00808 dbus_bool_t 00809 _dbus_parse_unix_group_from_config (const DBusString *groupname, 00810 dbus_gid_t *gid_p) 00811 { 00812 return FALSE; 00813 } 00814 00823 dbus_bool_t 00824 _dbus_parse_unix_user_from_config (const DBusString *username, 00825 dbus_uid_t *uid_p) 00826 { 00827 return FALSE; 00828 } 00829 00830 00841 dbus_bool_t 00842 _dbus_unix_groups_from_uid (dbus_uid_t uid, 00843 dbus_gid_t **group_ids, 00844 int *n_group_ids) 00845 { 00846 return FALSE; 00847 } 00848 00849 00850 /* DBusString stuff */ 00852 00853 /************************************************************************ 00854 00855 error handling 00856 00857 ************************************************************************/ 00858 00859 00860 00861 00862 00863 /* lan manager error codes */ 00864 const char* 00865 _dbus_lm_strerror(int error_number) 00866 { 00867 #ifdef DBUS_WINCE 00868 // TODO 00869 return "unknown"; 00870 #else 00871 const char *msg; 00872 switch (error_number) 00873 { 00874 case NERR_NetNotStarted: 00875 return "The workstation driver is not installed."; 00876 case NERR_UnknownServer: 00877 return "The server could not be located."; 00878 case NERR_ShareMem: 00879 return "An internal error occurred. The network cannot access a shared memory segment."; 00880 case NERR_NoNetworkResource: 00881 return "A network resource shortage occurred."; 00882 case NERR_RemoteOnly: 00883 return "This operation is not supported on workstations."; 00884 case NERR_DevNotRedirected: 00885 return "The device is not connected."; 00886 case NERR_ServerNotStarted: 00887 return "The Server service is not started."; 00888 case NERR_ItemNotFound: 00889 return "The queue is empty."; 00890 case NERR_UnknownDevDir: 00891 return "The device or directory does not exist."; 00892 case NERR_RedirectedPath: 00893 return "The operation is invalid on a redirected resource."; 00894 case NERR_DuplicateShare: 00895 return "The name has already been shared."; 00896 case NERR_NoRoom: 00897 return "The server is currently out of the requested resource."; 00898 case NERR_TooManyItems: 00899 return "Requested addition of items exceeds the maximum allowed."; 00900 case NERR_InvalidMaxUsers: 00901 return "The Peer service supports only two simultaneous users."; 00902 case NERR_BufTooSmall: 00903 return "The API return buffer is too small."; 00904 case NERR_RemoteErr: 00905 return "A remote API error occurred."; 00906 case NERR_LanmanIniError: 00907 return "An error occurred when opening or reading the configuration file."; 00908 case NERR_NetworkError: 00909 return "A general network error occurred."; 00910 case NERR_WkstaInconsistentState: 00911 return "The Workstation service is in an inconsistent state. Restart the computer before restarting the Workstation service."; 00912 case NERR_WkstaNotStarted: 00913 return "The Workstation service has not been started."; 00914 case NERR_BrowserNotStarted: 00915 return "The requested information is not available."; 00916 case NERR_InternalError: 00917 return "An internal error occurred."; 00918 case NERR_BadTransactConfig: 00919 return "The server is not configured for transactions."; 00920 case NERR_InvalidAPI: 00921 return "The requested API is not supported on the remote server."; 00922 case NERR_BadEventName: 00923 return "The event name is invalid."; 00924 case NERR_DupNameReboot: 00925 return "The computer name already exists on the network. Change it and restart the computer."; 00926 case NERR_CfgCompNotFound: 00927 return "The specified component could not be found in the configuration information."; 00928 case NERR_CfgParamNotFound: 00929 return "The specified parameter could not be found in the configuration information."; 00930 case NERR_LineTooLong: 00931 return "A line in the configuration file is too long."; 00932 case NERR_QNotFound: 00933 return "The printer does not exist."; 00934 case NERR_JobNotFound: 00935 return "The print job does not exist."; 00936 case NERR_DestNotFound: 00937 return "The printer destination cannot be found."; 00938 case NERR_DestExists: 00939 return "The printer destination already exists."; 00940 case NERR_QExists: 00941 return "The printer queue already exists."; 00942 case NERR_QNoRoom: 00943 return "No more printers can be added."; 00944 case NERR_JobNoRoom: 00945 return "No more print jobs can be added."; 00946 case NERR_DestNoRoom: 00947 return "No more printer destinations can be added."; 00948 case NERR_DestIdle: 00949 return "This printer destination is idle and cannot accept control operations."; 00950 case NERR_DestInvalidOp: 00951 return "This printer destination request contains an invalid control function."; 00952 case NERR_ProcNoRespond: 00953 return "The print processor is not responding."; 00954 case NERR_SpoolerNotLoaded: 00955 return "The spooler is not running."; 00956 case NERR_DestInvalidState: 00957 return "This operation cannot be performed on the print destination in its current state."; 00958 case NERR_QInvalidState: 00959 return "This operation cannot be performed on the printer queue in its current state."; 00960 case NERR_JobInvalidState: 00961 return "This operation cannot be performed on the print job in its current state."; 00962 case NERR_SpoolNoMemory: 00963 return "A spooler memory allocation failure occurred."; 00964 case NERR_DriverNotFound: 00965 return "The device driver does not exist."; 00966 case NERR_DataTypeInvalid: 00967 return "The data type is not supported by the print processor."; 00968 case NERR_ProcNotFound: 00969 return "The print processor is not installed."; 00970 case NERR_ServiceTableLocked: 00971 return "The service database is locked."; 00972 case NERR_ServiceTableFull: 00973 return "The service table is full."; 00974 case NERR_ServiceInstalled: 00975 return "The requested service has already been started."; 00976 case NERR_ServiceEntryLocked: 00977 return "The service does not respond to control actions."; 00978 case NERR_ServiceNotInstalled: 00979 return "The service has not been started."; 00980 case NERR_BadServiceName: 00981 return "The service name is invalid."; 00982 case NERR_ServiceCtlTimeout: 00983 return "The service is not responding to the control function."; 00984 case NERR_ServiceCtlBusy: 00985 return "The service control is busy."; 00986 case NERR_BadServiceProgName: 00987 return "The configuration file contains an invalid service program name."; 00988 case NERR_ServiceNotCtrl: 00989 return "The service could not be controlled in its present state."; 00990 case NERR_ServiceKillProc: 00991 return "The service ended abnormally."; 00992 case NERR_ServiceCtlNotValid: 00993 return "The requested pause or stop is not valid for this service."; 00994 case NERR_NotInDispatchTbl: 00995 return "The service control dispatcher could not find the service name in the dispatch table."; 00996 case NERR_BadControlRecv: 00997 return "The service control dispatcher pipe read failed."; 00998 case NERR_ServiceNotStarting: 00999 return "A thread for the new service could not be created."; 01000 case NERR_AlreadyLoggedOn: 01001 return "This workstation is already logged on to the local-area network."; 01002 case NERR_NotLoggedOn: 01003 return "The workstation is not logged on to the local-area network."; 01004 case NERR_BadUsername: 01005 return "The user name or group name parameter is invalid."; 01006 case NERR_BadPassword: 01007 return "The password parameter is invalid."; 01008 case NERR_UnableToAddName_W: 01009 return "@W The logon processor did not add the message alias."; 01010 case NERR_UnableToAddName_F: 01011 return "The logon processor did not add the message alias."; 01012 case NERR_UnableToDelName_W: 01013 return "@W The logoff processor did not delete the message alias."; 01014 case NERR_UnableToDelName_F: 01015 return "The logoff processor did not delete the message alias."; 01016 case NERR_LogonsPaused: 01017 return "Network logons are paused."; 01018 case NERR_LogonServerConflict: 01019 return "A centralized logon-server conflict occurred."; 01020 case NERR_LogonNoUserPath: 01021 return "The server is configured without a valid user path."; 01022 case NERR_LogonScriptError: 01023 return "An error occurred while loading or running the logon script."; 01024 case NERR_StandaloneLogon: 01025 return "The logon server was not specified. Your computer will be logged on as STANDALONE."; 01026 case NERR_LogonServerNotFound: 01027 return "The logon server could not be found."; 01028 case NERR_LogonDomainExists: 01029 return "There is already a logon domain for this computer."; 01030 case NERR_NonValidatedLogon: 01031 return "The logon server could not validate the logon."; 01032 case NERR_ACFNotFound: 01033 return "The security database could not be found."; 01034 case NERR_GroupNotFound: 01035 return "The group name could not be found."; 01036 case NERR_UserNotFound: 01037 return "The user name could not be found."; 01038 case NERR_ResourceNotFound: 01039 return "The resource name could not be found."; 01040 case NERR_GroupExists: 01041 return "The group already exists."; 01042 case NERR_UserExists: 01043 return "The user account already exists."; 01044 case NERR_ResourceExists: 01045 return "The resource permission list already exists."; 01046 case NERR_NotPrimary: 01047 return "This operation is only allowed on the primary domain controller of the domain."; 01048 case NERR_ACFNotLoaded: 01049 return "The security database has not been started."; 01050 case NERR_ACFNoRoom: 01051 return "There are too many names in the user accounts database."; 01052 case NERR_ACFFileIOFail: 01053 return "A disk I/O failure occurred."; 01054 case NERR_ACFTooManyLists: 01055 return "The limit of 64 entries per resource was exceeded."; 01056 case NERR_UserLogon: 01057 return "Deleting a user with a session is not allowed."; 01058 case NERR_ACFNoParent: 01059 return "The parent directory could not be located."; 01060 case NERR_CanNotGrowSegment: 01061 return "Unable to add to the security database session cache segment."; 01062 case NERR_SpeGroupOp: 01063 return "This operation is not allowed on this special group."; 01064 case NERR_NotInCache: 01065 return "This user is not cached in user accounts database session cache."; 01066 case NERR_UserInGroup: 01067 return "The user already belongs to this group."; 01068 case NERR_UserNotInGroup: 01069 return "The user does not belong to this group."; 01070 case NERR_AccountUndefined: 01071 return "This user account is undefined."; 01072 case NERR_AccountExpired: 01073 return "This user account has expired."; 01074 case NERR_InvalidWorkstation: 01075 return "The user is not allowed to log on from this workstation."; 01076 case NERR_InvalidLogonHours: 01077 return "The user is not allowed to log on at this time."; 01078 case NERR_PasswordExpired: 01079 return "The password of this user has expired."; 01080 case NERR_PasswordCantChange: 01081 return "The password of this user cannot change."; 01082 case NERR_PasswordHistConflict: 01083 return "This password cannot be used now."; 01084 case NERR_PasswordTooShort: 01085 return "The password does not meet the password policy requirements. Check the minimum password length, password complexity and password history requirements."; 01086 case NERR_PasswordTooRecent: 01087 return "The password of this user is too recent to change."; 01088 case NERR_InvalidDatabase: 01089 return "The security database is corrupted."; 01090 case NERR_DatabaseUpToDate: 01091 return "No updates are necessary to this replicant network/local security database."; 01092 case NERR_SyncRequired: 01093 return "This replicant database is outdated; synchronization is required."; 01094 case NERR_UseNotFound: 01095 return "The network connection could not be found."; 01096 case NERR_BadAsgType: 01097 return "This asg_type is invalid."; 01098 case NERR_DeviceIsShared: 01099 return "This device is currently being shared."; 01100 case NERR_NoComputerName: 01101 return "The computer name could not be added as a message alias. The name may already exist on the network."; 01102 case NERR_MsgAlreadyStarted: 01103 return "The Messenger service is already started."; 01104 case NERR_MsgInitFailed: 01105 return "The Messenger service failed to start."; 01106 case NERR_NameNotFound: 01107 return "The message alias could not be found on the network."; 01108 case NERR_AlreadyForwarded: 01109 return "This message alias has already been forwarded."; 01110 case NERR_AddForwarded: 01111 return "This message alias has been added but is still forwarded."; 01112 case NERR_AlreadyExists: 01113 return "This message alias already exists locally."; 01114 case NERR_TooManyNames: 01115 return "The maximum number of added message aliases has been exceeded."; 01116 case NERR_DelComputerName: 01117 return "The computer name could not be deleted."; 01118 case NERR_LocalForward: 01119 return "Messages cannot be forwarded back to the same workstation."; 01120 case NERR_GrpMsgProcessor: 01121 return "An error occurred in the domain message processor."; 01122 case NERR_PausedRemote: 01123 return "The message was sent, but the recipient has paused the Messenger service."; 01124 case NERR_BadReceive: 01125 return "The message was sent but not received."; 01126 case NERR_NameInUse: 01127 return "The message alias is currently in use. Try again later."; 01128 case NERR_MsgNotStarted: 01129 return "The Messenger service has not been started."; 01130 case NERR_NotLocalName: 01131 return "The name is not on the local computer."; 01132 case NERR_NoForwardName: 01133 return "The forwarded message alias could not be found on the network."; 01134 case NERR_RemoteFull: 01135 return "The message alias table on the remote station is full."; 01136 case NERR_NameNotForwarded: 01137 return "Messages for this alias are not currently being forwarded."; 01138 case NERR_TruncatedBroadcast: 01139 return "The broadcast message was truncated."; 01140 case NERR_InvalidDevice: 01141 return "This is an invalid device name."; 01142 case NERR_WriteFault: 01143 return "A write fault occurred."; 01144 case NERR_DuplicateName: 01145 return "A duplicate message alias exists on the network."; 01146 case NERR_DeleteLater: 01147 return "@W This message alias will be deleted later."; 01148 case NERR_IncompleteDel: 01149 return "The message alias was not successfully deleted from all networks."; 01150 case NERR_MultipleNets: 01151 return "This operation is not supported on computers with multiple networks."; 01152 case NERR_NetNameNotFound: 01153 return "This shared resource does not exist."; 01154 case NERR_DeviceNotShared: 01155 return "This device is not shared."; 01156 case NERR_ClientNameNotFound: 01157 return "A session does not exist with that computer name."; 01158 case NERR_FileIdNotFound: 01159 return "There is not an open file with that identification number."; 01160 case NERR_ExecFailure: 01161 return "A failure occurred when executing a remote administration command."; 01162 case NERR_TmpFile: 01163 return "A failure occurred when opening a remote temporary file."; 01164 case NERR_TooMuchData: 01165 return "The data returned from a remote administration command has been truncated to 64K."; 01166 case NERR_DeviceShareConflict: 01167 return "This device cannot be shared as both a spooled and a non-spooled resource."; 01168 case NERR_BrowserTableIncomplete: 01169 return "The information in the list of servers may be incorrect."; 01170 case NERR_NotLocalDomain: 01171 return "The computer is not active in this domain."; 01172 #ifdef NERR_IsDfsShare 01173 01174 case NERR_IsDfsShare: 01175 return "The share must be removed from the Distributed File System before it can be deleted."; 01176 #endif 01177 01178 case NERR_DevInvalidOpCode: 01179 return "The operation is invalid for this device."; 01180 case NERR_DevNotFound: 01181 return "This device cannot be shared."; 01182 case NERR_DevNotOpen: 01183 return "This device was not open."; 01184 case NERR_BadQueueDevString: 01185 return "This device name list is invalid."; 01186 case NERR_BadQueuePriority: 01187 return "The queue priority is invalid."; 01188 case NERR_NoCommDevs: 01189 return "There are no shared communication devices."; 01190 case NERR_QueueNotFound: 01191 return "The queue you specified does not exist."; 01192 case NERR_BadDevString: 01193 return "This list of devices is invalid."; 01194 case NERR_BadDev: 01195 return "The requested device is invalid."; 01196 case NERR_InUseBySpooler: 01197 return "This device is already in use by the spooler."; 01198 case NERR_CommDevInUse: 01199 return "This device is already in use as a communication device."; 01200 case NERR_InvalidComputer: 01201 return "This computer name is invalid."; 01202 case NERR_MaxLenExceeded: 01203 return "The string and prefix specified are too long."; 01204 case NERR_BadComponent: 01205 return "This path component is invalid."; 01206 case NERR_CantType: 01207 return "Could not determine the type of input."; 01208 case NERR_TooManyEntries: 01209 return "The buffer for types is not big enough."; 01210 case NERR_ProfileFileTooBig: 01211 return "Profile files cannot exceed 64K."; 01212 case NERR_ProfileOffset: 01213 return "The start offset is out of range."; 01214 case NERR_ProfileCleanup: 01215 return "The system cannot delete current connections to network resources."; 01216 case NERR_ProfileUnknownCmd: 01217 return "The system was unable to parse the command line in this file."; 01218 case NERR_ProfileLoadErr: 01219 return "An error occurred while loading the profile file."; 01220 case NERR_ProfileSaveErr: 01221 return "@W Errors occurred while saving the profile file. The profile was partially saved."; 01222 case NERR_LogOverflow: 01223 return "Log file %1 is full."; 01224 case NERR_LogFileChanged: 01225 return "This log file has changed between reads."; 01226 case NERR_LogFileCorrupt: 01227 return "Log file %1 is corrupt."; 01228 case NERR_SourceIsDir: 01229 return "The source path cannot be a directory."; 01230 case NERR_BadSource: 01231 return "The source path is illegal."; 01232 case NERR_BadDest: 01233 return "The destination path is illegal."; 01234 case NERR_DifferentServers: 01235 return "The source and destination paths are on different servers."; 01236 case NERR_RunSrvPaused: 01237 return "The Run server you requested is paused."; 01238 case NERR_ErrCommRunSrv: 01239 return "An error occurred when communicating with a Run server."; 01240 case NERR_ErrorExecingGhost: 01241 return "An error occurred when starting a background process."; 01242 case NERR_ShareNotFound: 01243 return "The shared resource you are connected to could not be found."; 01244 case NERR_InvalidLana: 01245 return "The LAN adapter number is invalid."; 01246 case NERR_OpenFiles: 01247 return "There are open files on the connection."; 01248 case NERR_ActiveConns: 01249 return "Active connections still exist."; 01250 case NERR_BadPasswordCore: 01251 return "This share name or password is invalid."; 01252 case NERR_DevInUse: 01253 return "The device is being accessed by an active process."; 01254 case NERR_LocalDrive: 01255 return "The drive letter is in use locally."; 01256 case NERR_AlertExists: 01257 return "The specified client is already registered for the specified event."; 01258 case NERR_TooManyAlerts: 01259 return "The alert table is full."; 01260 case NERR_NoSuchAlert: 01261 return "An invalid or nonexistent alert name was raised."; 01262 case NERR_BadRecipient: 01263 return "The alert recipient is invalid."; 01264 case NERR_AcctLimitExceeded: 01265 return "A user's session with this server has been deleted."; 01266 case NERR_InvalidLogSeek: 01267 return "The log file does not contain the requested record number."; 01268 case NERR_BadUasConfig: 01269 return "The user accounts database is not configured correctly."; 01270 case NERR_InvalidUASOp: 01271 return "This operation is not permitted when the Netlogon service is running."; 01272 case NERR_LastAdmin: 01273 return "This operation is not allowed on the last administrative account."; 01274 case NERR_DCNotFound: 01275 return "Could not find domain controller for this domain."; 01276 case NERR_LogonTrackingError: 01277 return "Could not set logon information for this user."; 01278 case NERR_NetlogonNotStarted: 01279 return "The Netlogon service has not been started."; 01280 case NERR_CanNotGrowUASFile: 01281 return "Unable to add to the user accounts database."; 01282 case NERR_TimeDiffAtDC: 01283 return "This server's clock is not synchronized with the primary domain controller's clock."; 01284 case NERR_PasswordMismatch: 01285 return "A password mismatch has been detected."; 01286 case NERR_NoSuchServer: 01287 return "The server identification does not specify a valid server."; 01288 case NERR_NoSuchSession: 01289 return "The session identification does not specify a valid session."; 01290 case NERR_NoSuchConnection: 01291 return "The connection identification does not specify a valid connection."; 01292 case NERR_TooManyServers: 01293 return "There is no space for another entry in the table of available servers."; 01294 case NERR_TooManySessions: 01295 return "The server has reached the maximum number of sessions it supports."; 01296 case NERR_TooManyConnections: 01297 return "The server has reached the maximum number of connections it supports."; 01298 case NERR_TooManyFiles: 01299 return "The server cannot open more files because it has reached its maximum number."; 01300 case NERR_NoAlternateServers: 01301 return "There are no alternate servers registered on this server."; 01302 case NERR_TryDownLevel: 01303 return "Try down-level (remote admin protocol) version of API instead."; 01304 case NERR_UPSDriverNotStarted: 01305 return "The UPS driver could not be accessed by the UPS service."; 01306 case NERR_UPSInvalidConfig: 01307 return "The UPS service is not configured correctly."; 01308 case NERR_UPSInvalidCommPort: 01309 return "The UPS service could not access the specified Comm Port."; 01310 case NERR_UPSSignalAsserted: 01311 return "The UPS indicated a line fail or low battery situation. Service not started."; 01312 case NERR_UPSShutdownFailed: 01313 return "The UPS service failed to perform a system shut down."; 01314 case NERR_BadDosRetCode: 01315 return "The program below returned an MS-DOS error code:"; 01316 case NERR_ProgNeedsExtraMem: 01317 return "The program below needs more memory:"; 01318 case NERR_BadDosFunction: 01319 return "The program below called an unsupported MS-DOS function:"; 01320 case NERR_RemoteBootFailed: 01321 return "The workstation failed to boot."; 01322 case NERR_BadFileCheckSum: 01323 return "The file below is corrupt."; 01324 case NERR_NoRplBootSystem: 01325 return "No loader is specified in the boot-block definition file."; 01326 case NERR_RplLoadrNetBiosErr: 01327 return "NetBIOS returned an error: The NCB and SMB are dumped above."; 01328 case NERR_RplLoadrDiskErr: 01329 return "A disk I/O error occurred."; 01330 case NERR_ImageParamErr: 01331 return "Image parameter substitution failed."; 01332 case NERR_TooManyImageParams: 01333 return "Too many image parameters cross disk sector boundaries."; 01334 case NERR_NonDosFloppyUsed: 01335 return "The image was not generated from an MS-DOS diskette formatted with /S."; 01336 case NERR_RplBootRestart: 01337 return "Remote boot will be restarted later."; 01338 case NERR_RplSrvrCallFailed: 01339 return "The call to the Remoteboot server failed."; 01340 case NERR_CantConnectRplSrvr: 01341 return "Cannot connect to the Remoteboot server."; 01342 case NERR_CantOpenImageFile: 01343 return "Cannot open image file on the Remoteboot server."; 01344 case NERR_CallingRplSrvr: 01345 return "Connecting to the Remoteboot server..."; 01346 case NERR_StartingRplBoot: 01347 return "Connecting to the Remoteboot server..."; 01348 case NERR_RplBootServiceTerm: 01349 return "Remote boot service was stopped; check the error log for the cause of the problem."; 01350 case NERR_RplBootStartFailed: 01351 return "Remote boot startup failed; check the error log for the cause of the problem."; 01352 case NERR_RPL_CONNECTED: 01353 return "A second connection to a Remoteboot resource is not allowed."; 01354 case NERR_BrowserConfiguredToNotRun: 01355 return "The browser service was configured with MaintainServerList=No."; 01356 case NERR_RplNoAdaptersStarted: 01357 return "Service failed to start since none of the network adapters started with this service."; 01358 case NERR_RplBadRegistry: 01359 return "Service failed to start due to bad startup information in the registry."; 01360 case NERR_RplBadDatabase: 01361 return "Service failed to start because its database is absent or corrupt."; 01362 case NERR_RplRplfilesShare: 01363 return "Service failed to start because RPLFILES share is absent."; 01364 case NERR_RplNotRplServer: 01365 return "Service failed to start because RPLUSER group is absent."; 01366 case NERR_RplCannotEnum: 01367 return "Cannot enumerate service records."; 01368 case NERR_RplWkstaInfoCorrupted: 01369 return "Workstation record information has been corrupted."; 01370 case NERR_RplWkstaNotFound: 01371 return "Workstation record was not found."; 01372 case NERR_RplWkstaNameUnavailable: 01373 return "Workstation name is in use by some other workstation."; 01374 case NERR_RplProfileInfoCorrupted: 01375 return "Profile record information has been corrupted."; 01376 case NERR_RplProfileNotFound: 01377 return "Profile record was not found."; 01378 case NERR_RplProfileNameUnavailable: 01379 return "Profile name is in use by some other profile."; 01380 case NERR_RplProfileNotEmpty: 01381 return "There are workstations using this profile."; 01382 case NERR_RplConfigInfoCorrupted: 01383 return "Configuration record information has been corrupted."; 01384 case NERR_RplConfigNotFound: 01385 return "Configuration record was not found."; 01386 case NERR_RplAdapterInfoCorrupted: 01387 return "Adapter ID record information has been corrupted."; 01388 case NERR_RplInternal: 01389 return "An internal service error has occurred."; 01390 case NERR_RplVendorInfoCorrupted: 01391 return "Vendor ID record information has been corrupted."; 01392 case NERR_RplBootInfoCorrupted: 01393 return "Boot block record information has been corrupted."; 01394 case NERR_RplWkstaNeedsUserAcct: 01395 return "The user account for this workstation record is missing."; 01396 case NERR_RplNeedsRPLUSERAcct: 01397 return "The RPLUSER local group could not be found."; 01398 case NERR_RplBootNotFound: 01399 return "Boot block record was not found."; 01400 case NERR_RplIncompatibleProfile: 01401 return "Chosen profile is incompatible with this workstation."; 01402 case NERR_RplAdapterNameUnavailable: 01403 return "Chosen network adapter ID is in use by some other workstation."; 01404 case NERR_RplConfigNotEmpty: 01405 return "There are profiles using this configuration."; 01406 case NERR_RplBootInUse: 01407 return "There are workstations, profiles, or configurations using this boot block."; 01408 case NERR_RplBackupDatabase: 01409 return "Service failed to backup Remoteboot database."; 01410 case NERR_RplAdapterNotFound: 01411 return "Adapter record was not found."; 01412 case NERR_RplVendorNotFound: 01413 return "Vendor record was not found."; 01414 case NERR_RplVendorNameUnavailable: 01415 return "Vendor name is in use by some other vendor record."; 01416 case NERR_RplBootNameUnavailable: 01417 return "(boot name, vendor ID) is in use by some other boot block record."; 01418 case NERR_RplConfigNameUnavailable: 01419 return "Configuration name is in use by some other configuration."; 01420 case NERR_DfsInternalCorruption: 01421 return "The internal database maintained by the Dfs service is corrupt."; 01422 case NERR_DfsVolumeDataCorrupt: 01423 return "One of the records in the internal Dfs database is corrupt."; 01424 case NERR_DfsNoSuchVolume: 01425 return "There is no DFS name whose entry path matches the input Entry Path."; 01426 case NERR_DfsVolumeAlreadyExists: 01427 return "A root or link with the given name already exists."; 01428 case NERR_DfsAlreadyShared: 01429 return "The server share specified is already shared in the Dfs."; 01430 case NERR_DfsNoSuchShare: 01431 return "The indicated server share does not support the indicated DFS namespace."; 01432 case NERR_DfsNotALeafVolume: 01433 return "The operation is not valid on this portion of the namespace."; 01434 case NERR_DfsLeafVolume: 01435 return "The operation is not valid on this portion of the namespace."; 01436 case NERR_DfsVolumeHasMultipleServers: 01437 return "The operation is ambiguous because the link has multiple servers."; 01438 case NERR_DfsCantCreateJunctionPoint: 01439 return "Unable to create a link."; 01440 case NERR_DfsServerNotDfsAware: 01441 return "The server is not Dfs Aware."; 01442 case NERR_DfsBadRenamePath: 01443 return "The specified rename target path is invalid."; 01444 case NERR_DfsVolumeIsOffline: 01445 return "The specified DFS link is offline."; 01446 case NERR_DfsNoSuchServer: 01447 return "The specified server is not a server for this link."; 01448 case NERR_DfsCyclicalName: 01449 return "A cycle in the Dfs name was detected."; 01450 case NERR_DfsNotSupportedInServerDfs: 01451 return "The operation is not supported on a server-based Dfs."; 01452 case NERR_DfsDuplicateService: 01453 return "This link is already supported by the specified server-share."; 01454 case NERR_DfsCantRemoveLastServerShare: 01455 return "Can't remove the last server-share supporting this root or link."; 01456 case NERR_DfsVolumeIsInterDfs: 01457 return "The operation is not supported for an Inter-DFS link."; 01458 case NERR_DfsInconsistent: 01459 return "The internal state of the Dfs Service has become inconsistent."; 01460 case NERR_DfsServerUpgraded: 01461 return "The Dfs Service has been installed on the specified server."; 01462 case NERR_DfsDataIsIdentical: 01463 return "The Dfs data being reconciled is identical."; 01464 case NERR_DfsCantRemoveDfsRoot: 01465 return "The DFS root cannot be deleted. Uninstall DFS if required."; 01466 case NERR_DfsChildOrParentInDfs: 01467 return "A child or parent directory of the share is already in a Dfs."; 01468 case NERR_DfsInternalError: 01469 return "Dfs internal error."; 01470 /* the following are not defined in mingw */ 01471 #if 0 01472 01473 case NERR_SetupAlreadyJoined: 01474 return "This machine is already joined to a domain."; 01475 case NERR_SetupNotJoined: 01476 return "This machine is not currently joined to a domain."; 01477 case NERR_SetupDomainController: 01478 return "This machine is a domain controller and cannot be unjoined from a domain."; 01479 case NERR_DefaultJoinRequired: 01480 return "The destination domain controller does not support creating machine accounts in OUs."; 01481 case NERR_InvalidWorkgroupName: 01482 return "The specified workgroup name is invalid."; 01483 case NERR_NameUsesIncompatibleCodePage: 01484 return "The specified computer name is incompatible with the default language used on the domain controller."; 01485 case NERR_ComputerAccountNotFound: 01486 return "The specified computer account could not be found."; 01487 case NERR_PersonalSku: 01488 return "This version of Windows cannot be joined to a domain."; 01489 case NERR_PasswordMustChange: 01490 return "The password must change at the next logon."; 01491 case NERR_AccountLockedOut: 01492 return "The account is locked out."; 01493 case NERR_PasswordTooLong: 01494 return "The password is too long."; 01495 case NERR_PasswordNotComplexEnough: 01496 return "The password does not meet the complexity policy."; 01497 case NERR_PasswordFilterError: 01498 return "The password does not meet the requirements of the password filter DLLs."; 01499 #endif 01500 01501 } 01502 msg = strerror (error_number); 01503 if (msg == NULL) 01504 msg = "unknown"; 01505 01506 return msg; 01507 #endif //DBUS_WINCE 01508 } 01509 01524 dbus_bool_t 01525 _dbus_command_for_pid (unsigned long pid, 01526 DBusString *str, 01527 int max_len, 01528 DBusError *error) 01529 { 01530 // FIXME 01531 return FALSE; 01532 }