| 5026 | } |
| 5027 | |
| 5028 | BOOL |
| 5029 | Ext2SetAppAutorunXP(BOOL bInstall) |
| 5030 | { |
| 5031 | BOOL rc = FALSE; |
| 5032 | HKEY key ; |
| 5033 | CHAR keyPath[MAX_PATH] ; |
| 5034 | LONG status ; |
| 5035 | |
| 5036 | CHAR appPath[MAX_PATH] ; |
| 5037 | |
| 5038 | GetModuleFileName(NULL, appPath, MAX_PATH - 6); |
| 5039 | strcat(appPath, " -quiet"); |
| 5040 | |
| 5041 | strcpy (keyPath, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run") ; |
| 5042 | status = RegOpenKeyEx (HKEY_LOCAL_MACHINE, |
| 5043 | keyPath, |
| 5044 | 0, |
| 5045 | KEY_ALL_ACCESS, |
| 5046 | &key) ; |
| 5047 | |
| 5048 | if (status != ERROR_SUCCESS) { |
| 5049 | return FALSE; |
| 5050 | } |
| 5051 | |
| 5052 | if (!bInstall) { |
| 5053 | status = RegDeleteValue (key, EXT2_MANAGER_NAME) ; |
| 5054 | if (status != ERROR_SUCCESS) { |
| 5055 | goto errorout; |
| 5056 | } |
| 5057 | } else { |
| 5058 | status = RegSetValueEx( key, EXT2_MANAGER_NAME, 0, REG_SZ, |
| 5059 | (BYTE *)appPath, (int)strlen(appPath)); |
| 5060 | if (status != ERROR_SUCCESS) { |
| 5061 | goto errorout; |
| 5062 | } |
| 5063 | } |
| 5064 | |
| 5065 | rc = TRUE; |
| 5066 | |
| 5067 | errorout: |
| 5068 | |
| 5069 | RegCloseKey (key) ; |
| 5070 | return rc; |
| 5071 | } |
| 5072 | |
| 5073 | CHAR *Ext2QueryAutoUserList() |
| 5074 | { |