> For the complete documentation index, see [llms.txt](https://www.pinvoke.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.pinvoke.dev/advapi32/changeserviceconfig.md).

# ChangeServiceConfigW

```csharp
[DllImport("ADVAPI32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern unsafe BOOL ChangeServiceConfigW(
    SC_HANDLE hService,
    ENUM_SERVICE_TYPE dwServiceType,
    SERVICE_START_TYPE dwStartType,
    SERVICE_ERROR dwErrorControl,
    PCWSTR lpBinaryPathName,
    PCWSTR lpLoadOrderGroup,
    [Optional] uint* lpdwTagId,
    PCWSTR lpDependencies,
    PCWSTR lpServiceStartName,
    PCWSTR lpPassword,
    PCWSTR lpDisplayName);
```

[SC\_HANDLE](/security/sc_handle.md)

[ENUM\_SERVICE\_TYPE](/services/enum_service_type.md)

[SERVICE\_START\_TYPE](/services/service_start_type.md)

[SERVICE\_ERROR](/services/service_error.md)
