00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #undef open
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-memory.h"
00036
00037 #include <io.h>
00038 #include <sys/stat.h>
00039 #include <aclapi.h>
00040
00041 #include <stdio.h>
00042 #include <stdlib.h>
00043 #include <fcntl.h>
00044 #include <errno.h>
00045
00046 #if defined __MINGW32__ || (defined _MSC_VER && _MSC_VER <= 1310)
00047
00048
00049
00050 #define errno_t int
00051
00052 errno_t strcat_s(char *dest, size_t size, char *src)
00053 {
00054 _dbus_assert(strlen(dest) + strlen(src) +1 <= size);
00055 strcat(dest,src);
00056 return 0;
00057 }
00058
00059 errno_t strcpy_s(char *dest, size_t size, char *src)
00060 {
00061 _dbus_assert(strlen(src) +1 <= size);
00062 strcpy(dest,src);
00063 return 0;
00064 }
00065 #endif
00066
00075 dbus_bool_t
00076 _dbus_become_daemon (const DBusString *pidfile,
00077 DBusPipe *print_pid_pipe,
00078 DBusError *error)
00079 {
00080 return TRUE;
00081 }
00082
00091 dbus_bool_t
00092 _dbus_write_pid_file (const DBusString *filename,
00093 unsigned long pid,
00094 DBusError *error)
00095 {
00096 const char *cfilename;
00097 DBusFile file;
00098 FILE *f;
00099
00100 cfilename = _dbus_string_get_const_data (filename);
00101
00102 if (!_dbus_file_open(&file, cfilename, O_WRONLY|O_CREAT|O_EXCL|O_BINARY, 0644))
00103 {
00104 dbus_set_error (error, _dbus_error_from_errno (errno),
00105 "Failed to open \"%s\": %s", cfilename,
00106 _dbus_strerror (errno));
00107 return FALSE;
00108 }
00109
00110 if ((f = fdopen (file.FDATA, "w")) == NULL)
00111 {
00112 dbus_set_error (error, _dbus_error_from_errno (errno),
00113 "Failed to fdopen fd %d: %s", file.FDATA, _dbus_strerror (errno));
00114 _dbus_file_close (&file, NULL);
00115 return FALSE;
00116 }
00117
00118 if (fprintf (f, "%lu\n", pid) < 0)
00119 {
00120 dbus_set_error (error, _dbus_error_from_errno (errno),
00121 "Failed to write to \"%s\": %s", cfilename,
00122 _dbus_strerror (errno));
00123
00124 fclose (f);
00125 return FALSE;
00126 }
00127
00128 if (fclose (f) == EOF)
00129 {
00130 dbus_set_error (error, _dbus_error_from_errno (errno),
00131 "Failed to close \"%s\": %s", cfilename,
00132 _dbus_strerror (errno));
00133 return FALSE;
00134 }
00135
00136 return TRUE;
00137 }
00138
00145 dbus_bool_t
00146 _dbus_verify_daemon_user (const char *user)
00147 {
00148 return TRUE;
00149 }
00150
00158 dbus_bool_t
00159 _dbus_change_to_daemon_user (const char *user,
00160 DBusError *error)
00161 {
00162 return TRUE;
00163 }
00164
00173 dbus_bool_t
00174 _dbus_change_identity (dbus_uid_t uid,
00175 dbus_gid_t gid,
00176 DBusError *error)
00177 {
00178 return TRUE;
00179 }
00180
00187 dbus_bool_t
00188 _dbus_user_at_console(const char *username,
00189 DBusError *error)
00190 {
00191 #ifdef DBUS_WINCE
00192 return TRUE;
00193 #else
00194 dbus_bool_t retval = FALSE;
00195 wchar_t *wusername;
00196 DWORD sid_length;
00197 PSID user_sid, console_user_sid;
00198 HWINSTA winsta;
00199
00200 wusername = _dbus_win_utf8_to_utf16 (username, error);
00201 if (!wusername)
00202 return FALSE;
00203
00204
00205 if (!_dbus_win_account_to_sid (wusername, &user_sid, error))
00206 goto out0;
00207
00208
00209
00210
00211 if (!(winsta = OpenWindowStation ("WinSta0", FALSE, READ_CONTROL)))
00212 {
00213 _dbus_win_set_error_from_win_error (error, GetLastError ());
00214 goto out2;
00215 }
00216
00217 sid_length = 0;
00218 GetUserObjectInformation (winsta, UOI_USER_SID,
00219 NULL, 0, &sid_length);
00220 if (sid_length == 0)
00221 {
00222
00223 goto out2;
00224 }
00225
00226 if (sid_length < 0 || sid_length > 1000)
00227 {
00228 dbus_set_error_const (error, DBUS_ERROR_FAILED, "Invalid SID length");
00229 goto out3;
00230 }
00231
00232 console_user_sid = dbus_malloc (sid_length);
00233 if (!console_user_sid)
00234 {
00235 _DBUS_SET_OOM (error);
00236 goto out3;
00237 }
00238
00239 if (!GetUserObjectInformation (winsta, UOI_USER_SID,
00240 console_user_sid, sid_length, &sid_length))
00241 {
00242 _dbus_win_set_error_from_win_error (error, GetLastError ());
00243 goto out4;
00244 }
00245
00246 if (!IsValidSid (console_user_sid))
00247 {
00248 dbus_set_error_const (error, DBUS_ERROR_FAILED, "Invalid SID");
00249 goto out4;
00250 }
00251
00252 retval = EqualSid (user_sid, console_user_sid);
00253
00254 out4:
00255 dbus_free (console_user_sid);
00256 out3:
00257 CloseWindowStation (winsta);
00258 out2:
00259 dbus_free (user_sid);
00260 out0:
00261 dbus_free (wusername);
00262
00263 return retval;
00264 #endif //DBUS_WINCE
00265 }
00266
00274 dbus_bool_t
00275 _dbus_delete_directory (const DBusString *filename,
00276 DBusError *error)
00277 {
00278 const char *filename_c;
00279
00280 _DBUS_ASSERT_ERROR_IS_CLEAR (error);
00281
00282 filename_c = _dbus_string_get_const_data (filename);
00283
00284 if (rmdir (filename_c) != 0)
00285 {
00286 dbus_set_error (error, DBUS_ERROR_FAILED,
00287 "Failed to remove directory %s: %s\n",
00288 filename_c, _dbus_strerror (errno));
00289 return FALSE;
00290 }
00291
00292 return TRUE;
00293 }
00294
00300 void
00301 _dbus_set_signal_handler (int sig,
00302 DBusSignalHandler handler)
00303 {
00304 _dbus_verbose ("_dbus_set_signal_handler() has to be implemented\n");
00305 }
00306
00312 dbus_bool_t
00313 _dbus_file_exists (const char *file)
00314 {
00315 HANDLE h = CreateFile(
00316 file,
00317 0,
00318 0,
00319 NULL,
00320 OPEN_EXISTING,
00321 FILE_ATTRIBUTE_NORMAL,
00322 NULL
00323 );
00324
00325
00326 if (h != INVALID_HANDLE_VALUE && GetLastError() != ERROR_PATH_NOT_FOUND)
00327 {
00328 CloseHandle(h);
00329 return TRUE;
00330 }
00331 else
00332 return FALSE;
00333 }
00334
00343 dbus_bool_t
00344 _dbus_stat(const DBusString *filename,
00345 DBusStat *statbuf,
00346 DBusError *error)
00347 {
00348 #ifdef DBUS_WINCE
00349 return TRUE;
00350
00351 #else
00352 const char *filename_c;
00353 #if !defined(DBUS_WIN) && !defined(DBUS_WINCE)
00354
00355 struct stat sb;
00356 #else
00357
00358 WIN32_FILE_ATTRIBUTE_DATA wfad;
00359 char *lastdot;
00360 DWORD rc;
00361 PSID owner_sid, group_sid;
00362 PSECURITY_DESCRIPTOR sd;
00363 #endif
00364
00365 _DBUS_ASSERT_ERROR_IS_CLEAR (error);
00366
00367 filename_c = _dbus_string_get_const_data (filename);
00368
00369 if (!GetFileAttributesEx (filename_c, GetFileExInfoStandard, &wfad))
00370 {
00371 _dbus_win_set_error_from_win_error (error, GetLastError ());
00372 return FALSE;
00373 }
00374
00375 if (wfad.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
00376 statbuf->mode = _S_IFDIR;
00377 else
00378 statbuf->mode = _S_IFREG;
00379
00380 statbuf->mode |= _S_IREAD;
00381 if (wfad.dwFileAttributes & FILE_ATTRIBUTE_READONLY)
00382 statbuf->mode |= _S_IWRITE;
00383
00384 lastdot = strrchr (filename_c, '.');
00385 if (lastdot && stricmp (lastdot, ".exe") == 0)
00386 statbuf->mode |= _S_IEXEC;
00387
00388 statbuf->mode |= (statbuf->mode & 0700) >> 3;
00389 statbuf->mode |= (statbuf->mode & 0700) >> 6;
00390
00391 statbuf->nlink = 1;
00392
00393 sd = NULL;
00394 rc = GetNamedSecurityInfo ((char *) filename_c, SE_FILE_OBJECT,
00395 OWNER_SECURITY_INFORMATION |
00396 GROUP_SECURITY_INFORMATION,
00397 &owner_sid, &group_sid,
00398 NULL, NULL,
00399 &sd);
00400 if (rc != ERROR_SUCCESS)
00401 {
00402 _dbus_win_set_error_from_win_error (error, rc);
00403 if (sd != NULL)
00404 LocalFree (sd);
00405 return FALSE;
00406 }
00407
00408 #ifdef ENABLE_UID_TO_SID
00409
00410 statbuf->uid = _dbus_win_sid_to_uid_t (owner_sid);
00411 statbuf->gid = _dbus_win_sid_to_uid_t (group_sid);
00412 #endif
00413
00414 LocalFree (sd);
00415
00416 statbuf->size = ((dbus_int64_t) wfad.nFileSizeHigh << 32) + wfad.nFileSizeLow;
00417
00418 statbuf->atime =
00419 (((dbus_int64_t) wfad.ftLastAccessTime.dwHighDateTime << 32) +
00420 wfad.ftLastAccessTime.dwLowDateTime) / 10000000 - DBUS_INT64_CONSTANT (116444736000000000);
00421
00422 statbuf->mtime =
00423 (((dbus_int64_t) wfad.ftLastWriteTime.dwHighDateTime << 32) +
00424 wfad.ftLastWriteTime.dwLowDateTime) / 10000000 - DBUS_INT64_CONSTANT (116444736000000000);
00425
00426 statbuf->ctime =
00427 (((dbus_int64_t) wfad.ftCreationTime.dwHighDateTime << 32) +
00428 wfad.ftCreationTime.dwLowDateTime) / 10000000 - DBUS_INT64_CONSTANT (116444736000000000);
00429
00430 return TRUE;
00431 #endif //DBUS_WINCE
00432 }
00433
00434
00435 #ifdef HAVE_DIRENT_H
00436
00437
00438 #include <dirent.h>
00439 #define _dbus_opendir opendir
00440 #define _dbus_readdir readdir
00441 #define _dbus_closedir closedir
00442
00443 #else
00444
00445 #ifdef HAVE_IO_H
00446 #include <io.h>
00447 #endif
00448
00449 #include <sys/types.h>
00450 #include <stdlib.h>
00451
00452
00453
00454
00455
00456
00457
00458
00459
00460
00461
00462
00463
00464
00465
00466
00467
00468
00469
00470
00471
00472 #define HAVE_NO_D_NAMLEN
00473 #define HAVE_DD_LOCK
00474
00475 #define MAXNAMLEN 255
00476
00477 #define __dirfd(dir) (dir)->dd_fd
00478
00479
00480 struct dirent
00481 {
00482 long d_ino;
00483 off_t d_off;
00484 unsigned short d_reclen;
00485 char d_name[_MAX_FNAME+1];
00486 };
00487
00488
00489 typedef struct
00490 {
00491 long handle;
00492 short offset;
00493 short finished;
00494 struct _finddata_t fileinfo;
00495 char *dir;
00496 struct dirent dent;
00497 }
00498 DIR;
00499
00500
00501
00502
00503
00504
00505
00506
00507
00508
00509
00510
00511
00512
00513 DIR * _dbus_opendir(const char *dir)
00514 {
00515 DIR *dp;
00516 char *filespec;
00517 long handle;
00518 int index;
00519
00520 filespec = malloc(strlen(dir) + 2 + 1);
00521 strcpy(filespec, dir);
00522 index = strlen(filespec) - 1;
00523 if (index >= 0 && (filespec[index] == '/' || filespec[index] == '\\'))
00524 filespec[index] = '\0';
00525 strcat(filespec, "\\*");
00526
00527 dp = (DIR *)malloc(sizeof(DIR));
00528 dp->offset = 0;
00529 dp->finished = 0;
00530 dp->dir = strdup(dir);
00531
00532 if ((handle = _findfirst(filespec, &(dp->fileinfo))) < 0)
00533 {
00534 if (errno == ENOENT)
00535 dp->finished = 1;
00536 else
00537 return NULL;
00538 }
00539
00540 dp->handle = handle;
00541 free(filespec);
00542
00543 return dp;
00544 }
00545
00546 struct dirent * _dbus_readdir(DIR *dp)
00547 {
00548 if (!dp || dp->finished)
00549 return NULL;
00550
00551 if (dp->offset != 0)
00552 {
00553 if (_findnext(dp->handle, &(dp->fileinfo)) < 0)
00554 {
00555 dp->finished = 1;
00556 errno = 0;
00557 return NULL;
00558 }
00559 }
00560 dp->offset++;
00561
00562 strncpy(dp->dent.d_name, dp->fileinfo.name, _MAX_FNAME);
00563 dp->dent.d_ino = 1;
00564 dp->dent.d_reclen = strlen(dp->dent.d_name);
00565 dp->dent.d_off = dp->offset;
00566
00567 return &(dp->dent);
00568 }
00569
00570
00571 int _dbus_closedir(DIR *dp)
00572 {
00573 if (!dp)
00574 return 0;
00575 _findclose(dp->handle);
00576 if (dp->dir)
00577 free(dp->dir);
00578 if (dp)
00579 free(dp);
00580
00581 return 0;
00582 }
00583
00584 #endif //#ifdef HAVE_DIRENT_H
00585
00589 struct DBusDirIter
00590 {
00591 DIR *d;
00593 };
00594
00602 DBusDirIter*
00603 _dbus_directory_open (const DBusString *filename,
00604 DBusError *error)
00605 {
00606 DIR *d;
00607 DBusDirIter *iter;
00608 const char *filename_c;
00609
00610 _DBUS_ASSERT_ERROR_IS_CLEAR (error);
00611
00612 filename_c = _dbus_string_get_const_data (filename);
00613
00614 d = _dbus_opendir (filename_c);
00615 if (d == NULL)
00616 {
00617 dbus_set_error (error, _dbus_error_from_errno (errno),
00618 "Failed to read directory \"%s\": %s",
00619 filename_c,
00620 _dbus_strerror (errno));
00621 return NULL;
00622 }
00623 iter = dbus_new0 (DBusDirIter, 1);
00624 if (iter == NULL)
00625 {
00626 _dbus_closedir (d);
00627 dbus_set_error (error, DBUS_ERROR_NO_MEMORY,
00628 "Could not allocate memory for directory iterator");
00629 return NULL;
00630 }
00631
00632 iter->d = d;
00633
00634 return iter;
00635 }
00636
00650 dbus_bool_t
00651 _dbus_directory_get_next_file (DBusDirIter *iter,
00652 DBusString *filename,
00653 DBusError *error)
00654 {
00655 struct dirent *ent;
00656
00657 _DBUS_ASSERT_ERROR_IS_CLEAR (error);
00658
00659 again:
00660 errno = 0;
00661 ent = _dbus_readdir (iter->d);
00662 if (ent == NULL)
00663 {
00664 if (errno != 0)
00665 dbus_set_error (error,
00666 _dbus_error_from_errno (errno),
00667 "%s", _dbus_strerror (errno));
00668 return FALSE;
00669 }
00670 else if (ent->d_name[0] == '.' &&
00671 (ent->d_name[1] == '\0' ||
00672 (ent->d_name[1] == '.' && ent->d_name[2] == '\0')))
00673 goto again;
00674 else
00675 {
00676 _dbus_string_set_length (filename, 0);
00677 if (!_dbus_string_append (filename, ent->d_name))
00678 {
00679 dbus_set_error (error, DBUS_ERROR_NO_MEMORY,
00680 "No memory to read directory entry");
00681 return FALSE;
00682 }
00683 else
00684 return TRUE;
00685 }
00686 }
00687
00691 void
00692 _dbus_directory_close (DBusDirIter *iter)
00693 {
00694 _dbus_closedir (iter->d);
00695 dbus_free (iter);
00696 }
00697
00704 dbus_bool_t
00705 _dbus_path_is_absolute (const DBusString *filename)
00706 {
00707 if (_dbus_string_get_length (filename) > 0)
00708 return _dbus_string_get_byte (filename, 1) == ':'
00709 || _dbus_string_get_byte (filename, 0) == '\\'
00710 || _dbus_string_get_byte (filename, 0) == '/';
00711 else
00712 return FALSE;
00713 }
00714
00716
00728 dbus_bool_t
00729 _dbus_string_get_dirname(const DBusString *filename,
00730 DBusString *dirname)
00731 {
00732 int sep;
00733
00734 _dbus_assert (filename != dirname);
00735 _dbus_assert (filename != NULL);
00736 _dbus_assert (dirname != NULL);
00737
00738
00739 sep = _dbus_string_get_length (filename);
00740 if (sep == 0)
00741 return _dbus_string_append (dirname, ".");
00742
00743 while (sep > 0 &&
00744 (_dbus_string_get_byte (filename, sep - 1) == '/' ||
00745 _dbus_string_get_byte (filename, sep - 1) == '\\'))
00746 --sep;
00747
00748 _dbus_assert (sep >= 0);
00749
00750 if (sep == 0 ||
00751 (sep == 2 &&
00752 _dbus_string_get_byte (filename, 1) == ':' &&
00753 isalpha (_dbus_string_get_byte (filename, 0))))
00754 return _dbus_string_copy_len (filename, 0, sep + 1,
00755 dirname, _dbus_string_get_length (dirname));
00756
00757 {
00758 int sep1, sep2;
00759 _dbus_string_find_byte_backward (filename, sep, '/', &sep1);
00760 _dbus_string_find_byte_backward (filename, sep, '\\', &sep2);
00761
00762 sep = MAX (sep1, sep2);
00763 }
00764 if (sep < 0)
00765 return _dbus_string_append (dirname, ".");
00766
00767 while (sep > 0 &&
00768 (_dbus_string_get_byte (filename, sep - 1) == '/' ||
00769 _dbus_string_get_byte (filename, sep - 1) == '\\'))
00770 --sep;
00771
00772 _dbus_assert (sep >= 0);
00773
00774 if ((sep == 0 ||
00775 (sep == 2 &&
00776 _dbus_string_get_byte (filename, 1) == ':' &&
00777 isalpha (_dbus_string_get_byte (filename, 0))))
00778 &&
00779 (_dbus_string_get_byte (filename, sep) == '/' ||
00780 _dbus_string_get_byte (filename, sep) == '\\'))
00781 return _dbus_string_copy_len (filename, 0, sep + 1,
00782 dirname, _dbus_string_get_length (dirname));
00783 else
00784 return _dbus_string_copy_len (filename, 0, sep - 0,
00785 dirname, _dbus_string_get_length (dirname));
00786 }
00787
00788
00796 dbus_bool_t
00797 _dbus_unix_user_is_process_owner (dbus_uid_t uid)
00798 {
00799 return FALSE;
00800 }
00801
00802
00803
00804
00805
00815 dbus_bool_t
00816 _dbus_unix_user_is_at_console (dbus_uid_t uid,
00817 DBusError *error)
00818 {
00819 return FALSE;
00820 }
00821
00822
00831 dbus_bool_t
00832 _dbus_parse_unix_group_from_config (const DBusString *groupname,
00833 dbus_gid_t *gid_p)
00834 {
00835 return FALSE;
00836 }
00837
00846 dbus_bool_t
00847 _dbus_parse_unix_user_from_config (const DBusString *username,
00848 dbus_uid_t *uid_p)
00849 {
00850 return FALSE;
00851 }
00852
00853
00864 dbus_bool_t
00865 _dbus_unix_groups_from_uid (dbus_uid_t uid,
00866 dbus_gid_t **group_ids,
00867 int *n_group_ids)
00868 {
00869 return FALSE;
00870 }
00871
00872
00873
00875
00876
00877
00878
00879
00880
00881
00882
00890 void
00891 _dbus_win_set_error_from_win_error (DBusError *error,
00892 int code)
00893 {
00894 char *msg;
00895
00896
00897 FormatMessageA (FORMAT_MESSAGE_ALLOCATE_BUFFER |
00898 FORMAT_MESSAGE_IGNORE_INSERTS |
00899 FORMAT_MESSAGE_FROM_SYSTEM,
00900 NULL, code, MAKELANGID (LANG_ENGLISH, SUBLANG_ENGLISH_US),
00901 (LPTSTR) &msg, 0, NULL);
00902 if (msg)
00903 {
00904 char *msg_copy;
00905
00906 msg_copy = dbus_malloc (strlen (msg));
00907 strcpy (msg_copy, msg);
00908 LocalFree (msg);
00909
00910 dbus_set_error (error, "win32.error", "%s", msg_copy);
00911 }
00912 else
00913 dbus_set_error (error, "win32.error", "Unknown error code %d or FormatMessage failed", code);
00914 }
00915
00916 void
00917 _dbus_win_warn_win_error (const char *message,
00918 int code)
00919 {
00920 DBusError error = DBUS_ERROR_INIT;
00921
00922 _dbus_win_set_error_from_win_error (&error, code);
00923 _dbus_warn ("%s: %s\n", message, error.message);
00924 dbus_error_free (&error);
00925 }
00926
00934 const char*
00935 _dbus_strerror (int error_number)
00936 {
00937 #ifdef DBUS_WINCE
00938
00939 return "unknown";
00940 #else
00941 const char *msg;
00942
00943 switch (error_number)
00944 {
00945 case WSAEINTR:
00946 return "Interrupted function call";
00947 case WSAEACCES:
00948 return "Permission denied";
00949 case WSAEFAULT:
00950 return "Bad address";
00951 case WSAEINVAL:
00952 return "Invalid argument";
00953 case WSAEMFILE:
00954 return "Too many open files";
00955 case WSAEWOULDBLOCK:
00956 return "Resource temporarily unavailable";
00957 case WSAEINPROGRESS:
00958 return "Operation now in progress";
00959 case WSAEALREADY:
00960 return "Operation already in progress";
00961 case WSAENOTSOCK:
00962 return "Socket operation on nonsocket";
00963 case WSAEDESTADDRREQ:
00964 return "Destination address required";
00965 case WSAEMSGSIZE:
00966 return "Message too long";
00967 case WSAEPROTOTYPE:
00968 return "Protocol wrong type for socket";
00969 case WSAENOPROTOOPT:
00970 return "Bad protocol option";
00971 case WSAEPROTONOSUPPORT:
00972 return "Protocol not supported";
00973 case WSAESOCKTNOSUPPORT:
00974 return "Socket type not supported";
00975 case WSAEOPNOTSUPP:
00976 return "Operation not supported";
00977 case WSAEPFNOSUPPORT:
00978 return "Protocol family not supported";
00979 case WSAEAFNOSUPPORT:
00980 return "Address family not supported by protocol family";
00981 case WSAEADDRINUSE:
00982 return "Address already in use";
00983 case WSAEADDRNOTAVAIL:
00984 return "Cannot assign requested address";
00985 case WSAENETDOWN:
00986 return "Network is down";
00987 case WSAENETUNREACH:
00988 return "Network is unreachable";
00989 case WSAENETRESET:
00990 return "Network dropped connection on reset";
00991 case WSAECONNABORTED:
00992 return "Software caused connection abort";
00993 case WSAECONNRESET:
00994 return "Connection reset by peer";
00995 case WSAENOBUFS:
00996 return "No buffer space available";
00997 case WSAEISCONN:
00998 return "Socket is already connected";
00999 case WSAENOTCONN:
01000 return "Socket is not connected";
01001 case WSAESHUTDOWN:
01002 return "Cannot send after socket shutdown";
01003 case WSAETIMEDOUT:
01004 return "Connection timed out";
01005 case WSAECONNREFUSED:
01006 return "Connection refused";
01007 case WSAEHOSTDOWN:
01008 return "Host is down";
01009 case WSAEHOSTUNREACH:
01010 return "No route to host";
01011 case WSAEPROCLIM:
01012 return "Too many processes";
01013 case WSAEDISCON:
01014 return "Graceful shutdown in progress";
01015 case WSATYPE_NOT_FOUND:
01016 return "Class type not found";
01017 case WSAHOST_NOT_FOUND:
01018 return "Host not found";
01019 case WSATRY_AGAIN:
01020 return "Nonauthoritative host not found";
01021 case WSANO_RECOVERY:
01022 return "This is a nonrecoverable error";
01023 case WSANO_DATA:
01024 return "Valid name, no data record of requested type";
01025 case WSA_INVALID_HANDLE:
01026 return "Specified event object handle is invalid";
01027 case WSA_INVALID_PARAMETER:
01028 return "One or more parameters are invalid";
01029 case WSA_IO_INCOMPLETE:
01030 return "Overlapped I/O event object not in signaled state";
01031 case WSA_IO_PENDING:
01032 return "Overlapped operations will complete later";
01033 case WSA_NOT_ENOUGH_MEMORY:
01034 return "Insufficient memory available";
01035 case WSA_OPERATION_ABORTED:
01036 return "Overlapped operation aborted";
01037 #ifdef WSAINVALIDPROCTABLE
01038
01039 case WSAINVALIDPROCTABLE:
01040 return "Invalid procedure table from service provider";
01041 #endif
01042 #ifdef WSAINVALIDPROVIDER
01043
01044 case WSAINVALIDPROVIDER:
01045 return "Invalid service provider version number";
01046 #endif
01047 #ifdef WSAPROVIDERFAILEDINIT
01048
01049 case WSAPROVIDERFAILEDINIT:
01050 return "Unable to initialize a service provider";
01051 #endif
01052
01053 case WSASYSCALLFAILURE:
01054 return "System call failure";
01055 }
01056 msg = strerror (error_number);
01057 if (msg == NULL)
01058 msg = "unknown";
01059
01060 return msg;
01061 #endif //DBUS_WINCE
01062 }
01063
01064
01065
01066
01067 const char*
01068 _dbus_lm_strerror(int error_number)
01069 {
01070 #ifdef DBUS_WINCE
01071
01072 return "unknown";
01073 #else
01074 const char *msg;
01075 switch (error_number)
01076 {
01077 case NERR_NetNotStarted:
01078 return "The workstation driver is not installed.";
01079 case NERR_UnknownServer:
01080 return "The server could not be located.";
01081 case NERR_ShareMem:
01082 return "An internal error occurred. The network cannot access a shared memory segment.";
01083 case NERR_NoNetworkResource:
01084 return "A network resource shortage occurred.";
01085 case NERR_RemoteOnly:
01086 return "This operation is not supported on workstations.";
01087 case NERR_DevNotRedirected:
01088 return "The device is not connected.";
01089 case NERR_ServerNotStarted:
01090 return "The Server service is not started.";
01091 case NERR_ItemNotFound:
01092 return "The queue is empty.";
01093 case NERR_UnknownDevDir:
01094 return "The device or directory does not exist.";
01095 case NERR_RedirectedPath:
01096 return "The operation is invalid on a redirected resource.";
01097 case NERR_DuplicateShare:
01098 return "The name has already been shared.";
01099 case NERR_NoRoom:
01100 return "The server is currently out of the requested resource.";
01101 case NERR_TooManyItems:
01102 return "Requested addition of items exceeds the maximum allowed.";
01103 case NERR_InvalidMaxUsers:
01104 return "The Peer service supports only two simultaneous users.";
01105 case NERR_BufTooSmall:
01106 return "The API return buffer is too small.";
01107 case NERR_RemoteErr:
01108 return "A remote API error occurred.";
01109 case NERR_LanmanIniError:
01110 return "An error occurred when opening or reading the configuration file.";
01111 case NERR_NetworkError:
01112 return "A general network error occurred.";
01113 case NERR_WkstaInconsistentState:
01114 return "The Workstation service is in an inconsistent state. Restart the computer before restarting the Workstation service.";
01115 case NERR_WkstaNotStarted:
01116 return "The Workstation service has not been started.";
01117 case NERR_BrowserNotStarted:
01118 return "The requested information is not available.";
01119 case NERR_InternalError:
01120 return "An internal error occurred.";
01121 case NERR_BadTransactConfig:
01122 return "The server is not configured for transactions.";
01123 case NERR_InvalidAPI:
01124 return "The requested API is not supported on the remote server.";
01125 case NERR_BadEventName:
01126 return "The event name is invalid.";
01127 case NERR_DupNameReboot:
01128 return "The computer name already exists on the network. Change it and restart the computer.";
01129 case NERR_CfgCompNotFound:
01130 return "The specified component could not be found in the configuration information.";
01131 case NERR_CfgParamNotFound:
01132 return "The specified parameter could not be found in the configuration information.";
01133 case NERR_LineTooLong:
01134 return "A line in the configuration file is too long.";
01135 case NERR_QNotFound:
01136 return "The printer does not exist.";
01137 case NERR_JobNotFound:
01138 return "The print job does not exist.";
01139 case NERR_DestNotFound:
01140 return "The printer destination cannot be found.";
01141 case NERR_DestExists:
01142 return "The printer destination already exists.";
01143 case NERR_QExists:
01144 return "The printer queue already exists.";
01145 case NERR_QNoRoom:
01146 return "No more printers can be added.";
01147 case NERR_JobNoRoom:
01148 return "No more print jobs can be added.";
01149 case NERR_DestNoRoom:
01150 return "No more printer destinations can be added.";
01151 case NERR_DestIdle:
01152 return "This printer destination is idle and cannot accept control operations.";
01153 case NERR_DestInvalidOp:
01154 return "This printer destination request contains an invalid control function.";
01155 case NERR_ProcNoRespond:
01156 return "The print processor is not responding.";
01157 case NERR_SpoolerNotLoaded:
01158 return "The spooler is not running.";
01159 case NERR_DestInvalidState:
01160 return "This operation cannot be performed on the print destination in its current state.";
01161 case NERR_QInvalidState:
01162 return "This operation cannot be performed on the printer queue in its current state.";
01163 case NERR_JobInvalidState:
01164 return "This operation cannot be performed on the print job in its current state.";
01165 case NERR_SpoolNoMemory:
01166 return "A spooler memory allocation failure occurred.";
01167 case NERR_DriverNotFound:
01168 return "The device driver does not exist.";
01169 case NERR_DataTypeInvalid:
01170 return "The data type is not supported by the print processor.";
01171 case NERR_ProcNotFound:
01172 return "The print processor is not installed.";
01173 case NERR_ServiceTableLocked:
01174 return "The service database is locked.";
01175 case NERR_ServiceTableFull:
01176 return "The service table is full.";
01177 case NERR_ServiceInstalled:
01178 return "The requested service has already been started.";
01179 case NERR_ServiceEntryLocked:
01180 return "The service does not respond to control actions.";
01181 case NERR_ServiceNotInstalled:
01182 return "The service has not been started.";
01183 case NERR_BadServiceName:
01184 return "The service name is invalid.";
01185 case NERR_ServiceCtlTimeout:
01186 return "The service is not responding to the control function.";
01187 case NERR_ServiceCtlBusy:
01188 return "The service control is busy.";
01189 case NERR_BadServiceProgName:
01190 return "The configuration file contains an invalid service program name.";
01191 case NERR_ServiceNotCtrl:
01192 return "The service could not be controlled in its present state.";
01193 case NERR_ServiceKillProc:
01194 return "The service ended abnormally.";
01195 case NERR_ServiceCtlNotValid:
01196 return "The requested pause or stop is not valid for this service.";
01197 case NERR_NotInDispatchTbl:
01198 return "The service control dispatcher could not find the service name in the dispatch table.";
01199 case NERR_BadControlRecv:
01200 return "The service control dispatcher pipe read failed.";
01201 case NERR_ServiceNotStarting:
01202 return "A thread for the new service could not be created.";
01203 case NERR_AlreadyLoggedOn:
01204 return "This workstation is already logged on to the local-area network.";
01205 case NERR_NotLoggedOn:
01206 return "The workstation is not logged on to the local-area network.";
01207 case NERR_BadUsername:
01208 return "The user name or group name parameter is invalid.";
01209 case NERR_BadPassword:
01210 return "The password parameter is invalid.";
01211 case NERR_UnableToAddName_W:
01212 return "@W The logon processor did not add the message alias.";
01213 case NERR_UnableToAddName_F:
01214 return "The logon processor did not add the message alias.";
01215 case NERR_UnableToDelName_W:
01216 return "@W The logoff processor did not delete the message alias.";
01217 case NERR_UnableToDelName_F:
01218 return "The logoff processor did not delete the message alias.";
01219 case NERR_LogonsPaused:
01220 return "Network logons are paused.";
01221 case NERR_LogonServerConflict:
01222 return "A centralized logon-server conflict occurred.";
01223 case NERR_LogonNoUserPath:
01224 return "The server is configured without a valid user path.";
01225 case NERR_LogonScriptError:
01226 return "An error occurred while loading or running the logon script.";
01227 case NERR_StandaloneLogon:
01228 return "The logon server was not specified. Your computer will be logged on as STANDALONE.";
01229 case NERR_LogonServerNotFound:
01230 return "The logon server could not be found.";
01231 case NERR_LogonDomainExists:
01232 return "There is already a logon domain for this computer.";
01233 case NERR_NonValidatedLogon:
01234 return "The logon server could not validate the logon.";
01235 case NERR_ACFNotFound:
01236 return "The security database could not be found.";
01237 case NERR_GroupNotFound:
01238 return "The group name could not be found.";
01239 case NERR_UserNotFound:
01240 return "The user name could not be found.";
01241 case NERR_ResourceNotFound:
01242 return "The resource name could not be found.";
01243 case NERR_GroupExists:
01244 return "The group already exists.";
01245 case NERR_UserExists:
01246 return "The user account already exists.";
01247 case NERR_ResourceExists:
01248 return "The resource permission list already exists.";
01249 case NERR_NotPrimary:
01250 return "This operation is only allowed on the primary domain controller of the domain.";
01251 case NERR_ACFNotLoaded:
01252 return "The security database has not been started.";
01253 case NERR_ACFNoRoom:
01254 return "There are too many names in the user accounts database.";
01255 case NERR_ACFFileIOFail:
01256 return "A disk I/O failure occurred.";
01257 case NERR_ACFTooManyLists:
01258 return "The limit of 64 entries per resource was exceeded.";
01259 case NERR_UserLogon:
01260 return "Deleting a user with a session is not allowed.";
01261 case NERR_ACFNoParent:
01262 return "The parent directory could not be located.";
01263 case NERR_CanNotGrowSegment:
01264 return "Unable to add to the security database session cache segment.";
01265 case NERR_SpeGroupOp:
01266 return "This operation is not allowed on this special group.";
01267 case NERR_NotInCache:
01268 return "This user is not cached in user accounts database session cache.";
01269 case NERR_UserInGroup:
01270 return "The user already belongs to this group.";
01271 case NERR_UserNotInGroup:
01272 return "The user does not belong to this group.";
01273 case NERR_AccountUndefined:
01274 return "This user account is undefined.";
01275 case NERR_AccountExpired:
01276 return "This user account has expired.";
01277 case NERR_InvalidWorkstation:
01278 return "The user is not allowed to log on from this workstation.";
01279 case NERR_InvalidLogonHours:
01280 return "The user is not allowed to log on at this time.";
01281 case NERR_PasswordExpired:
01282 return "The password of this user has expired.";
01283 case NERR_PasswordCantChange:
01284 return "The password of this user cannot change.";
01285 case NERR_PasswordHistConflict:
01286 return "This password cannot be used now.";
01287 case NERR_PasswordTooShort:
01288 return "The password does not meet the password policy requirements. Check the minimum password length, password complexity and password history requirements.";
01289 case NERR_PasswordTooRecent:
01290 return "The password of this user is too recent to change.";
01291 case NERR_InvalidDatabase:
01292 return "The security database is corrupted.";
01293 case NERR_DatabaseUpToDate:
01294 return "No updates are necessary to this replicant network/local security database.";
01295 case NERR_SyncRequired:
01296 return "This replicant database is outdated; synchronization is required.";
01297 case NERR_UseNotFound:
01298 return "The network connection could not be found.";
01299 case NERR_BadAsgType:
01300 return "This asg_type is invalid.";
01301 case NERR_DeviceIsShared:
01302 return "This device is currently being shared.";
01303 case NERR_NoComputerName:
01304 return "The computer name could not be added as a message alias. The name may already exist on the network.";
01305 case NERR_MsgAlreadyStarted:
01306 return "The Messenger service is already started.";
01307 case NERR_MsgInitFailed:
01308 return "The Messenger service failed to start.";
01309 case NERR_NameNotFound:
01310 return "The message alias could not be found on the network.";
01311 case NERR_AlreadyForwarded:
01312 return "This message alias has already been forwarded.";
01313 case NERR_AddForwarded:
01314 return "This message alias has been added but is still forwarded.";
01315 case NERR_AlreadyExists:
01316 return "This message alias already exists locally.";
01317 case NERR_TooManyNames:
01318 return "The maximum number of added message aliases has been exceeded.";
01319 case NERR_DelComputerName:
01320 return "The computer name could not be deleted.";
01321 case NERR_LocalForward:
01322 return "Messages cannot be forwarded back to the same workstation.";
01323 case NERR_GrpMsgProcessor:
01324 return "An error occurred in the domain message processor.";
01325 case NERR_PausedRemote:
01326 return "The message was sent, but the recipient has paused the Messenger service.";
01327 case NERR_BadReceive:
01328 return "The message was sent but not received.";
01329 case NERR_NameInUse:
01330 return "The message alias is currently in use. Try again later.";
01331 case NERR_MsgNotStarted:
01332 return "The Messenger service has not been started.";
01333 case NERR_NotLocalName:
01334 return "The name is not on the local computer.";
01335 case NERR_NoForwardName:
01336 return "The forwarded message alias could not be found on the network.";
01337 case NERR_RemoteFull:
01338 return "The message alias table on the remote station is full.";
01339 case NERR_NameNotForwarded:
01340 return "Messages for this alias are not currently being forwarded.";
01341 case NERR_TruncatedBroadcast:
01342 return "The broadcast message was truncated.";
01343 case NERR_InvalidDevice:
01344 return "This is an invalid device name.";
01345 case NERR_WriteFault:
01346 return "A write fault occurred.";
01347 case NERR_DuplicateName:
01348 return "A duplicate message alias exists on the network.";
01349 case NERR_DeleteLater:
01350 return "@W This message alias will be deleted later.";
01351 case NERR_IncompleteDel:
01352 return "The message alias was not successfully deleted from all networks.";
01353 case NERR_MultipleNets:
01354 return "This operation is not supported on computers with multiple networks.";
01355 case NERR_NetNameNotFound:
01356 return "This shared resource does not exist.";
01357 case NERR_DeviceNotShared:
01358 return "This device is not shared.";
01359 case NERR_ClientNameNotFound:
01360 return "A session does not exist with that computer name.";
01361 case NERR_FileIdNotFound:
01362 return "There is not an open file with that identification number.";
01363 case NERR_ExecFailure:
01364 return "A failure occurred when executing a remote administration command.";
01365 case NERR_TmpFile:
01366 return "A failure occurred when opening a remote temporary file.";
01367 case NERR_TooMuchData:
01368 return "The data returned from a remote administration command has been truncated to 64K.";
01369 case NERR_DeviceShareConflict:
01370 return "This device cannot be shared as both a spooled and a non-spooled resource.";
01371 case NERR_BrowserTableIncomplete:
01372 return "The information in the list of servers may be incorrect.";
01373 case NERR_NotLocalDomain:
01374 return "The computer is not active in this domain.";
01375 #ifdef NERR_IsDfsShare
01376
01377 case NERR_IsDfsShare:
01378 return "The share must be removed from the Distributed File System before it can be deleted.";
01379 #endif
01380
01381 case NERR_DevInvalidOpCode:
01382 return "The operation is invalid for this device.";
01383 case NERR_DevNotFound:
01384 return "This device cannot be shared.";
01385 case NERR_DevNotOpen:
01386 return "This device was not open.";
01387 case NERR_BadQueueDevString:
01388 return "This device name list is invalid.";
01389 case NERR_BadQueuePriority:
01390 return "The queue priority is invalid.";
01391 case NERR_NoCommDevs:
01392 return "There are no shared communication devices.";
01393 case NERR_QueueNotFound:
01394 return "The queue you specified does not exist.";
01395 case NERR_BadDevString:
01396 return "This list of devices is invalid.";
01397 case NERR_BadDev:
01398 return "The requested device is invalid.";
01399 case NERR_InUseBySpooler:
01400 return "This device is already in use by the spooler.";
01401 case NERR_CommDevInUse:
01402 return "This device is already in use as a communication device.";
01403 case NERR_InvalidComputer:
01404 return "This computer name is invalid.";
01405 case NERR_MaxLenExceeded:
01406 return "The string and prefix specified are too long.";
01407 case NERR_BadComponent:
01408 return "This path component is invalid.";
01409 case NERR_CantType:
01410 return "Could not determine the type of input.";
01411 case NERR_TooManyEntries:
01412 return "The buffer for types is not big enough.";
01413 case NERR_ProfileFileTooBig:
01414 return "Profile files cannot exceed 64K.";
01415 case NERR_ProfileOffset:
01416 return "The start offset is out of range.";
01417 case NERR_ProfileCleanup:
01418 return "The system cannot delete current connections to network resources.";
01419 case NERR_ProfileUnknownCmd:
01420 return "The system was unable to parse the command line in this file.";
01421 case NERR_ProfileLoadErr:
01422 return "An error occurred while loading the profile file.";
01423 case NERR_ProfileSaveErr:
01424 return "@W Errors occurred while saving the profile file. The profile was partially saved.";
01425 case NERR_LogOverflow:
01426 return "Log file %1 is full.";
01427 case NERR_LogFileChanged:
01428 return "This log file has changed between reads.";
01429 case NERR_LogFileCorrupt:
01430 return "Log file %1 is corrupt.";
01431 case NERR_SourceIsDir:
01432 return "The source path cannot be a directory.";
01433 case NERR_BadSource:
01434 return "The source path is illegal.";
01435 case NERR_BadDest:
01436 return "The destination path is illegal.";
01437 case NERR_DifferentServers:
01438 return "The source and destination paths are on different servers.";
01439 case NERR_RunSrvPaused:
01440 return "The Run server you requested is paused.";
01441 case NERR_ErrCommRunSrv:
01442 return "An error occurred when communicating with a Run server.";
01443 case NERR_ErrorExecingGhost:
01444 return "An error occurred when starting a background process.";
01445 case NERR_ShareNotFound:
01446 return "The shared resource you are connected to could not be found.";
01447 case NERR_InvalidLana:
01448 return "The LAN adapter number is invalid.";
01449 case NERR_OpenFiles:
01450 return "There are open files on the connection.";
01451 case NERR_ActiveConns:
01452 return "Active connections still exist.";
01453 case NERR_BadPasswordCore:
01454 return "This share name or password is invalid.";
01455 case NERR_DevInUse:
01456 return "The device is being accessed by an active process.";
01457 case NERR_LocalDrive:
01458 return "The drive letter is in use locally.";
01459 case NERR_AlertExists:
01460 return "The specified client is already registered for the specified event.";
01461 case NERR_TooManyAlerts:
01462 return "The alert table is full.";
01463 case NERR_NoSuchAlert:
01464 return "An invalid or nonexistent alert name was raised.";
01465 case NERR_BadRecipient:
01466 return "The alert recipient is invalid.";
01467 case NERR_AcctLimitExceeded:
01468 return "A user's session with this server has been deleted.";
01469 case NERR_InvalidLogSeek:
01470 return "The log file does not contain the requested record number.";
01471 case NERR_BadUasConfig:
01472 return "The user accounts database is not configured correctly.";
01473 case NERR_InvalidUASOp:
01474 return "This operation is not permitted when the Netlogon service is running.";
01475 case NERR_LastAdmin:
01476 return "This operation is not allowed on the last administrative account.";
01477 case NERR_DCNotFound:
01478 return "Could not find domain controller for this domain.";
01479 case NERR_LogonTrackingError:
01480 return "Could not set logon information for this user.";
01481 case NERR_NetlogonNotStarted:
01482 return "The Netlogon service has not been started.";
01483 case NERR_CanNotGrowUASFile:
01484 return "Unable to add to the user accounts database.";
01485 case NERR_TimeDiffAtDC:
01486 return "This server's clock is not synchronized with the primary domain controller's clock.";
01487 case NERR_PasswordMismatch:
01488 return "A password mismatch has been detected.";
01489 case NERR_NoSuchServer:
01490 return "The server identification does not specify a valid server.";
01491 case NERR_NoSuchSession:
01492 return "The session identification does not specify a valid session.";
01493 case NERR_NoSuchConnection:
01494 return "The connection identification does not specify a valid connection.";
01495 case NERR_TooManyServers:
01496 return "There is no space for another entry in the table of available servers.";
01497 case NERR_TooManySessions:
01498 return "The server has reached the maximum number of sessions it supports.";
01499 case NERR_TooManyConnections:
01500 return "The server has reached the maximum number of connections it supports.";
01501 case NERR_TooManyFiles:
01502 return "The server cannot open more files because it has reached its maximum number.";
01503 case NERR_NoAlternateServers:
01504 return "There are no alternate servers registered on this server.";
01505 case NERR_TryDownLevel:
01506 return "Try down-level (remote admin protocol) version of API instead.";
01507 case NERR_UPSDriverNotStarted:
01508 return "The UPS driver could not be accessed by the UPS service.";
01509 case NERR_UPSInvalidConfig:
01510 return "The UPS service is not configured correctly.";
01511 case NERR_UPSInvalidCommPort:
01512 return "The UPS service could not access the specified Comm Port.";
01513 case NERR_UPSSignalAsserted:
01514 return "The UPS indicated a line fail or low battery situation. Service not started.";
01515 case NERR_UPSShutdownFailed:
01516 return "The UPS service failed to perform a system shut down.";
01517 case NERR_BadDosRetCode:
01518 return "The program below returned an MS-DOS error code:";
01519 case NERR_ProgNeedsExtraMem:
01520 return "The program below needs more memory:";
01521 case NERR_BadDosFunction:
01522 return "The program below called an unsupported MS-DOS function:";
01523 case NERR_RemoteBootFailed:
01524 return "The workstation failed to boot.";
01525 case NERR_BadFileCheckSum:
01526 return "The file below is corrupt.";
01527 case NERR_NoRplBootSystem:
01528 return "No loader is specified in the boot-block definition file.";
01529 case NERR_RplLoadrNetBiosErr:
01530 return "NetBIOS returned an error: The NCB and SMB are dumped above.";
01531 case NERR_RplLoadrDiskErr:
01532 return "A disk I/O error occurred.";
01533 case NERR_ImageParamErr:
01534 return "Image parameter substitution failed.";
01535 case NERR_TooManyImageParams:
01536 return "Too many image parameters cross disk sector boundaries.";
01537 case NERR_NonDosFloppyUsed:
01538 return "The image was not generated from an MS-DOS diskette formatted with /S.";
01539 case NERR_RplBootRestart:
01540 return "Remote boot will be restarted later.";
01541 case NERR_RplSrvrCallFailed:
01542 return "The call to the Remoteboot server failed.";
01543 case NERR_CantConnectRplSrvr:
01544 return "Cannot connect to the Remoteboot server.";
01545 case NERR_CantOpenImageFile:
01546 return "Cannot open image file on the Remoteboot server.";
01547 case NERR_CallingRplSrvr:
01548 return "Connecting to the Remoteboot server...";
01549 case NERR_StartingRplBoot:
01550 return "Connecting to the Remoteboot server...";
01551 case NERR_RplBootServiceTerm:
01552 return "Remote boot service was stopped; check the error log for the cause of the problem.";
01553 case NERR_RplBootStartFailed:
01554 return "Remote boot startup failed; check the error log for the cause of the problem.";
01555 case NERR_RPL_CONNECTED:
01556 return "A second connection to a Remoteboot resource is not allowed.";
01557 case NERR_BrowserConfiguredToNotRun:
01558 return "The browser service was configured with MaintainServerList=No.";
01559 case NERR_RplNoAdaptersStarted:
01560 return "Service failed to start since none of the network adapters started with this service.";
01561 case NERR_RplBadRegistry:
01562 return "Service failed to start due to bad startup information in the registry.";
01563 case NERR_RplBadDatabase:
01564 return "Service failed to start because its database is absent or corrupt.";
01565 case NERR_RplRplfilesShare:
01566 return "Service failed to start because RPLFILES share is absent.";
01567 case NERR_RplNotRplServer:
01568 return "Service failed to start because RPLUSER group is absent.";
01569 case NERR_RplCannotEnum:
01570 return "Cannot enumerate service records.";
01571 case NERR_RplWkstaInfoCorrupted:
01572 return "Workstation record information has been corrupted.";
01573 case NERR_RplWkstaNotFound:
01574 return "Workstation record was not found.";
01575 case NERR_RplWkstaNameUnavailable:
01576 return "Workstation name is in use by some other workstation.";
01577 case NERR_RplProfileInfoCorrupted:
01578 return "Profile record information has been corrupted.";
01579 case NERR_RplProfileNotFound:
01580 return "Profile record was not found.";
01581 case NERR_RplProfileNameUnavailable:
01582 return "Profile name is in use by some other profile.";
01583 case NERR_RplProfileNotEmpty:
01584 return "There are workstations using this profile.";
01585 case NERR_RplConfigInfoCorrupted:
01586 return "Configuration record information has been corrupted.";
01587 case NERR_RplConfigNotFound:
01588 return "Configuration record was not found.";
01589 case NERR_RplAdapterInfoCorrupted:
01590 return "Adapter ID record information has been corrupted.";
01591 case NERR_RplInternal:
01592 return "An internal service error has occurred.";
01593 case NERR_RplVendorInfoCorrupted:
01594 return "Vendor ID record information has been corrupted.";
01595 case NERR_RplBootInfoCorrupted:
01596 return "Boot block record information has been corrupted.";
01597 case NERR_RplWkstaNeedsUserAcct:
01598 return "The user account for this workstation record is missing.";
01599 case NERR_RplNeedsRPLUSERAcct:
01600 return "The RPLUSER local group could not be found.";
01601 case NERR_RplBootNotFound:
01602 return "Boot block record was not found.";
01603 case NERR_RplIncompatibleProfile:
01604 return "Chosen profile is incompatible with this workstation.";
01605 case NERR_RplAdapterNameUnavailable:
01606 return "Chosen network adapter ID is in use by some other workstation.";
01607 case NERR_RplConfigNotEmpty:
01608 return "There are profiles using this configuration.";
01609 case NERR_RplBootInUse:
01610 return "There are workstations, profiles, or configurations using this boot block.";
01611 case NERR_RplBackupDatabase:
01612 return "Service failed to backup Remoteboot database.";
01613 case NERR_RplAdapterNotFound:
01614 return "Adapter record was not found.";
01615 case NERR_RplVendorNotFound:
01616 return "Vendor record was not found.";
01617 case NERR_RplVendorNameUnavailable:
01618 return "Vendor name is in use by some other vendor record.";
01619 case NERR_RplBootNameUnavailable:
01620 return "(boot name, vendor ID) is in use by some other boot block record.";
01621 case NERR_RplConfigNameUnavailable:
01622 return "Configuration name is in use by some other configuration.";
01623 case NERR_DfsInternalCorruption:
01624 return "The internal database maintained by the Dfs service is corrupt.";
01625 case NERR_DfsVolumeDataCorrupt:
01626 return "One of the records in the internal Dfs database is corrupt.";
01627 case NERR_DfsNoSuchVolume:
01628 return "There is no DFS name whose entry path matches the input Entry Path.";
01629 case NERR_DfsVolumeAlreadyExists:
01630 return "A root or link with the given name already exists.";
01631 case NERR_DfsAlreadyShared:
01632 return "The server share specified is already shared in the Dfs.";
01633 case NERR_DfsNoSuchShare:
01634 return "The indicated server share does not support the indicated DFS namespace.";
01635 case NERR_DfsNotALeafVolume:
01636 return "The operation is not valid on this portion of the namespace.";
01637 case NERR_DfsLeafVolume:
01638 return "The operation is not valid on this portion of the namespace.";
01639 case NERR_DfsVolumeHasMultipleServers:
01640 return "The operation is ambiguous because the link has multiple servers.";
01641 case NERR_DfsCantCreateJunctionPoint:
01642 return "Unable to create a link.";
01643 case NERR_DfsServerNotDfsAware:
01644 return "The server is not Dfs Aware.";
01645 case NERR_DfsBadRenamePath:
01646 return "The specified rename target path is invalid.";
01647 case NERR_DfsVolumeIsOffline:
01648 return "The specified DFS link is offline.";
01649 case NERR_DfsNoSuchServer:
01650 return "The specified server is not a server for this link.";
01651 case NERR_DfsCyclicalName:
01652 return "A cycle in the Dfs name was detected.";
01653 case NERR_DfsNotSupportedInServerDfs:
01654 return "The operation is not supported on a server-based Dfs.";
01655 case NERR_DfsDuplicateService:
01656 return "This link is already supported by the specified server-share.";
01657 case NERR_DfsCantRemoveLastServerShare:
01658 return "Can't remove the last server-share supporting this root or link.";
01659 case NERR_DfsVolumeIsInterDfs:
01660 return "The operation is not supported for an Inter-DFS link.";
01661 case NERR_DfsInconsistent:
01662 return "The internal state of the Dfs Service has become inconsistent.";
01663 case NERR_DfsServerUpgraded:
01664 return "The Dfs Service has been installed on the specified server.";
01665 case NERR_DfsDataIsIdentical:
01666 return "The Dfs data being reconciled is identical.";
01667 case NERR_DfsCantRemoveDfsRoot:
01668 return "The DFS root cannot be deleted. Uninstall DFS if required.";
01669 case NERR_DfsChildOrParentInDfs:
01670 return "A child or parent directory of the share is already in a Dfs.";
01671 case NERR_DfsInternalError:
01672 return "Dfs internal error.";
01673
01674 #if 0
01675
01676 case NERR_SetupAlreadyJoined:
01677 return "This machine is already joined to a domain.";
01678 case NERR_SetupNotJoined:
01679 return "This machine is not currently joined to a domain.";
01680 case NERR_SetupDomainController:
01681 return "This machine is a domain controller and cannot be unjoined from a domain.";
01682 case NERR_DefaultJoinRequired:
01683 return "The destination domain controller does not support creating machine accounts in OUs.";
01684 case NERR_InvalidWorkgroupName:
01685 return "The specified workgroup name is invalid.";
01686 case NERR_NameUsesIncompatibleCodePage:
01687 return "The specified computer name is incompatible with the default language used on the domain controller.";
01688 case NERR_ComputerAccountNotFound:
01689 return "The specified computer account could not be found.";
01690 case NERR_PersonalSku:
01691 return "This version of Windows cannot be joined to a domain.";
01692 case NERR_PasswordMustChange:
01693 return "The password must change at the next logon.";
01694 case NERR_AccountLockedOut:
01695 return "The account is locked out.";
01696 case NERR_PasswordTooLong:
01697 return "The password is too long.";
01698 case NERR_PasswordNotComplexEnough:
01699 return "The password does not meet the complexity policy.";
01700 case NERR_PasswordFilterError:
01701 return "The password does not meet the requirements of the password filter DLLs.";
01702 #endif
01703
01704 }
01705 msg = strerror (error_number);
01706 if (msg == NULL)
01707 msg = "unknown";
01708
01709 return msg;
01710 #endif //DBUS_WINCE
01711 }