标签:show mds cmd lsa har rev cal controls turn
1 #include <windows.h> 2 using namespace std; 3 4 int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, 5 LPSTR lpCmdLine, int nCmdShow) 6 { 7 HKEY hKEY; 8 char *SharePath = "SYSTEM\\CurrentControlSet\\services\\LanmanServer\\Parameters"; 9 DWORD dwShare = 0; 10 11 if(ERROR_SUCCESS == RegOpenKeyEx(HKEY_LOCAL_MACHINE, SharePath, 0, KEY_SET_VALUE, &hKEY)) 12 { 13 if(ERROR_SUCCESS == RegSetValueEx(hKEY, "AutoShareWks", 0, REG_DWORD, (BYTE*)&dwShare, sizeof(DWORD))) 14 { 15 if(ERROR_SUCCESS == RegSetValueEx(hKEY, "AutoShareServer", 0, REG_DWORD, (BYTE*)&dwShare, sizeof(DWORD))) 16 { 17 MessageBox(NULL, "关闭默认共享成功!", "提示:", MB_ICONEXCLAMATION); 18 } 19 } 20 else 21 { 22 MessageBox(NULL, "关闭默认共享失败!", "提示:", MB_ICONERROR); 23 } 24 } 25 RegCloseKey(hKEY); 26 27 28 HKEY hKEY1; 29 char *IPCPath = "SYSTEM\\CurrentControlSet\\Control\\Lsa"; 30 DWORD dwIPC = 1; 31 32 if(ERROR_SUCCESS == RegOpenKeyEx(HKEY_LOCAL_MACHINE, IPCPath, 0, KEY_SET_VALUE, &hKEY1)) 33 { 34 if(ERROR_SUCCESS == RegSetValueEx(hKEY1, "restrictanonymous", 0, REG_DWORD, (BYTE*)&dwIPC, sizeof(DWORD))) 35 { 36 MessageBox(NULL, "关闭 IPC 共享成功!", "提示:", MB_ICONEXCLAMATION); 37 } 38 else 39 { 40 MessageBox(NULL, "关闭 IPC 共享失败!", "提示:", MB_ICONERROR); 41 } 42 } 43 RegCloseKey(hKEY1); 44 return 0; 45 }
标签:show mds cmd lsa har rev cal controls turn
原文地址:https://www.cnblogs.com/hoy0a1d/p/9257982.html