41#define MAX_NUM_THREADS 128
45static const char FILE_NETCONFIG[] =
"C:\\ReactOS\\System32\\drivers\\etc\\netconfig";
53#ifndef STANDALONE_NFSD
126 printf(
"Shutting down..\n");
133 dprintf(1,
"writing downcall: xid=%lld opcode=%s status=%d "
139 dprintf(2,
"making a downcall: outbuf_len %ld\n\n", outbuf_len);
143 eprintf(
"IOCTL_NFS41_WRITE failed with %d xid=%lld opcode=%s\n",
155#ifndef STANDALONE_NFSD
191 fprintf(
stderr,
"nfsd() failed to open file '%s'\n", config_path);
204 "--uid <non-zero value> --gid\n");
211 out->debug_level = 1;
242 fprintf(
stderr,
"Invalid (or missing) anonymous uid value of %d\n",
260 fprintf(
stdout,
"parse_cmdlineargs: debug_level %d ldap is %d\n",
261 out->debug_level,
out->ldap_enable);
267 char ipstringbuffer[46];
268 DWORD ipbufferlength = 46;
270 dprintf(1,
"getaddrinfo response flags: 0x%x\n",
ptr->ai_flags);
271 switch (
ptr->ai_family) {
274 dprintf(1,
"Family: AF_INET IPv4 address %s\n",
279 NULL, ipstringbuffer, &ipbufferlength))
282 dprintf(1,
"Family: AF_INET6 IPv6 address %s\n", ipstringbuffer);
285 default:
dprintf(1,
"Other %ld\n",
ptr->ai_family);
break;
287 dprintf(1,
"Canonical name: %s\n",
ptr->ai_canonname);
299 eprintf(
"getdomainname: GetNetworkParams returned %d\n",
status);
303 if (net_info ==
NULL) {
309 eprintf(
"getdomainname: GetNetworkParams returned %d\n",
status);
323 eprintf(
"getdomainname: getaddrinfo failed with %d\n",
status);
330 switch (
ptr->ai_family) {
349 dprintf(1,
"getdomainname: domainname %s %d\n",
361 eprintf(
"getdomainname: unable to get a domain name. "
362 "Set this machine's domain name:\n"
363 "System > ComputerName > Change > More > mydomain\n");
378#ifdef STANDALONE_NFSD
414 dprintf(1,
"NFS41 driver started\n");
447#pragma warning (push)
448#pragma warning (disable : 4306)
451 dprintf(1,
"debug mode. dumping memory leaks to stderr on exit.\n");
463 eprintf(
"id mapping initialization failed with %d\n",
status);
480 dprintf(1,
"starting nfs41 mini redirector\n");
484 eprintf(
"IOCTL_NFS41_START failed with %d\n",
489#ifndef STANDALONE_NFSD
497 idmapper, 0, &tids[
i].
tid);
504#ifndef STANDALONE_NFSD
511 dprintf(1,
"Parent waiting for children threads\n");
515 dprintf(1,
"Parent woke up!!!!\n");
522#ifndef STANDALONE_NFSD
ACPI_SIZE strlen(const char *String)
BOOL ReportStatusToSCMgr(DWORD dwCurrentState, DWORD dwWin32ExitCode, DWORD dwWaitHint)
#define _CRTDBG_MODE_FILE
#define _CRTDBG_LEAK_CHECK_DF
#define _CrtSetReportMode(t, f)
#define _CRTDBG_FILE_STDERR
#define _CrtSetDbgFlag(f)
#define _CRTDBG_ALLOC_MEM_DF
#define _CrtSetReportFile(t, f)
void eprintf(LPCSTR format,...)
const char * opcode2string(DWORD opcode)
void set_debug_level(int level)
BOOL WINAPI DeviceIoControl(IN HANDLE hDevice, IN DWORD dwIoControlCode, IN LPVOID lpInBuffer OPTIONAL, IN DWORD nInBufferSize OPTIONAL, OUT LPVOID lpOutBuffer OPTIONAL, IN DWORD nOutBufferSize OPTIONAL, OUT LPDWORD lpBytesReturned OPTIONAL, IN LPOVERLAPPED lpOverlapped OPTIONAL)
BOOL WINAPI GetUserNameA(LPSTR lpszName, LPDWORD lpSize)
#define INVALID_HANDLE_VALUE
UINT WINAPI GetSystemDirectoryA(OUT LPSTR lpBuffer, IN UINT uSize)
DWORD WINAPI GetTickCount(VOID)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean flag
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
int nfs41_idmap_name_to_ids(struct idmap_context *context, const char *username, uid_t *uid_out, gid_t *gid_out)
int nfs41_idmap_create(struct idmap_context **context_out)
void nfs41_idmap_free(struct idmap_context *context)
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
_Check_return_ _CRTIMP FILE *__cdecl fopen(_In_z_ const char *_Filename, _In_z_ const char *_Mode)
_Check_return_opt_ _CRTIMP int __cdecl fclose(_Inout_ FILE *_File)
DWORD WINAPI GetNetworkParams(PFIXED_INFO pFixedInfo, PULONG pOutBufLen)
#define memcpy(s1, s2, n)
void nfs41_server_list_init()
#define NFS41_HOSTNAME_LEN
static int map_user_to_ids(nfs41_idmapper *idmapper, uid_t *uid, gid_t *gid)
static void print_getaddrinfo(struct addrinfo *ptr)
static const char FILE_NETCONFIG[]
VOID ServiceStart(DWORD argc, LPTSTR *argv)
struct _nfsd_args nfsd_args
static unsigned int WINAPI thread_main(void *args)
struct _nfs41_process_thread nfs41_process_thread
char localdomain_name[NFS41_HOSTNAME_LEN]
static bool_t check_for_files()
static int getdomainname()
static bool_t parse_cmdlineargs(int argc, TCHAR *argv[], nfsd_args *out)
nfs41_updowncall_list upcall
#define IOCTL_NFS41_WRITE
#define IOCTL_NFS41_START
#define NFS41_USER_DEVICE_NAME_A
BOOL WINAPI QueryServiceStatus(SC_HANDLE hService, LPSERVICE_STATUS lpServiceStatus)
BOOL WINAPI CloseServiceHandle(SC_HANDLE hSCObject)
_CRTIMP uintptr_t __cdecl _beginthreadex(_In_opt_ void *_Security, _In_ unsigned _StackSize, _In_ unsigned(__stdcall *_StartAddress)(void *), _In_opt_ void *_ArgList, _In_ unsigned _InitFlag, _Out_opt_ unsigned *_ThrdAddr)
namespace GUID const ADDRINFOEXW * hints
STRSAFEAPI StringCchCatA(STRSAFE_LPSTR pszDest, size_t cchDest, STRSAFE_LPCSTR pszSrc)
char HostName[MAX_HOSTNAME_LEN+4]
char DomainName[MAX_DOMAIN_NAME_LEN+4]
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
void upcall_marshall(IN nfs41_upcall *upcall, OUT unsigned char *buffer, IN uint32_t length, OUT uint32_t *length_out)
int upcall_parse(IN unsigned char *buffer, IN uint32_t length, OUT nfs41_upcall *upcall)
void upcall_cleanup(IN nfs41_upcall *upcall)
int upcall_handle(IN nfs41_upcall *upcall)
void upcall_cancel(IN nfs41_upcall *upcall)
#define NFSD_VERSION_MISMATCH
DWORD WINAPI GetLastError(void)
#define ERROR_BUFFER_OVERFLOW
#define ERROR_INTERNAL_ERROR
#define WSAAddressToString
int PASCAL FAR WSAGetLastError(void)
#define SERVICE_ALL_ACCESS
#define SC_MANAGER_ALL_ACCESS