Changeset 21916 for trunk/src/advapi32/service.cpp
- Timestamp:
- Dec 18, 2011, 10:28:22 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:ignore
-
old new 1 bin 2 Makefile.inc 1 env.cmd 2 LocalConfig.kmk
-
-
Property svn:mergeinfo
set to
/branches/gcc-kmk merged eligible
- Property svn:ignore
-
trunk/src/advapi32/service.cpp
r5976 r21916 10 10 * 11 11 * 12 * TODO: Not done; starting services; control handlers and many other things 12 * TODO: Not done; starting services; control handlers and many other things 13 13 * TODO: Service status handles are the same as service handles 14 14 * … … 26 26 #include <misc.h> 27 27 #include <unicode.h> 28 #include <win \winreg.h>29 #include <win \winsvc.h>28 #include <win/winreg.h> 29 #include <win/winsvc.h> 30 30 #include <heapstring.h> 31 31 #define USE_ODIN_REGISTRY_APIS … … 71 71 //TODO: Faster way to checking this 72 72 //***************************************************************************** 73 BOOL CheckServiceHandle(SC_HANDLE hService) 73 BOOL CheckServiceHandle(SC_HANDLE hService) 74 74 { 75 75 HKEY keyThisService; … … 147 147 fdwDesiredAccess)); 148 148 149 if(lpszMachineName) 149 if(lpszMachineName) 150 150 lpszMachineNameA = HEAP_strdupWtoA(GetProcessHeap(), 0, lpszMachineName); 151 151 if(lpszDatabaseName) … … 154 154 hService = OpenSCManagerA(lpszMachineNameA, lpszDataBaseNameA, fdwDesiredAccess); 155 155 156 if(lpszMachineNameA) 156 if(lpszMachineNameA) 157 157 HeapFree(GetProcessHeap(), 0, lpszMachineNameA); 158 158 if(lpszDataBaseNameA) … … 190 190 return FALSE; 191 191 } 192 192 193 193 if(lpszServiceName == NULL) { 194 194 SetLastError(ERROR_INVALID_PARAMETER); … … 442 442 * Result : 443 443 * Remark : 444 * Status : 444 * Status : 445 445 * 446 446 * Author : SvL … … 494 494 * Result : 495 495 * Remark : 496 * Status : 496 * Status : 497 497 * 498 498 * Author : SvL … … 574 574 * Result : 575 575 * Remark : 576 * Status : 576 * Status : 577 577 * 578 578 * Author : SvL … … 621 621 * Result : 622 622 * Remark : 623 * Status : 623 * Status : 624 624 * 625 625 * Author : SvL … … 665 665 * Result : 666 666 * Remark : 667 * Status : 667 * Status : 668 668 * 669 669 * Author : SvL … … 719 719 RegSetValueExA(keyThisService, REG_SERVICE_STARTTYPE, 0, REG_DWORD, (LPBYTE)&dwStartType, sizeof(DWORD)); 720 720 RegSetValueExA(keyThisService, REG_SERVICE_ERRORCONTROL, 0, REG_DWORD, (LPBYTE)&dwErrorControl, sizeof(DWORD)); 721 if(lpDisplayName) 721 if(lpDisplayName) 722 722 RegSetValueExA(keyThisService, REG_SERVICE_DISPLAYNAME, 0, REG_SZ, (LPBYTE)lpDisplayName, strlen(lpDisplayName)+1); 723 if(lpLoadOrderGroup) 723 if(lpLoadOrderGroup) 724 724 RegSetValueExA(keyThisService, REG_SERVICE_LOADORDERGROUP, 0, REG_SZ, (LPBYTE)lpDisplayName, strlen(lpLoadOrderGroup)+1); 725 725 if(lpDependencies) { … … 736 736 737 737 //Pointer to a variable that receives a tag value that is unique in the group specified in the 738 //lpLoadOrderGroup parameter. Specify NULL if you are not changing the existing tag. 738 //lpLoadOrderGroup parameter. Specify NULL if you are not changing the existing tag. 739 739 DWORD tag = 1; //TODO!! 740 740 RegSetValueExA(keyThisService, REG_SERVICE_TAG, 0, REG_DWORD, (LPBYTE)&tag, sizeof(DWORD)); … … 773 773 * Result : 774 774 * Remark : 775 * Status : 775 * Status : 776 776 * 777 777 * Author : SvL … … 855 855 * Result : 856 856 * Remark : 857 * Status : 857 * Status : 858 858 * 859 859 * Author : SvL … … 893 893 * Result : 894 894 * Remark : 895 * Status : 895 * Status : 896 896 * 897 897 * Author : SvL … … 929 929 * Result : 930 930 * Remark : 931 * Status : 931 * Status : 932 932 * 933 933 * Author : SvL … … 962 962 * Result : 963 963 * Remark : 964 * Status : 964 * Status : 965 965 * 966 966 * Author : SvL … … 1021 1021 * Result : 1022 1022 * Remark : 1023 * Status : 1023 * Status : 1024 1024 * 1025 1025 * Author : SvL … … 1359 1359 while(*cmd != ' ' && *cmd != 0) cmd++; //skip non-space chars 1360 1360 while(*cmd == ' ' && *cmd != 0) cmd++; //skip spaces 1361 nrargs++; 1361 nrargs++; 1362 1362 } 1363 1363 return nrargs; … … 1373 1373 * Result : 1374 1374 * Remark : 1375 * Status : 1375 * Status : 1376 1376 * 1377 1377 * Author : SvL … … 1413 1413 * Result : 1414 1414 * Remark : 1415 * Status : 1415 * Status : 1416 1416 * 1417 1417 * Author : SvL … … 1453 1453 * Result : 1454 1454 * Remark : 1455 * Status : 1455 * Status : 1456 1456 * 1457 1457 * Author : SvL … … 1467 1467 lpHandlerProc)); 1468 1468 1469 //Doesn't work for services of type 1469 //Doesn't work for services of type 1470 1470 if(lpszServiceName == NULL) { 1471 1471 SetLastError(ERROR_INVALID_NAME); … … 1494 1494 * Result : 1495 1495 * Remark : 1496 * Status : 1496 * Status : 1497 1497 * 1498 1498 * Author : SvL … … 1503 1503 { 1504 1504 SC_HANDLE hSCMgr, hService; 1505 1505 1506 1506 dprintf(("ADVAPI32: RegisterServiceCtrlHandlerW(%s,%08xh) not implemented (FAKED)", 1507 1507 lpszServiceName, 1508 1508 lpHandlerProc)); 1509 1509 1510 //Doesn't work for services of type 1510 //Doesn't work for services of type 1511 1511 if(lpszServiceName == NULL) { 1512 1512 SetLastError(ERROR_INVALID_NAME); … … 1542 1542 * Result : 1543 1543 * Remark : 1544 * Status : 1544 * Status : 1545 1545 * 1546 1546 * Author : SvL … … 1597 1597 * Result : 1598 1598 * Remark : Called from ServiceMain function (registered with RegisterServiceCtrlHandler) 1599 * Status : 1599 * Status : 1600 1600 * 1601 1601 * Author : SvL … … 1637 1637 * Result : 1638 1638 * Remark : 1639 * Status : 1639 * Status : 1640 1640 * 1641 1641 * Author : SvL … … 1685 1685 keytype = REG_DWORD; 1686 1686 RegQueryValueExA((HKEY)schService, REG_SERVICE_WAITHINT, 0, &keytype, (LPBYTE)&lpssServiceStatus->dwWaitHint, &size); 1687 1687 1688 1688 SetLastError(0); 1689 1689 return TRUE;
Note:
See TracChangeset
for help on using the changeset viewer.