libjmmcg  release_579_6_g8cffd
A C++ library containing an eclectic mix of useful, advanced components.
NetShare.hpp
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright © 2002 by J.M.McGuiness, coder@hussar.me.uk
3 **
4 ** This library is free software; you can redistribute it and/or
5 ** modify it under the terms of the GNU Lesser General Public
6 ** License as published by the Free Software Foundation; either
7 ** version 2.1 of the License, or (at your option) any later version.
8 **
9 ** This library is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 ** Lesser General Public License for more details.
13 **
14 ** You should have received a copy of the GNU Lesser General Public
15 ** License along with this library; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18 
19 #pragma once
20 
22 
23 #include "../../../core/ttypes.hpp"
24 
25 // Networking functionality such as browsing.
26 #include<lm.h>
27 
28 namespace jmmcg { namespace LIBJMMCG_VER_NAMESPACE { namespace NTUtils {
29 
30 /////////////////////////////////////////////////////////////////////////////
31 
32 const tchar server_info_9X_lib_name[]=_T("svrapi.dll");
33 const tchar dir_separator=_T('\\');
34 
35 /////////////////////////////////////////////////////////////////////////////
36 
37 class AFX_EXT_CLASS NetShare : virtual protected LoadLibraryWrapper
38 {
39 public:
40  __stdcall NetShare(void);
41  __stdcall NetShare(const tstring &DirectoryToShare,const TCHAR * const Sharename,const TCHAR * const description,const TCHAR * const Server,const DWORD max_connections,SECURITY_DESCRIPTOR *sd,const DWORD share_perms);
42  __stdcall NetShare(const tstring &DirectoryToShare,const TCHAR * const Sharename,const TCHAR * const description,const TCHAR * const Username,const TCHAR * const Server,const DWORD access_mask,const DWORD max_connections,const DWORD share_perms);
43  __stdcall ~NetShare(void);
44 
45  bool __fastcall Create(const tstring &DirectoryToShare,const TCHAR * const Sharename,const TCHAR * const description,const TCHAR * const Server,const DWORD max_connections,const SECURITY_DESCRIPTOR * const sd,const DWORD share_perms);
46  bool __fastcall Create(const tstring &DirectoryToShare,const TCHAR * const Sharename,const TCHAR * const description,const TCHAR * const Username,const TCHAR * const Server,const DWORD access_mask,const DWORD max_connections,const DWORD share_perms);
47  bool __fastcall Delete(void);
48 
49 private:
52 
55 
57  bool deleted;
59 
60  // Stop any compiler silliness...
61  __stdcall NetShare(const NetShare &);
62  NetShare & __fastcall operator=(const NetShare &);
63 };
64 
65 } } }