Announcement

Collapse
No announcement yet.

Registry restrictions?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Registry restrictions?

    Does anyone know of any registry restrictions whereas registry entries cannot be written in?
    I had read there may be a few long ago, but I doubt it...
    I am administrator, although it's a Win98 box this code fails:
    It's just writing an entry to pop up a message box prior to logon either on 98 or NT/2k, pretty handy too:

    Code:
                 Case %IDMAIN_SET
                    If osinfo.dwPlatformId = %VER_PLATFORM_WIN32_NT Then
                        SaveSetting %HKEY_LOCAL_MACHINE,ByVal "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", ByVal "LegalNoticeCaption",g_MsgTitle
                        SaveSetting %HKEY_LOCAL_MACHINE,ByVal "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", ByVal "LegalNoticeText",g_MsgText
                    Else
                        SaveSetting %HKEY_LOCAL_MACHINE,ByVal "SOFTWARE\Microsoft\Windows\CurrentVersion\Winlogon", ByVal "LegalNoticeCaption",g_MsgTitle
                        SaveSetting %HKEY_LOCAL_MACHINE,ByVal "SOFTWARE\Microsoft\Windows\CurrentVersion\Winlogon", ByVal "LegalNoticeText",g_MsgText
                    End If
    
    
    This SaveSetting function has worked for years, and still does work everywhere else...
    Function SaveSetting(lpKey As Long,ByVal cMainkey As String, ByVal Key As String, _
                         ByVal Setting As String) As Long
    Local hKey   As Long
    Local Result As Long
    Local zText  As Asciiz * 2048
    
    ' ** Create the section
    If RegCreateKeyEx(lpKey, cMainKey + Chr$(0),0, "", %REG_OPTION_NON_VOLATILE, _
                       %KEY_ALL_ACCESS, ByVal %NULL, hKey, Result) <> %ERROR_SUCCESS Then
        Exit Function
    End If
    
    ' ** Save the value for the key
    If Len(Setting) Then
        zText = Setting
        RegSetValueEx hKey, Key+Chr$(0), 0, %REG_SZ, zText, Len(Setting)+1
    Else
        RegSetValueEx hKey, Key+Chr$(0), 0, %REG_SZ, ByVal %NULL, 0
    End If
        ' ** Close the key
        RegCloseKey hKey
        Function = %TRUE
    End Function
    ------------------
    Scott

    [This message has been edited by Scott Turchin (edited March 29, 2001).]
    Scott Turchin
    MCSE, MCP+I
    http://www.tngbbs.com
    ----------------------
    True Karate-do is this: that in daily life, one's mind and body be trained and developed in a spirit of humility; and that in critical times, one be devoted utterly to the cause of justice. -Gichin Funakoshi

  • #2
    Question2, what's the size limit on string registry entries?
    I've seen paragraphs in this particular entry but I think my $CRLF is doing something bad....
    With no $CRLF this saves:

    Computer Tresspass 1 as defined by RCW 9A.52.110 - A person is
    guilty of Computer Tresspass in the first degree, if the person without
    authorization intentionally gains access to a computer system or electronic
    database of another; AND a. The access is made with the intent to commit
    another crime, OR b. The violatoin involves a computer or database maintained
    by a government agency. Computer Tresspass in the first degree is a class C
    felony. (up to 3 years in prison)

    Computer Tresspass 2 as defined by RCW 9A.52.120 - A person is
    guilty of Computer Tresspass in the second degree, if the person without
    authorization intentionally gains access to a computer system or electronic
    database of another; AND a. The access is made with the intent to commit
    another crime, OR b. The violatoin involves a computer or database maintained
    by a government agency. c. Intentionally gains access to a computer or database
    of another under circumstances not constituting the offense in the first degree.
    Computer Tresspass in the 2nd degree is a Gross Misdemeanor. (up to 1 year
    in prison.)

    ------------------
    Scott

    [This message has been edited by Scott Turchin (edited March 29, 2001).]
    Scott Turchin
    MCSE, MCP+I
    http://www.tngbbs.com
    ----------------------
    True Karate-do is this: that in daily life, one's mind and body be trained and developed in a spirit of humility; and that in critical times, one be devoted utterly to the cause of justice. -Gichin Funakoshi

    Comment


    • #3
      Problem solved, programmer headspace...

      ------------------
      Scott
      Scott Turchin
      MCSE, MCP+I
      http://www.tngbbs.com
      ----------------------
      True Karate-do is this: that in daily life, one's mind and body be trained and developed in a spirit of humility; and that in critical times, one be devoted utterly to the cause of justice. -Gichin Funakoshi

      Comment

      Working...
      X