- Added support for NTLDR style freeloader GUI. To enable, edit freeldr.ini and add:
[reactos.git] / vms / server / server.c
index 335f1c1..3ef07e8 100644 (file)
@@ -32,47 +32,59 @@ HANDLE VmsApiPort = NULL;
 
 /**********************************************************************
  * NAME                                                        PRIVATE
- *     VmspCreatePort/1
+ *     VmsApiNull/2
  */
-NTSTATUS VmsStaticServerThread (PVOID x)
+NTSTATUS NTAPI VmsApiNull (IN OUT PCSR_API_MESSAGE ApiMessage,
+                          IN OUT PULONG Reply)
 {
-       NTSTATUS Status = STATUS_SUCCESS;
-       LPC_MAX_MESSAGE Request;
-       PPORT_MESSAGE Reply = NULL;
-       ULONG MessageType = 0;
+       DPRINT("VMSSRV: %s called\n", __FUNCTION__);
 
-       while (TRUE)
-       {
-               Status = NtReplyWaitReceivePort (VmsApiPort,
-                                                0,
-                                                Reply,
-                                                (PPORT_MESSAGE) & Request);
-               if(NT_SUCCESS(Status))
-               {
-                       MessageType = Request.Header.u2.s2.Type;
-                       DPRINT("VMS: %s received a message (Type=%d)\n",
-                                       __FUNCTION__, MessageType);
-                       switch(MessageType)
-                       {
-                       default:
-                               continue;
-                       }
-               }else{
-                       DPRINT("VMS: %s: NtReplyWaitReceivePort failed (Status=%08lx)\n",
-                                       __FUNCTION__, Status);
-               }
-       }
-       return Status;
+       *Reply = 0;
+       return STATUS_SUCCESS;
 }
 
+PCSR_API_ROUTINE VmsServerApiDispatchTable [1] =
+{
+       VmsApiNull
+};
+
+BOOLEAN VmsServerApiValidTable [1] =
+{
+    TRUE
+};
+
+PCHAR VmsServerApiNameTable [1] =
+{
+    "Null",
+};
+
 /*=====================================================================
  *     PUBLIC API
  *===================================================================*/
 
-NTSTATUS STDCALL ServerDllInitialization (ULONG ArgumentCount,
-                                         LPWSTR *Argument)
+NTSTATUS NTAPI ServerDllInitialization (PCSR_SERVER_DLL LoadedServerDll)
 {
-       return CsrAddStaticServerThread ();
+       NTSTATUS Status = STATUS_SUCCESS;
+       
+       DPRINT("VMSSRV: %s called\n", __FUNCTION__);
+
+       // Get the listening port from csrsrv.dll
+       VmsApiPort = CsrQueryApiPort ();
+       if (NULL == VmsApiPort)
+       {
+               Status = STATUS_UNSUCCESSFUL;
+       } else {
+               // Set CSR information
+               LoadedServerDll->ApiBase             = 0;
+               LoadedServerDll->HighestApiSupported = 0;
+               LoadedServerDll->DispatchTable       = VmsServerApiDispatchTable;
+               LoadedServerDll->ValidTable          = VmsServerApiValidTable;
+               LoadedServerDll->NameTable           = VmsServerApiNameTable;
+               LoadedServerDll->SizeOfProcessData   = 0;
+               LoadedServerDll->ConnectCallback     = NULL;
+               LoadedServerDll->DisconnectCallback  = NULL;
+       }
+       return Status;
 }
 
 /* EOF */