In this patch I make 3 functions (FIXME): NetShareEnum, NetShareDel, NetShareAdd

Files to change:
dlls/svrapi/svrapi_main.c
dlls/svrapi/svrapi.spec

--
Best Regards, Konstantin Petrov

--- dlls/svrapi/svrapi_main.c	2006-09-04 20:18:12 +0400
+++ dlls/svrapi/svrapi_main.c1	2006-09-04 20:19:10 +0400
@@ -53,3 +53,75 @@
     }
     return TRUE;
 }
+
+/***********************************************************************
+ */
+ NET_API_STATUS WINAPI WIN98_NetShareEnum( const char* pszServer, short sLevel, char* pbBuffer,     unsigned short cbBuffer, unsigned short* pcEntriesRead, unsigned short* pcTotalAvail)
+{
+       if((cbBuffer == 0) || (pbBuffer == NULL)) return ERROR_INVALID_DATA;
+
+       FIXME("Stub (%s %d %p %d %p %p)\n", debugstr_a(pszServer), sLevel, pbBuffer,
+             cbBuffer, pcEntriesRead, pcTotalAvail);
+       HeapFree(GetProcessHeap(), 0, pbBuffer);
+       pbBuffer = NULL;
+
+       /*    *bufptr = NULL;*/
+
+       *pcEntriesRead = 0;
+       *pcTotalAvail = 0;
+
+/*    return ERROR_NOT_SUPPORTED;*/
+    return NERR_Success;
+}
+
+/************************************************************************
+*  The NetShareDel function deletes a share name from a server's list of shared resources,
+*  disconnecting all connections to the shared resource.
+*  servername
+*  pszServer    [in]      Pointer to a string that specifies the DNS or NetBIOS name of the remote
+*                         server on which the function is to execute. If this parameter is NULL,
+*                         the local computer is used.
+*  pszNetName   [in]      Pointer to a string that specifies the name of the share to delete.
+*  usReserved   [in]      Reserved, must be zero.
+*/
+ NET_API_STATUS WINAPI WIN98_NetShareDel( const char* pszServer, const char* pszNetName,
+ unsigned short usReserved )
+{
+       FIXME("Stub (%s %s %d)\n", (pszServer ? pszServer:"NULL"), (pszNetName ? pszNetName:"NULL"), usReserved );
+       if(usReserved != 0) return ERROR_INVALID_PARAMETER;
+       /*network computer*/
+       if(pszServer != NULL) return NERR_NetNameNotFound;
+       /*local computer*/
+       else return NERR_Success;
+}
+
+/************************************************************************
+  The NetShareAdd function shares a server resource.
+*
+*
+*  pszServer    [in]      Pointer to a string that specifies the DNS or NetBIOS name of the remote
+*                         server on which the function is to execute. If this parameter is NULL,
+*                         the local computer is used.
+*  sLevel       [in] = 50 Specifies information about the shared resource, including the name and
+*                         type of the resource, a comment associated with the resource, and
+*                         passwords. The pbBuffer parameter points to a share_info_50 structure.
+*                         Note that the string you specify in the shi50_path member must contain
+*                         only uppercase characters. If the path contains lowercase characters,
+*                         calls to NetShareAdd can fail with NERR_UnknownDevDir or ERROR_BAD_NET_NAME.
+*  pbBuffer     [in]      Pointer to the buffer that specifies the data. The format of this data
+*                         depends on the value of the level parameter
+*  cbBuffer     [in]      = sizeof(struct share_info_50);
+*/
+ NET_API_STATUS WINAPI WIN98_NetShareAdd(const char* pszServer,short sLevel,const char* pbBuffer,  unsigned short cbBuffer)
+{
+       FIXME("Stub (%s %d %s %d)\n", (pszServer ? pszServer:"NULL"), sLevel, (pbBuffer ? pbBuffer:"NULL"), cbBuffer);
+/*     if ((sLevel == 50) && (cbBuffer == sizeof(share_info_50))) real size of share_info_50 is not known*/
+       if ((sLevel == 50) && (cbBuffer != 0))
+       {
+           /*network computer*/
+               if(pszServer != NULL) return NERR_UnknownDevDir;
+               /*local computer*/
+               else return NERR_Success;
+       }
+       else return ERROR_INVALID_PARAMETER;
+}

--- dlls/svrapi/svrapi.spec	2006-09-04 20:21:47 +0400
+++ dlls/svrapi/svrapi.spec	2006-09-04 20:21:52 +0400
@@ -13,8 +13,8 @@
 @ stub NetSessionDel
 @ stub NetSessionEnum
 @ stub NetSessionGetInfo
-@ stub NetShareAdd
-@ stub NetShareDel
-@ stub NetShareEnum
+@ stdcall NetShareAdd(str long str long) WIN98_NetShareAdd
+@ stdcall NetShareDel(str str long) WIN98_NetShareDel
+@ stdcall NetShareEnum(str long ptr long ptr ptr) WIN98_NetShareEnum
 @ stub NetShareGetInfo
 @ stub NetShareSetInfo


Reply via email to